From: Mattias Forsblad <mattias.forsblad@gmail.com>
To: netdev@vger.kernel.org
Cc: Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Vladimir Oltean <olteanv@gmail.com>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Tobias Waldekranz <tobias@waldekranz.com>,
Mattias Forsblad <mattias.forsblad@gmail.com>
Subject: [PATCH v1 net-next 0/2] net: tc: dsa: Implement offload of matchall for bridged DSA ports
Date: Fri, 1 Apr 2022 12:04:16 +0200 [thread overview]
Message-ID: <20220401100418.3762272-1-mattias.forsblad@gmail.com> (raw)
Greetings,
This series implements offloading of tc matchall filter to HW
for bridged DSA ports.
Background
When using a non-VLAN filtering bridge we want to be able to drop
traffic directed to the CPU port so that the CPU doesn't get unnecessary loaded.
This is specially important when we have disabled learning on user ports.
A sample configuration could be something like this:
br0
/ \
swp0 swp1
ip link add dev br0 type bridge stp_state 0 vlan_filtering 0
ip link set swp0 master br0
ip link set swp1 master br0
ip link set swp0 type bridge_slave learning off
ip link set swp1 type bridge_slave learning off
ip link set swp0 up
ip link set swp1 up
ip link set br0 up
After discussions here: https://lore.kernel.org/netdev/YjMo9xyoycXgSWXS@shredder/
it was advised to use tc to set an ingress filter that could then
be offloaded to HW, like so:
tc qdisc add dev br0 clsact
tc filter add dev br0 ingress pref 1 proto all matchall action drop
Limitations
If there is tc rules on a bridge and all the ports leave the bridge
and then joins the bridge again, the indirect framwork doesn't seem
to reoffload them at join. The tc rules need to be torn down and
re-added.
The first part of this serie uses the flow indirect framework to
setup monitoring of tc qdisc and filters added to a bridge.
The second part offloads the matchall filter to HW for Marvell
switches.
RFC -> v1: Monitor bridge join/leave and re-evaluate offloading (Vladimir Oltean)
Mattias Forsblad (2):
net: tc: dsa: Add the matchall filter with drop action for bridged DSA
ports.
net: dsa: Implement tc offloading for drop target.
drivers/net/dsa/mv88e6xxx/chip.c | 23 +++-
include/net/dsa.h | 14 ++
net/dsa/dsa2.c | 5 +
net/dsa/dsa_priv.h | 3 +
net/dsa/port.c | 2 +
net/dsa/slave.c | 221 ++++++++++++++++++++++++++++++-
6 files changed, 264 insertions(+), 4 deletions(-)
--
2.25.1
next reply other threads:[~2022-04-01 10:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-01 10:04 Mattias Forsblad [this message]
2022-04-01 10:04 ` [PATCH v1 net-next 1/2] net: tc: dsa: Add the matchall filter with drop action for bridged DSA ports Mattias Forsblad
2022-04-01 18:10 ` Jakub Kicinski
2022-04-01 10:04 ` [PATCH v1 net-next 2/2] net: dsa: Implement tc offloading for drop target Mattias Forsblad
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=20220401100418.3762272-1-mattias.forsblad@gmail.com \
--to=mattias.forsblad@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=tobias@waldekranz.com \
--cc=vivien.didelot@gmail.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;
as well as URLs for NNTP newsgroup(s).