Skip to contentSkip to conversation

Intel Wired LAN Driver Updates

PATCH In review Aaron Brown 2 participants 8 messages Feb 28, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Intel Wired LAN Driver Updates

This series contains updates to ixgbe and ixgbevf.

Don provides an update to change a hard coded timeout interval to a system-wide timeout one, collects AUTOC register functions into one place and fixes some firmware bit handling.

Emil resolves a tx handling error introduced in a recent commit and adds check for CHECKSUM_PARTIAL to avoid an skb_is_gso check

Don Skidmore (4):
ixgbe: fix to use correct timeout interval for memory read completion
ixgbe: collect all 82599 AUTOC code in one function
ixgbe: fix bit toggled for 82599 reset fix.
ixgbe: Add check for FW veto bit

Emil Tantilov (2):
ixgbevf: fix handling of tx checksumming
ixgbevf: add check for CHECKSUM_PARTIAL when doing TSO

 drivers/net/ethernet/intel/ixgbe/ixgbe.h          |   1 -
 drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c    |   2 +
 drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c    | 189 ++++++++++++----------
 drivers/net/ethernet/intel/ixgbe/ixgbe_common.c   | 172 +++++++++++++-------
 drivers/net/ethernet/intel/ixgbe/ixgbe_common.h   |   5 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c      |  44 ++++-
 drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h      |   3 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_type.h     |  21 ++-
 drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c     |   2 +
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c |   5 +-
 10 files changed, 294 insertions(+), 150 deletions(-)
Signature · 1 line
1.8.5.GIT
#1 lore raw

PATCH 1/6 ixgbe: fix to use correct timeout interval for memory read completion

From: Don Skidmore <[email protected]>

Currently we were just always polling for a hard coded 80 ms and not respecting the system-wide timeout interval. Since up until now all devices have been tested with this 80ms value we continue to use this value as a hard minimum.

---
 drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 54 ++++++++++++++++++++++++-
 drivers/net/ethernet/intel/ixgbe/ixgbe_type.h   | 13 +++++-
 2 files changed, 64 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +52 -2
index b5c434b..2e84ee8 100644
@@ -2437,6 +2437,55 @@ out:
 }
 
 /**
+ * ixgbe_pcie_timeout_poll - Return number of times to poll for completion
+ * @hw: pointer to hardware structure
+ *
+ * System-wide timeout range is encoded in PCIe Device Control2 register.
+ *
+ *  Add 10% to specified maximum and return the number of times to poll for
+ *  completion timeout, in units of 100 microsec.  Never return less than
+ *  800 = 80 millisec.
+ **/
+static u32 ixgbe_pcie_timeout_poll(struct ixgbe_hw *hw)
+{
+	struct ixgbe_adapter *adapter = hw->back;
+	s16 devctl2;
+	u32 pollcnt;
+
+	pci_read_config_word(adapter->pdev, IXGBE_PCI_DEVICE_CONTROL2,
+			     &devctl2);
+	devctl2 &= IXGBE_PCIDEVCTRL2_TIMEO_MASK;
+
+	switch (devctl2) {
+	case IXGBE_PCIDEVCTRL2_65_130ms:
+		 pollcnt = 1300;         /* 130 millisec */
+		break;
+	case IXGBE_PCIDEVCTRL2_260_520ms:
+		pollcnt = 5200;         /* 520 millisec */
+		break;
+	case IXGBE_PCIDEVCTRL2_1_2s:
+		pollcnt = 20000;        /* 2 sec */
+		break;
+	case IXGBE_PCIDEVCTRL2_4_8s:
+		pollcnt = 80000;        /* 8 sec */
+		break;
+	case IXGBE_PCIDEVCTRL2_17_34s:
+		pollcnt = 34000;        /* 34 sec */
+		break;
+	case IXGBE_PCIDEVCTRL2_50_100us:        /* 100 microsecs */
+	case IXGBE_PCIDEVCTRL2_1_2ms:           /* 2 millisecs */
+	case IXGBE_PCIDEVCTRL2_16_32ms:         /* 32 millisec */
+	case IXGBE_PCIDEVCTRL2_16_32ms_def:     /* 32 millisec default */
+	default:
+		pollcnt = 800;          /* 80 millisec minimum */
+		break;
+	}
+
+	/* add 10% to spec maximum */
+	return (pollcnt * 11) / 10;
+}
+
+/**
  *  ixgbe_disable_pcie_master - Disable PCI-express master access
  *  @hw: pointer to hardware structure
  *
@@ -2449,7 +2498,7 @@ static s32 ixgbe_disable_pcie_master(struct ixgbe_hw *hw)
 {
 	struct ixgbe_adapter *adapter = hw->back;
 	s32 status = 0;
-	u32 i;
+	u32 i, poll;
 	u16 value;
 
 	/* Always set this bit to ensure any future transactions are blocked */
