[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20260126061340.757543-4-mmyangfl@gmail.com>
Date: Mon, 26 Jan 2026 14:13:31 +0800
From: David Yang <mmyangfl@...il.com>
To: netdev@...r.kernel.org
Cc: David Yang <mmyangfl@...il.com>,
Vladimir Oltean <vladimir.oltean@....com>,
Claudiu Manoil <claudiu.manoil@....com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
UNGLinuxDriver@...rochip.com,
Andrew Lunn <andrew@...n.ch>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>,
Russell King <linux@...linux.org.uk>,
linux-kernel@...r.kernel.org
Subject: [PATCH net-next 3/3] net: dsa: ocelot: check policer entry
rate_bytes_per_sec might be 0, check for it.
Signed-off-by: David Yang <mmyangfl@...il.com>
---
drivers/net/dsa/ocelot/felix.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c
index 9e5ede932b42..fb2d02ff0fe7 100644
--- a/drivers/net/dsa/ocelot/felix.c
+++ b/drivers/net/dsa/ocelot/felix.c
@@ -2011,6 +2011,10 @@ static int felix_port_policer_add(struct dsa_switch *ds, int port,
.burst = policer->burst,
};
+ if (dsa_mall_policer_tc_entry_type(policer) !=
+ DSA_MALL_POLICER_TC_KNOWN)
+ return -EOPNOTSUPP;
+
return ocelot_port_policer_add(ocelot, port, &pol);
}
--
2.51.0
Powered by blists - more mailing lists