search for: mergeable_buf_free

Displaying 6 results from an estimated 6 matches for "mergeable_buf_free".

2023 Mar 28
1
[PATCH net-next 5/8] virtio_net: separate the logic of freeing the rest mergeable buf
...12 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 09aed60e2f51..a3f2bcb3db27 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -1076,6 +1076,28 @@ static struct sk_buff *receive_big(struct net_device *dev, return NULL; } +static void mergeable_buf_free(struct receive_queue *rq, int num_buf, + struct net_device *dev, + struct virtnet_rq_stats *stats) +{ + struct page *page; + void *buf; + int len; + + while (num_buf-- > 1) { + buf = virtqueue_get_buf(rq->vq, &len); + if (unlikely(!buf)) { + pr_debug("%s: rx err...
2023 Mar 22
1
[PATCH net-next 7/8] virtio_net: introduce receive_mergeable_xdp()
...+ case VIRTNET_XDP_RES_PASS: + head_skb = build_skb_from_xdp_buff(dev, vi, &xdp, xdp_frags_truesz); + if (unlikely(!head_skb)) + goto err_xdp; + return head_skb; + + case VIRTNET_XDP_RES_CONSUMED: + return NULL; + + case VIRTNET_XDP_RES_DROP: + break; + } + +err_xdp: + put_page(page); + mergeable_buf_free(rq, num_buf, dev, stats); + + stats->xdp_drops++; + stats->drops++; + return NULL; +} + static struct sk_buff *receive_mergeable(struct net_device *dev, struct virtnet_info *vi, struct receive_queue *rq, @@ -1325,18 +1382,16 @@ static struct sk_buff *receive_mergeable(struct ne...
2023 Mar 30
1
[PATCH net-next 7/8] virtio_net: introduce receive_mergeable_xdp()
...v, vi, &xdp, xdp_frags_truesz); > + if (unlikely(!head_skb)) > + goto err_xdp; > + return head_skb; > + > + case VIRTNET_XDP_RES_CONSUMED: > + return NULL; > + > + case VIRTNET_XDP_RES_DROP: > + break; > + } > + > +err_xdp: > + put_page(page); > + mergeable_buf_free(rq, num_buf, dev, stats); > + > + stats->xdp_drops++; > + stats->drops++; > + return NULL; > +} > + > static struct sk_buff *receive_mergeable(struct net_device *dev, > struct virtnet_info *vi, > struct receive_queue *rq, > @@ -1325,21 +1382,22 @@...
2023 Mar 28
8
[PATCH net-next 0/8] virtio_net: refactor xdp codes
Due to historical reasons, the implementation of XDP in virtio-net is relatively chaotic. For example, the processing of XDP actions has two copies of similar code. Such as page, xdp_page processing, etc. The purpose of this patch set is to refactor these code. Reduce the difficulty of subsequent maintenance. Subsequent developers will not introduce new bugs because of some complex logical
2023 Mar 22
9
[PATCH net-next 0/8] virtio_net: refactor xdp codes
Due to historical reasons, the implementation of XDP in virtio-net is relatively chaotic. For example, the processing of XDP actions has two copies of similar code. Such as page, xdp_page processing, etc. The purpose of this patch set is to refactor these code. Reduce the difficulty of subsequent maintenance. Subsequent developers will not introduce new bugs because of some complex logical
2023 Mar 15
10
[RFC net-next 0/8] virtio_net: refactor xdp codes
Due to historical reasons, the implementation of XDP in virtio-net is relatively chaotic. For example, the processing of XDP actions has two copies of similar code. Such as page, xdp_page processing, etc. The purpose of this patch set is to refactor these code. Reduce the difficulty of subsequent maintenance. Subsequent developers will not introduce new bugs because of some complex logical