]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx4: Add VF vlan protocol 802.1ad support
authorMoshe Shemesh <moshe@mellanox.com>
Thu, 22 Sep 2016 09:11:16 +0000 (12:11 +0300)
committerDavid S. Miller <davem@davemloft.net>
Sat, 24 Sep 2016 12:01:27 +0000 (08:01 -0400)
commit420d6b934b08c148e26d8bd8f244a0875a9a1dcb
tree62b69ec85dbf6c9bf3b1a07ff33aba9dbf5ef174
parent20235b2144e034ab00c1068be906ac20a9e70ea1
net/mlx4: Add VF vlan protocol 802.1ad support

Move the vf to VST 802.1ad mode (mlx4 VST QinQ mode) by setting vf vlan
protocol to 802.1ad.
VST 802.1ad mode in mlx4, is used for STAG strip/insertion by PF, while
the CTAG is set by the VF.
Read current vlan protocol as part of the vf configuration state.

Upon setting vf vlan protocol to 802.1ad, we use a mechanism of handshake
to verify that both the vf and the pf driver version support it.
The handshake uses the command QUERY_FUNC_CAP:
- The vf sets a pre-defined support bit in input modifier.
- A pf that supports the feature sends the request to the vf through a
  pre-defined field in the output mailbox.
- In case vf does not support the feature, the pf will fail the control
  command (in this case, IP link tool command to set the vf vlan
  protocol to 802.1ad).

No change in VST 802.1Q mode.

Signed-off-by: Moshe Shemesh <moshe@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/cmd.c
drivers/net/ethernet/mellanox/mlx4/en_netdev.c
drivers/net/ethernet/mellanox/mlx4/fw.c
drivers/net/ethernet/mellanox/mlx4/mlx4.h
include/linux/mlx4/cmd.h