LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH net-next v2] net: bridge: switchdev: pass more port flags to drivers
@ 2021-08-12 14:22 DENG Qingfang
  2021-08-14  1:11 ` Vladimir Oltean
  0 siblings, 1 reply; 2+ messages in thread
From: DENG Qingfang @ 2021-08-12 14:22 UTC (permalink / raw)
  To: Roopa Prabhu, Nikolay Aleksandrov, David S. Miller,
	Jakub Kicinski, Jiri Pirko, Ivan Vecera,
	moderated list:ETHERNET BRIDGE, open list:ETHERNET BRIDGE,
	open list
  Cc: Ido Schimmel, Tobias Waldekranz, Vladimir Oltean

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next v2] net: bridge: switchdev: pass more port flags to drivers
  2021-08-12 14:22 [PATCH net-next v2] net: bridge: switchdev: pass more port flags to drivers DENG Qingfang
@ 2021-08-14  1:11 ` Vladimir Oltean
  0 siblings, 0 replies; 2+ messages in thread
From: Vladimir Oltean @ 2021-08-14  1:11 UTC (permalink / raw)
  To: DENG Qingfang
  Cc: Roopa Prabhu, Nikolay Aleksandrov, David S. Miller,
	Jakub Kicinski, Jiri Pirko, Ivan Vecera,
	moderated list:ETHERNET BRIDGE, open list:ETHERNET BRIDGE,
	open list, Ido Schimmel, Tobias Waldekranz

On Thu, Aug 12, 2021 at 10:22:12PM +0800, DENG Qingfang wrote:
> 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

If you insist to not write a competent commit message which properly
explains the motivation for the change, then please remove my
Suggested-by tag and resend. Thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-14  1:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-12 14:22 [PATCH net-next v2] net: bridge: switchdev: pass more port flags to drivers DENG Qingfang
2021-08-14  1:11 ` Vladimir Oltean

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).