diff mbox series

[net-next,v2] net: bridge: switchdev: pass more port flags to drivers

Message ID 20210812142213.2251697-1-dqfext@gmail.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v2] net: bridge: switchdev: pass more port flags to drivers | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 12 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

Qingfang Deng Aug. 12, 2021, 2:22 p.m. UTC
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(-)

Comments

Vladimir Oltean Aug. 14, 2021, 1:11 a.m. UTC | #1
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
diff mbox series

Patch

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,