aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/benet')
-rw-r--r--drivers/net/benet/be_main.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index d762c2a3dd9b..bc110782da88 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -1947,7 +1947,20 @@ static void be_sriov_enable(struct be_adapter *adapter)
1947 be_check_sriov_fn_type(adapter); 1947 be_check_sriov_fn_type(adapter);
1948#ifdef CONFIG_PCI_IOV 1948#ifdef CONFIG_PCI_IOV
1949 if (be_physfn(adapter) && num_vfs) { 1949 if (be_physfn(adapter) && num_vfs) {
1950 int status; 1950 int status, pos;
1951 u16 nvfs;
1952
1953 pos = pci_find_ext_capability(adapter->pdev,
1954 PCI_EXT_CAP_ID_SRIOV);
1955 pci_read_config_word(adapter->pdev,
1956 pos + PCI_SRIOV_TOTAL_VF, &nvfs);
1957
1958 if (num_vfs > nvfs) {
1959 dev_info(&adapter->pdev->dev,
1960 "Device supports %d VFs and not %d\n",
1961 nvfs, num_vfs);
1962 num_vfs = nvfs;
1963 }
1951 1964
1952 status = pci_enable_sriov(adapter->pdev, num_vfs); 1965 status = pci_enable_sriov(adapter->pdev, num_vfs);
1953 adapter->sriov_enabled = status ? false : true; 1966 adapter->sriov_enabled = status ? false : true;
@@ -3284,13 +3297,6 @@ static int __init be_init_module(void)
3284 rx_frag_size = 2048; 3297 rx_frag_size = 2048;
3285 } 3298 }
3286 3299
3287 if (num_vfs > 32) {
3288 printk(KERN_WARNING DRV_NAME
3289 " : Module param num_vfs must not be greater than 32."
3290 "Using 32\n");
3291 num_vfs = 32;
3292 }
3293
3294 return pci_register_driver(&be_driver); 3300 return pci_register_driver(&be_driver);
3295} 3301}
3296module_init(be_init_module); 3302module_init(be_init_module);