]> Pileus Git - ~andy/linux/commitdiff
Merge branch 'ixgbe'
authorDavid S. Miller <davem@davemloft.net>
Sat, 18 Jan 2014 02:38:13 +0000 (18:38 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 18 Jan 2014 02:38:13 +0000 (18:38 -0800)
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 <davem@davemloft.net>
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.h

index b445ad121de1f5daf8e5d275f423b378d1d54e57..61d985c9330b57c0a5b2e2862dfb369f06faedf2 100644 (file)
@@ -5067,7 +5067,7 @@ static int ixgbe_sw_init(struct ixgbe_adapter *adapter)
 
        /* assign number of SR-IOV VFs */
        if (hw->mac.type != ixgbe_mac_82598EB) {
-               if (max_vfs > 63) {
+               if (max_vfs > IXGBE_MAX_VFS_DRV_LIMIT) {
                        adapter->num_vfs = 0;
                        e_dev_warn("max_vfs parameter out of range. Not assigning any SR-IOV VFs\n");
                } else {
@@ -8019,8 +8019,8 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        /* Mailbox */
        ixgbe_init_mbx_params_pf(hw);
        memcpy(&hw->mbx.ops, ii->mbx_ops, sizeof(hw->mbx.ops));
+       pci_sriov_set_totalvfs(pdev, IXGBE_MAX_VFS_DRV_LIMIT);
        ixgbe_enable_sriov(adapter);
-       pci_sriov_set_totalvfs(pdev, 63);
 skip_sriov:
 
 #endif
index 0558c7139f38ec307c3ce503856735cb7a970e37..dff0977876f75448ee67ef6e1305bdc8b5e8be22 100644 (file)
@@ -148,7 +148,7 @@ void ixgbe_enable_sriov(struct ixgbe_adapter *adapter)
                 * physical function.  If the user requests greater thn
                 * 63 VFs then it is an error - reset to default of zero.
                 */
-               adapter->num_vfs = min_t(unsigned int, adapter->num_vfs, 63);
+               adapter->num_vfs = min_t(unsigned int, adapter->num_vfs, IXGBE_MAX_VFS_DRV_LIMIT);
 
                err = pci_enable_sriov(adapter->pdev, adapter->num_vfs);
                if (err) {
@@ -257,7 +257,7 @@ static int ixgbe_pci_sriov_enable(struct pci_dev *dev, int num_vfs)
         * PF.  The PCI bus driver already checks for other values out of
         * range.
         */
-       if (num_vfs > 63) {
+       if (num_vfs > IXGBE_MAX_VFS_DRV_LIMIT) {
                err = -EPERM;
                goto err_out;
        }
index 4713f9fc7f46938996029a2fcda15a8b753b2104..8bd29190514e4a7be7fd498cb28a0bef1336d082 100644 (file)
 #ifndef _IXGBE_SRIOV_H_
 #define _IXGBE_SRIOV_H_
 
+/*  ixgbe driver limit the max number of VFs could be enabled to
+ *  63 (IXGBE_MAX_VF_FUNCTIONS - 1)
+ */
+#define IXGBE_MAX_VFS_DRV_LIMIT  (IXGBE_MAX_VF_FUNCTIONS - 1)
+
 void ixgbe_restore_vf_multicasts(struct ixgbe_adapter *adapter);
 void ixgbe_msg_task(struct ixgbe_adapter *adapter);
 int ixgbe_vf_configuration(struct pci_dev *pdev, unsigned int event_mask);