diff options
author | Ido Schimmel <idosch@mellanox.com> | 2018-02-28 13:12:11 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-02-28 12:32:36 -0500 |
commit | b3529af6bb0d4fe72defdd539712ceffaa054fb3 (patch) | |
tree | eea718420f95c54f6035102d89bc98019db0bf2f /include/net/secure_seq.h | |
parent | 9d45deb04c59b628b21fc5014aff4f9a1d38f969 (diff) | |
download | linux-b3529af6bb0d4fe72defdd539712ceffaa054fb3.tar.gz linux-b3529af6bb0d4fe72defdd539712ceffaa054fb3.tar.bz2 linux-b3529af6bb0d4fe72defdd539712ceffaa054fb3.zip |
spectrum: Reference count VLAN entries
One of the basic construct in the device is a port-VLAN pair, which can
be bound to a FID or a RIF in order to direct packets to the bridge or
the router, respectively.
Since not all the netdevs are configured with a VLAN (e.g., sw1p1 vs.
sw1p1.10), VID 1 is used to represent these and thus this VID can be
used by both upper devices of mlxsw ports and by the driver itself.
However, this VID is not reference counted and therefore might be freed
prematurely, which can result in various WARNINGs. For example:
$ ip link add name br0 type bridge vlan_filtering 1
$ teamd -t team0 -d -c '{"runner": {"name": "lacp"}}'
$ ip link set dev team0 master br0
$ ip link set dev enp1s0np1 master team0
$ ip address add 192.0.2.1/24 dev enp1s0np1
The enslavement to team0 will fail because team0 already has an upper
and thus vlan_vids_del_by_dev() will be executed as part of team's error
path which will delete VID 1 from enp1s0np1 (added by br0 as PVID). The
WARNING will be generated when the driver will realize it can't find VID
1 on the port and bind it to a RIF.
Fix this by adding a reference count to the VLAN entries on the port, in
a similar fashion to the reference counting used by the corresponding
'vlan_vid_info' structure in the 8021q driver.
Fixes: c57529e1d5d8 ("mlxsw: spectrum: Replace vPorts with Port-VLAN")
Reported-by: Tal Bar <talb@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Tested-by: Tal Bar <talb@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/secure_seq.h')
0 files changed, 0 insertions, 0 deletions