netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] team: Fix incorrect deletion of ETH_P_8021AD protocol vid from slaves
@ 2023-08-14  3:23 Ziyang Xuan
  2023-08-15  8:08 ` Simon Horman
  2023-08-16  2:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Ziyang Xuan @ 2023-08-14  3:23 UTC (permalink / raw)
  To: jiri, davem, edumazet, kuba, pabeni, netdev, idosch; +Cc: kaber

Similar to commit 01f4fd270870 ("bonding: Fix incorrect deletion of
ETH_P_8021AD protocol vid from slaves"), we can trigger BUG_ON(!vlan_info)
in unregister_vlan_dev() with the following testcase:

  # ip netns add ns1
  # ip netns exec ns1 ip link add team1 type team
  # ip netns exec ns1 ip link add team_slave type veth peer veth2
  # ip netns exec ns1 ip link set team_slave master team1
  # ip netns exec ns1 ip link add link team_slave name team_slave.10 type vlan id 10 protocol 802.1ad
  # ip netns exec ns1 ip link add link team1 name team1.10 type vlan id 10 protocol 802.1ad
  # ip netns exec ns1 ip link set team_slave nomaster
  # ip netns del ns1

Add S-VLAN tag related features support to team driver. So the team driver
will always propagate the VLAN info to its slaves.

Fixes: 8ad227ff89a7 ("net: vlan: add 802.1ad support")
Suggested-by: Ido Schimmel <idosch@idosch.org>
Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
---
 drivers/net/team/team.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index d3dc22509ea5..382756c3fb83 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -2200,7 +2200,9 @@ static void team_setup(struct net_device *dev)
 
 	dev->hw_features = TEAM_VLAN_FEATURES |
 			   NETIF_F_HW_VLAN_CTAG_RX |
-			   NETIF_F_HW_VLAN_CTAG_FILTER;
+			   NETIF_F_HW_VLAN_CTAG_FILTER |
+			   NETIF_F_HW_VLAN_STAG_RX |
+			   NETIF_F_HW_VLAN_STAG_FILTER;
 
 	dev->hw_features |= NETIF_F_GSO_ENCAP_ALL;
 	dev->features |= dev->hw_features;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] team: Fix incorrect deletion of ETH_P_8021AD protocol vid from slaves
  2023-08-14  3:23 [PATCH net] team: Fix incorrect deletion of ETH_P_8021AD protocol vid from slaves Ziyang Xuan
@ 2023-08-15  8:08 ` Simon Horman
  2023-08-16  2:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2023-08-15  8:08 UTC (permalink / raw)
  To: Ziyang Xuan; +Cc: jiri, davem, edumazet, kuba, pabeni, netdev, idosch, kaber

On Mon, Aug 14, 2023 at 11:23:01AM +0800, Ziyang Xuan wrote:
> Similar to commit 01f4fd270870 ("bonding: Fix incorrect deletion of
> ETH_P_8021AD protocol vid from slaves"), we can trigger BUG_ON(!vlan_info)
> in unregister_vlan_dev() with the following testcase:
> 
>   # ip netns add ns1
>   # ip netns exec ns1 ip link add team1 type team
>   # ip netns exec ns1 ip link add team_slave type veth peer veth2
>   # ip netns exec ns1 ip link set team_slave master team1
>   # ip netns exec ns1 ip link add link team_slave name team_slave.10 type vlan id 10 protocol 802.1ad
>   # ip netns exec ns1 ip link add link team1 name team1.10 type vlan id 10 protocol 802.1ad
>   # ip netns exec ns1 ip link set team_slave nomaster
>   # ip netns del ns1
> 
> Add S-VLAN tag related features support to team driver. So the team driver
> will always propagate the VLAN info to its slaves.
> 
> Fixes: 8ad227ff89a7 ("net: vlan: add 802.1ad support")
> Suggested-by: Ido Schimmel <idosch@idosch.org>
> Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>

Reviewed-by: Simon Horman <horms@kernel.org>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] team: Fix incorrect deletion of ETH_P_8021AD protocol vid from slaves
  2023-08-14  3:23 [PATCH net] team: Fix incorrect deletion of ETH_P_8021AD protocol vid from slaves Ziyang Xuan
  2023-08-15  8:08 ` Simon Horman
@ 2023-08-16  2:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-08-16  2:10 UTC (permalink / raw)
  To: Ziyang Xuan; +Cc: jiri, davem, edumazet, kuba, pabeni, netdev, idosch, kaber

Hello:

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

On Mon, 14 Aug 2023 11:23:01 +0800 you wrote:
> Similar to commit 01f4fd270870 ("bonding: Fix incorrect deletion of
> ETH_P_8021AD protocol vid from slaves"), we can trigger BUG_ON(!vlan_info)
> in unregister_vlan_dev() with the following testcase:
> 
>   # ip netns add ns1
>   # ip netns exec ns1 ip link add team1 type team
>   # ip netns exec ns1 ip link add team_slave type veth peer veth2
>   # ip netns exec ns1 ip link set team_slave master team1
>   # ip netns exec ns1 ip link add link team_slave name team_slave.10 type vlan id 10 protocol 802.1ad
>   # ip netns exec ns1 ip link add link team1 name team1.10 type vlan id 10 protocol 802.1ad
>   # ip netns exec ns1 ip link set team_slave nomaster
>   # ip netns del ns1
> 
> [...]

Here is the summary with links:
  - [net] team: Fix incorrect deletion of ETH_P_8021AD protocol vid from slaves
    https://git.kernel.org/netdev/net/c/dafcbce07136

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-16  2:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-14  3:23 [PATCH net] team: Fix incorrect deletion of ETH_P_8021AD protocol vid from slaves Ziyang Xuan
2023-08-15  8:08 ` Simon Horman
2023-08-16  2:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).