]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx4_core: Do not reset module-parameter num_vfs when fail to enable sriov
authorJack Morgenstein <jackm@dev.mellanox.co.il>
Tue, 15 May 2012 10:35:01 +0000 (10:35 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 May 2012 04:56:58 +0000 (00:56 -0400)
commit47a2cd8180bd1cb79b4120c64dd1b7b356aa6719
treea0e407d16a38fd655e5a76c47e63eb0153ca9bfb
parent5af16a785e486e500db6f82c576fb046860cef5d
net/mlx4_core: Do not reset module-parameter num_vfs when fail to enable sriov

Consider the following scenario: 2 HCAs, where only one of which can run SRIOV.

If we reset the module parameter, all the VFs of the SRIOV HCA will be
claimed by the PPF host (-- the code relies on num_vfs being non-zero
to avoid this claiming, and num_vfs was reset when pci_enable_sriov failed
for the non-SRIOV HCA).

The solution is not to touch the num_vfs parameter.

Also, eliminate the unneeded check of num_vfs when disabling sriov
(the dev flag bit is sufficient).

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/main.c