Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: mscc: ocelot: fix build error due to missing IEEE_8021QAZ_MAX_TCS

IEEE_8021QAZ_MAX_TCS is defined in include/uapi/linux/dcbnl.h, which is
included by net/dcbnl.h. Then, linux/netdevice.h conditionally includes
net/dcbnl.h if CONFIG_DCB is enabled.

Therefore, when CONFIG_DCB is disabled, this indirect dependency is
broken.

There isn't a good reason to include net/dcbnl.h headers into the ocelot
switch library which exports low-level hardware API, so replace
IEEE_8021QAZ_MAX_TCS with OCELOT_NUM_TC which has the same value.

Fixes: 978777d0fb06 ("net: dsa: felix: configure default-prio and dscp priorities")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://lore.kernel.org/r/20220315131215.273450-1-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Vladimir Oltean and committed by
Jakub Kicinski
72f56fdb c24f6577

+2 -2
+2 -2
drivers/net/ethernet/mscc/ocelot.c
··· 2917 2917 2918 2918 int ocelot_port_set_default_prio(struct ocelot *ocelot, int port, u8 prio) 2919 2919 { 2920 - if (prio >= IEEE_8021QAZ_MAX_TCS) 2920 + if (prio >= OCELOT_NUM_TC) 2921 2921 return -ERANGE; 2922 2922 2923 2923 ocelot_rmw_gix(ocelot, ··· 2959 2959 { 2960 2960 int mask, val; 2961 2961 2962 - if (prio >= IEEE_8021QAZ_MAX_TCS) 2962 + if (prio >= OCELOT_NUM_TC) 2963 2963 return -ERANGE; 2964 2964 2965 2965 /* There is at least one app table priority (this one), so we need to