i40e: set pf_id based on device and function numbers
authorChristopher Pau <christopher.pau@intel.com>
Sat, 16 Nov 2013 10:00:33 +0000 (10:00 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 6 Dec 2013 07:12:57 +0000 (23:12 -0800)
pf_id needs to be encoded for cards with ARI enabled, which
allows for larger function numbers than 8.

Commit-Id: I23fa7df9dabf3878cc08c9b2151729c8539f5f17
Signed-off-by: Christopher Pau <christopher.pau@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_common.c

index 1e4ea134975ac43e8288132e6e4b93bacb2f4b7e..9e868eac8e1e69aa8d204fb2cde63c1593b12b84 100644 (file)
@@ -297,7 +297,11 @@ i40e_status i40e_pf_reset(struct i40e_hw *hw)
        }
 
        /* Determine the PF number based on the PCI fn */
-       hw->pf_id = (u8)hw->bus.func;
+       reg = rd32(hw, I40E_GLPCI_CAPSUP);
+       if (reg & I40E_GLPCI_CAPSUP_ARI_EN_MASK)
+               hw->pf_id = (u8)((hw->bus.device << 3) | hw->bus.func);
+       else
+               hw->pf_id = (u8)hw->bus.func;
 
        /* If there was a Global Reset in progress when we got here,
         * we don't need to do the PF Reset