diff mbox series

[net] net: hsr: hsr_slave: Fix the promiscuous mode in offload mode

Message ID 20240322100447.27615-1-r-gunasekaran@ti.com (mailing list archive)
State Accepted
Commit b11c81731c810efe592e510bb0110e0db6877419
Delegated to: Netdev Maintainers
Headers show
Series [net] net: hsr: hsr_slave: Fix the promiscuous mode in offload mode | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 944 this patch: 944
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 955 this patch: 955
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 955 this patch: 955
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-03-23--00-00 (tests: 943)

Commit Message

Ravi Gunasekaran March 22, 2024, 10:04 a.m. UTC
commit e748d0fd66ab ("net: hsr: Disable promiscuous mode in
offload mode") disables promiscuous mode of slave devices
while creating an HSR interface. But while deleting the
HSR interface, it does not take care of it. It decreases the
promiscuous mode count, which eventually enables promiscuous
mode on the slave devices when creating HSR interface again.

Fix this by not decrementing the promiscuous mode count while
deleting the HSR interface when offload is enabled.

Fixes: e748d0fd66ab ("net: hsr: Disable promiscuous mode in offload mode")
Signed-off-by: Ravi Gunasekaran <r-gunasekaran@ti.com>
---
 net/hsr/hsr_slave.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Jiri Pirko March 22, 2024, 11:09 a.m. UTC | #1
Fri, Mar 22, 2024 at 11:04:47AM CET, r-gunasekaran@ti.com wrote:
>commit e748d0fd66ab ("net: hsr: Disable promiscuous mode in
>offload mode") disables promiscuous mode of slave devices
>while creating an HSR interface. But while deleting the
>HSR interface, it does not take care of it. It decreases the
>promiscuous mode count, which eventually enables promiscuous
>mode on the slave devices when creating HSR interface again.
>
>Fix this by not decrementing the promiscuous mode count while
>deleting the HSR interface when offload is enabled.
>
>Fixes: e748d0fd66ab ("net: hsr: Disable promiscuous mode in offload mode")
>Signed-off-by: Ravi Gunasekaran <r-gunasekaran@ti.com>

Reviewed-by: Jiri Pirko <jiri@nvidia.com>
patchwork-bot+netdevbpf@kernel.org March 26, 2024, 3:10 a.m. UTC | #2
Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Fri, 22 Mar 2024 15:34:47 +0530 you wrote:
> commit e748d0fd66ab ("net: hsr: Disable promiscuous mode in
> offload mode") disables promiscuous mode of slave devices
> while creating an HSR interface. But while deleting the
> HSR interface, it does not take care of it. It decreases the
> promiscuous mode count, which eventually enables promiscuous
> mode on the slave devices when creating HSR interface again.
> 
> [...]

Here is the summary with links:
  - [net] net: hsr: hsr_slave: Fix the promiscuous mode in offload mode
    https://git.kernel.org/netdev/net/c/b11c81731c81

You are awesome, thank you!
diff mbox series

Patch

diff --git a/net/hsr/hsr_slave.c b/net/hsr/hsr_slave.c
index e5742f2a2d52..1b6457f357bd 100644
--- a/net/hsr/hsr_slave.c
+++ b/net/hsr/hsr_slave.c
@@ -220,7 +220,8 @@  void hsr_del_port(struct hsr_port *port)
 		netdev_update_features(master->dev);
 		dev_set_mtu(master->dev, hsr_get_max_mtu(hsr));
 		netdev_rx_handler_unregister(port->dev);
-		dev_set_promiscuity(port->dev, -1);
+		if (!port->hsr->fwd_offloaded)
+			dev_set_promiscuity(port->dev, -1);
 		netdev_upper_dev_unlink(port->dev, master->dev);
 	}