diff mbox series

[net-next] net: lan966x: Fix the vlan used by host ports

Message ID 20211223140113.1954778-1-horatiu.vultur@microchip.com (mailing list archive)
State Accepted
Commit 0c94d657d2a416c861df4789fd310f09f5dfad59
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: lan966x: Fix the vlan used by host ports | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 24 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Horatiu Vultur Dec. 23, 2021, 2:01 p.m. UTC
The blamed commit changed the vlan used by the host ports to be 4095
instead of 0.
Because of this change the following issues are seen:
- when the port is probed first it was adding an entry in the MAC table
  with the wrong vlan (port->pvid which is default 0) and not HOST_PVID
- when the port is removed from a bridge, it was using the wrong vlan to
  add entries in the MAC table. It was using the old PVID and not the
  HOST_PVID

This patch fixes this two issues by using the HOST_PVID instead of
port->pvid.

Fixes: 6d2c186afa5d5d ("net: lan966x: Add vlan support.")
Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
 drivers/net/ethernet/microchip/lan966x/lan966x_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Dec. 27, 2021, 12:20 p.m. UTC | #1
Hello:

This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Thu, 23 Dec 2021 15:01:13 +0100 you wrote:
> The blamed commit changed the vlan used by the host ports to be 4095
> instead of 0.
> Because of this change the following issues are seen:
> - when the port is probed first it was adding an entry in the MAC table
>   with the wrong vlan (port->pvid which is default 0) and not HOST_PVID
> - when the port is removed from a bridge, it was using the wrong vlan to
>   add entries in the MAC table. It was using the old PVID and not the
>   HOST_PVID
> 
> [...]

Here is the summary with links:
  - [net-next] net: lan966x: Fix the vlan used by host ports
    https://git.kernel.org/netdev/net-next/c/0c94d657d2a4

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
index 54097247c7a7..2cb70da63db3 100644
--- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
+++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
@@ -322,7 +322,7 @@  static int lan966x_mc_unsync(struct net_device *dev, const unsigned char *addr)
 	struct lan966x_port *port = netdev_priv(dev);
 	struct lan966x *lan966x = port->lan966x;
 
-	return lan966x_mac_forget(lan966x, addr, port->pvid, ENTRYTYPE_LOCKED);
+	return lan966x_mac_forget(lan966x, addr, HOST_PVID, ENTRYTYPE_LOCKED);
 }
 
 static int lan966x_mc_sync(struct net_device *dev, const unsigned char *addr)
@@ -330,7 +330,7 @@  static int lan966x_mc_sync(struct net_device *dev, const unsigned char *addr)
 	struct lan966x_port *port = netdev_priv(dev);
 	struct lan966x *lan966x = port->lan966x;
 
-	return lan966x_mac_cpu_learn(lan966x, addr, port->pvid);
+	return lan966x_mac_cpu_learn(lan966x, addr, HOST_PVID);
 }
 
 static void lan966x_port_set_rx_mode(struct net_device *dev)
@@ -594,7 +594,7 @@  static int lan966x_probe_port(struct lan966x *lan966x, u32 p,
 
 	eth_hw_addr_gen(dev, lan966x->base_mac, p + 1);
 
-	lan966x_mac_learn(lan966x, PGID_CPU, dev->dev_addr, port->pvid,
+	lan966x_mac_learn(lan966x, PGID_CPU, dev->dev_addr, HOST_PVID,
 			  ENTRYTYPE_LOCKED);
 
 	port->phylink_config.dev = &port->dev->dev;