Commit b905b5d4 authored by Vasundhara Volam's avatar Vasundhara Volam Committed by David S. Miller
Browse files

be2net: Call be_vf_setup() even when VFs are enbaled from previous load



Re-define the sriov_want() macro to check for number of VFs that need
to be enabled in the current load of the driver or the number of VFs that
still remain enabled from the previous load (attached VFs cannot be disabled.)
Signed-off-by: default avatarVasundhara Volam <vasundhara.volam@emulex.com>
Signed-off-by: default avatarSathya Perla <sathya.perla@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b85f75ea
...@@ -470,8 +470,8 @@ struct be_adapter { ...@@ -470,8 +470,8 @@ struct be_adapter {
#define be_physfn(adapter) (!adapter->virtfn) #define be_physfn(adapter) (!adapter->virtfn)
#define sriov_enabled(adapter) (adapter->num_vfs > 0) #define sriov_enabled(adapter) (adapter->num_vfs > 0)
#define sriov_want(adapter) (be_max_vfs(adapter) && num_vfs && \ #define sriov_want(adapter) (be_physfn(adapter) && \
be_physfn(adapter)) (num_vfs || pci_num_vf(adapter->pdev)))
#define for_all_vfs(adapter, vf_cfg, i) \ #define for_all_vfs(adapter, vf_cfg, i) \
for (i = 0, vf_cfg = &adapter->vf_cfg[i]; i < adapter->num_vfs; \ for (i = 0, vf_cfg = &adapter->vf_cfg[i]; i < adapter->num_vfs; \
i++, vf_cfg++) i++, vf_cfg++)
......
...@@ -2948,12 +2948,12 @@ static void BEx_get_resources(struct be_adapter *adapter, ...@@ -2948,12 +2948,12 @@ static void BEx_get_resources(struct be_adapter *adapter,
struct pci_dev *pdev = adapter->pdev; struct pci_dev *pdev = adapter->pdev;
bool use_sriov = false; bool use_sriov = false;
if (BE3_chip(adapter) && be_physfn(adapter)) { if (BE3_chip(adapter) && sriov_want(adapter)) {
int max_vfs; int max_vfs;
max_vfs = pci_sriov_get_totalvfs(pdev); max_vfs = pci_sriov_get_totalvfs(pdev);
res->max_vfs = max_vfs > 0 ? min(MAX_VFS, max_vfs) : 0; res->max_vfs = max_vfs > 0 ? min(MAX_VFS, max_vfs) : 0;
use_sriov = res->max_vfs && num_vfs; use_sriov = res->max_vfs;
} }
if (be_physfn(adapter)) if (be_physfn(adapter))
...@@ -3242,7 +3242,7 @@ static int be_setup(struct be_adapter *adapter) ...@@ -3242,7 +3242,7 @@ static int be_setup(struct be_adapter *adapter)
be_cmd_set_flow_control(adapter, adapter->tx_fc, be_cmd_set_flow_control(adapter, adapter->tx_fc,
adapter->rx_fc); adapter->rx_fc);
if (be_physfn(adapter) && num_vfs) { if (sriov_want(adapter)) {
if (be_max_vfs(adapter)) if (be_max_vfs(adapter))
be_vf_setup(adapter); be_vf_setup(adapter);
else else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment