search for: xdp_page

Displaying 20 results from an estimated 80 matches for "xdp_page".

Did you mean: map_page
2023 Mar 28
1
[PATCH net-next 2/8] virtio_net: mergeable xdp: introduce mergeable_xdp_prepare
...nsigned int *frame_sz, + int *num_buf, + struct page **page, + int offset, + unsigned int *len, + struct virtio_net_hdr_mrg_rxbuf *hdr) +{ + unsigned int truesize = mergeable_ctx_to_truesize(ctx); + unsigned int headroom = mergeable_ctx_to_headroom(ctx); + struct page *xdp_page; + unsigned int xdp_room; + + /* Transient failure which in theory could occur if + * in-flight packets from before XDP was enabled reach + * the receive path after XDP is loaded. + */ + if (unlikely(hdr->hdr.gso_type)) + return NULL; + + /* Now XDP core assumes frag size is PAGE_SIZE, but b...
2023 Mar 28
1
[PATCH net-next 1/8] virtio_net: mergeable xdp: put old page immediately
In the xdp implementation of virtio-net mergeable, it always checks whether two page is used and a page is selected to release. This is complicated for the processing of action, and be careful. In the entire process, we have such principles: * If xdp_page is used (PASS, TX, Redirect), then we release the old page. * If it is a drop case, we will release two. The old page obtained from buf is release inside err_xdp, and xdp_page needs be relased by us. But in fact, when we allocate a new page, we can release the old page immediately. Then just o...
2023 Mar 31
1
[PATCH net-next 2/8] virtio_net: mergeable xdp: introduce mergeable_xdp_prepare
...buf, > + struct page **page, > + int offset, > + unsigned int *len, > + struct virtio_net_hdr_mrg_rxbuf *hdr) > +{ > + unsigned int truesize = mergeable_ctx_to_truesize(ctx); > + unsigned int headroom = mergeable_ctx_to_headroom(ctx); > + struct page *xdp_page; > + unsigned int xdp_room; > + > + /* Transient failure which in theory could occur if > + * in-flight packets from before XDP was enabled reach > + * the receive path after XDP is loaded. > + */ > + if (unlikely(hdr->hdr.gso_type)) > + return NULL; > + > + /*...
2023 Mar 31
1
[PATCH net-next 1/8] virtio_net: mergeable xdp: put old page immediately
...ba.com> wrote: > > In the xdp implementation of virtio-net mergeable, it always checks > whether two page is used and a page is selected to release. This is > complicated for the processing of action, and be careful. > > In the entire process, we have such principles: > * If xdp_page is used (PASS, TX, Redirect), then we release the old > page. > * If it is a drop case, we will release two. The old page obtained from > buf is release inside err_xdp, and xdp_page needs be relased by us. > > But in fact, when we allocate a new page, we can release the old page...
2023 Mar 23
1
[PATCH net-next 1/8] virtio_net: mergeable xdp: put old page immediately
...t; In the xdp implementation of virtio-net mergeable, it always checks > > whether two page is used and a page is selected to release. This is > > complicated for the processing of action, and be careful. > > > > In the entire process, we have such principles: > > * If xdp_page is used (PASS, TX, Redirect), then we release the old > > page. > > * If it is a drop case, we will release two. The old page obtained from > > buf is release inside err_xdp, and xdp_page needs be relased by us. > > > > But in fact, when we allocate a new page, we...
2016 Dec 23
1
[PATCH net 4/9] virtio-net: correctly handle XDP_PASS for linearized packets
On 16-12-23 06:37 AM, Jason Wang wrote: > When XDP_PASS were determined for linearized packets, we try to get > new buffers in the virtqueue and build skbs from them. This is wrong, > we should create skbs based on existed buffers instead. Fixing them by > creating skb based on xdp_page. > > With this patch "ping 192.168.100.4 -s 3900 -M do" works for XDP_PASS. > > Cc: John Fastabend <john.r.fastabend at intel.com> > Signed-off-by: Jason Wang <jasowang at redhat.com> > --- > drivers/net/virtio_net.c | 10 ++++++++-- > 1 file changed...
2016 Dec 23
1
[PATCH net 4/9] virtio-net: correctly handle XDP_PASS for linearized packets
On 16-12-23 06:37 AM, Jason Wang wrote: > When XDP_PASS were determined for linearized packets, we try to get > new buffers in the virtqueue and build skbs from them. This is wrong, > we should create skbs based on existed buffers instead. Fixing them by > creating skb based on xdp_page. > > With this patch "ping 192.168.100.4 -s 3900 -M do" works for XDP_PASS. > > Cc: John Fastabend <john.r.fastabend at intel.com> > Signed-off-by: Jason Wang <jasowang at redhat.com> > --- > drivers/net/virtio_net.c | 10 ++++++++-- > 1 file changed...
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 relationships. In addition, the supporting to AF_XDP that I want to submit later will also n...
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 relationships. In addition, the supporting to AF_XDP that I want to submit later will also n...
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 relationships. In addition, the supporting to AF_XDP that I want to submit later will also n...
2023 Mar 28
1
[PATCH net-next 4/8] virtio_net: separate the logic of freeing xdp shinfo
...et.c index 72b9d6ee4024..09aed60e2f51 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -798,6 +798,21 @@ static int virtnet_xdp_xmit(struct net_device *dev, return ret; } +static void put_xdp_frags(struct xdp_buff *xdp) +{ + struct skb_shared_info *shinfo; + struct page *xdp_page; + int i; + + if (xdp_buff_has_frags(xdp)) { + shinfo = xdp_get_shared_info_from_buff(xdp); + for (i = 0; i < shinfo->nr_frags; i++) { + xdp_page = skb_frag_page(&shinfo->frags[i]); + put_page(xdp_page); + } + } +} + static int virtnet_xdp_handler(struct bpf_prog *xdp_prog, str...
2018 Mar 01
7
[PATCH net-next 0/2] virtio-net: re enable XDP_REDIRECT for mergeable buffer
Hi: 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 - complex logic like EWMA and linearizing during XDP processing Fix those by: - reserve enough tailroom during refill - disable EWMA
2018 Mar 01
7
[PATCH net-next 0/2] virtio-net: re enable XDP_REDIRECT for mergeable buffer
Hi: 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 - complex logic like EWMA and linearizing during XDP processing Fix those by: - reserve enough tailroom during refill - disable EWMA
2018 Mar 01
0
[PATCH net-next 1/2] virtio-net: re enable XDP_REDIRECT for mergeable buffer
...vice *dev, struct bpf_prog *xdp_prog; unsigned int truesize; unsigned int headroom = mergeable_ctx_to_headroom(ctx); - bool sent; + bool sent, skb_xdp = false; + int err; head_skb = NULL; rcu_read_lock(); xdp_prog = rcu_dereference(rq->xdp_prog); if (xdp_prog) { - struct page *xdp_page; struct xdp_buff xdp; void *data; u32 act; - /* This happens when rx buffer size is underestimated */ + /* This happens when rx buffer size is underestimated + * or headroom is not enough because of the buffer + * was refilled before XDP is set. In both cases, + * for simplicity,...
2016 Dec 23
21
[PATCH net 0/9] several fixups for virtio-net XDP
Merry Xmas and a Happy New year to all: This series tries to fixes several issues for virtio-net XDP which could be categorized into several parts: - fix several issues during XDP linearizing - allow csumed packet to work for XDP_PASS - make EWMA rxbuf size estimation works for XDP - forbid XDP when GUEST_UFO is support - remove big packet XDP support - add XDP support or small buffer Please
2016 Dec 23
21
[PATCH net 0/9] several fixups for virtio-net XDP
Merry Xmas and a Happy New year to all: This series tries to fixes several issues for virtio-net XDP which could be categorized into several parts: - fix several issues during XDP linearizing - allow csumed packet to work for XDP_PASS - make EWMA rxbuf size estimation works for XDP - forbid XDP when GUEST_UFO is support - remove big packet XDP support - add XDP support or small buffer Please
2018 Mar 01
1
[PATCH net-next 1/2] virtio-net: re enable XDP_REDIRECT for mergeable buffer
...truesize; > unsigned int headroom = mergeable_ctx_to_headroom(ctx); > - bool sent; > + bool sent, skb_xdp = false; > + int err; > > head_skb = NULL; > > rcu_read_lock(); > xdp_prog = rcu_dereference(rq->xdp_prog); > if (xdp_prog) { > - struct page *xdp_page; > struct xdp_buff xdp; > void *data; > u32 act; > > - /* This happens when rx buffer size is underestimated */ > + /* This happens when rx buffer size is underestimated > + * or headroom is not enough because of the buffer > + * was refilled before XDP is s...
2023 Mar 23
0
[PATCH net-next 1/8] virtio_net: mergeable xdp: put old page immediately
...et mergeable, it always checks > >>> whether two page is used and a page is selected to release. This is > >>> complicated for the processing of action, and be careful. > >>> > >>> In the entire process, we have such principles: > >>> * If xdp_page is used (PASS, TX, Redirect), then we release the old > >>> page. > >>> * If it is a drop case, we will release two. The old page obtained from > >>> buf is release inside err_xdp, and xdp_page needs be relased by us. > >>> > >>> But i...
2016 Dec 23
0
[PATCH net 4/9] virtio-net: correctly handle XDP_PASS for linearized packets
When XDP_PASS were determined for linearized packets, we try to get new buffers in the virtqueue and build skbs from them. This is wrong, we should create skbs based on existed buffers instead. Fixing them by creating skb based on xdp_page. With this patch "ping 192.168.100.4 -s 3900 -M do" works for XDP_PASS. Cc: John Fastabend <john.r.fastabend at intel.com> Signed-off-by: Jason Wang <jasowang at redhat.com> --- drivers/net/virtio_net.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff...
2018 May 21
9
[PATCH net 0/4] Fix several issues of virtio-net mergeable XDP
Hi: Please review the patches that tries to fix sevreal issues of virtio-net mergeable XDP. Thanks Jason Wang (4): virtio-net: correctly redirect linearized packet virtio-net: correctly transmit XDP buff after linearizing virtio-net: reset num_buf to 1 after linearizing packet virito-net: fix leaking page for gso packet during mergeable XDP drivers/net/virtio_net.c | 21