Displaying 9 results from an estimated 9 matches for "xdp_convert_buff_to_frame".
2023 Apr 04
1
[PATCH net-next 3/8] virtio_net: introduce virtnet_xdp_handler() to seprate the logic of run xdp
...P_TX/XDP_REDIRECTION goes for this.
>
> So t virtnet_xdp_handler() just maps XDP ACTION plus the error
> conditions to the above three states.
>
> We can simply map error to XDP_DROP like:
>
> case XDP_TX:
> stats->xdp_tx++;
> xdpf = xdp_convert_buff_to_frame(xdp);
> if (unlikely(!xdpf))
> return XDP_DROP;
>
> A good side effect is to avoid the xdp_xmit pointer to be passed to
> the function.
So, I guess you mean this:
switch (act) {
case XDP_PASS:
/* handle pass */
return skb;
case XDP_TX:...
2023 Apr 04
1
[PATCH net-next 3/8] virtio_net: introduce virtnet_xdp_handler() to seprate the logic of run xdp
...> > So t virtnet_xdp_handler() just maps XDP ACTION plus the error
> > conditions to the above three states.
> >
> > We can simply map error to XDP_DROP like:
> >
> > case XDP_TX:
> > stats->xdp_tx++;
> > xdpf = xdp_convert_buff_to_frame(xdp);
> > if (unlikely(!xdpf))
> > return XDP_DROP;
> >
> > A good side effect is to avoid the xdp_xmit pointer to be passed to
> > the function.
>
>
> So, I guess you mean this:
>
> switch (act) {
>...
2023 Apr 03
1
[PATCH net-next 3/8] virtio_net: introduce virtnet_xdp_handler() to seprate the logic of run xdp
...+ act = bpf_prog_run_xdp(xdp_prog, xdp);
> + stats->xdp_packets++;
> +
> + switch (act) {
> + case XDP_PASS:
> + return VIRTNET_XDP_RES_PASS;
> +
> + case XDP_TX:
> + stats->xdp_tx++;
> + xdpf = xdp_convert_buff_to_frame(xdp);
> + if (unlikely(!xdpf))
> + return VIRTNET_XDP_RES_DROP;
> +
> + err = virtnet_xdp_xmit(dev, 1, &xdpf, 0);
> + if (unlikely(!err)) {
> + xdp_return_frame_rx_napi(xdpf);
> +...
2023 Apr 04
1
[PATCH net-next 3/8] virtio_net: introduce virtnet_xdp_handler() to seprate the logic of run xdp
...ror
> > > > conditions to the above three states.
> > > >
> > > > We can simply map error to XDP_DROP like:
> > > >
> > > > case XDP_TX:
> > > > stats->xdp_tx++;
> > > > xdpf = xdp_convert_buff_to_frame(xdp);
> > > > if (unlikely(!xdpf))
> > > > return XDP_DROP;
> > > >
> > > > A good side effect is to avoid the xdp_xmit pointer to be passed to
> > > > the function.
> > >
> > >
>...
2023 Mar 28
1
[PATCH net-next 6/8] virtio_net: auto release xdp shinfo
...ff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index a3f2bcb3db27..136131a7868a 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -833,14 +833,14 @@ static int virtnet_xdp_handler(struct bpf_prog *xdp_prog, struct xdp_buff *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...
2023 Apr 03
1
[PATCH net-next 6/8] virtio_net: auto release xdp shinfo
...t.c b/drivers/net/virtio_net.c
> index a3f2bcb3db27..136131a7868a 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -833,14 +833,14 @@ static int virtnet_xdp_handler(struct bpf_prog *xdp_prog, struct xdp_buff *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_excep...
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