[PATCH net-next 08/13] net: dsa: hellcreek: deny tc-taprio changes to per-tc max SDU

From: Vladimir Oltean
Date: Wed Sep 14 2022 - 11:35:06 EST


Since the driver does not act upon the max_sdu argument (which it
should, in full offload mode), deny any other values except the default
all-zeroes, which means that all traffic classes should use the same MTU
as the port itself.

Signed-off-by: Vladimir Oltean <vladimir.oltean@xxxxxxx>
---
drivers/net/dsa/hirschmann/hellcreek.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/net/dsa/hirschmann/hellcreek.c b/drivers/net/dsa/hirschmann/hellcreek.c
index ea8bbfce0f1f..8ef7816627b6 100644
--- a/drivers/net/dsa/hirschmann/hellcreek.c
+++ b/drivers/net/dsa/hirschmann/hellcreek.c
@@ -1814,10 +1814,15 @@ static int hellcreek_port_setup_tc(struct dsa_switch *ds, int port,
{
struct tc_taprio_qopt_offload *taprio = type_data;
struct hellcreek *hellcreek = ds->priv;
+ int tc;

if (type != TC_SETUP_QDISC_TAPRIO)
return -EOPNOTSUPP;

+ for (tc = 0; tc < TC_MAX_QUEUE; tc++)
+ if (taprio->max_sdu[tc])
+ return -EOPNOTSUPP;
+
if (!hellcreek_validate_schedule(hellcreek, taprio))
return -EOPNOTSUPP;

--
2.34.1