All of lore.kernel.org
 help / color / mirror / Atom feed
* [net-next 00/10][pull request] 10GbE Intel Wired LAN Driver Updates 2016-09-23
@ 2016-09-23  7:51 Jeff Kirsher
  2016-09-23  7:51 ` [net-next 01/10] ixgbe: simplify the logic for setting VLAN filtering Jeff Kirsher
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Jeff Kirsher @ 2016-09-23  7:51 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann, jogreene, guru.anbalagane

This series contains updates to ixgbe and ixgbevf.

Emil provides several changes, first simplifies the logic for setting VLAN
filtering by checking the VMDQ flag and the old 82598 MAC, instead of
having to maintain a list of MAC types.  Then made two functions static
that are used only within the file, a by-product is sparse is now happy.
Added spinlocks to make sure that the MTU configuration is handled
properly.  Fixed an issue where when SR-IOV is enabled while the
ixgbevf driver is loaded would result in all mailbox requests being
rejected by ixgbe, so call ixgbe_sriov_reinit() before pci_enable_sriov()
to ensure mailbox requests are properly handled.

Mark resolves a NULL pointer issue by simply setting the read and write
*_ref_mdi pointers for x550em_a devices.  Then clearly indicates within
ethtool that all MACs support pause frames and made sure that the
advertising is set to the requested mode.  Fixed an issue where
MDIO_PRTAD_NONE was not being used consistently to indicate no PHY
address.

Alex fixes an issue, where the support for multiple queues when SR-IOV
is enabled was added but the support was not reported.  With that, fix
an issue where the hardware redirection table could support more queues
then the PF currently has when SR-IOV is enabled, so use the RSS mask to
trim off the bits that are not used.  Lastly, instead of limiting the
VFs if we do not use 4 queues for RSS in the PF, we can instead just limit
the RSS queues used to a power of 2.  We can now support use cases where
VFs are using more queues than the PF is currently using and can support
RSS if so desired.

The following are changes since commit cdd0766d7da19085e88df86d1e5e21d9fe3d374f:
  Merge branch 'ftgmac100-ast2500-support'
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue 10GbE

Alexander Duyck (3):
  ixgbe: Allow setting multiple queues when SR-IOV is enabled
  ixgbe: Limit reporting of redirection table if SR-IOV is enabled
  ixgbe: Support 4 queue RSS on VFs with 1 or 2 queue RSS on PF

Emil Tantilov (4):
  ixgbe: simplify the logic for setting VLAN filtering
  ixgbe: make ixgbe_led_on/off_t_x550em static
  ixgbevf: add spinlocks for MTU change calls
  ixgbe: reset before SRIOV init to avoid mailbox issues

Mark Rustad (3):
  ixgbe: Resolve NULL reference by setting {read, write}_reg_mdi
  ixgbe: Indicate support for pause frames in all cases
  ixgbe: Use MDIO_PRTAD_NONE consistently

 drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c  | 29 +++++++++++--
 drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c      |  7 ++--
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c     | 51 ++++++++---------------
 drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c      |  4 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c    |  4 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c     |  8 ++--
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c |  4 ++
 7 files changed, 62 insertions(+), 45 deletions(-)

-- 
2.7.4

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [net-next 01/10] ixgbe: simplify the logic for setting VLAN filtering
  2016-09-23  7:51 [net-next 00/10][pull request] 10GbE Intel Wired LAN Driver Updates 2016-09-23 Jeff Kirsher
@ 2016-09-23  7:51 ` Jeff Kirsher
  2016-09-23  7:51 ` [net-next 02/10] ixgbe: make ixgbe_led_on/off_t_x550em static Jeff Kirsher
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Jeff Kirsher @ 2016-09-23  7:51 UTC (permalink / raw)
  To: davem
  Cc: Emil Tantilov, netdev, nhorman, sassmann, jogreene,
	guru.anbalagane, Jeff Kirsher

From: Emil Tantilov <emil.s.tantilov@intel.com>

Simplify the logic for setting VLNCTRL.VFE by checking the  VMDQ flag
and 82598 MAC instead of having to maintain a list of MAC types.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 39 ++++++++-------------------
 1 file changed, 11 insertions(+), 28 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index d76bc1a..1c88858 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -4105,23 +4105,20 @@ static void ixgbe_vlan_promisc_enable(struct ixgbe_adapter *adapter)
 
 	vlnctrl = IXGBE_READ_REG(hw, IXGBE_VLNCTRL);
 
-	switch (hw->mac.type) {
-	case ixgbe_mac_82599EB:
-	case ixgbe_mac_X540:
-	case ixgbe_mac_X550:
-	case ixgbe_mac_X550EM_x:
-	case ixgbe_mac_x550em_a:
-	default:
-		if (adapter->flags & IXGBE_FLAG_VMDQ_ENABLED)
-			break;
-		/* fall through */
-	case ixgbe_mac_82598EB:
-		/* legacy case, we can just disable VLAN filtering */
+	if (adapter->flags & IXGBE_FLAG_VMDQ_ENABLED) {
+	/* For VMDq and SR-IOV we must leave VLAN filtering enabled */
+		vlnctrl |= IXGBE_VLNCTRL_VFE;
+		IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlnctrl);
+	} else {
 		vlnctrl &= ~IXGBE_VLNCTRL_VFE;
 		IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlnctrl);
 		return;
 	}
 
+	/* Nothing to do for 82598 */
+	if (hw->mac.type == ixgbe_mac_82598EB)
+		return;
+
 	/* We are already in VLAN promisc, nothing to do */
 	if (adapter->flags2 & IXGBE_FLAG2_VLAN_PROMISC)
 		return;
@@ -4129,10 +4126,6 @@ static void ixgbe_vlan_promisc_enable(struct ixgbe_adapter *adapter)
 	/* Set flag so we don't redo unnecessary work */
 	adapter->flags2 |= IXGBE_FLAG2_VLAN_PROMISC;
 
-	/* For VMDq and SR-IOV we must leave VLAN filtering enabled */
-	vlnctrl |= IXGBE_VLNCTRL_VFE;
-	IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlnctrl);
-
 	/* Add PF to all active pools */
 	for (i = IXGBE_VLVF_ENTRIES; --i;) {
 		u32 reg_offset = IXGBE_VLVFB(i * 2 + VMDQ_P(0) / 32);
@@ -4204,19 +4197,9 @@ static void ixgbe_vlan_promisc_disable(struct ixgbe_adapter *adapter)
 	vlnctrl |= IXGBE_VLNCTRL_VFE;
 	IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlnctrl);
 
-	switch (hw->mac.type) {
-	case ixgbe_mac_82599EB:
-	case ixgbe_mac_X540:
-	case ixgbe_mac_X550:
-	case ixgbe_mac_X550EM_x:
-	case ixgbe_mac_x550em_a:
-	default:
-		if (adapter->flags & IXGBE_FLAG_VMDQ_ENABLED)
-			break;
-		/* fall through */
-	case ixgbe_mac_82598EB:
+	if (!(adapter->flags & IXGBE_FLAG_VMDQ_ENABLED) ||
+	    hw->mac.type == ixgbe_mac_82598EB)
 		return;
-	}
 
 	/* We are not in VLAN promisc, nothing to do */
 	if (!(adapter->flags2 & IXGBE_FLAG2_VLAN_PROMISC))
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [net-next 02/10] ixgbe: make ixgbe_led_on/off_t_x550em static
  2016-09-23  7:51 [net-next 00/10][pull request] 10GbE Intel Wired LAN Driver Updates 2016-09-23 Jeff Kirsher
  2016-09-23  7:51 ` [net-next 01/10] ixgbe: simplify the logic for setting VLAN filtering Jeff Kirsher
