cxgb4: number of VFs supported is not always 16

Total number of VFs supported by PF is used to determine the last
byte of VF's mac address. Number of VFs supported is not always
16, use the variable nvfs to get the number of VFs supported
rather than hard coding it to 16.

Signed-off-by: Casey Leedom <leedom@chelsio.com>
Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Ganesh Goudar 2018-11-27 14:59:06 +05:30 коммит произвёл David S. Miller
Родитель 93029d7d40
Коммит 1b974aa43a
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -2646,7 +2646,7 @@ static void cxgb4_mgmt_fill_vf_station_mac_addr(struct adapter *adap)
for (vf = 0, nvfs = pci_sriov_get_totalvfs(adap->pdev); for (vf = 0, nvfs = pci_sriov_get_totalvfs(adap->pdev);
vf < nvfs; vf++) { vf < nvfs; vf++) {
macaddr[5] = adap->pf * 16 + vf; macaddr[5] = adap->pf * nvfs + vf;
ether_addr_copy(adap->vfinfo[vf].vf_mac_addr, macaddr); ether_addr_copy(adap->vfinfo[vf].vf_mac_addr, macaddr);
} }
} }