search for: err_xdp_frags

Displaying 13 results from an estimated 13 matches for "err_xdp_frags".

2023 Mar 28
1
[PATCH net-next 1/8] virtio_net: mergeable xdp: put old page immediately
...ge_address(page) + offset, len); frame_sz = PAGE_SIZE; offset = VIRTIO_XDP_HEADROOM; + + put_page(page); + page = xdp_page; } else { xdp_page = page; } @@ -1278,8 +1284,6 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, if (unlikely(!head_skb)) goto err_xdp_frags; - if (unlikely(xdp_page != page)) - put_page(page); rcu_read_unlock(); return head_skb; case XDP_TX: @@ -1297,8 +1301,6 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, goto err_xdp_frags; } *xdp_xmit |= VIRTIO_XDP_TX; - if (unlikely(xdp_page !=...
2023 Mar 31
1
[PATCH net-next 1/8] virtio_net: mergeable xdp: put old page immediately
...assignment then we can use: data = page_address(page) + offset; Which seems cleaner? Thanks > @@ -1278,8 +1284,6 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, > if (unlikely(!head_skb)) > goto err_xdp_frags; > > - if (unlikely(xdp_page != page)) > - put_page(page); > rcu_read_unlock(); > return head_skb; > case XDP_TX: > @@ -1297,8 +1301,6 @@ static struct sk_buff *r...
2023 Apr 03
1
[PATCH net-next 3/8] virtio_net: introduce virtnet_xdp_handler() to seprate the logic of run xdp
...frame *xdpf; > struct page *xdp_page; > struct xdp_buff xdp; > void *data; > @@ -1294,49 +1329,22 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, > if (unlikely(err)) > goto err_xdp_frags; > > - act = bpf_prog_run_xdp(xdp_prog, &xdp); > - stats->xdp_packets++; > + act = virtnet_xdp_handler(xdp_prog, &xdp, dev, xdp_xmit, stats); > > switch (act) { > - case XDP_PASS: > +...
2023 Mar 23
1
[PATCH net-next 1/8] virtio_net: mergeable xdp: put old page immediately
...e = page; > > } > > It seems the above else block is not needed anymore. Yes, the follow-up patch has this optimization. > > > @@ -1278,8 +1284,6 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, > > if (unlikely(!head_skb)) > > goto err_xdp_frags; > > > > - if (unlikely(xdp_page != page)) > > - put_page(page); > > rcu_read_unlock(); > > return head_skb; > > case XDP_TX: > > @@ -1297,8 +1301,6 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, > > goto err_...
2023 Mar 28
1
[PATCH net-next 6/8] virtio_net: auto release xdp shinfo
...*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 err_xdp; act = virtnet_xdp_handler(xdp_prog, &xdp, dev, xdp_xmit, stats); @@ -1369,7 +1377,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, case VIRTNET_XDP_RES_PASS: head_skb = build_skb_from_xdp_buff(dev, vi, &xdp, xdp_frags_truesz); if (un...
2023 Apr 03
1
[PATCH net-next 6/8] virtio_net: auto release xdp shinfo
...ct 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 err_xdp; > > act = virtnet_xdp_handler(xdp_prog, &xdp, dev, xdp_xmit, stats); > > @@ -1369,7 +1377,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, > case VIRTNET_XDP_RES_PASS: > head_skb = build_skb_from_xdp_buff(dev, vi,...
2023 Apr 04
1
[PATCH net-next 3/8] virtio_net: introduce virtnet_xdp_handler() to seprate the logic of run xdp
...; struct xdp_buff xdp; > > > > void *data; > > > > @@ -1294,49 +1329,22 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, > > > > if (unlikely(err)) > > > > goto err_xdp_frags; > > > > > > > > - act = bpf_prog_run_xdp(xdp_prog, &xdp); > > > > - stats->xdp_packets++; > > > > + act = virtnet_xdp_handler(xdp_prog, &xdp, dev, xdp_xmit, stats); > > > > > > &g...
2023 Apr 04
1
[PATCH net-next 3/8] virtio_net: introduce virtnet_xdp_handler() to seprate the logic of run xdp
...ruct xdp_buff xdp; > > > > > void *data; > > > > > @@ -1294,49 +1329,22 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, > > > > > if (unlikely(err)) > > > > > goto err_xdp_frags; > > > > > > > > > > - act = bpf_prog_run_xdp(xdp_prog, &xdp); > > > > > - stats->xdp_packets++; > > > > > + act = virtnet_xdp_handler(xdp_prog, &xdp, dev, xdp_xmit, stats); > > &g...
2023 Apr 04
1
[PATCH net-next 3/8] virtio_net: introduce virtnet_xdp_handler() to seprate the logic of run xdp
...gt; > > void *data; > > > > > > > @@ -1294,49 +1329,22 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, > > > > > > > if (unlikely(err)) > > > > > > > goto err_xdp_frags; > > > > > > > > > > > > > > - act = bpf_prog_run_xdp(xdp_prog, &xdp); > > > > > > > - stats->xdp_packets++; > > > > > > > + act = virtnet_xdp_handler(xdp_prog, &...
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
2023 Mar 28
1
[PATCH net-next 4/8] virtio_net: separate the logic of freeing xdp shinfo
...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_info_from_buff(&xdp); - for (i = 0; i < shinfo->nr_frags; i++) { - xdp_page = skb_frag_page(&shinfo->frags[i]); - put_page(xdp_page); - } - } - + put_xdp_frags(&xdp); goto er...