public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] xsk: use __xsk_rcv_zc_safe for ZC multi-buffer Rx processing
@ 2026-03-10 13:30 Maciej Fijalkowski
  2026-03-10 18:22 ` kernel test robot
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Maciej Fijalkowski @ 2026-03-10 13:30 UTC (permalink / raw)
  To: netdev
  Cc: bpf, magnus.karlsson, stfomichev, kuba, pabeni, horms,
	Maciej Fijalkowski

Commit f620af11c27b ("xsk: avoid double checking against rx queue being
full") addressed a case in copy mode, when working with multi-buffer
xdp_buff, where we were peeking onto XSK Rx queue twice, to find out if
there is a space to produce descriptors.

Adjust ZC path to follow the same principle.

Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
---
 net/xdp/xsk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/xdp/xsk.c b/net/xdp/xsk.c
index ef265e45810c..cdf93728fcba 100644
--- a/net/xdp/xsk.c
+++ b/net/xdp/xsk.c
@@ -196,13 +196,13 @@ static int xsk_rcv_zc(struct xdp_sock *xs, struct xdp_buff *xdp, u32 len)
 		goto err;
 	}
 
-	__xsk_rcv_zc(xs, xskb, len, contd);
+	__xsk_rcv_zc_safe(xs, xskb, len, contd);
 	xskb_list = &xskb->pool->xskb_list;
 	list_for_each_entry_safe(pos, tmp, xskb_list, list_node) {
 		if (list_is_singular(xskb_list))
 			contd = 0;
 		len = pos->xdp.data_end - pos->xdp.data;
-		__xsk_rcv_zc(xs, pos, len, contd);
+		__xsk_rcv_zc_safe(xs, pos, len, contd);
 		list_del_init(&pos->list_node);
 	}
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH net-next] xsk: use __xsk_rcv_zc_safe for ZC multi-buffer Rx processing
  2026-03-10 13:30 [PATCH net-next] xsk: use __xsk_rcv_zc_safe for ZC multi-buffer Rx processing Maciej Fijalkowski
@ 2026-03-10 18:22 ` kernel test robot
  2026-03-10 21:59 ` Stanislav Fomichev
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2026-03-10 18:22 UTC (permalink / raw)
  To: Maciej Fijalkowski, netdev
  Cc: oe-kbuild-all, bpf, magnus.karlsson, stfomichev, kuba, pabeni,
	horms, Maciej Fijalkowski

Hi Maciej,

kernel test robot noticed the following build errors:

[auto build test ERROR on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Maciej-Fijalkowski/xsk-use-__xsk_rcv_zc_safe-for-ZC-multi-buffer-Rx-processing/20260310-222557
base:   net-next/main
patch link:    https://lore.kernel.org/r/20260310133024.422464-1-maciej.fijalkowski%40intel.com
patch subject: [PATCH net-next] xsk: use __xsk_rcv_zc_safe for ZC multi-buffer Rx processing
config: m68k-allmodconfig (https://download.01.org/0day-ci/archive/20260311/202603110244.wZ0G0ef2-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260311/202603110244.wZ0G0ef2-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603110244.wZ0G0ef2-lkp@intel.com/

All errors (new ones prefixed by >>):

   net/xdp/xsk.c: In function 'xsk_rcv_zc':
>> net/xdp/xsk.c:188:9: error: implicit declaration of function '__xsk_rcv_zc_safe'; did you mean '__xsk_rcv_zc'? [-Wimplicit-function-declaration]
     188 |         __xsk_rcv_zc_safe(xs, xskb, len, contd);
         |         ^~~~~~~~~~~~~~~~~
         |         __xsk_rcv_zc


vim +188 net/xdp/xsk.c

   162	
   163	static int xsk_rcv_zc(struct xdp_sock *xs, struct xdp_buff *xdp, u32 len)
   164	{
   165		struct xdp_buff_xsk *xskb = container_of(xdp, struct xdp_buff_xsk, xdp);
   166		u32 frags = xdp_buff_has_frags(xdp);
   167		struct xdp_buff_xsk *pos, *tmp;
   168		struct list_head *xskb_list;
   169		u32 contd = 0;
   170		u32 num_desc;
   171		int err;
   172	
   173		if (likely(!frags)) {
   174			err = __xsk_rcv_zc(xs, xskb, len, contd);
   175			if (err)
   176				goto err;
   177			return 0;
   178		}
   179	
   180		contd = XDP_PKT_CONTD;
   181		num_desc = xdp_get_shared_info_from_buff(xdp)->nr_frags + 1;
   182		if (xskq_prod_nb_free(xs->rx, num_desc) < num_desc) {
   183			xs->rx_queue_full++;
   184			err = -ENOBUFS;
   185			goto err;
   186		}
   187	
 > 188		__xsk_rcv_zc_safe(xs, xskb, len, contd);
   189		xskb_list = &xskb->pool->xskb_list;
   190		list_for_each_entry_safe(pos, tmp, xskb_list, list_node) {
   191			if (list_is_singular(xskb_list))
   192				contd = 0;
   193			len = pos->xdp.data_end - pos->xdp.data;
   194			__xsk_rcv_zc_safe(xs, pos, len, contd);
   195			list_del_init(&pos->list_node);
   196		}
   197	
   198		return 0;
   199	err:
   200		xsk_buff_free(xdp);
   201		return err;
   202	}
   203	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH net-next] xsk: use __xsk_rcv_zc_safe for ZC multi-buffer Rx processing
  2026-03-10 13:30 [PATCH net-next] xsk: use __xsk_rcv_zc_safe for ZC multi-buffer Rx processing Maciej Fijalkowski
  2026-03-10 18:22 ` kernel test robot
