search for: headroom

Displaying 20 results from an estimated 312 matches for "headroom".

2017 Jul 18
1
[PATCH net-next 2/5] virtio-net: pack headroom into ctx for mergeable buffer
On Mon, Jul 17, 2017 at 08:43:58PM +0800, Jason Wang wrote: > Pack headroom into ctx, then during XDP set, we could know the size of > headroom and copy if needed. This is required for avoiding reset on > XDP. Not really when XDP is set - it's when buffers are used. virtio-net: pack headroom into ctx for mergeable buffers Pack headroom into ctx - this way when...
2017 Jul 18
1
[PATCH net-next 2/5] virtio-net: pack headroom into ctx for mergeable buffer
On Mon, Jul 17, 2017 at 08:43:58PM +0800, Jason Wang wrote: > Pack headroom into ctx, then during XDP set, we could know the size of > headroom and copy if needed. This is required for avoiding reset on > XDP. Not really when XDP is set - it's when buffers are used. virtio-net: pack headroom into ctx for mergeable buffers Pack headroom into ctx - this way when...
2023 Mar 28
1
[PATCH net-next 2/8] virtio_net: mergeable xdp: introduce mergeable_xdp_prepare
Separating the logic of preparation for xdp from receive_mergeable. The purpose of this is to simplify the logic of execution of XDP. The main logic here is that when headroom is insufficient, we need to allocate a new page and calculate offset. It should be noted that if there is new page, the variable page will refer to the new page. Signed-off-by: Xuan Zhuo <xuanzhuo at linux.alibaba.com> --- drivers/net/virtio_net.c | 135 ++++++++++++++++++++++---------------...
2023 Mar 31
1
[PATCH net-next 2/8] virtio_net: mergeable xdp: introduce mergeable_xdp_prepare
? 2023/3/28 20:04, Xuan Zhuo ??: > Separating the logic of preparation for xdp from receive_mergeable. > > The purpose of this is to simplify the logic of execution of XDP. > > The main logic here is that when headroom is insufficient, we need to > allocate a new page and calculate offset. It should be noted that if > there is new page, the variable page will refer to the new page. > > Signed-off-by: Xuan Zhuo <xuanzhuo at linux.alibaba.com> > --- > drivers/net/virtio_net.c | 135 +++++++...
2017 Jul 18
1
[PATCH net-next 4/5] virtio-net: do not reset during XDP set
On Mon, Jul 17, 2017 at 08:44:00PM +0800, Jason Wang wrote: > We used to reset during XDP set, the main reason is we need allocate > extra headroom for header adjustment but there's no way to know the > headroom of exist receive buffer. This works buy maybe complex and may > cause the network down for a while which is bad for user > experience. So this patch tries to avoid this by: > > - packing headroom into receive buffer...
2017 Jul 18
1
[PATCH net-next 4/5] virtio-net: do not reset during XDP set
On Mon, Jul 17, 2017 at 08:44:00PM +0800, Jason Wang wrote: > We used to reset during XDP set, the main reason is we need allocate > extra headroom for header adjustment but there's no way to know the > headroom of exist receive buffer. This works buy maybe complex and may > cause the network down for a while which is bad for user > experience. So this patch tries to avoid this by: > > - packing headroom into receive buffer...
2016 Dec 23
1
[RFC PATCH] virtio_net: XDP support for adjust_head
Add support for XDP adjust head by allocating a 256B header region that XDP programs can grow into. This is only enabled when a XDP program is loaded. In order to ensure that we do not have to unwind queue headroom push queue setup below bpf_prog_add. It reads better to do a prog ref unwind vs another queue setup call. TBD merge with Jason Wang's fixes, do a bit more testing, note big_packet support is removed by Jason as well. Signed-off-by: John Fastabend <john.r.fastabend at intel.com> ---...
2016 Dec 23
1
[RFC PATCH] virtio_net: XDP support for adjust_head
Add support for XDP adjust head by allocating a 256B header region that XDP programs can grow into. This is only enabled when a XDP program is loaded. In order to ensure that we do not have to unwind queue headroom push queue setup below bpf_prog_add. It reads better to do a prog ref unwind vs another queue setup call. TBD merge with Jason Wang's fixes, do a bit more testing, note big_packet support is removed by Jason as well. Signed-off-by: John Fastabend <john.r.fastabend at intel.com> ---...
2017 Jul 17
0
[PATCH net-next 2/5] virtio-net: pack headroom into ctx for mergeable buffer
Pack headroom into ctx, then during XDP set, we could know the size of headroom and copy if needed. This is required for avoiding reset on XDP. Signed-off-by: Jason Wang <jasowang at redhat.com> --- drivers/net/virtio_net.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions...
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
2017 Jul 17
13
[PATCH net-next 0/5] refine virtio-net XDP
Hi: This series brings two optimizations for virtio-net XDP: - avoid reset during XDP set - turn off offloads on demand Please review. Thanks Jason Wang (5): virtio_ring: allow to store zero as the ctx virtio-net: pack headroom into ctx for mergeable buffer virtio-net: switch to use new ctx API for small buffer virtio-net: do not reset during XDP set virtio-net: switch off offloads on demand if possible on XDP set drivers/net/virtio_net.c | 325 +++++++++++++++++++++++++------------------ drivers/virtio/virtio...
2017 Jul 17
13
[PATCH net-next 0/5] refine virtio-net XDP
Hi: This series brings two optimizations for virtio-net XDP: - avoid reset during XDP set - turn off offloads on demand Please review. Thanks Jason Wang (5): virtio_ring: allow to store zero as the ctx virtio-net: pack headroom into ctx for mergeable buffer virtio-net: switch to use new ctx API for small buffer virtio-net: do not reset during XDP set virtio-net: switch off offloads on demand if possible on XDP set drivers/net/virtio_net.c | 325 +++++++++++++++++++++++++------------------ drivers/virtio/virtio...
2018 Mar 02
6
[PATCH net V2] virtio-net: re enable XDP_REDIRECT for mergeable buffer
...acket larger than the MTU. */ - if ((page_off + buflen) > PAGE_SIZE) { + if ((page_off + buflen + tailroom) > PAGE_SIZE) { put_page(p); goto err_buf; } @@ -690,6 +691,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, unsigned int truesize; unsigned int headroom = mergeable_ctx_to_headroom(ctx); bool sent; + int err; head_skb = NULL; @@ -701,7 +703,12 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, void *data; u32 act; - /* This happens when rx buffer size is underestimated */ + /* This happens when rx buffer size is u...
2018 Mar 02
6
[PATCH net V2] virtio-net: re enable XDP_REDIRECT for mergeable buffer
...acket larger than the MTU. */ - if ((page_off + buflen) > PAGE_SIZE) { + if ((page_off + buflen + tailroom) > PAGE_SIZE) { put_page(p); goto err_buf; } @@ -690,6 +691,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, unsigned int truesize; unsigned int headroom = mergeable_ctx_to_headroom(ctx); bool sent; + int err; head_skb = NULL; @@ -701,7 +703,12 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, void *data; u32 act; - /* This happens when rx buffer size is underestimated */ + /* This happens when rx buffer size is u...
2018 Mar 02
0
[PATCH net V2] virtio-net: re enable XDP_REDIRECT for mergeable buffer
...if ((page_off + buflen) > PAGE_SIZE) { > + if ((page_off + buflen + tailroom) > PAGE_SIZE) { > put_page(p); > goto err_buf; > } > @@ -690,6 +691,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, > unsigned int truesize; > unsigned int headroom = mergeable_ctx_to_headroom(ctx); > bool sent; > + int err; > > head_skb = NULL; > > @@ -701,7 +703,12 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, > void *data; > u32 act; > > - /* This happens when rx buffer size is underestima...
2018 Mar 01
0
[PATCH net-next 1/2] virtio-net: re enable XDP_REDIRECT for mergeable buffer
...skb; +} + static struct sk_buff *receive_small(struct net_device *dev, struct virtnet_info *vi, struct receive_queue *rq, @@ -689,31 +709,30 @@ static struct sk_buff *receive_mergeable(struct net_device *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 r...
2018 Mar 02
2
[PATCH net] virtio-net: re enable XDP_REDIRECT for mergeable buffer
...acket larger than the MTU. */ - if ((page_off + buflen) > PAGE_SIZE) { + if ((page_off + buflen + tailroom) > PAGE_SIZE) { put_page(p); goto err_buf; } @@ -690,6 +691,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, unsigned int truesize; unsigned int headroom = mergeable_ctx_to_headroom(ctx); bool sent; + int err; head_skb = NULL; @@ -701,7 +703,12 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, void *data; u32 act; - /* This happens when rx buffer size is underestimated */ + /* This happens when rx buffer size is u...
2018 Mar 02
2
[PATCH net] virtio-net: re enable XDP_REDIRECT for mergeable buffer
...acket larger than the MTU. */ - if ((page_off + buflen) > PAGE_SIZE) { + if ((page_off + buflen + tailroom) > PAGE_SIZE) { put_page(p); goto err_buf; } @@ -690,6 +691,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, unsigned int truesize; unsigned int headroom = mergeable_ctx_to_headroom(ctx); bool sent; + int err; head_skb = NULL; @@ -701,7 +703,12 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, void *data; u32 act; - /* This happens when rx buffer size is underestimated */ + /* This happens when rx buffer size is u...
2018 Mar 01
1
[PATCH net-next 1/2] virtio-net: re enable XDP_REDIRECT for mergeable buffer
...uff *receive_small(struct net_device *dev, > struct virtnet_info *vi, > struct receive_queue *rq, > @@ -689,31 +709,30 @@ static struct sk_buff *receive_mergeable(struct net_device *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;...