@@ -2481,7 +2530,8 @@ static s32 ixgbe_disable_pcie_master(struct ixgbe_hw *hw)
 	 * Before proceeding, make sure that the PCIe block does not have
 	 * transactions pending.
 	 */
-	for (i = 0; i < IXGBE_PCI_MASTER_DISABLE_TIMEOUT; i++) {
+	poll = ixgbe_pcie_timeout_poll(hw);
+	for (i = 0; i < poll; i++) {
 		udelay(100);
 		pci_read_config_word(adapter->pdev, IXGBE_PCI_DEVICE_STATUS,
 							 &value);
drivers/net/ethernet/intel/ixgbe/ixgbe_type.h +12 -1
index 9283cff..245819d 100644
@@ -1854,8 +1854,19 @@ enum {
 #define IXGBE_PCI_HEADER_TYPE_MULTIFUNC 0x80
 #define IXGBE_PCI_DEVICE_CONTROL2_16ms  0x0005
 
+#define IXGBE_PCIDEVCTRL2_TIMEO_MASK	0xf
+#define IXGBE_PCIDEVCTRL2_16_32ms_def	0x0
+#define IXGBE_PCIDEVCTRL2_50_100us	0x1
+#define IXGBE_PCIDEVCTRL2_1_2ms		0x2
+#define IXGBE_PCIDEVCTRL2_16_32ms	0x5
+#define IXGBE_PCIDEVCTRL2_65_130ms	0x6
+#define IXGBE_PCIDEVCTRL2_260_520ms	0x9
+#define IXGBE_PCIDEVCTRL2_1_2s		0xa
+#define IXGBE_PCIDEVCTRL2_4_8s		0xd
+#define IXGBE_PCIDEVCTRL2_17_34s	0xe
+
 /* Number of 100 microseconds we wait for PCI Express master disable */
-#define IXGBE_PCI_MASTER_DISABLE_TIMEOUT 800
+#define IXGBE_PCI_MASTER_DISABLE_TIMEOUT	800
 
 /* RAH */
 #define IXGBE_RAH_VIND_MASK     0x003C0000
Signature · 1 line
1.8.5.GIT
#2 lore raw

PATCH 2/6 ixgbe: collect all 82599 AUTOC code in one function

In reply to Aaron Brown

From: Don Skidmore <[email protected]>

When reading or writing to the AUTOC register on 82599 devices we need to preform various operations that aren't needed for other MAC types. This patch will collect all of that code into one place to minimize MAC checks in common code paths.

While doing this I also clean up some cases where we weren't holding the SW/FW semaphore during a read/modify/write of AUTOC.

---
 drivers/net/ethernet/intel/ixgbe/ixgbe.h        |   1 -
 drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c  |   2 +
 drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c  | 171 +++++++++++++-----------
 drivers/net/ethernet/intel/ixgbe/ixgbe_common.c | 118 ++++++++--------
 drivers/net/ethernet/intel/ixgbe/ixgbe_common.h |   5 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_type.h   |   3 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c   |   2 +
 7 files changed, 161 insertions(+), 141 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe.h +0 -1
index 0186ea2..cca13a5 100644
@@ -884,7 +884,6 @@ s32 ixgbe_fdir_erase_perfect_filter_82599(struct ixgbe_hw *hw,
 					  u16 soft_id);
 void ixgbe_atr_compute_perfect_hash_82599(union ixgbe_atr_input *input,
 					  union ixgbe_atr_input *mask);
-bool ixgbe_verify_lesm_fw_enabled_82599(struct ixgbe_hw *hw);
 void ixgbe_set_rx_mode(struct net_device *netdev);
 #ifdef CONFIG_IXGBE_DCB
 void ixgbe_set_rx_drop_en(struct ixgbe_adapter *adapter);
drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c +2 -0
index a26f3fe..10e563c 100644
@@ -1316,6 +1316,8 @@ static struct ixgbe_mac_operations mac_ops_82598 = {
 	.get_thermal_sensor_data = NULL,
 	.init_thermal_sensor_thresh = NULL,
 	.mng_fw_enabled		= NULL,
+	.prot_autoc_read	= &prot_autoc_read_generic,
+	.prot_autoc_write	= &prot_autoc_write_generic,
 };
 
 static struct ixgbe_eeprom_operations eeprom_ops_82598 = {
drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c +92 -79

269 lines not on this page · raw message

drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +59 -59

177 lines not on this page · raw message

drivers/net/ethernet/intel/ixgbe/ixgbe_common.h +4 -1
index f2e3919..a042db2 100644
@@ -98,6 +98,10 @@ s32 ixgbe_check_mac_link_generic(struct ixgbe_hw *hw,
                                  bool *link_up, bool link_up_wait_to_complete);
 s32 ixgbe_get_wwn_prefix_generic(struct ixgbe_hw *hw, u16 *wwnn_prefix,
                                  u16 *wwpn_prefix);
+
+s32 prot_autoc_read_generic(struct ixgbe_hw *hw, bool *, u32 *reg_val);
+s32 prot_autoc_write_generic(struct ixgbe_hw *hw, u32 reg_val, bool locked);
+
 s32 ixgbe_blink_led_start_generic(struct ixgbe_hw *hw, u32 index);
 s32 ixgbe_blink_led_stop_generic(struct ixgbe_hw *hw, u32 index);
 void ixgbe_set_mac_anti_spoofing(struct ixgbe_hw *hw, bool enable, int pf);
@@ -109,7 +113,6 @@ void ixgbe_clear_tx_pending(struct ixgbe_hw *hw);
 
 void ixgbe_set_rxpba_generic(struct ixgbe_hw *hw, int num_pb,
 			     u32 headroom, int strategy);
-s32 ixgbe_reset_pipeline_82599(struct ixgbe_hw *hw);
 
 #define IXGBE_I2C_THERMAL_SENSOR_ADDR	0xF8
 #define IXGBE_EMC_INTERNAL_DATA		0x00
drivers/net/ethernet/intel/ixgbe/ixgbe_type.h +2 -1
index 245819d..692341f 100644
@@ -2870,6 +2870,8 @@ struct ixgbe_mac_operations {
 	s32 (*enable_rx_dma)(struct ixgbe_hw *, u32);
 	s32 (*acquire_swfw_sync)(struct ixgbe_hw *, u16);
 	void (*release_swfw_sync)(struct ixgbe_hw *, u16);
+	s32 (*prot_autoc_read)(struct ixgbe_hw *, bool *, u32 *);
+	s32 (*prot_autoc_write)(struct ixgbe_hw *, u32, bool);
 
 	/* Link */
 	void (*disable_tx_laser)(struct ixgbe_hw *);
@@ -2969,7 +2971,6 @@ struct ixgbe_mac_info {
 	u32                             max_tx_queues;
 	u32                             max_rx_queues;
 	u32                             orig_autoc;
-	u32                             cached_autoc;
 	u32                             orig_autoc2;
 	bool                            orig_link_settings_stored;
 	bool                            autotry_restart;
drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c +2 -0
index 24b80a6..c870f37 100644
@@ -855,6 +855,8 @@ static struct ixgbe_mac_operations mac_ops_X540 = {
 	.get_thermal_sensor_data = NULL,
 	.init_thermal_sensor_thresh = NULL,
 	.mng_fw_enabled		= NULL,
+	.prot_autoc_read	= &prot_autoc_read_generic,
+	.prot_autoc_write	= &prot_autoc_write_generic,
 };
 
 static struct ixgbe_eeprom_operations eeprom_ops_X540 = {
Signature · 1 line
1.8.5.GIT
#3 lore raw

PATCH 3/6 ixgbe: fix bit toggled for 82599 reset fix.

In reply to Aaron Brown

From: Don Skidmore <[email protected]>

The current code doesn't toggle the correct bit to reset the data pipeline on Restart_AN assertion. This patch corrects that.

---
 drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c +2 -1
index 1c31d2d..e919c28 100644
@@ -2395,7 +2395,8 @@ static s32 ixgbe_reset_pipeline_82599(struct ixgbe_hw *hw)
 	autoc_reg |= IXGBE_AUTOC_AN_RESTART;
 
 	/* Write AUTOC register with toggled LMS[2] bit and Restart_AN */
-	IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc_reg ^ IXGBE_AUTOC_LMS_1G_AN);
+	IXGBE_WRITE_REG(hw, IXGBE_AUTOC,
+			autoc_reg ^ (0x4 << IXGBE_AUTOC_LMS_SHIFT));
 
 	/* Wait for AN to leave state 0 */
 	for (i = 0; i < 10; i++) {
Signature · 1 line
1.8.5.GIT
#4 lore raw

PATCH 4/6 ixgbe: Add check for FW veto bit

In reply to Aaron Brown

From: Don Skidmore <[email protected]>

The driver will now honor the MNG FW veto bit in blocking link resets. This patch will affect x520 and x540 systems.

---
 drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c | 15 ++++++++-
 drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c   | 44 +++++++++++++++++++++++++-
 drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h   |  3 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_type.h  |  5 ++-
 4 files changed, 63 insertions(+), 4 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c +14 -1
index e919c28..b96cefd 100644
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   Intel 10 Gigabit PCI Express Linux driver
-  Copyright(c) 1999 - 2013 Intel Corporation.
+  Copyright(c) 1999 - 2014 Intel Corporation.
 
   This program is free software; you can redistribute it and/or modify it
   under the terms and conditions of the GNU General Public License,
@@ -233,6 +233,10 @@ static s32 prot_autoc_write_82599(struct ixgbe_hw *hw, u32 autoc, bool locked)
 {
 	s32 ret_val = 0;
 
+	/* Blocked by MNG FW so bail */
+	if (ixgbe_check_reset_blocked(hw))
+		goto out;
+
 	/* We only need to get the lock if:
 	 *  - We didn't do it already (in the read part of a read-modify-write)
 	 *  - LESM is enabled.
@@ -247,6 +251,7 @@ static s32 prot_autoc_write_82599(struct ixgbe_hw *hw, u32 autoc, bool locked)
 	IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc);
 	ret_val = ixgbe_reset_pipeline_82599(hw);
 
+out:
 	/* Free the SW/FW semaphore as we either grabbed it here or
 	 * already had it when this function was called.
 	 */
@@ -591,6 +596,10 @@ static void ixgbe_disable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw)
 {
 	u32 esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP);
 
+	/* Blocked by MNG FW so bail */
+	if (ixgbe_check_reset_blocked(hw))
+		return;
+
 	/* Disable tx laser; allow 100us to go dark per spec */
 	esdp_reg |= IXGBE_ESDP_SDP3;
 	IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg);
@@ -631,6 +640,10 @@ static void ixgbe_enable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw)
  **/
 static void ixgbe_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw)
 {
+	/* Blocked by MNG FW so bail */
+	if (ixgbe_check_reset_blocked(hw))
+		return;
+
 	if (hw->mac.autotry_restart) {
 		ixgbe_disable_tx_laser_multispeed_fiber(hw);
 		ixgbe_enable_tx_laser_multispeed_fiber(hw);
drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c +43 -1

80 lines not on this page · raw message

drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h +2 -1
index fffcbdd..b4d4323 100644
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   Intel 10 Gigabit PCI Express Linux driver
-  Copyright(c) 1999 - 2013 Intel Corporation.
+  Copyright(c) 1999 - 2014 Intel Corporation.
 
   This program is free software; you can redistribute it and/or modify it
   under the terms and conditions of the GNU General Public License,
@@ -131,6 +131,7 @@ s32 ixgbe_setup_phy_link_speed_generic(struct ixgbe_hw *hw,
 s32 ixgbe_get_copper_link_capabilities_generic(struct ixgbe_hw *hw,
                                                ixgbe_link_speed *speed,
                                                bool *autoneg);
+s32 ixgbe_check_reset_blocked(struct ixgbe_hw *hw);
 
 /* PHY specific */
 s32 ixgbe_check_phy_link_tnx(struct ixgbe_hw *hw,
drivers/net/ethernet/intel/ixgbe/ixgbe_type.h +4 -1
index 692341f..c10382e 100644
@@ -1,7 +1,7 @@
 /*******************************************************************************
 
   Intel 10 Gigabit PCI Express Linux driver
-  Copyright(c) 1999 - 2013 Intel Corporation.
+  Copyright(c) 1999 - 2014 Intel Corporation.
 
   This program is free software; you can redistribute it and/or modify it
   under the terms and conditions of the GNU General Public License,
@@ -1610,6 +1610,9 @@ enum {
 #define IXGBE_MACC_FS        0x00040000
 #define IXGBE_MAC_RX2TX_LPBK 0x00000002
 
+/* Veto Bit definiton */
+#define IXGBE_MMNGC_MNG_VETO  0x00000001
+
 /* LINKS Bit Masks */
 #define IXGBE_LINKS_KX_AN_COMP  0x80000000
 #define IXGBE_LINKS_UP          0x40000000
Signature · 1 line
1.8.5.GIT
#5 lore raw

PATCH 5/6 ixgbevf: fix handling of tx checksumming

In reply to Aaron Brown

From: Emil Tantilov <[email protected]>

This patch resolves an issue introduced by:
commit 7ad1a093519e37fb673579819bf6af122641c397
ixgbevf: make the first tx_buffer a repository for most of the skb info

Incorrect check for the result of ixgbevf_tso() can lead to calling ixgbevf_tx_csum() which can spawn 2 context descriptors and result in performance degradation and/or corrupted packets.

---
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +1 -1
index a6af7b7..79023ba 100644
@@ -3155,7 +3155,7 @@ static int ixgbevf_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 	tso = ixgbevf_tso(tx_ring, first, &hdr_len);
 	if (tso < 0)
 		goto out_drop;
-	else
+	else if (!tso)
 		ixgbevf_tx_csum(tx_ring, first);
 
 	ixgbevf_tx_map(tx_ring, first, hdr_len);
Signature · 1 line
1.8.5.GIT
#6 lore raw

PATCH 6/6 ixgbevf: add check for CHECKSUM_PARTIAL when doing TSO

In reply to Aaron Brown

From: Emil Tantilov <[email protected]>

This patch adds check for CHECKSUM_PARTIAL to avoid the skb_is_gso check in ixgbevf_tso(). It should reduce overhead for workloads that are not using TSO or checksum offloads. It is the same as in ixgbe.

---
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +3 -0
index 79023ba..57e0cd8 100644
@@ -2777,6 +2777,9 @@ static int ixgbevf_tso(struct ixgbevf_ring *tx_ring,
 	u32 vlan_macip_lens, type_tucmd;
 	u32 mss_l4len_idx, l4len;
 
+	if (skb->ip_summed != CHECKSUM_PARTIAL)
+		return 0;
+
 	if (!skb_is_gso(skb))
 		return 0;
 
Signature · 1 line
1.8.5.GIT
maintainer
#7 lore raw
In reply to Aaron Brown

From: Aaron Brown <[email protected]>
Date: Thu, 27 Feb 2014 20:32:39 -0800

Quoted 8 lines

This series contains updates to ixgbe and ixgbevf.

Don provides an update to change a hard coded timeout interval to a system-wide timeout one, collects AUTOC register functions into one place and fixes some firmware bit handling.

Emil resolves a tx handling error introduced in a recent commit and adds check for CHECKSUM_PARTIAL to avoid an skb_is_gso check

Looks good, series applied, thanks Aaron.