@ 2026-03-10 21:59 ` Stanislav Fomichev
  2026-03-13  0:33   ` Jakub Kicinski
  2026-03-10 22:10 ` kernel test robot
  2026-03-11  0:36 ` Jason Xing
  3 siblings, 1 reply; 9+ messages in thread
From: Stanislav Fomichev @ 2026-03-10 21:59 UTC (permalink / raw)
  To: Maciej Fijalkowski; +Cc: netdev, bpf, magnus.karlsson, kuba, pabeni, horms

On 03/10, Maciej Fijalkowski wrote:
> Commit f620af11c27b ("xsk: avoid double checking against rx queue being
> full") addressed a case in copy mode, when working with multi-buffer
> xdp_buff, where we were peeking onto XSK Rx queue twice, to find out if
> there is a space to produce descriptors.
> 
> Adjust ZC path to follow the same principle.
> 
> Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>

Acked-by: Stanislav Fomichev <sdf@fomichev.me>

(build bot seems to be confused because f620af11c27b went via bpf-next?)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH net-next] xsk: use __xsk_rcv_zc_safe for ZC multi-buffer Rx processing
  2026-03-10 13:30 [PATCH net-next] xsk: use __xsk_rcv_zc_safe for ZC multi-buffer Rx processing Maciej Fijalkowski
  2026-03-10 18:22 ` kernel test robot
  2026-03-10 21:59 ` Stanislav Fomichev
@ 2026-03-10 22:10 ` kernel test robot
  2026-03-11  0:36 ` Jason Xing
  3 siblings, 0 replies; 9+ messages in thread
From: kernel test robot @ 2026-03-10 22:10 UTC (permalink / raw)
  To: Maciej Fijalkowski, netdev
  Cc: llvm, oe-kbuild-all, bpf, magnus.karlsson, stfomichev, kuba,
	pabeni, horms, Maciej Fijalkowski

Hi Maciej,

kernel test robot noticed the following build errors:

