From: Grygorii Strashko <grygorii.strashko@ti.com>
To: "David S. Miller" <davem@davemloft.net>, <netdev@vger.kernel.org>,
Jakub Kicinski <kuba@kernel.org>
Cc: <linux-kernel@vger.kernel.org>,
Kishon Vijay Abraham I <kishon@ti.com>,
Vignesh Raghavendra <vigneshr@ti.com>,
<linux-omap@vger.kernel.org>, Tony Lindgren <tony@atomide.com>,
Andrew Lunn <andrew@lunn.ch>,
Vladimir Oltean <vladimir.oltean@nxp.com>
Subject: [PATCH net-next v2 0/3] net: ethernet: ti: cpsw: enable bc/mc storm prevention support
Date: Mon, 1 Nov 2021 19:01:19 +0200 [thread overview]
Message-ID: <20211101170122.19160-1-grygorii.strashko@ti.com> (raw)
Hi
This series first adds supports for the ALE feature to rate limit number ingress
broadcast(BC)/multicast(MC) packets per/sec which main purpose is BC/MC storm
prevention.
And then enables corresponding support for ingress broadcast(BC)/multicast(MC)
packets rate limiting for TI CPSW switchdev and AM65x/J221E CPSW_NUSS drivers by
implementing HW offload for simple tc-flower with policer action with matches
on dst_mac:
- ff:ff:ff:ff:ff:ff has to be used for BC packets rate limiting
- 01:00:00:00:00:00 fixed value has to be used for MC packets rate limiting
Examples:
- BC rate limit to 1000pps:
tc qdisc add dev eth0 clsact
tc filter add dev eth0 ingress flower skip_sw dst_mac ff:ff:ff:ff:ff:ff \
action police pkts_rate 1000 pkts_burst 1
- MC rate limit to 20000pps:
tc qdisc add dev eth0 clsact
tc filter add dev eth0 ingress flower skip_sw dst_mac 01:00:00:00:00:00 \
action police pkts_rate 10000 pkts_burst 1
pkts_burst - not used.
The solution inspired patch from Vladimir Oltean [1].
Changes in v2:
- switch to packet-per-second policing introduced by
commit 2ffe0395288a ("net/sched: act_police: add support for packet-per-second policing") [2]
v1: https://patchwork.kernel.org/project/netdevbpf/cover/20201114035654.32658-1-grygorii.strashko@ti.com/
[1] https://lore.kernel.org/patchwork/patch/1217254/
[2] https://patchwork.kernel.org/project/netdevbpf/cover/20210312140831.23346-1-simon.horman@netronome.com/
Grygorii Strashko (3):
drivers: net: cpsw: ale: add broadcast/multicast rate limit support
net: ethernet: ti: am65-cpsw: enable bc/mc storm prevention support
net: ethernet: ti: cpsw_new: enable bc/mc storm prevention support
drivers/net/ethernet/ti/am65-cpsw-qos.c | 145 ++++++++++++++++++++
drivers/net/ethernet/ti/am65-cpsw-qos.h | 8 ++
drivers/net/ethernet/ti/cpsw_ale.c | 66 +++++++++
drivers/net/ethernet/ti/cpsw_ale.h | 2 +
drivers/net/ethernet/ti/cpsw_new.c | 4 +-
drivers/net/ethernet/ti/cpsw_priv.c | 170 ++++++++++++++++++++++++
drivers/net/ethernet/ti/cpsw_priv.h | 8 ++
7 files changed, 402 insertions(+), 1 deletion(-)
--
2.17.1
next reply other threads:[~2021-11-01 17:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-01 17:01 Grygorii Strashko [this message]
2021-11-01 17:01 ` [PATCH net-next v2 1/3] drivers: net: cpsw: ale: add broadcast/multicast rate limit support Grygorii Strashko
2021-11-01 17:01 ` [PATCH net-next v2 2/3] net: ethernet: ti: am65-cpsw: enable bc/mc storm prevention support Grygorii Strashko
2021-11-03 0:38 ` Jakub Kicinski
2021-11-03 22:20 ` Grygorii Strashko
2021-11-03 23:07 ` Jakub Kicinski
2021-11-03 23:19 ` Grygorii Strashko
2021-11-01 17:01 ` [PATCH net-next v2 3/3] net: ethernet: ti: cpsw_new: " Grygorii Strashko
2021-11-01 23:53 ` [PATCH net-next v2 0/3] net: ethernet: ti: cpsw: " Vladimir Oltean
2021-11-02 12:36 ` Grygorii Strashko
2021-11-02 14:38 ` Vladimir Oltean
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211101170122.19160-1-grygorii.strashko@ti.com \
--to=grygorii.strashko@ti.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=kishon@ti.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=tony@atomide.com \
--cc=vigneshr@ti.com \
--cc=vladimir.oltean@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox