search for: virtnet_xdp_res_pass

Displaying 11 results from an estimated 11 matches for "virtnet_xdp_res_pass".

2023 Apr 03
1
[PATCH net-next 3/8] virtio_net: introduce virtnet_xdp_handler() to seprate the logic of run xdp
...net.c b/drivers/net/virtio_net.c > index bb426958cdd4..72b9d6ee4024 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > @@ -301,6 +301,15 @@ struct padded_vnet_hdr { > char padding[12]; > }; > > +enum { > + /* xdp pass */ > + VIRTNET_XDP_RES_PASS, > + /* drop packet. the caller needs to release the page. */ > + VIRTNET_XDP_RES_DROP, > + /* packet is consumed by xdp. the caller needs to do nothing. */ > + VIRTNET_XDP_RES_CONSUMED, > +}; I'd prefer this to be done on top unless it is a must. But I d...
2023 Apr 04
1
[PATCH net-next 3/8] virtio_net: introduce virtnet_xdp_handler() to seprate the logic of run xdp
...gt; > > +++ b/drivers/net/virtio_net.c > > > > @@ -301,6 +301,15 @@ struct padded_vnet_hdr { > > > > char padding[12]; > > > > }; > > > > > > > > +enum { > > > > + /* xdp pass */ > > > > + VIRTNET_XDP_RES_PASS, > > > > + /* drop packet. the caller needs to release the page. */ > > > > + VIRTNET_XDP_RES_DROP, > > > > + /* packet is consumed by xdp. the caller needs to do nothing. */ > > > > + VIRTNET_XDP_RES_CONSUMED, > > > &...
2023 Apr 04
1
[PATCH net-next 3/8] virtio_net: introduce virtnet_xdp_handler() to seprate the logic of run xdp
...ct padded_vnet_hdr { > > > > > > > char padding[12]; > > > > > > > }; > > > > > > > > > > > > > > +enum { > > > > > > > + /* xdp pass */ > > > > > > > + VIRTNET_XDP_RES_PASS, > > > > > > > + /* drop packet. the caller needs to release the page. */ > > > > > > > + VIRTNET_XDP_RES_DROP, > > > > > > > + /* packet is consumed by xdp. the caller needs to do nothing. */ > > > > >...
2023 Apr 04
1
[PATCH net-next 3/8] virtio_net: introduce virtnet_xdp_handler() to seprate the logic of run xdp
...tio_net.c > > > > > @@ -301,6 +301,15 @@ struct padded_vnet_hdr { > > > > > char padding[12]; > > > > > }; > > > > > > > > > > +enum { > > > > > + /* xdp pass */ > > > > > + VIRTNET_XDP_RES_PASS, > > > > > + /* drop packet. the caller needs to release the page. */ > > > > > + VIRTNET_XDP_RES_DROP, > > > > > + /* packet is consumed by xdp. the caller needs to do nothing. */ > > > > > + VIRTNET_XDP_RES_CONSUM...
2023 Mar 30
1
[PATCH net-next 7/8] virtio_net: introduce receive_mergeable_xdp()
...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; > + > + act = virtnet_xdp_handler(xdp_prog, &xdp, dev, xdp_xmit, stats); > + > + switch (act) { > + case VIRTNET_XDP_RES_PASS: > + head_skb = build_skb_from_xdp_buff(dev, vi, &xdp, xdp_frags_truesz); > + if (unlikely(!head_skb)) > + goto err_xdp; > + return head_skb; > + > + case VIRTNET_XDP_RES_CONSUMED: > + return NULL; > + > + case VIRTNET_XDP_RES_DROP: > + break; > + } >...
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 6/8] virtio_net: auto release xdp shinfo
..., 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 (unlikely(!head_skb)) - goto err_xdp_frags; + goto err_xdp; rcu_read_unlock(); return head_skb; @@ -1379,11 +1387,8 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, goto xdp_x...
2023 Apr 03
1
[PATCH net-next 6/8] virtio_net: auto release xdp shinfo
...ags_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 (unlikely(!head_skb)) > - goto err_xdp_frags; > + goto err_xdp; > > rcu_read_unlock(); > return head_skb; > @@ -1379,11 +1387,8 @@ static struct sk_buff *receive_mer...
2023 Mar 22
1
[PATCH net-next 7/8] virtio_net: introduce receive_mergeable_xdp()
...+ if (!data) + goto err_xdp; + + 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; + + act = virtnet_xdp_handler(xdp_prog, &xdp, dev, xdp_xmit, stats); + + switch (act) { + case VIRTNET_XDP_RES_PASS: + head_skb = build_skb_from_xdp_buff(dev, vi, &xdp, xdp_frags_truesz); + if (unlikely(!head_skb)) + goto err_xdp; + return head_skb; + + case VIRTNET_XDP_RES_CONSUMED: + return NULL; + + case VIRTNET_XDP_RES_DROP: + break; + } + +err_xdp: + put_page(page); + mergeable_buf_free(rq, num_b...