Skip to contentSkip to conversation

octeontx2-af: fix build regression without CONFIG_DCB

PATCH Applied Arnd Bergmann 3 participants 3 messages Dec 13, 2024 – Dec 15, 2024

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

PATCH 1/1 octeontx2-af: fix build regression without CONFIG_DCB

From: Arnd Bergmann <[email protected]>

When DCB is disabled, the pfc_en struct member cannot be accessed:

drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c: In function 'otx2_is_pfc_enabled':
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c:22:48: error: 'struct otx2_nic' has no member named 'pfc_en'
22 | return IS_ENABLED(CONFIG_DCB) && !!pfvf->pfc_en;
| ^~
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c: In function 'otx2_nix_config_bp':
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c:1755:33: error: 'IEEE_8021QAZ_MAX_TCS' undeclared (first use in this function)

 1755 |                 req->chan_cnt = IEEE_8021QAZ_MAX_TCS;
      |                                 ^~~~~~~~~~~~~~~~~~~~

Move the member out of the #ifdef block to avoid putting back another check in the source file and add the missing include file unconditionally.

Fixes a7ef63dbd588 ("octeontx2-af: Disable backpressure between CPT and NIX")
---
 drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 1 +
 drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c +1 -0
index bf56888e7fe7..2b49bfec7869 100644
@@ -10,6 +10,7 @@
 #include <net/page_pool/helpers.h>
 #include <net/tso.h>
 #include <linux/bitfield.h>
+#include <linux/dcbnl.h>
 #include <net/xfrm.h>
 
 #include "otx2_reg.h"
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h +1 -1
index 44d737a0dd09..65814e3dc93f 100644
@@ -505,9 +505,9 @@ struct otx2_nic {
 
 	/* Devlink */
 	struct otx2_devlink	*dl;
-#ifdef CONFIG_DCB
 	/* PFC */
 	u8			pfc_en;
+#ifdef CONFIG_DCB
 	u8			*queue_to_pfc_map;
 	u16			pfc_schq_list[NIX_TXSCH_LVL_CNT][MAX_TXSCHQ_PER_FUNC];
 	bool			pfc_alloc_status[NIX_PF_PFC_PRIO_MAX];
Signature · 1 line
2.39.5
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

When DCB is disabled, the pfc_en struct member cannot be accessed:

drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c: In function 'otx2_is_pfc_enabled':
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c:22:48: error: 'struct otx2_nic' has no member named 'pfc_en'
22 | return IS_ENABLED(CONFIG_DCB) && !!pfvf->pfc_en;
| ^~
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c: In function 'otx2_nix_config_bp':
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c:1755:33: error: 'IEEE_8021QAZ_MAX_TCS' undeclared (first use in this function)

Quoted 8 lines
 1755 |                 req->chan_cnt = IEEE_8021QAZ_MAX_TCS;
      |                                 ^~~~~~~~~~~~~~~~~~~~

Move the member out of the #ifdef block to avoid putting back another check in the source file and add the missing include file unconditionally.

Fixes a7ef63dbd588 ("octeontx2-af: Disable backpressure between CPT and NIX")

I think a nice follow-up would be to move pfc_en
so there is no/less unused space around it.

#2 lore raw
In reply to Arnd Bergmann
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

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

Quoted 10 lines · On Fri, 13 Dec 2024 09:32:18 +0100 you wrote:

From: Arnd Bergmann <[email protected]>

When DCB is disabled, the pfc_en struct member cannot be accessed:

drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c: In function 'otx2_is_pfc_enabled':
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c:22:48: error: 'struct otx2_nic' has no member named 'pfc_en'
22 | return IS_ENABLED(CONFIG_DCB) && !!pfvf->pfc_en;
| ^~
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c: In function 'otx2_nix_config_bp':
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c:1755:33: error: 'IEEE_8021QAZ_MAX_TCS' undeclared (first use in this function)

Quoted 4 lines
 1755 |                 req->chan_cnt = IEEE_8021QAZ_MAX_TCS;
      |                                 ^~~~~~~~~~~~~~~~~~~~

[...]

Here is the summary with links:
- [net-next] octeontx2-af: fix build regression without CONFIG_DCB

    https://git.kernel.org/netdev/net-next/c/410cd938511f

You are awesome, thank you!

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