search for: virtnet_xdp_res_consum

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

2023 Apr 03
1
[PATCH net-next 3/8] virtio_net: introduce virtnet_xdp_handler() to seprate the logic of run xdp
...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 don't see any advantage of introducing this, it's partial mapping of XDP action and it needs to be extended when XDP action is extended. (And we've already had: VIRTIO_XDP_REDIR and VIRTIO_XDP_TX ...) > +...
2023 Apr 04
1
[PATCH net-next 3/8] virtio_net: introduce virtnet_xdp_handler() to seprate the logic of run xdp
...gt; > > + 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 don't see > > > any advantage of introducing this, it's partial mapping of XDP action > > > and it needs to be extended when XDP action is extended. (A...
2023 Apr 04
1
[PATCH net-next 3/8] virtio_net: introduce virtnet_xdp_handler() to seprate the logic of run xdp
...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 don't see > > > > any advantage of introducing this, it's partial mapping of XDP action > > > > and it needs to be extended when X...
2023 Apr 04
1
[PATCH net-next 3/8] virtio_net: introduce virtnet_xdp_handler() to seprate the logic of run xdp
...gt; > > > + /* 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 don't see > > > > > > any advantage of introducing this, it's partial mapping of XDP action > > >...
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
...|= VIRTIO_XDP_TX; @@ -850,7 +850,7 @@ static int virtnet_xdp_handler(struct bpf_prog *xdp_prog, struct xdp_buff *xdp, stats->xdp_redirects++; err = xdp_do_redirect(dev, xdp, xdp_prog); if (err) - return VIRTNET_XDP_RES_DROP; + goto drop; *xdp_xmit |= VIRTIO_XDP_REDIR; return VIRTNET_XDP_RES_CONSUMED; @@ -862,8 +862,12 @@ static int virtnet_xdp_handler(struct bpf_prog *xdp_prog, struct xdp_buff *xdp, trace_xdp_exception(dev, xdp_prog, act); fallthrough; case XDP_DROP: - return VIRTNET_XDP_RES_DROP; + goto drop; } + +drop: + put_xdp_frags(xdp); + return VIRTNET_XDP_RES_DROP; }...
2023 Apr 03
1
[PATCH net-next 6/8] virtio_net: auto release xdp shinfo
...nt virtnet_xdp_handler(struct bpf_prog *xdp_prog, struct xdp_buff *xdp, > stats->xdp_redirects++; > err = xdp_do_redirect(dev, xdp, xdp_prog); > if (err) > - return VIRTNET_XDP_RES_DROP; > + goto drop; > > *xdp_xmit |= VIRTIO_XDP_REDIR; > return VIRTNET_XDP_RES_CONSUMED; > @@ -862,8 +862,12 @@ static int virtnet_xdp_handler(struct bpf_prog *xdp_prog, struct xdp_buff *xdp, > trace_xdp_exception(dev, xdp_prog, act); > fallthrough; > case XDP_DROP: > - return VIRTNET_XDP_RES_DROP; > + goto drop; This goto is kind of meaningless. Th...
2023 Mar 30
1
[PATCH net-next 7/8] virtio_net: introduce receive_mergeable_xdp()
..._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_buf, dev, stats); > + > + stats->xdp_drops++; > + stats->drops++; > + return NULL; > +} > + > static st...
2023 Mar 22
1
[PATCH net-next 7/8] virtio_net: introduce receive_mergeable_xdp()
...kely(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_buf, dev, stats); + + stats->xdp_drops++; + stats->drops++; + return NULL; +} + static struct sk_buff *receive_mergeable(struct net_device *dev, struct virtnet_in...