Skip to content

Commit

Permalink
net: dsa: microchip: dcb: set default apptrust to PCP only
Browse files Browse the repository at this point in the history
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.

This patch do not affect other KSZ8 related quirks. User will still be
warned by setting not support configurations for the port 2.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Acked-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20240510053828.2412516-4-o.rempel@pengutronix.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Oleksij Rempel authored and Jakub Kicinski committed May 13, 2024
1 parent 593d6ad commit 01e400f
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions drivers/net/dsa/microchip/ksz_dcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
};
Expand Down Expand Up @@ -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,
Expand All @@ -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));
}

/**
Expand Down

0 comments on commit 01e400f

Please sign in to comment.