search for: mergeable_xdp_prepare

Displaying 14 results from an estimated 14 matches for "mergeable_xdp_prepare".

2023 Mar 23
0
[PATCH net-next 2/8] virtio_net: mergeable xdp: introduce mergeable_xdp_prepare
On Thu, 23 Mar 2023 15:24:38 +0800, Yunsheng Lin <linyunsheng at huawei.com> wrote: > On 2023/3/23 13:40, Jason Wang wrote: > >>> > >>>> > >>>> Also, it seems better to split the xdp_linearize_page() to two functions > >>>> as pskb_expand_head() and __skb_linearize() do, one to expand the headroom, > >>>> the other
2023 Mar 28
1
[PATCH net-next 2/8] virtio_net: mergeable xdp: introduce mergeable_xdp_prepare
...58 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 4d2bf1ce0730..bb426958cdd4 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -1162,6 +1162,79 @@ static int virtnet_build_xdp_buff_mrg(struct net_device *dev, return 0; } +static void *mergeable_xdp_prepare(struct virtnet_info *vi, + struct receive_queue *rq, + struct bpf_prog *xdp_prog, + void *ctx, + unsigned int *frame_sz, + int *num_buf, + struct page **page, + int offset, + unsigned int *len, + struct virtio_net_hdr_mrg_rxbuf *hdr) +{ + unsign...
2023 Mar 31
1
[PATCH net-next 2/8] virtio_net: mergeable xdp: introduce mergeable_xdp_prepare
...irtio_net.c b/drivers/net/virtio_net.c > index 4d2bf1ce0730..bb426958cdd4 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > @@ -1162,6 +1162,79 @@ static int virtnet_build_xdp_buff_mrg(struct net_device *dev, > return 0; > } > > +static void *mergeable_xdp_prepare(struct virtnet_info *vi, > + struct receive_queue *rq, > + struct bpf_prog *xdp_prog, > + void *ctx, > + unsigned int *frame_sz, > + int *num_buf, > + struct page **page, > + int offset, > + unsigned int *len, > + stru...
2023 Mar 30
1
[PATCH net-next 7/8] virtio_net: introduce receive_mergeable_xdp()
...--------- > 1 file changed, 76 insertions(+), 52 deletions(-) > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > index 136131a7868a..c8978d8d8adb 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > @@ -1316,6 +1316,63 @@ static void *mergeable_xdp_prepare(struct virtnet_info *vi, > return page_address(xdp_page) + VIRTIO_XDP_HEADROOM; > } > > +static struct sk_buff *receive_mergeable_xdp(struct net_device *dev, > + struct virtnet_info *vi, > + struct receive_queue *rq, > + struct bpf_prog *xdp_prog...
2023 Mar 15
10
[RFC net-next 0/8] virtio_net: refactor xdp codes
...tch set[1]. I may have to wait to merge this. So this patch set is a RFC. Please review. Thanks. [1]. https://lore.kernel.org/netdev/20230315015223.89137-1-xuanzhuo at linux.alibaba.com/ Xuan Zhuo (8): virtio_net: mergeable xdp: put old page immediately virtio_net: mergeable xdp: introduce mergeable_xdp_prepare virtio_net: introduce virtnet_xdp_handler() to seprate the logic of run xdp virtio_net: separate the logic of freeing xdp shinfo virtio_net: separate the logic of freeing the rest mergeable buf virtio_net: auto release xdp shinfo virtio_net: introduce receive_mergeable_xdp() virtio_...
2023 Mar 22
9
[PATCH net-next 0/8] virtio_net: refactor xdp codes
...d to reuse the logic of XDP, such as the processing of actions, I don't want to introduce a new similar code. In this way, I can reuse these codes in the future. Please review. Thanks. Xuan Zhuo (8): virtio_net: mergeable xdp: put old page immediately virtio_net: mergeable xdp: introduce mergeable_xdp_prepare virtio_net: introduce virtnet_xdp_handler() to seprate the logic of run xdp virtio_net: separate the logic of freeing xdp shinfo virtio_net: separate the logic of freeing the rest mergeable buf virtio_net: auto release xdp shinfo virtio_net: introduce receive_mergeable_xdp() virtio_...
2023 Mar 28
8
[PATCH net-next 0/8] virtio_net: refactor xdp codes
...ng of actions, I don't want to introduce a new similar code. In this way, I can reuse these codes in the future. Please review. Thanks. v1: 1. fix some variables are uninitialized Xuan Zhuo (8): virtio_net: mergeable xdp: put old page immediately virtio_net: mergeable xdp: introduce mergeable_xdp_prepare virtio_net: introduce virtnet_xdp_handler() to seprate the logic of run xdp virtio_net: separate the logic of freeing xdp shinfo virtio_net: separate the logic of freeing the rest mergeable buf virtio_net: auto release xdp shinfo virtio_net: introduce receive_mergeable_xdp() virtio_...
2023 Mar 28
1
[PATCH net-next 4/8] virtio_net: separate the logic of freeing xdp shinfo
...atic struct sk_buff *receive_mergeable(struct net_device *dev, xdp_prog = rcu_dereference(rq->xdp_prog); if (xdp_prog) { unsigned int xdp_frags_truesz = 0; - struct skb_shared_info *shinfo; - struct page *xdp_page; struct xdp_buff xdp; void *data; u32 act; - int i; data = mergeable_xdp_prepare(vi, rq, xdp_prog, ctx, &frame_sz, &num_buf, &page, offset, &len, hdr); @@ -1348,14 +1360,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, goto err_xdp_frags; } err_xdp_frags: - if (xdp_buff_has_frags(&xdp)) { - shinfo = xdp_get_shared_i...
2023 Mar 22
1
[PATCH net-next 0/8] virtio_net: refactor xdp codes
...e that code make progress though. Would it make sense to merge this one through the virtio tree? Then you will have all the pieces in one place and try to target next linux. > Xuan Zhuo (8): > virtio_net: mergeable xdp: put old page immediately > virtio_net: mergeable xdp: introduce mergeable_xdp_prepare > virtio_net: introduce virtnet_xdp_handler() to seprate the logic of > run xdp > virtio_net: separate the logic of freeing xdp shinfo > virtio_net: separate the logic of freeing the rest mergeable buf > virtio_net: auto release xdp shinfo > virtio_net: introduce rec...
2023 Mar 22
1
[PATCH net-next 0/8] virtio_net: refactor xdp codes
...dency on net-next? > > > > Then you will have all the pieces in one place and try to target > > next linux. > > > > > > > Xuan Zhuo (8): > > > virtio_net: mergeable xdp: put old page immediately > > > virtio_net: mergeable xdp: introduce mergeable_xdp_prepare > > > virtio_net: introduce virtnet_xdp_handler() to seprate the logic of > > > run xdp > > > virtio_net: separate the logic of freeing xdp shinfo > > > virtio_net: separate the logic of freeing the rest mergeable buf > > > virtio_net: auto r...
2023 Mar 21
1
[RFC net-next 0/8] virtio_net: refactor xdp codes
...ew. > > > > Thanks. > > > > [1]. https://lore.kernel.org/netdev/20230315015223.89137-1-xuanzhuo at linux.alibaba.com/ > > > > > > Xuan Zhuo (8): > > virtio_net: mergeable xdp: put old page immediately > > virtio_net: mergeable xdp: introduce mergeable_xdp_prepare > > virtio_net: introduce virtnet_xdp_handler() to seprate the logic of > > run xdp > > virtio_net: separate the logic of freeing xdp shinfo > > virtio_net: separate the logic of freeing the rest mergeable buf > > virtio_net: auto release xdp shinfo > &g...
2023 Mar 22
1
[PATCH net-next 7/8] virtio_net: introduce receive_mergeable_xdp()
...128 +++++++++++++++++++++++---------------- 1 file changed, 76 insertions(+), 52 deletions(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 136131a7868a..6ecb17e972e1 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@ -1316,6 +1316,63 @@ static void *mergeable_xdp_prepare(struct virtnet_info *vi, return page_address(xdp_page) + VIRTIO_XDP_HEADROOM; } +static struct sk_buff *receive_mergeable_xdp(struct net_device *dev, + struct virtnet_info *vi, + struct receive_queue *rq, + struct bpf_prog *xdp_prog, + void *buf, +...
2023 Mar 28
1
[PATCH net-next 6/8] virtio_net: auto release xdp shinfo
...eturn -EINVAL; + goto err; } frag = &shinfo->frags[shinfo->nr_frags++]; @@ -1233,6 +1237,10 @@ static int virtnet_build_xdp_buff_mrg(struct net_device *dev, *xdp_frags_truesize = xdp_frags_truesz; return 0; + +err: + put_xdp_frags(xdp); + return -EINVAL; } static void *mergeable_xdp_prepare(struct virtnet_info *vi, @@ -1361,7 +1369,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, err = virtnet_build_xdp_buff_mrg(dev, vi, rq, &xdp, data, len, frame_sz, &num_buf, &xdp_frags_truesz, stats); if (unlikely(err)) - goto err_xdp_frags; + goto...
2023 Apr 03
1
[PATCH net-next 6/8] virtio_net: auto release xdp shinfo
...;frags[shinfo->nr_frags++]; > @@ -1233,6 +1237,10 @@ static int virtnet_build_xdp_buff_mrg(struct net_device *dev, > > *xdp_frags_truesize = xdp_frags_truesz; > return 0; > + > +err: > + put_xdp_frags(xdp); > + return -EINVAL; > } > > static void *mergeable_xdp_prepare(struct virtnet_info *vi, > @@ -1361,7 +1369,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, > err = virtnet_build_xdp_buff_mrg(dev, vi, rq, &xdp, data, len, frame_sz, > &num_buf, &xdp_frags_truesz, stats); > if (unlikely(err)) > -...