mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-19 13:11:14 +00:00
be2net: Use GET_PROFILE_CONFIG cmd for BE3-R to query max-vfs
Use GET_PROFILE_CONFIG_V1 cmd even for BE3-R (it's already used for Lancer-R and Skyhawk-R), to query max-vfs value supported by the FW. This is needed as on some configs, the value exported in the PCI-config space is not accurate. Signed-off-by: Suresh Reddy <suresh.reddy@emulex.com> Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
39e7d095f9
commit
ecf1f6e1df
1 changed files with 10 additions and 7 deletions
|
@ -3150,13 +3150,16 @@ 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;
|
||||||
int max_vfs;
|
int max_vfs = 0;
|
||||||
|
|
||||||
max_vfs = pci_sriov_get_totalvfs(pdev);
|
if (be_physfn(adapter) && BE3_chip(adapter)) {
|
||||||
|
be_cmd_get_profile_config(adapter, res, 0);
|
||||||
if (BE3_chip(adapter) && sriov_want(adapter)) {
|
/* Some old versions of BE3 FW don't report max_vfs value */
|
||||||
res->max_vfs = max_vfs > 0 ? min(MAX_VFS, max_vfs) : 0;
|
if (res->max_vfs == 0) {
|
||||||
use_sriov = res->max_vfs;
|
max_vfs = pci_sriov_get_totalvfs(pdev);
|
||||||
|
res->max_vfs = max_vfs > 0 ? min(MAX_VFS, max_vfs) : 0;
|
||||||
|
}
|
||||||
|
use_sriov = res->max_vfs && sriov_want(adapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (be_physfn(adapter))
|
if (be_physfn(adapter))
|
||||||
|
@ -3197,7 +3200,7 @@ static void BEx_get_resources(struct be_adapter *adapter,
|
||||||
res->max_rx_qs = res->max_rss_qs + 1;
|
res->max_rx_qs = res->max_rss_qs + 1;
|
||||||
|
|
||||||
if (be_physfn(adapter))
|
if (be_physfn(adapter))
|
||||||
res->max_evt_qs = (max_vfs > 0) ?
|
res->max_evt_qs = (res->max_vfs > 0) ?
|
||||||
BE3_SRIOV_MAX_EVT_QS : BE3_MAX_EVT_QS;
|
BE3_SRIOV_MAX_EVT_QS : BE3_MAX_EVT_QS;
|
||||||
else
|
else
|
||||||
res->max_evt_qs = 1;
|
res->max_evt_qs = 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue