search for: receive_mergeable

Displaying 20 results from an estimated 318 matches for "receive_mergeable".

2023 Mar 28
1
[PATCH net-next 1/8] virtio_net: mergeable xdp: put old page immediately
...net/virtio_net.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index e2560b6f7980..4d2bf1ce0730 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -1245,6 +1245,9 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, if (!xdp_page) goto err_xdp; offset = VIRTIO_XDP_HEADROOM; + + put_page(page); + page = xdp_page; } else if (unlikely(headroom < virtnet_get_headroom(vi))) { xdp_room = SKB_DATA_ALIGN(VIRTIO_XDP_HEADROOM + sizeof(struct skb_shared_info));...
2023 Mar 31
1
[PATCH net-next 1/8] virtio_net: mergeable xdp: put old page immediately
...--- > 1 file changed, 6 insertions(+), 9 deletions(-) > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > index e2560b6f7980..4d2bf1ce0730 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > @@ -1245,6 +1245,9 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, > if (!xdp_page) > goto err_xdp; > offset = VIRTIO_XDP_HEADROOM; > + > + put_page(page); > + page = xdp_page; > }...
2013 Nov 20
2
[PATCH RFC] virtio_net: fix error handling for mergeable buffers
...at.com> > > Just to clarify my previous comment: it was not about the > idea of adding drop_mergeable_buffer - rather, I think that > adding knowledge about mergeable buffers into page_to_skb creates an > ugly internal API. > > Let's move the call to page_to_skb within receive_mergeable instead: > it's also nice that int offset = buf - page_address(page) logic > is not spread around like it was. > > Also, it's not nice that we ignore length errors when we drop > packets because of OOM. > > So I came up with the following - it seems to work but I didn...
2013 Nov 20
2
[PATCH RFC] virtio_net: fix error handling for mergeable buffers
...at.com> > > Just to clarify my previous comment: it was not about the > idea of adding drop_mergeable_buffer - rather, I think that > adding knowledge about mergeable buffers into page_to_skb creates an > ugly internal API. > > Let's move the call to page_to_skb within receive_mergeable instead: > it's also nice that int offset = buf - page_address(page) logic > is not spread around like it was. > > Also, it's not nice that we ignore length errors when we drop > packets because of OOM. > > So I came up with the following - it seems to work but I didn...
2013 Nov 27
4
[PATCH 1/2] virtio_net: fix error handling for mergeable buffers
...ertions(+), 32 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 7bab4de..0e6ea69 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -299,41 +299,53 @@ static struct sk_buff *page_to_skb(struct receive_queue *rq, return skb; } -static int receive_mergeable(struct receive_queue *rq, struct sk_buff *head_skb) +static struct sk_buff *receive_mergeable(struct net_device *dev, + struct receive_queue *rq, + void *buf, + unsigned int len) { - struct skb_vnet_hdr *hdr = skb_vnet_hdr(head_skb); + struct skb_vnet_hdr *hdr = buf; + int num_buf =...
2013 Nov 27
4
[PATCH 1/2] virtio_net: fix error handling for mergeable buffers
...ertions(+), 32 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 7bab4de..0e6ea69 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -299,41 +299,53 @@ static struct sk_buff *page_to_skb(struct receive_queue *rq, return skb; } -static int receive_mergeable(struct receive_queue *rq, struct sk_buff *head_skb) +static struct sk_buff *receive_mergeable(struct net_device *dev, + struct receive_queue *rq, + void *buf, + unsigned int len) { - struct skb_vnet_hdr *hdr = skb_vnet_hdr(head_skb); + struct skb_vnet_hdr *hdr = buf; + int num_buf =...
2018 Mar 02
6
[PATCH net V2] virtio-net: re enable XDP_REDIRECT for mergeable buffer
XDP_REDIRECT support for mergeable buffer was removed since commit 7324f5399b06 ("virtio_net: disable XDP_REDIRECT in receive_mergeable() case"). This is because we don't reserve enough tailroom for struct skb_shared_info which breaks XDP assumption. So this patch fixes this by reserving enough tailroom and using fixed size of rx buffer. Signed-off-by: Jason Wang <jasowang at redhat.com> --- Changes from V1: - do no...
2018 Mar 02
6
[PATCH net V2] virtio-net: re enable XDP_REDIRECT for mergeable buffer
XDP_REDIRECT support for mergeable buffer was removed since commit 7324f5399b06 ("virtio_net: disable XDP_REDIRECT in receive_mergeable() case"). This is because we don't reserve enough tailroom for struct skb_shared_info which breaks XDP assumption. So this patch fixes this by reserving enough tailroom and using fixed size of rx buffer. Signed-off-by: Jason Wang <jasowang at redhat.com> --- Changes from V1: - do no...
2013 Nov 20
2
[PATCH net] virtio-net: fix page refcnt leaking when fail to allocate frag skb
Hi, After further reflection I think we're looking at two related issues: (a) a memory leak that Jason has identified that occurs when a memory allocation fails in receive_mergeable. Jasons commit solves this issue. (b) virtio-net does not dequeue all buffers for a packet in the case that an error occurs on receive and mergeable receive buffers is enabled. For (a), this bug is new and due to changes in 2613af0ed18a, and the net impact is memory leak on the physical page. Howe...
2013 Nov 20
2
[PATCH net] virtio-net: fix page refcnt leaking when fail to allocate frag skb
Hi, After further reflection I think we're looking at two related issues: (a) a memory leak that Jason has identified that occurs when a memory allocation fails in receive_mergeable. Jasons commit solves this issue. (b) virtio-net does not dequeue all buffers for a packet in the case that an error occurs on receive and mergeable receive buffers is enabled. For (a), this bug is new and due to changes in 2613af0ed18a, and the net impact is memory leak on the physical page. Howe...
2023 Mar 23
1
[PATCH net-next 1/8] virtio_net: mergeable xdp: put old page immediately
...sertions(+), 9 deletions(-) > > > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > > index e2560b6f7980..4d2bf1ce0730 100644 > > --- a/drivers/net/virtio_net.c > > +++ b/drivers/net/virtio_net.c > > @@ -1245,6 +1245,9 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, > > if (!xdp_page) > > goto err_xdp; > > offset = VIRTIO_XDP_HEADROOM; > > + > > + put_page(page); > > the error handling of xdp_linearize_page() does not seems self contained. > Does it not seem better? > 1. if xdp_li...
2013 Nov 20
7
[PATCH net 1/3] virtio-net: drop the rest of buffers when we can't allocate skb
When mergeable buffer were used, we only put the first page buf leave the rest of buffers in the virt queue. This will cause the driver could not get the correct head buffer any more. Fix this by dropping the rest of buffers for this packet. The bug was introduced by commit 9ab86bbcf8be755256f0a5e994e0b38af6b4d399 (virtio_net: Defer skb allocation in receive path). Cc: Rusty Russell <rusty at
2013 Nov 20
7
[PATCH net 1/3] virtio-net: drop the rest of buffers when we can't allocate skb
When mergeable buffer were used, we only put the first page buf leave the rest of buffers in the virt queue. This will cause the driver could not get the correct head buffer any more. Fix this by dropping the rest of buffers for this packet. The bug was introduced by commit 9ab86bbcf8be755256f0a5e994e0b38af6b4d399 (virtio_net: Defer skb allocation in receive path). Cc: Rusty Russell <rusty at
2013 Dec 26
1
[PATCH stable v2 1/3] virtio_net: fix error handling for mergeable buffers
...ertions(+), 20 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 9fbdfcd..435076f 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -297,26 +297,33 @@ static struct sk_buff *page_to_skb(struct receive_queue *rq, return skb; } -static int receive_mergeable(struct receive_queue *rq, struct sk_buff *skb) +static struct sk_buff *receive_mergeable(struct net_device *dev, + struct receive_queue *rq, + void *buf, + unsigned int len) { - struct skb_vnet_hdr *hdr = skb_vnet_hdr(skb); - struct page *page; - int num_buf, i, len; + struct skb_vn...
2013 Dec 26
1
[PATCH stable v2 1/3] virtio_net: fix error handling for mergeable buffers
...ertions(+), 20 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 9fbdfcd..435076f 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -297,26 +297,33 @@ static struct sk_buff *page_to_skb(struct receive_queue *rq, return skb; } -static int receive_mergeable(struct receive_queue *rq, struct sk_buff *skb) +static struct sk_buff *receive_mergeable(struct net_device *dev, + struct receive_queue *rq, + void *buf, + unsigned int len) { - struct skb_vnet_hdr *hdr = skb_vnet_hdr(skb); - struct page *page; - int num_buf, i, len; + struct skb_vn...
2018 Mar 01
2
[PATCH net-next 0/2] virtio-net: re enable XDP_REDIRECT for mergeable buffer
...018 11:19:03 +0800 >>> Jason Wang <jasowang at redhat.com> wrote: >>> >>>> This series tries to re-enable XDP_REDIRECT for mergeable buffer which >>>> was removed since commit 7324f5399b06 ("virtio_net: disable >>>> XDP_REDIRECT in receive_mergeable() case"). Main concerns are: >>>> >>>> - not enough tailroom was reserved which breaks cpumap >>> To address this at a more fundamental level, I would suggest that we/you >>> instead extend XDP to know it's buffers "frame" size/end. (The...
2018 Mar 01
2
[PATCH net-next 0/2] virtio-net: re enable XDP_REDIRECT for mergeable buffer
...018 11:19:03 +0800 >>> Jason Wang <jasowang at redhat.com> wrote: >>> >>>> This series tries to re-enable XDP_REDIRECT for mergeable buffer which >>>> was removed since commit 7324f5399b06 ("virtio_net: disable >>>> XDP_REDIRECT in receive_mergeable() case"). Main concerns are: >>>> >>>> - not enough tailroom was reserved which breaks cpumap >>> To address this at a more fundamental level, I would suggest that we/you >>> instead extend XDP to know it's buffers "frame" size/end. (The...
2013 Nov 28
4
[PATCH v2 1/2] virtio_net: fix error handling for mergeable buffers
...ertions(+), 31 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 7bab4de..5408de6 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -299,35 +299,47 @@ static struct sk_buff *page_to_skb(struct receive_queue *rq, return skb; } -static int receive_mergeable(struct receive_queue *rq, struct sk_buff *head_skb) +static struct sk_buff *receive_mergeable(struct net_device *dev, + struct receive_queue *rq, + void *buf, + unsigned int len) { - struct skb_vnet_hdr *hdr = skb_vnet_hdr(head_skb); + struct skb_vnet_hdr *hdr = buf; + int num_buf =...
2013 Nov 28
4
[PATCH v2 1/2] virtio_net: fix error handling for mergeable buffers
...ertions(+), 31 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 7bab4de..5408de6 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -299,35 +299,47 @@ static struct sk_buff *page_to_skb(struct receive_queue *rq, return skb; } -static int receive_mergeable(struct receive_queue *rq, struct sk_buff *head_skb) +static struct sk_buff *receive_mergeable(struct net_device *dev, + struct receive_queue *rq, + void *buf, + unsigned int len) { - struct skb_vnet_hdr *hdr = skb_vnet_hdr(head_skb); + struct skb_vnet_hdr *hdr = buf; + int num_buf =...
2017 Sep 19
6
[PATCH net-next 1/3] virtio-net: remove unnecessary parameter of virtnet_xdp_xmit()
...elta = orig_data - xdp.data; break; case XDP_TX: - if (unlikely(!virtnet_xdp_xmit(vi, rq, &xdp))) + if (unlikely(!virtnet_xdp_xmit(vi, &xdp))) trace_xdp_exception(vi->dev, xdp_prog, act); rcu_read_unlock(); goto xdp_xmit; @@ -677,7 +676,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, } break; case XDP_TX: - if (unlikely(!virtnet_xdp_xmit(vi, rq, &xdp))) + if (unlikely(!virtnet_xdp_xmit(vi, &xdp))) trace_xdp_exception(vi->dev, xdp_prog, act); ewma_pkt_len_add(&rq->mrg_avg_pkt_len, len); if (unlikely(xdp_page !...