Skip to contentSkip to conversation

nfp: xsk: fix a warning when allocating rx rings

PATCH Applied Simon Horman 2 participants 2 messages Mar 9, 2022 – Mar 11, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfp: xsk: fix a warning when allocating rx rings

From: Yinjun Zhang <[email protected]>

Previous commits introduced AF_XDP zero-copy support, in which we need register different mem model for xdp_rxq when AF_XDP zero-copy is enabled or not. And this should be done after xdp_rxq info is registered, which is not needed for ctrl port, otherwise there complaints warnings: "Missing register, driver bug".

Fix this by not registering mem model for ctrl port, just like we don't register xdp_rxq info for ctrl port.

Fixes 6402528b7a0b ("nfp: xsk: add AF_XDP zero-copy Rx and Tx support")
---
 drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/net/ethernet/netronome/nfp/nfp_net_common.c +5 -4
index d5ff80a62882..67a87fdf7564 100644
@@ -2622,11 +2622,12 @@ nfp_net_rx_ring_alloc(struct nfp_net_dp *dp, struct nfp_net_rx_ring *rx_ring)
 				       rx_ring->idx, rx_ring->r_vec->napi.napi_id);
 		if (err < 0)
 			return err;
-	}
 
-	err = xdp_rxq_info_reg_mem_model(&rx_ring->xdp_rxq, mem_type, NULL);
-	if (err)
-		goto err_alloc;
+		err = xdp_rxq_info_reg_mem_model(&rx_ring->xdp_rxq,
+						 mem_type, NULL);
+		if (err)
+			goto err_alloc;
+	}
 
 	rx_ring->cnt = dp->rxd_cnt;
 	rx_ring->size = array_size(rx_ring->cnt, sizeof(*rx_ring->rxds));
Signature · 1 line
2.20.1
#1 lore raw
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Wed, 9 Mar 2022 14:55:33 +0100 you wrote:

From: Yinjun Zhang <[email protected]>

Previous commits introduced AF_XDP zero-copy support, in which we need register different mem model for xdp_rxq when AF_XDP zero-copy is enabled or not. And this should be done after xdp_rxq info is registered, which is not needed for ctrl port, otherwise there complaints warnings: "Missing register, driver bug".

[...]

Here is the summary with links:
- [net-next] nfp: xsk: fix a warning when allocating rx rings

    https://git.kernel.org/netdev/net-next/c/87ed3de674c6

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html