From 16bf222a26a3fc3b44ef8f864c46c6bf8f9638c9 Mon Sep 17 00:00:00 2001 From: Mark Carlin Date: Wed, 11 Sep 2024 20:06:24 -0700 Subject: [PATCH 1/3] Only allow one native vlan. Add some debugging output. --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 7ed68287d246e1..039980c9e4128e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -6297,9 +6297,12 @@ static int stmmac_vlan_rx_add_vid(struct net_device *ndev, __be16 proto, u16 vid } if (priv->hw->num_vlan) { - ret = stmmac_add_hw_vlan_rx_fltr(priv, ndev, priv->hw, proto, vid); - if (ret) + if(priv->hw->vlan_filter[0] & GENMASK(15, 0)) { + netdev_warn(ndev, "Native VLAN Taken\n"); goto err_pm_put; + } + else + stmmac_add_hw_vlan_rx_fltr(priv, ndev, priv->hw, proto, vid); } err_pm_put: pm_runtime_put(priv->device); From 1995131005deb450c38ada810270d54c46c147dc Mon Sep 17 00:00:00 2001 From: Mark Carlin Date: Thu, 12 Sep 2024 09:42:20 -0700 Subject: [PATCH 2/3] Add some additional debug output. --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 039980c9e4128e..85e4398bbef7af 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -6298,11 +6298,12 @@ static int stmmac_vlan_rx_add_vid(struct net_device *ndev, __be16 proto, u16 vid if (priv->hw->num_vlan) { if(priv->hw->vlan_filter[0] & GENMASK(15, 0)) { - netdev_warn(ndev, "Native VLAN Taken\n"); goto err_pm_put; } - else + else { stmmac_add_hw_vlan_rx_fltr(priv, ndev, priv->hw, proto, vid); + netdev_warn(ndev, "Native VLAN Set To %d\n", vid); + } } err_pm_put: pm_runtime_put(priv->device); From 7804b21fd4636dbd7b7747916c024ef8d34619fd Mon Sep 17 00:00:00 2001 From: Mark Carlin Date: Thu, 12 Sep 2024 17:08:06 -0700 Subject: [PATCH 3/3] Remove debugging messages, add an info message for HW VLAN filter. --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 85e4398bbef7af..3634b5df8e9e58 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -6302,7 +6302,7 @@ static int stmmac_vlan_rx_add_vid(struct net_device *ndev, __be16 proto, u16 vid } else { stmmac_add_hw_vlan_rx_fltr(priv, ndev, priv->hw, proto, vid); - netdev_warn(ndev, "Native VLAN Set To %d\n", vid); + netdev_info(ndev, "HW VLAN Filter Set To %d\n", vid); } } err_pm_put: