search for: xdp_rxq_info

Displaying 20 results from an estimated 35 matches for "xdp_rxq_info".

2017 Dec 22
1
[bpf-next V2 PATCH 11/14] virtio_net: setup xdp_rxq_info
The virtio_net driver doesn't dynamically change the RX-ring queue layout and backing pages, but instead reject XDP setup if all the conditions for XDP is not meet. Thus, the xdp_rxq_info also remains fairly static. This allow us to simply add the reg/unreg to net_device open/close functions. Driver hook points for xdp_rxq_info: * reg : virtnet_open * unreg: virtnet_close Cc: "Michael S. Tsirkin" <mst at redhat.com> Cc: Jason Wang <jasowang at redhat.com>...
2017 Dec 31
1
[bpf-next V3 PATCH 11/14] virtio_net: setup xdp_rxq_info
The virtio_net driver doesn't dynamically change the RX-ring queue layout and backing pages, but instead reject XDP setup if all the conditions for XDP is not meet. Thus, the xdp_rxq_info also remains fairly static. This allow us to simply add the reg/unreg to net_device open/close functions. Driver hook points for xdp_rxq_info: * reg : virtnet_open * unreg: virtnet_close V3: - bugfix, also setup xdp.rxq in receive_mergeable() - Tested bpf-sample prog inside guest on a virti...
2017 Dec 13
0
[bpf-next V1-RFC PATCH 11/14] virtio_net: setup xdp_rxq_info
The virtio_net driver doesn't dynamically change the RX-ring queue layout and backing pages, but instead reject XDP setup if all the conditions for XDP is not meet. Thus, the xdp_rxq_info also remains fairly static. This allow us to simply add the init+reg/unreg to net_device open/close functions. Driver hook points for xdp_rxq_info: * init+reg: virtnet_open * unreg : virtnet_close Cc: "Michael S. Tsirkin" <mst at redhat.com> Cc: Jason Wang <jasowang at red...
2017 Dec 13
0
[bpf-next V1-RFC PATCH 11/14] virtio_net: setup xdp_rxq_info
The virtio_net driver doesn't dynamically change the RX-ring queue layout and backing pages, but instead reject XDP setup if all the conditions for XDP is not meet. Thus, the xdp_rxq_info also remains fairly static. This allow us to simply add the init+reg/unreg to net_device open/close functions. Driver hook points for xdp_rxq_info: * init+reg: virtnet_open * unreg : virtnet_close Cc: "Michael S. Tsirkin" <mst at redhat.com> Cc: Jason Wang <jasowang at red...
2018 Jan 03
0
[bpf-next V4 PATCH 11/14] virtio_net: setup xdp_rxq_info
The virtio_net driver doesn't dynamically change the RX-ring queue layout and backing pages, but instead reject XDP setup if all the conditions for XDP is not meet. Thus, the xdp_rxq_info also remains fairly static. This allow us to simply add the reg/unreg to net_device open/close functions. Driver hook points for xdp_rxq_info: * reg : virtnet_open * unreg: virtnet_close V3: - bugfix, also setup xdp.rxq in receive_mergeable() - Tested bpf-sample prog inside guest on a virti...
2023 May 03
2
[PATCH net v3] virtio_net: Fix error unwinding of XDP initialization
...avior. Need to roll back the previous rq initialization to avoid leaks in error unwinding of init code. Also extract a helper function of disable queue pairs, and use newly introduced helper function in error unwinding and virtnet_close; Issue: 3383038 Fixes: 754b8a21a96d ("virtio_net: setup xdp_rxq_info") Signed-off-by: Feng Liu <feliu at nvidia.com> Reviewed-by: William Tu <witu at nvidia.com> Reviewed-by: Parav Pandit <parav at nvidia.com> Reviewed-by: Simon Horman <simon.horman at corigine.com> Acked-by: Michael S. Tsirkin <mst at redhat.com> Change-Id: Ib4c6a...
2023 Feb 02
1
[PATCH 1/2] virtio-net: Keep stop() to follow mirror sequence of open()
...ommit in fixes tag frees rxq xdp info while RQ NAPI is still enabled and packet processing may be ongoing. Follow the mirror sequence of open() in the stop() callback. This ensures that when rxq info is unregistered, no rx packet processing is ongoing. Fixes: 754b8a21a96d ("virtio_net: setup xdp_rxq_info") Signed-off-by: Parav Pandit <parav at nvidia.com> --- drivers/net/virtio_net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 7e1a98430190..b7d0b54c3bb0 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/n...
2020 Jun 05
2
[PATCH] virtio_net: Unregister and re-register xdp_rxq across freeze/restore
Unregister each queue's xdp_rxq during freeze, and re-register the new instance during restore. All queues are released during free and recreated during restore, i.e. the pre-freeze xdp_rxq will be lost. The bug is detected by WARNs in xdp_rxq_info_unreg() and xdp_rxq_info_unreg_mem_model() that fire after a suspend/resume cycle as virtnet_close() attempts to unregister an uninitialized xdp_rxq object. ------------[ cut here ]------------ Driver BUG WARNING: CPU: 0 PID: 880 at net/core/xdp.c:163 xdp_rxq_info_unreg+0x48/0x50 Modules l...
2020 Jun 05
2
[PATCH] virtio_net: Unregister and re-register xdp_rxq across freeze/restore
Unregister each queue's xdp_rxq during freeze, and re-register the new instance during restore. All queues are released during free and recreated during restore, i.e. the pre-freeze xdp_rxq will be lost. The bug is detected by WARNs in xdp_rxq_info_unreg() and xdp_rxq_info_unreg_mem_model() that fire after a suspend/resume cycle as virtnet_close() attempts to unregister an uninitialized xdp_rxq object. ------------[ cut here ]------------ Driver BUG WARNING: CPU: 0 PID: 880 at net/core/xdp.c:163 xdp_rxq_info_unreg+0x48/0x50 Modules l...
2023 Apr 28
1
[PATCH net v1 1/2] virtio_net: Fix error unwinding of XDP initialization
...on may hit an error causing net device open failed. However, previous rqs have already initialized XDP and enabled NAPI, which is not the expected behavior. Need to roll back the previous rq initialization to avoid leaks in error unwinding of init code. Fixes: 754b8a21a96d ("virtio_net: setup xdp_rxq_info") Signed-off-by: Feng Liu <feliu at nvidia.com> Reviewed-by: William Tu <witu at nvidia.com> Reviewed-by: Parav Pandit <parav at nvidia.com> --- drivers/net/virtio_net.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/drivers/net...
2020 Jun 07
0
[PATCH] virtio_net: Unregister and re-register xdp_rxq across freeze/restore
...0700, Sean Christopherson wrote: > Unregister each queue's xdp_rxq during freeze, and re-register the new > instance during restore. All queues are released during free and > recreated during restore, i.e. the pre-freeze xdp_rxq will be lost. > > The bug is detected by WARNs in xdp_rxq_info_unreg() and > xdp_rxq_info_unreg_mem_model() that fire after a suspend/resume cycle as > virtnet_close() attempts to unregister an uninitialized xdp_rxq object. > > ------------[ cut here ]------------ > Driver BUG > WARNING: CPU: 0 PID: 880 at net/core/xdp.c:163 xdp_rxq_in...
2023 May 12
4
[PATCH net v6] virtio_net: Fix error unwinding of XDP initialization
...itialization to avoid leaks in error unwinding of init code. Also extract helper functions of disable and enable queue pairs. Use newly introduced disable helper function in error unwinding and virtnet_close. Use enable helper function in virtnet_open. Fixes: 754b8a21a96d ("virtio_net: setup xdp_rxq_info") Signed-off-by: Feng Liu <feliu at nvidia.com> Reviewed-by: Jiri Pirko <jiri at nvidia.com> Reviewed-by: William Tu <witu at nvidia.com> --- v5 -> v6 feedbacks from Xuan Zhuo - add disable_delayed_refill and cancel_delayed_work_sync v4 -> v5 feedbacks from Michael S....
2023 May 02
1
[PATCH net v2] virtio_net: Fix error unwinding of XDP initialization
...he expected behavior. Need to roll back the previous rq initialization to avoid leaks in error unwinding of init code. Also extract a helper function of disable queue pairs, and use newly introduced helper function in error unwinding and virtnet_close; Fixes: 754b8a21a96d ("virtio_net: setup xdp_rxq_info") Signed-off-by: Feng Liu <feliu at nvidia.com> Reviewed-by: William Tu <witu at nvidia.com> Reviewed-by: Parav Pandit <parav at nvidia.com> Reviewed-by: Simon Horman <simon.horman at corigine.com> Acked-by: Michael S. Tsirkin <mst at redhat.com> --- drivers/net/...
2023 May 02
1
[PATCH net v2] virtio_net: Fix error unwinding of XDP initialization
...roll back the previous rq initialization > to avoid leaks in error unwinding of init code. > > Also extract a helper function of disable queue pairs, and use newly > introduced helper function in error unwinding and virtnet_close; > > Fixes: 754b8a21a96d ("virtio_net: setup xdp_rxq_info") > Signed-off-by: Feng Liu <feliu at nvidia.com> > Reviewed-by: William Tu <witu at nvidia.com> > Reviewed-by: Parav Pandit <parav at nvidia.com> > Reviewed-by: Simon Horman <simon.horman at corigine.com> > Acked-by: Michael S. Tsirkin <mst at redhat....
2023 May 06
1
[PATCH net v3] virtio_net: Fix error unwinding of XDP initialization
...ious rq initialization > to avoid leaks in error unwinding of init code. > > Also extract a helper function of disable queue pairs, and use newly > introduced helper function in error unwinding and virtnet_close; > > Issue: 3383038 > Fixes: 754b8a21a96d ("virtio_net: setup xdp_rxq_info") > Signed-off-by: Feng Liu <feliu at nvidia.com> > Reviewed-by: William Tu <witu at nvidia.com> > Reviewed-by: Parav Pandit <parav at nvidia.com> > Reviewed-by: Simon Horman <simon.horman at corigine.com> > Acked-by: Michael S. Tsirkin <mst at redhat....
2023 May 06
1
[PATCH net v3] virtio_net: Fix error unwinding of XDP initialization
...gt; to avoid leaks in error unwinding of init code. >> >> Also extract a helper function of disable queue pairs, and use newly >> introduced helper function in error unwinding and virtnet_close; >> >> Issue: 3383038 >> Fixes: 754b8a21a96d ("virtio_net: setup xdp_rxq_info") >> Signed-off-by: Feng Liu <feliu at nvidia.com> >> Reviewed-by: William Tu <witu at nvidia.com> >> Reviewed-by: Parav Pandit <parav at nvidia.com> >> Reviewed-by: Simon Horman <simon.horman at corigine.com> >> Acked-by: Michael S. Tsirki...
2023 May 10
2
[PATCH net v3] virtio_net: Fix error unwinding of XDP initialization
...;> Also extract a helper function of disable queue pairs, and use newly >>>>>> introduced helper function in error unwinding and virtnet_close; >>>>>> >>>>>> Issue: 3383038 >>>>>> Fixes: 754b8a21a96d ("virtio_net: setup xdp_rxq_info") >>>>>> Signed-off-by: Feng Liu <feliu at nvidia.com> >>>>>> Reviewed-by: William Tu <witu at nvidia.com> >>>>>> Reviewed-by: Parav Pandit <parav at nvidia.com> >>>>>> Reviewed-by: Simon Horman <simon...
2018 Nov 15
0
[PATCH net-next 2/2] tuntap: free XDP dropped packets in a batch
...gt; --- drivers/net/tun.c | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/drivers/net/tun.c b/drivers/net/tun.c index a65779c6d72f..e90a7923a5f6 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -188,6 +188,11 @@ struct tun_file { struct xdp_rxq_info xdp_rxq; }; +struct tun_page { + struct page *page; + int count; +}; + struct tun_flow_entry { struct hlist_node hash_link; struct rcu_head rcu; @@ -2377,9 +2382,16 @@ static void tun_sock_write_space(struct sock *sk) kill_fasync(&tfile->fasync, SIGIO, POLL_OUT); } +static void...
2019 Feb 08
0
[PATCH net] virtio_net: Account for tx bytes and packets on sending xdp_frames
...n_xdp(const > struct bpf_prog *prog, > * already takes rcu_read_lock() when fetching the program, so > * it's not necessary here anymore. > */ > - return BPF_PROG_RUN(prog, xdp); > + u32 ret = BPF_PROG_RUN(prog, xdp); > + xdp->xdp_rxq_info.stats[ret]++ > + return ret; > } > > still we need a way (API) to report the rxq_info to whoever needs to > read current XDP stats I'm capturing this as tasks under the XDP-project github page: https://github.com/xdp-project/xdp-project/pull/13/files -- Best regards,...
2023 May 09
1
[PATCH net v3] virtio_net: Fix error unwinding of XDP initialization
...>>>> Also extract a helper function of disable queue pairs, and use newly > >>>> introduced helper function in error unwinding and virtnet_close; > >>>> > >>>> Issue: 3383038 > >>>> Fixes: 754b8a21a96d ("virtio_net: setup xdp_rxq_info") > >>>> Signed-off-by: Feng Liu <feliu at nvidia.com> > >>>> Reviewed-by: William Tu <witu at nvidia.com> > >>>> Reviewed-by: Parav Pandit <parav at nvidia.com> > >>>> Reviewed-by: Simon Horman <simon.horman at c...