OSDN Git Service

nfp: set driver VF limit
authorJakub Kicinski <jakub.kicinski@netronome.com>
Mon, 29 May 2017 00:52:54 +0000 (17:52 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 30 May 2017 15:27:04 +0000 (11:27 -0400)
commit651e1f2f19995c7585f34688331cda4f88e8df47
tree7d8bd14e0c868325c018e18cb2df1d14af1cbe7e
parent9d3727595b11ab8f2837b54922efd2998f2cade5
nfp: set driver VF limit

PCI subsystem has support for drivers limiting the number of VFs
available below what the IOV capability claims.  Make use of it.

While at it remove the #ifdef/#endif on CONFIG_PCI_IOV, it was
there to avoid unnecessary warnings in case device read failed
but kernel doesn't have SR-IOV support anyway.  Device reads
should not fail.

Note that we still need the driver-internal check for the case
where max VFs is 0 since PCI subsystem treats 0 as limit not set.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfp_main.c