Re: [PATCH net-next] octeontx2-af: fix build regression without CONFIG_DCB
From: Simon Horman
Date: Fri Dec 13 2024 - 13:38:48 EST
On Fri, Dec 13, 2024 at 09:32:18AM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@xxxxxxxx>
>
> 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")
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
Reviewed-by: Simon Horman <horms@xxxxxxxxxx>
I think a nice follow-up would be to move pfc_en
so there is no/less unused space around it.