Skip to contentSkip to conversation

net: bridge: switchdev: pass more port flags to drivers

PATCH In review DENG Qingfang 2 participants 2 messages Aug 12, 2021 – Aug 14, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net: bridge: switchdev: pass more port flags to drivers

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.

---
v1 -> v2: added more flags

 net/bridge/br_switchdev.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
net/bridge/br_switchdev.c +4 -2
index 6bf518d78f02..2ab46178c47c 100644
@@ -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,
Signature · 1 line
2.25.1
#1 lore raw
Quoted 11 lines · DENG Qingfang

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.

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