search for: trace_xdp_except

Displaying 20 results from an estimated 32 matches for "trace_xdp_except".

2023 Apr 03
1
[PATCH net-next 3/8] virtio_net: introduce virtnet_xdp_handler() to seprate the logic of run xdp
...return VIRTNET_XDP_RES_DROP; > + > + err = virtnet_xdp_xmit(dev, 1, &xdpf, 0); > + if (unlikely(!err)) { > + xdp_return_frame_rx_napi(xdpf); > + } else if (unlikely(err < 0)) { > + trace_xdp_exception(dev, xdp_prog, act); > + return VIRTNET_XDP_RES_DROP; > + } > + > + *xdp_xmit |= VIRTIO_XDP_TX; > + return VIRTNET_XDP_RES_CONSUMED; > + > + case XDP_REDIRECT: > + stats->xdp_redirects+...
2023 Apr 04
1
[PATCH net-next 3/8] virtio_net: introduce virtnet_xdp_handler() to seprate the logic of run xdp
...err = virtnet_xdp_xmit(dev, 1, &xdpf, 0); > > > > + if (unlikely(!err)) { > > > > + xdp_return_frame_rx_napi(xdpf); > > > > + } else if (unlikely(err < 0)) { > > > > + trace_xdp_exception(dev, xdp_prog, act); > > > > + return VIRTNET_XDP_RES_DROP; > > > > + } > > > > + > > > > + *xdp_xmit |= VIRTIO_XDP_TX; > > > > + return 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
...dp_xmit(dev, 1, &xdpf, 0); > > > > > + if (unlikely(!err)) { > > > > > + xdp_return_frame_rx_napi(xdpf); > > > > > + } else if (unlikely(err < 0)) { > > > > > + trace_xdp_exception(dev, xdp_prog, act); > > > > > + return VIRTNET_XDP_RES_DROP; > > > > > + } > > > > > + > > > > > + *xdp_xmit |= VIRTIO_XDP_TX; > > > > > + return VIRTNET_XD...
2023 Apr 04
1
[PATCH net-next 3/8] virtio_net: introduce virtnet_xdp_handler() to seprate the logic of run xdp
...> > > > > + if (unlikely(!err)) { > > > > > > > + xdp_return_frame_rx_napi(xdpf); > > > > > > > + } else if (unlikely(err < 0)) { > > > > > > > + trace_xdp_exception(dev, xdp_prog, act); > > > > > > > + return VIRTNET_XDP_RES_DROP; > > > > > > > + } > > > > > > > + > > > > > > > + *xdp_xmit |= VIRTIO_XDP_TX; > > > &gt...
2018 Mar 02
2
[PATCH net] virtio-net: re enable XDP_REDIRECT for mergeable buffer
..._PASS: /* recalculate offset to account for any header @@ -770,6 +774,19 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, goto err_xdp; rcu_read_unlock(); goto xdp_xmit; + case XDP_REDIRECT: + err = xdp_do_redirect(dev, &xdp, xdp_prog); + if (err) { + trace_xdp_exception(vi->dev, xdp_prog, act); + if (unlikely(xdp_page != page)) + put_page(xdp_page); + goto err_xdp; + } + *xdp_xmit = true; + if (unlikely(xdp_page != page)) + goto err_xdp; + rcu_read_unlock(); + goto xdp_xmit; default: bpf_warn_invalid_xdp_action(act); case XDP...
2018 Mar 02
2
[PATCH net] virtio-net: re enable XDP_REDIRECT for mergeable buffer
..._PASS: /* recalculate offset to account for any header @@ -770,6 +774,19 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, goto err_xdp; rcu_read_unlock(); goto xdp_xmit; + case XDP_REDIRECT: + err = xdp_do_redirect(dev, &xdp, xdp_prog); + if (err) { + trace_xdp_exception(vi->dev, xdp_prog, act); + if (unlikely(xdp_page != page)) + put_page(xdp_page); + goto err_xdp; + } + *xdp_xmit = true; + if (unlikely(xdp_page != page)) + goto err_xdp; + rcu_read_unlock(); + goto xdp_xmit; default: bpf_warn_invalid_xdp_action(act); case XDP...
2017 Sep 19
6
[PATCH net-next 1/3] virtio-net: remove unnecessary parameter of virtnet_xdp_xmit()
...dp) { struct virtio_net_hdr_mrg_rxbuf *hdr; @@ -542,7 +541,7 @@ static struct sk_buff *receive_small(struct net_device *dev, delta = orig_data - xdp.data; break; case XDP_TX: - if (unlikely(!virtnet_xdp_xmit(vi, rq, &xdp))) + if (unlikely(!virtnet_xdp_xmit(vi, &xdp))) trace_xdp_exception(vi->dev, xdp_prog, act); rcu_read_unlock(); goto xdp_xmit; @@ -677,7 +676,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, } break; case XDP_TX: - if (unlikely(!virtnet_xdp_xmit(vi, rq, &xdp))) + if (unlikely(!virtnet_xdp_xmit(vi, &xdp)))...
2017 Sep 19
6
[PATCH net-next 1/3] virtio-net: remove unnecessary parameter of virtnet_xdp_xmit()
...dp) { struct virtio_net_hdr_mrg_rxbuf *hdr; @@ -542,7 +541,7 @@ static struct sk_buff *receive_small(struct net_device *dev, delta = orig_data - xdp.data; break; case XDP_TX: - if (unlikely(!virtnet_xdp_xmit(vi, rq, &xdp))) + if (unlikely(!virtnet_xdp_xmit(vi, &xdp))) trace_xdp_exception(vi->dev, xdp_prog, act); rcu_read_unlock(); goto xdp_xmit; @@ -677,7 +676,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, } break; case XDP_TX: - if (unlikely(!virtnet_xdp_xmit(vi, rq, &xdp))) + if (unlikely(!virtnet_xdp_xmit(vi, &xdp)))...
2023 Mar 28
1
[PATCH net-next 6/8] virtio_net: auto release xdp shinfo
...ff *xdp, stats->xdp_tx++; xdpf = xdp_convert_buff_to_frame(xdp); if (unlikely(!xdpf)) - return VIRTNET_XDP_RES_DROP; + goto drop; err = virtnet_xdp_xmit(dev, 1, &xdpf, 0); if (unlikely(!err)) { xdp_return_frame_rx_napi(xdpf); } else if (unlikely(err < 0)) { trace_xdp_exception(dev, xdp_prog, act); - return VIRTNET_XDP_RES_DROP; + goto drop; } *xdp_xmit |= 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) -...
2023 Apr 03
1
[PATCH net-next 6/8] virtio_net: auto release xdp shinfo
...t_buff_to_frame(xdp); > if (unlikely(!xdpf)) > - return VIRTNET_XDP_RES_DROP; > + goto drop; > > err = virtnet_xdp_xmit(dev, 1, &xdpf, 0); > if (unlikely(!err)) { > xdp_return_frame_rx_napi(xdpf); > } else if (unlikely(err < 0)) { > trace_xdp_exception(dev, xdp_prog, act); > - return VIRTNET_XDP_RES_DROP; > + goto drop; > } > > *xdp_xmit |= 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_d...
2018 Sep 06
2
[PATCH net-next 06/11] tuntap: split out XDP logic
...dp_tx(tun->dev, xdp); > + if (*err < 0) > + break; > + *err = 0; > + goto out; > + case XDP_PASS: > + goto out; Do we need goto? why not just return? > + default: > + bpf_warn_invalid_xdp_action(act); > + /* fall through */ > + case XDP_ABORTED: > + trace_xdp_exception(tun->dev, xdp_prog, act); > + /* fall through */ > + case XDP_DROP: > + break; > + } > + > + put_page(virt_to_head_page(xdp->data_hard_start)); put here because caller does get_page :( Not pretty. I'd move this out to the caller. > +out: > + return act; How...
2018 Sep 06
2
[PATCH net-next 06/11] tuntap: split out XDP logic
...dp_tx(tun->dev, xdp); > + if (*err < 0) > + break; > + *err = 0; > + goto out; > + case XDP_PASS: > + goto out; Do we need goto? why not just return? > + default: > + bpf_warn_invalid_xdp_action(act); > + /* fall through */ > + case XDP_ABORTED: > + trace_xdp_exception(tun->dev, xdp_prog, act); > + /* fall through */ > + case XDP_DROP: > + break; > + } > + > + put_page(virt_to_head_page(xdp->data_hard_start)); put here because caller does get_page :( Not pretty. I'd move this out to the caller. > +out: > + return act; How...
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
2017 Sep 20
1
[PATCH net-next 3/3] virtio-net: support XDP_REDIRECT
...at redhat.com> > --- [...] > @@ -678,12 +711,20 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, > } > break; > case XDP_TX: > - if (unlikely(!virtnet_xdp_xmit(vi, &xdp))) > + if (unlikely(!__virtnet_xdp_xmit(vi, &xdp))) > trace_xdp_exception(vi->dev, xdp_prog, act); > + else > + *xdp_xmit = true; > if (unlikely(xdp_page != page)) > goto err_xdp; > rcu_read_unlock(); > goto xdp_xmit; > + case XDP_REDIRECT: > + err = xdp_do_redirect(dev, &xdp, xdp_prog); > + if (err) > +...
2018 Mar 02
0
[PATCH net] virtio-net: re enable XDP_REDIRECT for mergeable buffer
...at.com> wrote: > @@ -770,6 +774,19 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, > goto err_xdp; > rcu_read_unlock(); > goto xdp_xmit; > + case XDP_REDIRECT: > + err = xdp_do_redirect(dev, &xdp, xdp_prog); > + if (err) { > + trace_xdp_exception(vi->dev, xdp_prog, act); Do not add a trace_xdp_exception here... this is handled inside xdp_do_redirect() invocation. > + if (unlikely(xdp_page != page)) > + put_page(xdp_page); > + goto err_xdp; > + } > + *xdp_xmit = true; > + if (unlikely(xdp_page != pag...
2017 Sep 20
1
[PATCH net-next 3/3] virtio-net: support XDP_REDIRECT
...at redhat.com> > --- [...] > @@ -678,12 +711,20 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, > } > break; > case XDP_TX: > - if (unlikely(!virtnet_xdp_xmit(vi, &xdp))) > + if (unlikely(!__virtnet_xdp_xmit(vi, &xdp))) > trace_xdp_exception(vi->dev, xdp_prog, act); > + else > + *xdp_xmit = true; > if (unlikely(xdp_page != page)) > goto err_xdp; > rcu_read_unlock(); > goto xdp_xmit; > + case XDP_REDIRECT: > + err = xdp_do_redirect(dev, &xdp, xdp_prog); > + if (err) > +...
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
2018 Sep 06
0
[PATCH net-next 06/11] tuntap: split out XDP logic
...og); + xdp_do_flush_map(); + if (*err) + break; + goto out; + case XDP_TX: + *err = tun_xdp_tx(tun->dev, xdp); + if (*err < 0) + break; + *err = 0; + goto out; + case XDP_PASS: + goto out; + default: + bpf_warn_invalid_xdp_action(act); + /* fall through */ + case XDP_ABORTED: + trace_xdp_exception(tun->dev, xdp_prog, act); + /* fall through */ + case XDP_DROP: + break; + } + + put_page(virt_to_head_page(xdp->data_hard_start)); +out: + return act; +} + static struct sk_buff *tun_build_skb(struct tun_struct *tun, struct tun_file *tfile, struct iov_iter *from, @@...
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
2018 Sep 07
0
[PATCH net-next 06/11] tuntap: split out XDP logic
...*err = 0; >> + goto out; >> + case XDP_PASS: >> + goto out; > Do we need goto? why not just return? I don't see any difference. > >> + default: >> + bpf_warn_invalid_xdp_action(act); >> + /* fall through */ >> + case XDP_ABORTED: >> + trace_xdp_exception(tun->dev, xdp_prog, act); >> + /* fall through */ >> + case XDP_DROP: >> + break; >> + } >> + >> + put_page(virt_to_head_page(xdp->data_hard_start)); > put here because caller does get_page :( Not pretty. > I'd move this out to the caller. T...