On 7/8/25 21:52, Parav Pandit wrote:
From: Bui Quang Minh
Sent: 08 July 2025 08:12 PM
Since commit 4959aebba8c0 ("virtio-net: use mtu size as buffer length for big
packets"), the allocated size for big packets is not MAX_SKB_FRAGS *
PAGE_SIZE anymore but depends on negotiated MTU.
. This commit fixes the received length
check corresponding to that change. The current incorrect check can lead
to NULL page pointer dereference in the below while loop when erroneous
length is received.
Fixes: 4959aebba8c0 ("virtio-net: use mtu size as buffer length for big
packets")
S
On 7/8/25 21:26, Bui Quang Minh wrote:
On 7/7/25 10:48, Jason Wang wrote:
On Sun, Jul 6, 2025 at 10:12 PM Bui Quang Minh
wrote:
Since commit 4959aebba8c0 ("virtio-net: use mtu size as buffer length
for big packets"), the allocated size for big packets is not
MAX_SKB_FRAGS * PAGE_SI
On 7/7/25 10:48, Jason Wang wrote:
On Sun, Jul 6, 2025 at 10:12 PM Bui Quang Minh wrote:
Since commit 4959aebba8c0 ("virtio-net: use mtu size as buffer length
for big packets"), the allocated size for big packets is not
MAX_SKB_FRAGS * PAGE_SIZE anymore but depends on negotiate
. This commit fixes the received length
check corresponding to that change. The current incorrect check can lead
to NULL page pointer dereference in the below while loop when erroneous
length is received.
Fixes: 4959aebba8c0 ("virtio-net: use mtu size as buffer length for big
packets")
S
This commit does not do any functional changes. It moves xdp->data
adjustment for buffer other than first buffer to buf_to_xdp() helper so
that the xdp_buff adjustment does not scatter over different functions.
Signed-off-by: Bui Quang Minh
---
drivers/net/virtio_net.c | 11 +--
1 f
This commit does not do any functional changes. It moves xdp->data
adjustment for buffer other than first buffer to buf_to_xdp() helper so
that the xdp_buff adjustment does not scatter over different functions.
Signed-off-by: Bui Quang Minh
---
drivers/net/virtio_net.c | 11 +--
1 f
orrectly calculate the maximum
frame's length.
Cc: sta...@vger.kernel.org
Reviewed-by: Xuan Zhuo
Fixes: a4e7ba702701 ("virtio_net: xsk: rx: support recv small mode")
Signed-off-by: Bui Quang Minh
---
drivers/net/virtio_net.c | 22 ++
1 file changed, 18 insert
s helper contains
all logic to build xdp_buff and the tricky adjustment does not scatter
over different functions.
Version 3 changes:
- Patch 2: use xdp_prepare_buff helper to initialize xdp_buff
Version 2 changes:
- Patch 1: fix kdoc
Thanks,
Quang Minh.
Bui Quang Minh (2):
virtio-net: xsk: rx:
Replace the current repeated code to check received length in mergeable
mode with the new check_mergeable_len helper.
Signed-off-by: Bui Quang Minh
---
drivers/net/virtio_net.c | 34 +++---
1 file changed, 7 insertions(+), 27 deletions(-)
diff --git a/drivers/net
Signed-off-by: Bui Quang Minh
---
drivers/net/virtio_net.c | 38 ++
1 file changed, 34 insertions(+), 4 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index e53ba600605a..31661bcb3932 100644
--- a/drivers/net/virtio_net.c
+++ b/d
The truesize is guaranteed not to exceed PAGE_SIZE in
get_mergeable_buf_len(). It is saved in mergeable context, which is not
changeable by the host side, so the check in receive path is quite
redundant.
Acked-by: Jason Wang
Signed-off-by: Bui Quang Minh
---
drivers/net/virtio_net.c | 7
repeated code use the check_mergeable_len to
check for received data length in mergeable mode
Version 2 changes:
- Move the check_mergeable_len helper definition to the patch 1.
- Remove patch 4.
Thanks,
Quang Minh.
Bui Quang Minh (3):
virtio-net: ensure the received length does not exceed allocated
On 6/24/25 17:17, Paolo Abeni wrote:
On 6/21/25 4:49 PM, Bui Quang Minh wrote:
This commit does not do any functional changes. It moves xdp->data
adjustment for buffer other than first buffer to buf_to_xdp() helper so
that the xdp_buff adjustment does not scatter over different functi
On 6/26/25 09:38, Jason Wang wrote:
On Thu, Jun 26, 2025 at 12:10 AM Bui Quang Minh
wrote:
Currently, we have repeated code to check the received mergeable buffer's
length with allocated size. This commit creates a helper to do that and
converts current code to use it.
Signed-off-by
On 6/26/25 09:34, Jason Wang wrote:
On Thu, Jun 26, 2025 at 12:10 AM Bui Quang Minh
wrote:
In xdp_linearize_page, when reading the following buffers from the ring,
we forget to check the received length with the true allocate size. This
can lead to an out-of-bound read. This commit adds that
ZE in that
case and continue to process the frame.
In my opinion, the current drop behavior is fine and expected so this
commit is just an improvement not a bug fix.
Signed-off-by: Bui Quang Minh
---
drivers/net/virtio_net.c | 19 +++
1 file changed, 15 insertions(+), 4 deletion
Currently, we have repeated code to check the received mergeable buffer's
length with allocated size. This commit creates a helper to do that and
converts current code to use it.
Signed-off-by: Bui Quang Minh
---
drivers/net/virtio_net.c | 68 +---
1
The truesize is guaranteed not to exceed PAGE_SIZE in
get_mergeable_buf_len(). It is saved in mergeable context, which is not
changeable by the host side, so the check in receive path is quite
redundant.
Signed-off-by: Bui Quang Minh
---
drivers/net/virtio_net.c | 7 +++
1 file changed, 3
ned-off-by: Bui Quang Minh
---
drivers/net/virtio_net.c | 27 ++-
1 file changed, 22 insertions(+), 5 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index e53ba600605a..2a130a3e50ac 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/vi
lt; PAGE_SIZE. XDP does not have this
restriction, so we can lift the restriction here and continue processing
the frame.
Thanks,
Quang Minh.
Bui Quang Minh (4):
virtio-net: ensure the received length does not exceed allocated size
virtio-net: remove redundant truesize check with PAGE_SIZE
On 6/24/25 17:02, Paolo Abeni wrote:
On 6/21/25 4:49 PM, Bui Quang Minh wrote:
When calling buf_to_xdp, the len argument is the frame data's length
without virtio header's length (vi->hdr_len). We check that len with
xsk_pool_get_rx_frame_size() + vi->hdr_len
to ens
On 6/24/25 17:17, Paolo Abeni wrote:
On 6/21/25 4:49 PM, Bui Quang Minh wrote:
This commit does not do any functional changes. It moves xdp->data
adjustment for buffer other than first buffer to buf_to_xdp() helper so
that the xdp_buff adjustment does not scatter over different functi
This commit does not do any functional changes. It moves xdp->data
adjustment for buffer other than first buffer to buf_to_xdp() helper so
that the xdp_buff adjustment does not scatter over different functions.
Signed-off-by: Bui Quang Minh
---
drivers/net/virtio_net.c | 16 ++--
orrectly calculate the maximum
frame's length.
Fixes: a4e7ba702701 ("virtio_net: xsk: rx: support recv small mode")
Signed-off-by: Bui Quang Minh
---
drivers/net/virtio_net.c | 22 ++
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/drivers/net/
s helper contains
all logic to build xdp_buff and the tricky adjustment does not scatter
over different functions.
Version 2 changes:
- Patch 1: fix kdoc
Thanks,
Quang Minh.
Bui Quang Minh (2):
virtio-net: xsk: rx: fix the frame's length check
virtio-net: xsk: rx: move the xdp->data adjustme
On 6/19/25 09:11, Jakub Kicinski wrote:
On Sun, 15 Jun 2025 22:13:32 +0700 Bui Quang Minh wrote:
+/**
+ * buf_to_xdp() - convert the @buf context to xdp_buff
+ * @vi: virtnet_info struct
+ * @rq: the receive queue struct
+ * @buf: the xdp_buff pointer that is passed to
This commit does not do any functional changes. It moves xdp->data
adjustment for buffer other than first buffer to buf_to_xdp() helper so
that the xdp_buff adjustment does not scatter over different functions.
Signed-off-by: Bui Quang Minh
---
drivers/net/virtio_net.c | 16 ++--
orrectly calculate the maximum
frame's length.
Fixes: a4e7ba702701 ("virtio_net: xsk: rx: support recv small mode")
Signed-off-by: Bui Quang Minh
---
drivers/net/virtio_net.c | 30 ++
1 file changed, 26 insertions(+), 4 deletions(-)
diff --git a/driver
s helper contains
all logic to build xdp_buff and the tricky adjustment does not scatter
over different functions.
Thanks,
Quang Minh.
Bui Quang Minh (2):
virtio-net: xsk: rx: fix the frame's length check
virtio-net: xsk: rx: move the xdp->data adjustment to buf_to_xdp()
drivers/net/v
On 6/11/25 03:37, Jakub Kicinski wrote:
On Tue, 10 Jun 2025 22:18:32 +0700 Bui Quang Minh wrote:
Furthermore, we are in the zerocopy so we cannot linearize by
allocating a large enough buffer to cover the whole frame then copy the
frame data to it. That's not zerocopy anymore. Also, XDP s
On 6/9/25 23:58, Jakub Kicinski wrote:
On Fri, 6 Jun 2025 22:48:53 +0700 Bui Quang Minh wrote:
But currently, if a multi-buffer packet arrives, it will not go through
XDP program so it doesn't increase the stats but still goes to network
stack. So I think it's not a correct behavio
On 6/5/25 21:48, Jakub Kicinski wrote:
On Thu, 5 Jun 2025 21:33:26 +0700 Bui Quang Minh wrote:
On 6/5/25 18:03, Paolo Abeni wrote:
On 6/3/25 5:06 PM, Bui Quang Minh wrote:
In virtio-net, we have not yet supported multi-buffer XDP packet in
zerocopy mode when there is a binding XDP program
On 6/5/25 18:03, Paolo Abeni wrote:
On 6/3/25 5:06 PM, Bui Quang Minh wrote:
In virtio-net, we have not yet supported multi-buffer XDP packet in
zerocopy mode when there is a binding XDP program. However, in that
case, when receiving multi-buffer XDP packet, we skip the XDP program
and return
On 6/4/25 23:55, Zvi Effron wrote:
On Tue, Jun 3, 2025 at 8:09 AM Bui Quang Minh wrote:
In virtio-net, we have not yet supported multi-buffer XDP packet in
zerocopy mode when there is a binding XDP program. However, in that
case, when receiving multi-buffer XDP packet, we skip the XDP program
On 6/4/25 07:37, Jason Wang wrote:
On Tue, Jun 3, 2025 at 11:07 PM Bui Quang Minh wrote:
In virtio-net, we have not yet supported multi-buffer XDP packet in
zerocopy mode when there is a binding XDP program. However, in that
case, when receiving multi-buffer XDP packet, we skip the XDP program
incorrect behavior. This commit instead returns
XDP_DROP in that case.
Fixes: 99c861b44eb1 ("virtio_net: xsk: rx: support recv merge mode")
Cc: sta...@vger.kernel.org
Signed-off-by: Bui Quang Minh
---
drivers/net/virtio_net.c | 11 ---
1 file changed, 8 insertions(+), 3 deletion
On 6/3/25 09:56, Jason Wang wrote:
On Thu, May 29, 2025 at 8:28 PM Bui Quang Minh wrote:
On 5/29/25 12:59, Jason Wang wrote:
On Wed, May 28, 2025 at 12:19 AM Bui Quang Minh
wrote:
Currently, in zerocopy mode with mergeable receive buffer, virtio-net
does not support multi buffer but a
On 6/2/25 22:55, Maciej Fijalkowski wrote:
On Sat, May 31, 2025 at 03:51:57PM +0700, Bui Quang Minh wrote:
On 5/30/25 18:45, Maciej Fijalkowski wrote:
On Thu, May 29, 2025 at 09:29:14PM +0700, Bui Quang Minh wrote:
On 5/29/25 18:18, Maciej Fijalkowski wrote:
On Tue, May 27, 2025 at 11:19
have net/lib included in net related selftests.
Signed-off-by: Bui Quang Minh
---
Changes in v3:
- Don't remove INSTALL_DEP_TARGETS in install target so that net/lib is
copied to INSTALL_PATH
Changes in v2:
- Make the commit message clearer.
tools/testing/selftests/Makefile | 2 +-
1
On 5/30/25 18:45, Maciej Fijalkowski wrote:
On Thu, May 29, 2025 at 09:29:14PM +0700, Bui Quang Minh wrote:
On 5/29/25 18:18, Maciej Fijalkowski wrote:
On Tue, May 27, 2025 at 11:19:04PM +0700, Bui Quang Minh wrote:
This adds a test to test the virtio-net rx when there is a XDP socket
bound
have net/lib included in net related selftests.
Reviewed-by: Jakub Kicinski
Signed-off-by: Bui Quang Minh
---
Changes in v2:
- Make the commit message clearer.
tools/testing/selftests/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests
On 5/31/25 12:10, Bui Quang Minh wrote:
We have the logic to include net/lib automatically for net related
selftests. However, currently, this logic is only in install target
which means only `make install` will have net/lib included. This commit
moves the logic to all target so that all `make
On 5/29/25 18:18, Maciej Fijalkowski wrote:
On Tue, May 27, 2025 at 11:19:04PM +0700, Bui Quang Minh wrote:
This adds a test to test the virtio-net rx when there is a XDP socket
bound to it. There are tests for both copy mode and zerocopy mode, both
cases when XDP program returns XDP_PASS and
On 5/29/25 20:34, Simon Horman wrote:
On Thu, May 29, 2025 at 06:04:17PM +0700, Bui Quang Minh wrote:
On 5/29/25 17:32, Simon Horman wrote:
On Thu, May 29, 2025 at 02:05:36PM +0700, Bui Quang Minh wrote:
Currently, we only build net/lib dependency in install target. This
commit moves that to
On 5/29/25 12:59, Jason Wang wrote:
On Wed, May 28, 2025 at 12:19 AM Bui Quang Minh
wrote:
Currently, in zerocopy mode with mergeable receive buffer, virtio-net
does not support multi buffer but a single buffer only. This commit adds
support for multi mergeable receive buffer in the zerocopy
On 5/29/25 17:32, Simon Horman wrote:
On Thu, May 29, 2025 at 02:05:36PM +0700, Bui Quang Minh wrote:
Currently, we only build net/lib dependency in install target. This
commit moves that to all target so that net/lib is included in in-tree
build and run_tests.
Hi,
The above describes what is
Currently, we only build net/lib dependency in install target. This
commit moves that to all target so that net/lib is included in in-tree
build and run_tests.
Signed-off-by: Bui Quang Minh
---
tools/testing/selftests/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff
On 5/29/25 00:04, ALOK TIWARI wrote:
On 27-05-2025 21:49, Bui Quang Minh wrote:
+def main():
+ with NetDrvEpEnv(__file__, nsim_test=False) as cfg:
+ cfg.bin_local = path.abspath(path.dirname(__file__)
+ + "/../../../drivers/net/hw/xsk_re
On 5/28/25 23:44, ALOK TIWARI wrote:
On 27-05-2025 21:49, Bui Quang Minh wrote:
Currently, in zerocopy mode with mergeable receive buffer, virtio-net
does not support multi buffer but a single buffer only. This commit adds
support for multi mergeable receive buffer in the zerocopy XDP path by
Currently, in zerocopy mode with mergeable receive buffer, virtio-net
does not support multi buffer but a single buffer only. This commit adds
support for multi mergeable receive buffer in the zerocopy XDP path by
utilizing XDP buffer with frags.
Signed-off-by: Bui Quang Minh
---
drivers/net
This adds a test to test the virtio-net rx when there is a XDP socket
bound to it. There are tests for both copy mode and zerocopy mode, both
cases when XDP program returns XDP_PASS and XDP_REDIRECT to a XDP socket.
Signed-off-by: Bui Quang Minh
---
.../selftests/drivers/net/hw/.gitignore
TU to test both single buffer and multi
buffer XDP.
Changes in RFC v2:
- Return XDP_DROP when receiving multi-buffer XDP but BPF program does not
support it
- Add selftest
- Link to RFC v1:
https://lore.kernel.org/netdev/20250426082752.43222-1-minhquangbu...@gmail.com/
Thanks,
Quang Minh.
Bui Quang
On 4/26/25 15:27, Bui Quang Minh wrote:
Currently, in zerocopy mode with mergeable receive buffer, virtio-net
does not support multi buffer but a single buffer only. This commit adds
support for multi mergeable receive buffer in the zerocopy XDP path by
utilizing XDP buffer with frags.
Signed
Currently, in zerocopy mode with mergeable receive buffer, virtio-net
does not support multi buffer but a single buffer only. This commit adds
support for multi mergeable receive buffer in the zerocopy XDP path by
utilizing XDP buffer with frags.
Signed-off-by: Bui Quang Minh
---
drivers/net
When binding the XDP socket, we may get EBUSY because the deferred
destructor of XDP socket in previous test has not been executed yet. If
that is the case, just sleep and retry some times.
Signed-off-by: Bui Quang Minh
---
tools/testing/selftests/net/lib/xdp_helper.c | 20
The selftest reproduces the deadlock scenario when binding/unbinding XDP
program, XDP socket, rx ring resize on virtio_net interface.
Signed-off-by: Bui Quang Minh
---
.../testing/selftests/drivers/net/hw/Makefile | 1 +
.../selftests/drivers/net/hw/xsk_reconfig.py | 60 +++
2
This commit adds an optional -z flag to xdp_helper. When this flag is
provided, the XDP socket binding is forced to be in zerocopy mode.
Signed-off-by: Bui Quang Minh
---
tools/testing/selftests/net/lib/xdp_helper.c | 19 +--
1 file changed, 17 insertions(+), 2 deletions
Move xdp_helper to net/lib to make it easier for other selftests to use
the helper.
Signed-off-by: Bui Quang Minh
---
tools/testing/selftests/drivers/net/.gitignore| 1 -
tools/testing/selftests/drivers/net/Makefile | 1 -
tools/testing/selftests/drivers/net
duplication
Version 2 changes:
- Add selftest for deadlock scenario
Thanks,
Quang Minh.
Bui Quang Minh (4):
selftests: net: move xdp_helper to net/lib
selftests: net: add flag to force zerocopy mode in xdp_helper
selftests: net: retry when bind returns EBUSY in xdp_helper
selftests: net: add a
On 4/25/25 08:34, Jakub Kicinski wrote:
On Thu, 24 Apr 2025 17:47:13 +0700 Bui Quang Minh wrote:
This only includes the selftest for virtio-net deadlock bug. The fix
commit has been applied already.
This conflicts with Joe's series slightly:
https://lore.kernel.org/all/20250424002746.16
The selftest reproduces the deadlock scenario when binding/unbinding XDP
program, XDP socket, rx ring resize on virtio_net interface.
Signed-off-by: Bui Quang Minh
---
.../testing/selftests/drivers/net/hw/Makefile | 1 +
.../selftests/drivers/net/hw/xsk_reconfig.py | 68 +++
2
This commit adds an optional -z flag to xdp_helper. When this flag is
provided, the XDP socket binding is forced to be in zerocopy mode.
Signed-off-by: Bui Quang Minh
---
tools/testing/selftests/net/lib/xdp_helper.c | 19 +--
1 file changed, 17 insertions(+), 2 deletions
Move xdp_helper to net/lib to make it easier for other selftests to use
the helper.
Signed-off-by: Bui Quang Minh
---
tools/testing/selftests/drivers/net/Makefile | 2 --
tools/testing/selftests/drivers/net/queues.py | 4 ++--
tools/testing/selftests/net/lib
changes:
- Add force zerocopy mode to xdp_helper
- Make virtio_net selftest use force zerocopy mode
- Move virtio_net selftest to drivers/net/hw
Version 3 changes:
- Patch 1: refactor to avoid code duplication
Version 2 changes:
- Add selftest for deadlock scenario
Thanks,
Quang Minh.
Bui Quang Minh
On 4/24/25 05:23, Jakub Kicinski wrote:
On Wed, 23 Apr 2025 22:20:41 +0700 Bui Quang Minh wrote:
I've tried to make the setup_xsk into each test. However, I've an issue
that the XDP socket destruct waits for an RCU grace period as I see this
sock's flag SOCK_RCU_FREE is set. So
On 4/23/25 08:41, Jakub Kicinski wrote:
On Thu, 17 Apr 2025 14:28:06 +0700 Bui Quang Minh wrote:
The selftest reproduces the deadlock scenario when binding/unbinding XDP
program, XDP socket, rx ring resize on virtio_net interface.
Signed-off-by: Bui Quang Minh
---
.../testing/selftests
w
Version 3 changes:
- Patch 1: refactor to avoid code duplication
Version 2 changes:
- Add selftest for deadlock scenario
Thanks,
Quang Minh.
Bui Quang Minh (4):
virtio-net: disable delayed refill when pausing rx
selftests: net: move xdp_helper to net/lib
selftests: net: add flag to forc
This commit adds an optional -z flag to xdp_helper. When this flag is
provided, the XDP socket binding is forced to be in zerocopy mode.
Signed-off-by: Bui Quang Minh
---
tools/testing/selftests/net/lib/xdp_helper.c | 13 +++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff
The selftest reproduces the deadlock scenario when binding/unbinding XDP
program, XDP socket, rx ring resize on virtio_net interface.
Signed-off-by: Bui Quang Minh
---
.../testing/selftests/drivers/net/hw/Makefile | 1 +
.../selftests/drivers/net/hw/virtio_net.py| 65 +++
2
Move xdp_helper to net/lib to make it easier for other selftests to use
the helper.
Signed-off-by: Bui Quang Minh
---
tools/testing/selftests/drivers/net/Makefile | 2 --
tools/testing/selftests/drivers/net/queues.py | 4 ++--
tools/testing/selftests/net/lib
use the rx.
Fixes: 413f0271f396 ("net: protect NAPI enablement with netdev_lock()")
Acked-by: Michael S. Tsirkin
Signed-off-by: Bui Quang Minh
---
drivers/net/virtio_net.c | 69 +---
1 file changed, 57 insertions(+), 12 deletions(-)
diff
On 4/16/25 14:46, Jason Wang wrote:
On Wed, Apr 16, 2025 at 2:54 PM Bui Quang Minh wrote:
On 4/16/25 11:27, Jakub Kicinski wrote:
On Tue, 15 Apr 2025 14:43:41 +0700 Bui Quang Minh wrote:
+def setup_xsk(cfg, xdp_queue_id = 0) -> bkg:
+# Probe for support
+xdp = cmd(f'{cfg.net
On 4/16/25 11:27, Jakub Kicinski wrote:
On Tue, 15 Apr 2025 14:43:41 +0700 Bui Quang Minh wrote:
+def setup_xsk(cfg, xdp_queue_id = 0) -> bkg:
+# Probe for support
+xdp = cmd(f'{cfg.net_lib_dir / "xdp_helper"} - -', fail=False)
+if xdp.ret == 255:
+r
use the rx.
Fixes: 413f0271f396 ("net: protect NAPI enablement with netdev_lock()")
Signed-off-by: Bui Quang Minh
---
drivers/net/virtio_net.c | 69 +---
1 file changed, 57 insertions(+), 12 deletions(-)
diff --git a/drivers/net/virtio_net.c b/driv
Move xdp_helper to net/lib to make it easier for other selftests to use
the helper.
Signed-off-by: Bui Quang Minh
---
tools/testing/selftests/drivers/net/Makefile | 2 --
tools/testing/selftests/drivers/net/queues.py | 4 ++--
tools/testing/selftests/net/lib
The selftest reproduces the deadlock scenario when binding/unbinding XDP
program, XDP socket, rx ring resize on virtio_net interface.
Signed-off-by: Bui Quang Minh
---
tools/testing/selftests/Makefile | 2 +-
.../selftests/drivers/net/virtio_net/Makefile | 2 +
.../selftests
and fixes up the
virtnet_rx_resume to disable future and cancel all inflights delayed
refill_work before calling napi_disable() to pause the rx.
Version 3 changes:
- Patch 1: refactor to avoid code duplication
Version 2 changes:
- Add selftest for deadlock scenario
Thanks,
Quang Minh.
Bui Qua
and fixes up the
virtnet_rx_resume to disable future and cancel all inflights delayed
refill_work before calling napi_disable() to pause the rx.
Version 2 changes:
- Add selftest for deadlock scenario
Thanks,
Quang Minh.
Bui Quang Minh (3):
virtio-net: disable delayed refill when pausing rx
Move xdp_helper to net/lib to make it easier for other selftests to use
the helper.
Signed-off-by: Bui Quang Minh
---
tools/testing/selftests/drivers/net/Makefile | 2 --
tools/testing/selftests/drivers/net/queues.py | 4 ++--
tools/testing/selftests/net/lib
The selftest reproduces the deadlock scenario when binding/unbinding XDP
program, XDP socket, rx ring resize on virtio_net interface.
Signed-off-by: Bui Quang Minh
---
tools/testing/selftests/Makefile | 2 +-
.../selftests/drivers/net/virtio_net/Makefile | 2 +
.../selftests
use the rx.
Fixes: 413f0271f396 ("net: protect NAPI enablement with netdev_lock()")
Signed-off-by: Bui Quang Minh
---
drivers/net/virtio_net.c | 60 ++--
1 file changed, 51 insertions(+), 9 deletions(-)
diff --git a/drivers/net/virtio_net.c b/driv
e lock. We can try request_ops_lock in -next ?
Bui Quang Minh, could you add a selftest for this problem?
See tools/testing/selftests/drivers/net/virtio_net/
You can re-use / extend the XSK helper from
tools/testing/selftests/drivers/net/xdp_helper.c ?
(move it to tools/testing/selftests/net/lib
On 4/10/25 14:58, Michael S. Tsirkin wrote:
On Thu, Apr 10, 2025 at 02:05:57PM +0700, Bui Quang Minh wrote:
When pausing rx (e.g. set up xdp, xsk pool, rx resize), we call
napi_disable() on the receive queue's napi. In delayed refill_work, it
also calls napi_disable() on the receive qu
NAPI enablement with netdev_lock()")
Signed-off-by: Bui Quang Minh
---
drivers/net/virtio_net.c | 74 +---
1 file changed, 47 insertions(+), 27 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 7e4617216a4b..74bd1065c586
On 4/9/25 13:44, Bui Quang Minh wrote:
On 4/8/25 14:34, Jason Wang wrote:
On Mon, Apr 7, 2025 at 10:27 AM Bui Quang Minh
wrote:
On 4/7/25 08:03, Xuan Zhuo wrote:
On Fri, 4 Apr 2025 16:39:03 +0700, Bui Quang Minh
wrote:
When pausing rx (e.g. set up xdp, xsk pool, rx resize), we call
On 4/8/25 14:34, Jason Wang wrote:
On Mon, Apr 7, 2025 at 10:27 AM Bui Quang Minh wrote:
On 4/7/25 08:03, Xuan Zhuo wrote:
On Fri, 4 Apr 2025 16:39:03 +0700, Bui Quang Minh
wrote:
When pausing rx (e.g. set up xdp, xsk pool, rx resize), we call
napi_disable() on the receive queue's
On 4/7/25 08:03, Xuan Zhuo wrote:
On Fri, 4 Apr 2025 16:39:03 +0700, Bui Quang Minh
wrote:
When pausing rx (e.g. set up xdp, xsk pool, rx resize), we call
napi_disable() on the receive queue's napi. In delayed refill_work, it
also calls napi_disable() on the receive queue's napi
On 4/2/25 12:42, Bui Quang Minh wrote:
When setting up XDP for a running interface, we call napi_disable() on
the receive queue's napi. In delayed refill_work, it also calls
napi_disable() on the receive queue's napi. This can leads to deadlock
when napi_disable() is called on
On 4/3/25 17:43, Bui Quang Minh wrote:
On 4/2/25 12:42, Bui Quang Minh wrote:
When setting up XDP for a running interface, we call napi_disable() on
the receive queue's napi. In delayed refill_work, it also calls
napi_disable() on the receive queue's napi. This can leads to dea
ind xsk for rx")
Signed-off-by: Bui Quang Minh
---
drivers/net/virtio_net.c | 60 ++--
1 file changed, 51 insertions(+), 9 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 7e4617216a4b..4361b91ccc64 100644
--- a/dr
On 4/3/25 14:24, Paolo Abeni wrote:
On 4/2/25 7:42 AM, Bui Quang Minh wrote:
When setting up XDP for a running interface, we call napi_disable() on
the receive queue's napi. In delayed refill_work, it also calls
napi_disable() on the receive queue's napi. This can leads to dea
es this by disabling future and cancelling all inflight delayed
refill works before calling napi_disabled() in virtnet_xdp_set.
Fixes: 4941d472bf95 ("virtio-net: do not reset during XDP set")
Signed-off-by: Bui Quang Minh
---
drivers/net/virtio_net.c | 12
1 file changed, 12 inser
On Mon, Mar 22, 2021 at 03:00:37PM +0200, Mike Rapoport wrote:
> On Mon, Mar 22, 2021 at 11:14:37AM +0100, Michal Hocko wrote:
> > Le'ts Andrea and Mike
> >
> > On Fri 19-03-21 22:24:28, Bui Quang Minh wrote:
> > > userfaultfd_writeprotect() use change
entry in missing page table entry page fault path.
Signed-off-by: Bui Quang Minh
---
mm/huge_memory.c | 12
mm/memory.c | 10 ++
2 files changed, 22 insertions(+)
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index ae907a9c2050..9bb16a55a48c 100644
--- a/mm/huge_me
On 32-bit architecture, roundup_pow_of_two() can return 0 when the argument
has upper most bit set due to resulting 1UL << 32. Add a check for this
case.
Fixes: d5a3b1f ("bpf: introduce BPF_MAP_TYPE_STACK_TRACE")
Signed-off-by: Bui Quang Minh
---
kernel/bpf/stackmap.c | 2 ++
1
On Wed, Jan 27, 2021 at 11:23:41AM +0700, Bui Quang Minh wrote:
> > * Seems like there are quite a few similar calls scattered around
> > (cpumap, etc.). Did you audit these as well?
>
> I spotted another bug after re-auditting. In hashtab, there ares 2 places
> u
On Tue, Jan 26, 2021 at 09:36:57AM +, Lorenz Bauer wrote:
> On Tue, 26 Jan 2021 at 08:26, Bui Quang Minh wrote:
> >
> > In 32-bit architecture, the result of sizeof() is a 32-bit integer so
> > the expression becomes the multiplication between 2 32-bit integer which
>
.
Signed-off-by: Bui Quang Minh
---
kernel/bpf/devmap.c | 4 ++--
net/core/sock_map.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c
index f6e9c68afdd4..e849c3e8a49f 100644
--- a/kernel/bpf/devmap.c
+++ b/kernel/bpf/devmap.c
@@ -92,7
On Tue, Jan 12, 2021 at 01:42:33PM +0700, Minh Bùi Quang wrote:
> On Mon, Jan 11, 2021 at 9:31 PM Bui Quang Minh
> wrote:
> >
> > On Mon, Jan 11, 2021 at 01:00:31PM +0100, Oliver Neukum wrote:
> > > Am Montag, den 11.01.2021, 10:49 + schrieb
1 - 100 of 108 matches
Mail list logo