From: DENG Qingfang <dqfext@gmail.com>
To: Roopa Prabhu <roopa@nvidia.com>,
Nikolay Aleksandrov <nikolay@nvidia.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Jiri Pirko <jiri@resnulli.us>,
Ivan Vecera <ivecera@redhat.com>,
bridge@lists.linux-foundation.org (moderated list:ETHERNET
BRIDGE), netdev@vger.kernel.org (open list:ETHERNET BRIDGE),
linux-kernel@vger.kernel.org (open list)
Cc: Ido Schimmel <idosch@idosch.org>,
Tobias Waldekranz <tobias@waldekranz.com>,
Vladimir Oltean <olteanv@gmail.com>
Subject: [PATCH net-next v2] net: bridge: switchdev: pass more port flags to drivers
Date: Thu, 12 Aug 2021 22:22:12 +0800 [thread overview]
Message-ID: <20210812142213.2251697-1-dqfext@gmail.com> (raw)
These 3 port flags: BR_HAIRPIN_MODE, BR_MULTICAST_TO_UNICAST, and
BR_ISOLATED, affect the data path and should be handled by switchdev
drivers.
Add them to BR_PORT_FLAGS_HW_OFFLOAD so they can be passed down to
the drivers.
Suggested-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: DENG Qingfang <dqfext@gmail.com>
---
v1 -> v2: added more flags
net/bridge/br_switchdev.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/bridge/br_switchdev.c b/net/bridge/br_switchdev.c
index 6bf518d78f02..2ab46178c47c 100644
--- a/net/bridge/br_switchdev.c
+++ b/net/bridge/br_switchdev.c
@@ -70,8 +70,10 @@ bool nbp_switchdev_allowed_egress(const struct net_bridge_port *p,
}
/* Flags that can be offloaded to hardware */
-#define BR_PORT_FLAGS_HW_OFFLOAD (BR_LEARNING | BR_FLOOD | \
- BR_MCAST_FLOOD | BR_BCAST_FLOOD)
+#define BR_PORT_FLAGS_HW_OFFLOAD (BR_HAIRPIN_MODE | BR_LEARNING | \
+ BR_FLOOD | BR_MCAST_FLOOD | \
+ BR_MULTICAST_TO_UNICAST | \
+ BR_BCAST_FLOOD | BR_ISOLATED)
int br_switchdev_set_port_flag(struct net_bridge_port *p,
unsigned long flags,
--
2.25.1
next reply other threads:[~2021-08-12 14:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-12 14:22 DENG Qingfang [this message]
2021-08-14 1:11 ` [PATCH net-next v2] net: bridge: switchdev: pass more port flags to drivers 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=20210812142213.2251697-1-dqfext@gmail.com \
--to=dqfext@gmail.com \
--cc=bridge@lists.linux-foundation.org \
--cc=davem@davemloft.net \
--cc=idosch@idosch.org \
--cc=ivecera@redhat.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nikolay@nvidia.com \
--cc=olteanv@gmail.com \
--cc=roopa@nvidia.com \
--cc=tobias@waldekranz.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).