@ 2016-09-23  7:51 ` Jeff Kirsher
  2016-09-23  7:51 ` [net-next 03/10] ixgbe: Resolve NULL reference by setting {read, write}_reg_mdi Jeff Kirsher
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Jeff Kirsher @ 2016-09-23  7:51 UTC (permalink / raw)
  To: davem
  Cc: Emil Tantilov, netdev, nhorman, sassmann, jogreene,
	guru.anbalagane, Jeff Kirsher

From: Emil Tantilov <emil.s.tantilov@intel.com>

These functions are only used in ixgbe_x550.c.

Fixes a warning when compiling with -Wmissing-prototypes

Reported-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
index e092a89..dec8b11 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
@@ -2125,7 +2125,7 @@ static s32 ixgbe_reset_phy_t_X550em(struct ixgbe_hw *hw)
  *  @hw: pointer to hardware structure
  *  @led_idx: led number to turn on
  **/
-s32 ixgbe_led_on_t_x550em(struct ixgbe_hw *hw, u32 led_idx)
+static s32 ixgbe_led_on_t_x550em(struct ixgbe_hw *hw, u32 led_idx)
 {
 	u16 phy_data;
 
@@ -2147,7 +2147,7 @@ s32 ixgbe_led_on_t_x550em(struct ixgbe_hw *hw, u32 led_idx)
  *  @hw: pointer to hardware structure
  *  @led_idx: led number to turn off
  **/
-s32 ixgbe_led_off_t_x550em(struct ixgbe_hw *hw, u32 led_idx)
+static s32 ixgbe_led_off_t_x550em(struct ixgbe_hw *hw, u32 led_idx)
 {
 	u16 phy_data;
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [net-next 03/10] ixgbe: Resolve NULL reference by setting {read, write}_reg_mdi
  2016-09-23  7:51 [net-next 00/10][pull request] 10GbE Intel Wired LAN Driver Updates 2016-09-23 Jeff Kirsher
  2016-09-23  7:51 ` [net-next 01/10] ixgbe: simplify the logic for setting VLAN filtering Jeff Kirsher
  2016-09-23  7:51 ` [net-next 02/10] ixgbe: make ixgbe_led_on/off_t_x550em static Jeff Kirsher
@ 2016-09-23  7:51 ` Jeff Kirsher
  2016-09-23  7:51 ` [net-next 04/10] ixgbe: Indicate support for pause frames in all cases Jeff Kirsher
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Jeff Kirsher @ 2016-09-23  7:51 UTC (permalink / raw)
  To: davem
  Cc: Mark Rustad, netdev, nhorman, sassmann, jogreene,
	guru.anbalagane, Jeff Kirsher

From: Mark Rustad <mark.d.rustad@intel.com>

Set the read_reg_mdi and write_reg_mdi method pointers for
X550EM_A_10G_T devices to resolve jumping to NULL.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
index dec8b11..cd22efb 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
@@ -3049,6 +3049,8 @@ static const struct ixgbe_phy_operations phy_ops_x550em_a = {
 	.identify		= &ixgbe_identify_phy_x550em,
 	.read_reg		= &ixgbe_read_phy_reg_x550a,
 	.write_reg		= &ixgbe_write_phy_reg_x550a,
+	.read_reg_mdi		= &ixgbe_read_phy_reg_mdi,
+	.write_reg_mdi		= &ixgbe_write_phy_reg_mdi,
 };
 
 static const u32 ixgbe_mvals_X550[IXGBE_MVALS_IDX_LIMIT] = {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [net-next 04/10] ixgbe: Indicate support for pause frames in all cases
  2016-09-23  7:51 [net-next 00/10][pull request] 10GbE Intel Wired LAN Driver Updates 2016-09-23 Jeff Kirsher
                   ` (2 preceding siblings ...)
  2016-09-23  7:51 ` [net-next 03/10] ixgbe: Resolve NULL reference by setting {read, write}_reg_mdi Jeff Kirsher
@ 2016-09-23  7:51 ` Jeff Kirsher
  2016-09-23  7:51 ` [net-next 05/10] ixgbevf: add spinlocks for MTU change calls Jeff Kirsher
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Jeff Kirsher @ 2016-09-23  7:51 UTC (permalink / raw)
  To: davem
  Cc: Mark Rustad, netdev, nhorman, sassmann, jogreene,
	guru.anbalagane, Jeff Kirsher

From: Mark Rustad <mark.d.rustad@intel.com>

All the MACs supported by ixgbe support pause frames, so indicate
that support in ethtool. Also set advertising according to requested
mode.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index 9547191..730a99f 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -313,6 +313,25 @@ static int ixgbe_get_settings(struct net_device *netdev,
 		break;
 	}
 
+	/* Indicate pause support */
+	ecmd->supported |= SUPPORTED_Pause;
+
+	switch (hw->fc.requested_mode) {
+	case ixgbe_fc_full:
+		ecmd->advertising |= ADVERTISED_Pause;
+		break;
+	case ixgbe_fc_rx_pause:
+		ecmd->advertising |= ADVERTISED_Pause |
+				     ADVERTISED_Asym_Pause;
+		break;
+	case ixgbe_fc_tx_pause:
+		ecmd->advertising |= ADVERTISED_Asym_Pause;
+		break;
+	default:
+		ecmd->advertising &= ~(ADVERTISED_Pause |
+				       ADVERTISED_Asym_Pause);
+	}
+
 	if (netif_carrier_ok(netdev)) {
 		switch (adapter->link_speed) {
 		case IXGBE_LINK_SPEED_10GB_FULL:
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [net-next 05/10] ixgbevf: add spinlocks for MTU change calls
  2016-09-23  7:51 [net-next 00/10][pull request] 10GbE Intel Wired LAN Driver Updates 2016-09-23 Jeff Kirsher
                   ` (3 preceding siblings ...)
  2016-09-23  7:51 ` [net-next 04/10] ixgbe: Indicate support for pause frames in all cases Jeff Kirsher
@ 2016-09-23  7:51 ` Jeff Kirsher
  2016-09-23  7:51 ` [net-next 06/10] ixgbe: Use MDIO_PRTAD_NONE consistently Jeff Kirsher
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Jeff Kirsher @ 2016-09-23  7:51 UTC (permalink / raw)
  To: davem
  Cc: Emil Tantilov, netdev, nhorman, sassmann, jogreene,
	guru.anbalagane, Jeff Kirsher

From: Emil Tantilov <emil.s.tantilov@intel.com>

Protect set_rlpml with mailbox lock to make sure the MTU configuration
is handled properly.

This change resolves an issue where set_rlpml can fail when the VF
interface is brought up:
ixgbevf 0000:03:1d.6: Failed to set MTU at 1500

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 4044608..7eaac32 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -1810,8 +1810,10 @@ static void ixgbevf_configure_rx(struct ixgbevf_adapter *adapter)
 	if (hw->mac.type >= ixgbe_mac_X550_vf)
 		ixgbevf_setup_vfmrqc(adapter);
 
+	spin_lock_bh(&adapter->mbx_lock);
 	/* notify the PF of our intent to use this size of frame */
 	ret = hw->mac.ops.set_rlpml(hw, netdev->mtu + ETH_HLEN + ETH_FCS_LEN);
+	spin_unlock_bh(&adapter->mbx_lock);
 	if (ret)
 		dev_err(&adapter->pdev->dev,
 			"Failed to set MTU at %d\n", netdev->mtu);
@@ -3758,8 +3760,10 @@ static int ixgbevf_change_mtu(struct net_device *netdev, int new_mtu)
 	if ((new_mtu < 68) || (max_frame > max_possible_frame))
 		return -EINVAL;
 
+	spin_lock_bh(&adapter->mbx_lock);
 	/* notify the PF of our intent to use this size of frame */
 	ret = hw->mac.ops.set_rlpml(hw, max_frame);
+	spin_unlock_bh(&adapter->mbx_lock);
 	if (ret)
 		return -EINVAL;
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [net-next 06/10] ixgbe: Use MDIO_PRTAD_NONE consistently
  2016-09-23  7:51 [net-next 00/10][pull request] 10GbE Intel Wired LAN Driver Updates 2016-09-23 Jeff Kirsher
                   ` (4 preceding siblings ...)
  2016-09-23  7:51 ` [net-next 05/10] ixgbevf: add spinlocks for MTU change calls Jeff Kirsher
@ 2016-09-23  7:51 ` Jeff Kirsher
  2016-09-23  7:51 ` [net-next 07/10] ixgbe: Allow setting multiple queues when SR-IOV is enabled Jeff Kirsher
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Jeff Kirsher @ 2016-09-23  7:51 UTC (permalink / raw)
  To: davem
  Cc: Mark Rustad, netdev, nhorman, sassmann, jogreene,
	guru.anbalagane, Jeff Kirsher

From: Mark Rustad <mark.d.rustad@intel.com>

The value MDIO_PRTAD_NONE should be used to indicate no PHY address.
Not 0, not 0xFFFF. Use the MDIO_PRTAD_NONE value consistently.

Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c  | 4 ++--
 drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
index db0731e..021ab9b 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
@@ -346,8 +346,8 @@ s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw)
 				return 0;
 			}
 		}
-		/* clear value if nothing found */
-		hw->phy.mdio.prtad = 0;
+		/* indicate no PHY found */
+		hw->phy.mdio.prtad = MDIO_PRTAD_NONE;
 		return IXGBE_ERR_PHY_ADDR_INVALID;
 	}
 	return 0;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
index cd22efb..7e6b926 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
@@ -1459,7 +1459,7 @@ ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, ixgbe_link_speed speed,
 	/* Configure internal PHY for KR/KX. */
 	ixgbe_setup_kr_speed_x550em(hw, speed);
 
-	if (!hw->phy.mdio.prtad || hw->phy.mdio.prtad == 0xFFFF)
+	if (hw->phy.mdio.prtad == MDIO_PRTAD_NONE)
 		return IXGBE_ERR_PHY_ADDR_INVALID;
 
 	/* Get external PHY device id */
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [net-next 07/10] ixgbe: Allow setting multiple queues when SR-IOV is enabled
  2016-09-23  7:51 [net-next 00/10][pull request] 10GbE Intel Wired LAN Driver Updates 2016-09-23 Jeff Kirsher
                   ` (5 preceding siblings ...)
  2016-09-23  7:51 ` [net-next 06/10] ixgbe: Use MDIO_PRTAD_NONE consistently Jeff Kirsher
@ 2016-09-23  7:51 ` Jeff Kirsher
  2016-09-23  7:51 ` [net-next 08/10] ixgbe: Limit reporting of redirection table if " Jeff Kirsher
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Jeff Kirsher @ 2016-09-23  7:51 UTC (permalink / raw)
  To: davem
  Cc: Alexander Duyck, netdev, nhorman, sassmann, jogreene,
	guru.anbalagane, Jeff Kirsher

From: Alexander Duyck <alexander.h.duyck@intel.com>

The maximum queue count reported was 1, however support for multiple queues
with SR-IOV was added some time ago so we should report support for it to
the user so that they can select multiple queues if they so desire.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index 730a99f..2d872be 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -3060,8 +3060,8 @@ static unsigned int ixgbe_max_channels(struct ixgbe_adapter *adapter)
 		/* We only support one q_vector without MSI-X */
 		max_combined = 1;
 	} else if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) {
-		/* SR-IOV currently only allows one queue on the PF */
-		max_combined = 1;
+		/* Limit value based on the queue mask */
+		max_combined = adapter->ring_feature[RING_F_RSS].mask + 1;
 	} else if (tcs > 1) {
 		/* For DCB report channels per traffic class */
 		if (adapter->hw.mac.type == ixgbe_mac_82598EB) {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [net-next 08/10] ixgbe: Limit reporting of redirection table if SR-IOV is enabled
  2016-09-23  7:51 [net-next 00/10][pull request] 10GbE Intel Wired LAN Driver Updates 2016-09-23 Jeff Kirsher
                   ` (6 preceding siblings ...)
  2016-09-23  7:51 ` [net-next 07/10] ixgbe: Allow setting multiple queues when SR-IOV is enabled Jeff Kirsher
@ 2016-09-23  7:51 ` Jeff Kirsher
  2016-09-23  7:51 ` [net-next 09/10] ixgbe: Support 4 queue RSS on VFs with 1 or 2 queue RSS on PF Jeff Kirsher
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Jeff Kirsher @ 2016-09-23  7:51 UTC (permalink / raw)
  To: davem
  Cc: Alexander Duyck, netdev, nhorman, sassmann, jogreene,
	guru.anbalagane, Jeff Kirsher

From: Alexander Duyck <alexander.h.duyck@intel.com>

The hardware redirection table can support more queues then the PF
currently has when SR-IOV is enabled.  In order to account for this use the
RSS mask to trim of the bits that are not used.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index 2d872be..f49f803 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -2947,9 +2947,13 @@ static u32 ixgbe_rss_indir_size(struct net_device *netdev)
 static void ixgbe_get_reta(struct ixgbe_adapter *adapter, u32 *indir)
 {
 	int i, reta_size = ixgbe_rss_indir_tbl_entries(adapter);
+	u16 rss_m = adapter->ring_feature[RING_F_RSS].mask;
+
+	if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED)
+		rss_m = adapter->ring_feature[RING_F_RSS].indices - 1;
 
 	for (i = 0; i < reta_size; i++)
-		indir[i] = adapter->rss_indir_tbl[i];
+		indir[i] = adapter->rss_indir_tbl[i] & rss_m;
 }
 
 static int ixgbe_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key,
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [net-next 09/10] ixgbe: Support 4 queue RSS on VFs with 1 or 2 queue RSS on PF
  2016-09-23  7:51 [net-next 00/10][pull request] 10GbE Intel Wired LAN Driver Updates 2016-09-23 Jeff Kirsher
                   ` (7 preceding siblings ...)
  2016-09-23  7:51 ` [net-next 08/10] ixgbe: Limit reporting of redirection table if " Jeff Kirsher
@ 2016-09-23  7:51 ` Jeff Kirsher
  2016-09-23  7:51 ` [net-next 10/10] ixgbe: reset before SRIOV init to avoid mailbox issues Jeff Kirsher
  2016-09-24 12:22 ` [net-next 00/10][pull request] 10GbE Intel Wired LAN Driver Updates 2016-09-23 David Miller
  10 siblings, 0 replies; 12+ messages in thread
From: Jeff Kirsher @ 2016-09-23  7:51 UTC (permalink / raw)
  To: davem
  Cc: Alexander Duyck, netdev, nhorman, sassmann, jogreene,
	guru.anbalagane, Jeff Kirsher

From: Alexander Duyck <alexander.h.duyck@intel.com>

Instead of limiting the VFs if we don't use 4 queues for RSS in the PF we
can instead just limit the RSS queues used to a power of 2.  By doing this
we can support use cases where VFs are using more queues than the PF is
currently using and can support RSS if so desired.

The only limitation on this is that we cannot support 3 queues of RSS in
the PF or VF.  In either of these cases we should fall back to 2 queues in
order to be able to use the power of 2 masking provided by the psrtype
register.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c  |  7 ++++---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 12 +++++++-----
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
index bcdc884..15ab337 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c
@@ -515,15 +515,16 @@ static bool ixgbe_set_sriov_queues(struct ixgbe_adapter *adapter)
 	vmdq_i = min_t(u16, IXGBE_MAX_VMDQ_INDICES, vmdq_i);
 
 	/* 64 pool mode with 2 queues per pool */
-	if ((vmdq_i > 32) || (rss_i < 4) || (vmdq_i > 16 && pools)) {
+	if ((vmdq_i > 32) || (vmdq_i > 16 && pools)) {
 		vmdq_m = IXGBE_82599_VMDQ_2Q_MASK;
 		rss_m = IXGBE_RSS_2Q_MASK;
 		rss_i = min_t(u16, rss_i, 2);
-	/* 32 pool mode with 4 queues per pool */
+	/* 32 pool mode with up to 4 queues per pool */
 	} else {
 		vmdq_m = IXGBE_82599_VMDQ_4Q_MASK;
 		rss_m = IXGBE_RSS_4Q_MASK;
-		rss_i = 4;
+		/* We can support 4, 2, or 1 queues */
+		rss_i = (rss_i > 3) ? 4 : (rss_i > 1) ? 2 : 1;
 	}
 
 #ifdef IXGBE_FCOE
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 1c88858..a244d9a 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -3248,7 +3248,8 @@ static void ixgbe_setup_mtqc(struct ixgbe_adapter *adapter)
 			mtqc |= IXGBE_MTQC_RT_ENA | IXGBE_MTQC_8TC_8TQ;
 		else if (tcs > 1)
 			mtqc |= IXGBE_MTQC_RT_ENA | IXGBE_MTQC_4TC_4TQ;
-		else if (adapter->ring_feature[RING_F_RSS].indices == 4)
+		else if (adapter->ring_feature[RING_F_VMDQ].mask ==
+			 IXGBE_82599_VMDQ_4Q_MASK)
 			mtqc |= IXGBE_MTQC_32VF;
 		else
 			mtqc |= IXGBE_MTQC_64VF;
@@ -3475,12 +3476,12 @@ static void ixgbe_setup_reta(struct ixgbe_adapter *adapter)
 	u32 reta_entries = ixgbe_rss_indir_tbl_entries(adapter);
 	u16 rss_i = adapter->ring_feature[RING_F_RSS].indices;
 
-	/* Program table for at least 2 queues w/ SR-IOV so that VFs can
+	/* Program table for at least 4 queues w/ SR-IOV so that VFs can
 	 * make full use of any rings they may have.  We will use the
 	 * PSRTYPE register to control how many rings we use within the PF.
 	 */
-	if ((adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) && (rss_i < 2))
-		rss_i = 2;
+	if ((adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) && (rss_i < 4))
+		rss_i = 4;
 
 	/* Fill out hash function seeds */
 	for (i = 0; i < 10; i++)
@@ -3544,7 +3545,8 @@ static void ixgbe_setup_mrqc(struct ixgbe_adapter *adapter)
 				mrqc = IXGBE_MRQC_VMDQRT8TCEN;	/* 8 TCs */
 			else if (tcs > 1)
 				mrqc = IXGBE_MRQC_VMDQRT4TCEN;	/* 4 TCs */
-			else if (adapter->ring_feature[RING_F_RSS].indices == 4)
+			else if (adapter->ring_feature[RING_F_VMDQ].mask ==
+				 IXGBE_82599_VMDQ_4Q_MASK)
 				mrqc = IXGBE_MRQC_VMDQRSS32EN;
 			else
 				mrqc = IXGBE_MRQC_VMDQRSS64EN;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [net-next 10/10] ixgbe: reset before SRIOV init to avoid mailbox issues
  2016-09-23  7:51 [net-next 00/10][pull request] 10GbE Intel Wired LAN Driver Updates 2016-09-23 Jeff Kirsher
                   ` (8 preceding siblings ...)
  2016-09-23  7:51 ` [net-next 09/10] ixgbe: Support 4 queue RSS on VFs with 1 or 2 queue RSS on PF Jeff Kirsher
@ 2016-09-23  7:51 ` Jeff Kirsher
  2016-09-24 12:22 ` [net-next 00/10][pull request] 10GbE Intel Wired LAN Driver Updates 2016-09-23 David Miller
  10 siblings, 0 replies; 12+ messages in thread
From: Jeff Kirsher @ 2016-09-23  7:51 UTC (permalink / raw)
  To: davem
  Cc: Emil Tantilov, netdev, nhorman, sassmann, jogreene,
	guru.anbalagane, Jeff Kirsher

From: Emil Tantilov <emil.s.tantilov@intel.com>

Enabling SRIOV while the ixgbevf driver is loaded will result in all
mailbox requests from ixgbevf_open() being rejected by ixgbe because
adapter->clear_to_send is set to false on reset.

Call ixgbe_sriov_reinit() before pci_enable_sriov() to make sure that
mailbox requests are handled from the time ixgbevf is loaded.

Reported-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
index 8618599..343a182 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
@@ -329,13 +329,15 @@ static int ixgbe_pci_sriov_enable(struct pci_dev *dev, int num_vfs)
 	for (i = 0; i < adapter->num_vfs; i++)
 		ixgbe_vf_configuration(dev, (i | 0x10000000));
 
+	/* reset before enabling SRIOV to avoid mailbox issues */
+	ixgbe_sriov_reinit(adapter);
+
 	err = pci_enable_sriov(dev, num_vfs);
 	if (err) {
 		e_dev_warn("Failed to enable PCI sriov: %d\n", err);
 		return err;
 	}
 	ixgbe_get_vfs(adapter);
-	ixgbe_sriov_reinit(adapter);
 
 	return num_vfs;
 #else
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [net-next 00/10][pull request] 10GbE Intel Wired LAN Driver Updates 2016-09-23
  2016-09-23  7:51 [net-next 00/10][pull request] 10GbE Intel Wired LAN Driver Updates 2016-09-23 Jeff Kirsher
                   ` (9 preceding siblings ...)
  2016-09-23  7:51 ` [net-next 10/10] ixgbe: reset before SRIOV init to avoid mailbox issues Jeff Kirsher
@ 2016-09-24 12:22 ` David Miller
  10 siblings, 0 replies; 12+ messages in thread
From: David Miller @ 2016-09-24 12:22 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann, jogreene, guru.anbalagane

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Fri, 23 Sep 2016 00:51:33 -0700

> This series contains updates to ixgbe and ixgbevf.

Pulled, thanks Jeff.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-09-24 12:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-23  7:51 [net-next 00/10][pull request] 10GbE Intel Wired LAN Driver Updates 2016-09-23 Jeff Kirsher
2016-09-23  7:51 ` [net-next 01/10] ixgbe: simplify the logic for setting VLAN filtering Jeff Kirsher
2016-09-23  7:51 ` [net-next 02/10] ixgbe: make ixgbe_led_on/off_t_x550em static Jeff Kirsher
2016-09-23  7:51 ` [net-next 03/10] ixgbe: Resolve NULL reference by setting {read, write}_reg_mdi Jeff Kirsher
2016-09-23  7:51 ` [net-next 04/10] ixgbe: Indicate support for pause frames in all cases Jeff Kirsher
2016-09-23  7:51 ` [net-next 05/10] ixgbevf: add spinlocks for MTU change calls Jeff Kirsher
2016-09-23  7:51 ` [net-next 06/10] ixgbe: Use MDIO_PRTAD_NONE consistently Jeff Kirsher
2016-09-23  7:51 ` [net-next 07/10] ixgbe: Allow setting multiple queues when SR-IOV is enabled Jeff Kirsher
2016-09-23  7:51 ` [net-next 08/10] ixgbe: Limit reporting of redirection table if " Jeff Kirsher
2016-09-23  7:51 ` [net-next 09/10] ixgbe: Support 4 queue RSS on VFs with 1 or 2 queue RSS on PF Jeff Kirsher
2016-09-23  7:51 ` [net-next 10/10] ixgbe: reset before SRIOV init to avoid mailbox issues Jeff Kirsher
2016-09-24 12:22 ` [net-next 00/10][pull request] 10GbE Intel Wired LAN Driver Updates 2016-09-23 David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.