Message ID | 20240508103902.4134098-4-o.rempel@pengutronix.de (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: dsa: microchip: DCB fixes | expand |
Hi Oleksij, On Wed, 2024-05-08 at 12:39 +0200, Oleksij Rempel wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you > know the content is safe > > > -static const u8 ksz8_port2_supported_apptrust[] = { > - DCB_APP_SEL_PCP, > -}; > - > static const char * const ksz_supported_apptrust_variants[] = { > "empty", "dscp", "pcp", "dscp pcp" > }; > @@ -771,9 +767,8 @@ int ksz_port_get_apptrust(struct dsa_switch *ds, > int port, u8 *sel, int *nsel) > */ > int ksz_dcb_init_port(struct ksz_device *dev, int port) > { > - const u8 *sel; > + const u8 ksz_default_apptrust[] = { DCB_APP_SEL_PCP }; > int ret, ipm; > - int sel_len; > > if (is_ksz8(dev)) { > ipm = ieee8021q_tt_to_tc(IEEE8021Q_TT_BE, > @@ -789,18 +784,8 @@ int ksz_dcb_init_port(struct ksz_device *dev, > int port) > if (ret) > return ret; > > - if (ksz_is_ksz88x3(dev) && port == KSZ_PORT_2) { > - /* KSZ88x3 devices do not support DSCP classification > on > - * "Port 2. > - */ > - sel = ksz8_port2_supported_apptrust; > - sel_len = ARRAY_SIZE(ksz8_port2_supported_apptrust); If we remove this, How the user application knows about the DSCP resistriction of KSZ8 port 2. Is it implemented in other functions? > - } else { > - sel = ksz_supported_apptrust; > - sel_len = ARRAY_SIZE(ksz_supported_apptrust); > - } > - > - return ksz_port_set_apptrust(dev->ds, port, sel, sel_len); > + return ksz_port_set_apptrust(dev->ds, port, > ksz_default_apptrust, > + ARRAY_SIZE(ksz_default_apptrust) > ); > } > > /** > -- > 2.39.2 >
Hi Arun, On Wed, May 08, 2024 at 03:11:24PM +0000, Arun.Ramadoss@microchip.com wrote: > Hi Oleksij, > > On Wed, 2024-05-08 at 12:39 +0200, Oleksij Rempel wrote: > > EXTERNAL EMAIL: Do not click links or open attachments unless you > > know the content is safe > > > > > > -static const u8 ksz8_port2_supported_apptrust[] = { > > - DCB_APP_SEL_PCP, > > -}; > > - > > static const char * const ksz_supported_apptrust_variants[] = { > > "empty", "dscp", "pcp", "dscp pcp" > > }; > > @@ -771,9 +767,8 @@ int ksz_port_get_apptrust(struct dsa_switch *ds, > > int port, u8 *sel, int *nsel) > > */ > > int ksz_dcb_init_port(struct ksz_device *dev, int port) > > { > > - const u8 *sel; > > + const u8 ksz_default_apptrust[] = { DCB_APP_SEL_PCP }; > > int ret, ipm; > > - int sel_len; > > > > if (is_ksz8(dev)) { > > ipm = ieee8021q_tt_to_tc(IEEE8021Q_TT_BE, > > @@ -789,18 +784,8 @@ int ksz_dcb_init_port(struct ksz_device *dev, > > int port) > > if (ret) > > return ret; > > > > - if (ksz_is_ksz88x3(dev) && port == KSZ_PORT_2) { > > - /* KSZ88x3 devices do not support DSCP classification > > on > > - * "Port 2. > > - */ > > - sel = ksz8_port2_supported_apptrust; > > - sel_len = ARRAY_SIZE(ksz8_port2_supported_apptrust); > > If we remove this, How the user application knows about the DSCP > resistriction of KSZ8 port 2. Is it implemented in other functions? Yes, it is implemented in ksz_port_set_apptrust()->ksz88x3_port_apptrust_quirk(). This patch affects only default configuration.
diff --git a/drivers/net/dsa/microchip/ksz_dcb.c b/drivers/net/dsa/microchip/ksz_dcb.c index 07f6742df41bd..dfe2c48e1066a 100644 --- a/drivers/net/dsa/microchip/ksz_dcb.c +++ b/drivers/net/dsa/microchip/ksz_dcb.c @@ -82,10 +82,6 @@ static const u8 ksz_supported_apptrust[] = { IEEE_8021QAZ_APP_SEL_DSCP, }; -static const u8 ksz8_port2_supported_apptrust[] = { - DCB_APP_SEL_PCP, -}; - static const char * const ksz_supported_apptrust_variants[] = { "empty", "dscp", "pcp", "dscp pcp" }; @@ -771,9 +767,8 @@ int ksz_port_get_apptrust(struct dsa_switch *ds, int port, u8 *sel, int *nsel) */ int ksz_dcb_init_port(struct ksz_device *dev, int port) { - const u8 *sel; + const u8 ksz_default_apptrust[] = { DCB_APP_SEL_PCP }; int ret, ipm; - int sel_len; if (is_ksz8(dev)) { ipm = ieee8021q_tt_to_tc(IEEE8021Q_TT_BE, @@ -789,18 +784,8 @@ int ksz_dcb_init_port(struct ksz_device *dev, int port) if (ret) return ret; - if (ksz_is_ksz88x3(dev) && port == KSZ_PORT_2) { - /* KSZ88x3 devices do not support DSCP classification on - * "Port 2. - */ - sel = ksz8_port2_supported_apptrust; - sel_len = ARRAY_SIZE(ksz8_port2_supported_apptrust); - } else { - sel = ksz_supported_apptrust; - sel_len = ARRAY_SIZE(ksz_supported_apptrust); - } - - return ksz_port_set_apptrust(dev->ds, port, sel, sel_len); + return ksz_port_set_apptrust(dev->ds, port, ksz_default_apptrust, + ARRAY_SIZE(ksz_default_apptrust)); } /**
Before DCB support, the KSZ driver had only PCP as source of packet priority values. To avoid regressions, make PCP only as default value. User will need enable DSCP support manually. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> --- drivers/net/dsa/microchip/ksz_dcb.c | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-)