[auto build test ERROR on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Maciej-Fijalkowski/xsk-use-__xsk_rcv_zc_safe-for-ZC-multi-buffer-Rx-processing/20260310-222557
base:   net-next/main
patch link:    https://lore.kernel.org/r/20260310133024.422464-1-maciej.fijalkowski%40intel.com
patch subject: [PATCH net-next] xsk: use __xsk_rcv_zc_safe for ZC multi-buffer Rx processing
config: sparc64-allmodconfig (https://download.01.org/0day-ci/archive/20260311/202603110534.EYw1bSxj-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project 122f0b13a237b5024747b4ee99002590cc9a220a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260311/202603110534.EYw1bSxj-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603110534.EYw1bSxj-lkp@intel.com/

All errors (new ones prefixed by >>):

>> net/xdp/xsk.c:188:2: error: call to undeclared function '__xsk_rcv_zc_safe'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     188 |         __xsk_rcv_zc_safe(xs, xskb, len, contd);
         |         ^
   net/xdp/xsk.c:188:2: note: did you mean '__xsk_rcv_zc'?
   net/xdp/xsk.c:146:12: note: '__xsk_rcv_zc' declared here
     146 | static int __xsk_rcv_zc(struct xdp_sock *xs, struct xdp_buff_xsk *xskb, u32 len,
         |            ^
   1 error generated.


vim +/__xsk_rcv_zc_safe +188 net/xdp/xsk.c

   162	
   163	static int xsk_rcv_zc(struct xdp_sock *xs, struct xdp_buff *xdp, u32 len)
   164	{
   165		struct xdp_buff_xsk *xskb = container_of(xdp, struct xdp_buff_xsk, xdp);
   166		u32 frags = xdp_buff_has_frags(xdp);
   167		struct xdp_buff_xsk *pos, *tmp;
   168		struct list_head *xskb_list;
   169		u32 contd = 0;
   170		u32 num_desc;
   171		int err;
   172	
   173		if (likely(!frags)) {
   174			err = __xsk_rcv_zc(xs, xskb, len, contd);
   175			if (err)
   176				goto err;
   177			return 0;
   178		}
   179	
   180		contd = XDP_PKT_CONTD;
   181		num_desc = xdp_get_shared_info_from_buff(xdp)->nr_frags + 1;
   182		if (xskq_prod_nb_free(xs->rx, num_desc) < num_desc) {
   183			xs->rx_queue_full++;
   184			err = -ENOBUFS;
   185			goto err;
   186		}
   187	
 > 188		__xsk_rcv_zc_safe(xs, xskb, len, contd);
   189		xskb_list = &xskb->pool->xskb_list;
   190		list_for_each_entry_safe(pos, tmp, xskb_list, list_node) {
   191			if (list_is_singular(xskb_list))
   192				contd = 0;
   193			len = pos->xdp.data_end - pos->xdp.data;
   194			__xsk_rcv_zc_safe(xs, pos, len, contd);
   195			list_del_init(&pos->list_node);
   196		}
   197	
   198		return 0;
   199	err:
   200		xsk_buff_free(xdp);
   201		return err;
   202	}
   203	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH net-next] xsk: use __xsk_rcv_zc_safe for ZC multi-buffer Rx processing
  2026-03-10 13:30 [PATCH net-next] xsk: use __xsk_rcv_zc_safe for ZC multi-buffer Rx processing Maciej Fijalkowski
                   ` (2 preceding siblings ...)
  2026-03-10 22:10 ` kernel test robot
@ 2026-03-11  0:36 ` Jason Xing
  3 siblings, 0 replies; 9+ messages in thread
From: Jason Xing @ 2026-03-11  0:36 UTC (permalink / raw)
  To: Maciej Fijalkowski
  Cc: netdev, bpf, magnus.karlsson, stfomichev, kuba, pabeni, horms

On Tue, Mar 10, 2026 at 11:04 PM Maciej Fijalkowski
<maciej.fijalkowski@intel.com> wrote:
>
> Commit f620af11c27b ("xsk: avoid double checking against rx queue being
> full") addressed a case in copy mode, when working with multi-buffer
> xdp_buff, where we were peeking onto XSK Rx queue twice, to find out if
> there is a space to produce descriptors.
>
> Adjust ZC path to follow the same principle.
>
> Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>

Reviewed-by: Jason Xing <kerneljasonxing@gmail.com>

Thanks!

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH net-next] xsk: use __xsk_rcv_zc_safe for ZC multi-buffer Rx processing
  2026-03-10 21:59 ` Stanislav Fomichev
@ 2026-03-13  0:33   ` Jakub Kicinski
  2026-03-13  9:31     ` Maciej Fijalkowski
  0 siblings, 1 reply; 9+ messages in thread
From: Jakub Kicinski @ 2026-03-13  0:33 UTC (permalink / raw)
  To: Stanislav Fomichev
  Cc: Maciej Fijalkowski, netdev, bpf, magnus.karlsson, pabeni, horms

On Tue, 10 Mar 2026 14:59:14 -0700 Stanislav Fomichev wrote:
> (build bot seems to be confused because f620af11c27b went via bpf-next?)

The pre-req is in both trees now. Please repost?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH net-next] xsk: use __xsk_rcv_zc_safe for ZC multi-buffer Rx processing
  2026-03-13  0:33   ` Jakub Kicinski
@ 2026-03-13  9:31     ` Maciej Fijalkowski
  2026-03-13 10:49       ` Maciej Fijalkowski
  0 siblings, 1 reply; 9+ messages in thread
From: Maciej Fijalkowski @ 2026-03-13  9:31 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Stanislav Fomichev, netdev, bpf, magnus.karlsson, pabeni, horms

On Thu, Mar 12, 2026 at 05:33:48PM -0700, Jakub Kicinski wrote:
> On Tue, 10 Mar 2026 14:59:14 -0700 Stanislav Fomichev wrote:
> > (build bot seems to be confused because f620af11c27b went via bpf-next?)
> 
> The pre-req is in both trees now. Please repost?

Will do.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH net-next] xsk: use __xsk_rcv_zc_safe for ZC multi-buffer Rx processing
  2026-03-13  9:31     ` Maciej Fijalkowski
@ 2026-03-13 10:49       ` Maciej Fijalkowski
  2026-03-14 14:46         ` Jakub Kicinski
  0 siblings, 1 reply; 9+ messages in thread
From: Maciej Fijalkowski @ 2026-03-13 10:49 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Stanislav Fomichev, netdev, bpf, magnus.karlsson, pabeni, horms

On Fri, Mar 13, 2026 at 10:31:09AM +0100, Maciej Fijalkowski wrote:
> On Thu, Mar 12, 2026 at 05:33:48PM -0700, Jakub Kicinski wrote:
> > On Tue, 10 Mar 2026 14:59:14 -0700 Stanislav Fomichev wrote:
> > > (build bot seems to be confused because f620af11c27b went via bpf-next?)
> > 
> > The pre-req is in both trees now. Please repost?
> 
> Will do.

Argh, seems like it's not there. Maybe you meant Nikhil Rao's fixes, but
the pre-req for this patch [0] has been applied to bpf-next, I do not see
it on neither net-next nor net tree.

On bpf-next I see this as f620af11c27b ("xsk: avoid double checking against rx
queue being full").

[0] : https://lore.kernel.org/bpf/20260218150000.301176-1-maciej.fijalkowski@intel.com/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH net-next] xsk: use __xsk_rcv_zc_safe for ZC multi-buffer Rx processing
  2026-03-13 10:49       ` Maciej Fijalkowski
@ 2026-03-14 14:46         ` Jakub Kicinski
  0 siblings, 0 replies; 9+ messages in thread
From: Jakub Kicinski @ 2026-03-14 14:46 UTC (permalink / raw)
  To: Maciej Fijalkowski
  Cc: Stanislav Fomichev, netdev, bpf, magnus.karlsson, pabeni, horms

On Fri, 13 Mar 2026 11:49:50 +0100 Maciej Fijalkowski wrote:
> On Fri, Mar 13, 2026 at 10:31:09AM +0100, Maciej Fijalkowski wrote:
> > On Thu, Mar 12, 2026 at 05:33:48PM -0700, Jakub Kicinski wrote:  
> > > The pre-req is in both trees now. Please repost?  
> > 
> > Will do.  
> 
> Argh, seems like it's not there. Maybe you meant Nikhil Rao's fixes, but
> the pre-req for this patch [0] has been applied to bpf-next, I do not see
> it on neither net-next nor net tree.
> 
> On bpf-next I see this as f620af11c27b ("xsk: avoid double checking against rx
> queue being full").
> 
> [0] : https://lore.kernel.org/bpf/20260218150000.301176-1-maciej.fijalkowski@intel.com/

I see, repost for bpf-next then?

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-03-14 14:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-10 13:30 [PATCH net-next] xsk: use __xsk_rcv_zc_safe for ZC multi-buffer Rx processing Maciej Fijalkowski
2026-03-10 18:22 ` kernel test robot
2026-03-10 21:59 ` Stanislav Fomichev
2026-03-13  0:33   ` Jakub Kicinski
2026-03-13  9:31     ` Maciej Fijalkowski
2026-03-13 10:49       ` Maciej Fijalkowski
2026-03-14 14:46         ` Jakub Kicinski
2026-03-10 22:10 ` kernel test robot
2026-03-11  0:36 ` Jason Xing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox