diff options
author | Vasundhara Volam <vasundhara.volam@emulex.com> | 2012-08-28 16:37:41 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-30 13:27:05 -0400 |
commit | 7c5a524221dc3cf599a6aa4773eb0c1e2ca38adb (patch) | |
tree | 1e93f61b2a250b70b9c5f5f020692f6a4ab92e57 /drivers/net/ethernet/emulex | |
parent | 4cbdaf6d520b6bd9a1565525e5ad1967cb74e191 (diff) |
be2net: fix max VFs reported by HW
BE3 FW allocates VF resources for upto 30 VFs per PF while a max value of 32
may be reported via PCI config space. Fix this in the driver.
Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/emulex')
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_main.c | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be.h b/drivers/net/ethernet/emulex/benet/be.h index d266c86a53f7..5b622993ff17 100644 --- a/drivers/net/ethernet/emulex/benet/be.h +++ b/drivers/net/ethernet/emulex/benet/be.h | |||
@@ -110,6 +110,7 @@ static inline char *nic_name(struct pci_dev *pdev) | |||
110 | #define MAX_RX_POST BE_NAPI_WEIGHT /* Frags posted at a time */ | 110 | #define MAX_RX_POST BE_NAPI_WEIGHT /* Frags posted at a time */ |
111 | #define RX_FRAGS_REFILL_WM (RX_Q_LEN - MAX_RX_POST) | 111 | #define RX_FRAGS_REFILL_WM (RX_Q_LEN - MAX_RX_POST) |
112 | 112 | ||
113 | #define MAX_VFS 30 /* Max VFs supported by BE3 FW */ | ||
113 | #define FW_VER_LEN 32 | 114 | #define FW_VER_LEN 32 |
114 | 115 | ||
115 | struct be_dma_mem { | 116 | struct be_dma_mem { |
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index d86d25cc33cf..def2f6688964 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -2723,6 +2723,8 @@ static int be_get_config(struct be_adapter *adapter) | |||
2723 | if (pos) { | 2723 | if (pos) { |
2724 | pci_read_config_word(adapter->pdev, pos + PCI_SRIOV_TOTAL_VF, | 2724 | pci_read_config_word(adapter->pdev, pos + PCI_SRIOV_TOTAL_VF, |
2725 | &dev_num_vfs); | 2725 | &dev_num_vfs); |
2726 | if (!lancer_chip(adapter)) | ||
2727 | dev_num_vfs = min_t(u16, dev_num_vfs, MAX_VFS); | ||
2726 | adapter->dev_num_vfs = dev_num_vfs; | 2728 | adapter->dev_num_vfs = dev_num_vfs; |
2727 | } | 2729 | } |
2728 | return 0; | 2730 | return 0; |