Skip to content

Commit 7dd40c1

Browse files
committed
Merge branch 'ixgbe'
Aaron Brown says: ==================== Intel Wired LAN Driver Updates This series contains updates to ixgbe Ethan Zhao. The first one replaces the magic number "63" with a macro, IXGBE_MAX_VFS_DRV_LIMIT, the second moves the call to set driver_max_VFS to before SRIOV is enabled. The code of these patches match the v3 (1/2) and v2 (2/2) versions sent to the e1000-devel and netdev mailing lists. The intermediate versions (v4, v5) are from sorting out style issues, mostly tabs to spaces and split lines probably introduced via mailer. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 6c7e761 + 31ac910 commit 7dd40c1

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5067,7 +5067,7 @@ static int ixgbe_sw_init(struct ixgbe_adapter *adapter)
50675067

50685068
/* assign number of SR-IOV VFs */
50695069
if (hw->mac.type != ixgbe_mac_82598EB) {
5070-
if (max_vfs > 63) {
5070+
if (max_vfs > IXGBE_MAX_VFS_DRV_LIMIT) {
50715071
adapter->num_vfs = 0;
50725072
e_dev_warn("max_vfs parameter out of range. Not assigning any SR-IOV VFs\n");
50735073
} else {
@@ -8019,8 +8019,8 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
80198019
/* Mailbox */
80208020
ixgbe_init_mbx_params_pf(hw);
80218021
memcpy(&hw->mbx.ops, ii->mbx_ops, sizeof(hw->mbx.ops));
8022+
pci_sriov_set_totalvfs(pdev, IXGBE_MAX_VFS_DRV_LIMIT);
80228023
ixgbe_enable_sriov(adapter);
8023-
pci_sriov_set_totalvfs(pdev, 63);
80248024
skip_sriov:
80258025

80268026
#endif

drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ void ixgbe_enable_sriov(struct ixgbe_adapter *adapter)
148148
* physical function. If the user requests greater thn
149149
* 63 VFs then it is an error - reset to default of zero.
150150
*/
151-
adapter->num_vfs = min_t(unsigned int, adapter->num_vfs, 63);
151+
adapter->num_vfs = min_t(unsigned int, adapter->num_vfs, IXGBE_MAX_VFS_DRV_LIMIT);
152152

153153
err = pci_enable_sriov(adapter->pdev, adapter->num_vfs);
154154
if (err) {
@@ -257,7 +257,7 @@ static int ixgbe_pci_sriov_enable(struct pci_dev *dev, int num_vfs)
257257
* PF. The PCI bus driver already checks for other values out of
258258
* range.
259259
*/
260-
if (num_vfs > 63) {
260+
if (num_vfs > IXGBE_MAX_VFS_DRV_LIMIT) {
261261
err = -EPERM;
262262
goto err_out;
263263
}

drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828
#ifndef _IXGBE_SRIOV_H_
2929
#define _IXGBE_SRIOV_H_
3030

31+
/* ixgbe driver limit the max number of VFs could be enabled to
32+
* 63 (IXGBE_MAX_VF_FUNCTIONS - 1)
33+
*/
34+
#define IXGBE_MAX_VFS_DRV_LIMIT (IXGBE_MAX_VF_FUNCTIONS - 1)
35+
3136
void ixgbe_restore_vf_multicasts(struct ixgbe_adapter *adapter);
3237
void ixgbe_msg_task(struct ixgbe_adapter *adapter);
3338
int ixgbe_vf_configuration(struct pci_dev *pdev, unsigned int event_mask);

0 commit comments

Comments
 (0)