Skip to content

Commit

Permalink
octeontx2-af: fix build regression without CONFIG_DCB
Browse files Browse the repository at this point in the history
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: a7ef63d ("octeontx2-af: Disable backpressure between CPT and NIX")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20241213083228.2645757-1-arnd@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Arnd Bergmann authored and Jakub Kicinski committed Dec 15, 2024
1 parent a63bb69 commit 410cd93
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit 410cd93

Please sign in to comment.