Skip to contentSkip to conversation

igb fixes and cleanups

PATCH In review Jeff Kirsher 2 participants 8 messages Aug 4, 2008 – Aug 7, 2008

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

cover igb fixes and cleanups

Jeff,
There was a problem found in patches 4-6 in the last submission, where the changes made would cause problems for 82576 with 5 queues or more. So here is an undated patch set which resolves the problems seen.

---
Summary:
Alexander Duyck <[email protected]>:
igb: fix comments
igb: fix null pointer dereference seen with fiber NICs
igb: fixes 82576 serdes init to correctly support manual flow control changes
igb: correct issue of set_mta member of mac.ops not being populated
igb: remove three redundant functions left in the code
igb: remove igb_init_managability as it is deprecated
igb: remove 82576 quad adapter

---
 drivers/net/igb/e1000_82575.c   |   75 +++--------------------------------
 drivers/net/igb/e1000_82575.h   |    1 
 drivers/net/igb/e1000_defines.h |    1 
 drivers/net/igb/e1000_hw.h      |    2 
 drivers/net/igb/e1000_mac.c     |   84 ----------------------------------------
 drivers/net/igb/e1000_mac.h     |    5 --
 drivers/net/igb/e1000_regs.h    |    3 -
 drivers/net/igb/igb_ethtool.c   |    9 ----
 drivers/net/igb/igb_main.c      |   41 +------------------
 9 files changed, 14 insertions(+), 207 deletions(-)
Signature · 2 lines
Cheers,
Jeff
#1 lore raw

PATCH 1/7 igb: fix comments

From: Alexander Duyck <[email protected]>

The internal name was used in comments, replaced with silicon part number.

---

 drivers/net/igb/e1000_82575.c |    2 +-
 drivers/net/igb/igb_main.c    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/igb/e1000_82575.c +1 -1
index e098f23..f3d7be0 100644
@@ -1243,7 +1243,7 @@ out:
 u32 igb_translate_register_82576(u32 reg)
 {
 	/*
-	 * Some of the Kawela registers are located at different
+	 * Some of the 82576 registers are located at different
 	 * offsets than they are in older adapters.
 	 * Despite the difference in location, the registers
 	 * function in the same manner.
drivers/net/igb/igb_main.c +1 -1
index b602c4d..f23a048 100644
@@ -311,7 +311,7 @@ static void igb_assign_vector(struct igb_adapter *adapter, int rx_queue,
 		array_wr32(E1000_MSIXBM(0), msix_vector, msixbm);
 		break;
 	case e1000_82576:
-		/* Kawela uses a table-based method for assigning vectors.
+		/* The 82576 uses a table-based method for assigning vectors.
 		   Each queue has a single entry in the table to which we write
 		   a vector number along with a "valid" bit.  Sadly, the layout
 		   of the table is somewhat counterintuitive. */
#2 lore raw

PATCH 2/7 igb: fix null pointer dereference seen with fiber NICs

In reply to Jeff Kirsher

From: Alexander Duyck <[email protected]>

With a fiber or serdes NIC installed the driver was causing a null pointer dereference on driver unload.

---

 drivers/net/igb/igb_main.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/net/igb/igb_main.c +2 -1
index f23a048..cfed2b0 100644
@@ -1372,7 +1372,8 @@ static void __devexit igb_remove(struct pci_dev *pdev)
 
 	unregister_netdev(netdev);
 
-	if (!igb_check_reset_block(&adapter->hw))
+	if (adapter->hw.phy.ops.reset_phy &&
+	    !igb_check_reset_block(&adapter->hw))
 		adapter->hw.phy.ops.reset_phy(&adapter->hw);
 
 	igb_remove_device(&adapter->hw);
#3 lore raw

PATCH 3/7 igb: fixes 82576 serdes init to correctly support manual flow control changes

In reply to Jeff Kirsher

From: Alexander Duyck <[email protected]>

This patch changes the PCS configuration for serdes so that the flow control options change be set via the ethtool -A option.

---

 drivers/net/igb/e1000_82575.c   |    6 ++++++
 drivers/net/igb/e1000_defines.h |    1 +
 2 files changed, 7 insertions(+), 0 deletions(-)
drivers/net/igb/e1000_82575.c +6 -0
index f3d7be0..cd75a2b 100644
@@ -1136,6 +1136,12 @@ static s32 igb_setup_fiber_serdes_link_82575(struct e1000_hw *hw)
 		       E1000_PCS_LCTL_FORCE_LINK;     /* Force Link */
 		hw_dbg("Configuring Forced Link; PCS_LCTL = 0x%08X\n", reg);
 	}
+
+	if (hw->mac.type == e1000_82576) {
+		reg |= E1000_PCS_LCTL_FORCE_FCTRL;
+		igb_force_mac_fc(hw);
+	}
+
 	wr32(E1000_PCS_LCTL, reg);
 
 	return 0;
drivers/net/igb/e1000_defines.h +1 -0
index afdba3c..ce70068 100644
@@ -257,6 +257,7 @@
 #define E1000_PCS_LCTL_FDV_FULL          8
 #define E1000_PCS_LCTL_FSD               0x10
 #define E1000_PCS_LCTL_FORCE_LINK        0x20
+#define E1000_PCS_LCTL_FORCE_FCTRL       0x80
 #define E1000_PCS_LCTL_AN_ENABLE         0x10000
 #define E1000_PCS_LCTL_AN_RESTART        0x20000
 #define E1000_PCS_LCTL_AN_TIMEOUT        0x40000
#4 lore raw

PATCH 4/7 igb: correct issue of set_mta member of mac.ops not being populated

In reply to Jeff Kirsher

From: Alexander Duyck <[email protected]>

The igb_mta_set function was not being correctly used

---

 drivers/net/igb/e1000_82575.c |    2 +-
 drivers/net/igb/e1000_hw.h    |    1 -
 drivers/net/igb/e1000_mac.c   |    2 +-
 drivers/net/igb/e1000_mac.h   |    1 +
 4 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/igb/e1000_82575.c +1 -1
index cd75a2b..76f9f86 100644
@@ -850,7 +850,7 @@ void igb_update_mc_addr_list_82575(struct e1000_hw *hw,
 	for (; mc_addr_count > 0; mc_addr_count--) {
 		hash_value = igb_hash_mc_addr(hw, mc_addr_list);
 		hw_dbg("Hash value = 0x%03X\n", hash_value);
-		hw->mac.ops.mta_set(hw, hash_value);
+		igb_mta_set(hw, hash_value);
 		mc_addr_list += ETH_ALEN;
 	}
 }
drivers/net/igb/e1000_hw.h +0 -1
index 19fa4ee..a65ccc3 100644
@@ -420,7 +420,6 @@ struct e1000_mac_operations {
 	void (*rar_set)(struct e1000_hw *, u8 *, u32);
 	s32  (*read_mac_addr)(struct e1000_hw *);
 	s32  (*get_speed_and_duplex)(struct e1000_hw *, u16 *, u16 *);
-	void (*mta_set)(struct e1000_hw *, u32);
 };
 
 struct e1000_phy_operations {
drivers/net/igb/e1000_mac.c +1 -1
index 20408aa..9b0f0af 100644
@@ -271,7 +271,7 @@ void igb_rar_set(struct e1000_hw *hw, u8 *addr, u32 index)
  *  current value is read, the new bit is OR'd in and the new value is
  *  written back into the register.
  **/
-static void igb_mta_set(struct e1000_hw *hw, u32 hash_value)
+void igb_mta_set(struct e1000_hw *hw, u32 hash_value)
 {
 	u32 hash_bit, hash_reg, mta;
 
drivers/net/igb/e1000_mac.h +1 -0
index dc2f8cc..c2a9365 100644
@@ -63,6 +63,7 @@ void igb_clear_hw_cntrs_base(struct e1000_hw *hw);
 void igb_clear_vfta(struct e1000_hw *hw);
 void igb_config_collision_dist(struct e1000_hw *hw);
 void igb_init_rx_addrs(struct e1000_hw *hw, u16 rar_count);
+void igb_mta_set(struct e1000_hw *hw, u32 hash_value);
 void igb_put_hw_semaphore(struct e1000_hw *hw);
 void igb_rar_set(struct e1000_hw *hw, u8 *addr, u32 index);
 s32  igb_check_alt_mac_addr(struct e1000_hw *hw);
#5 lore raw

PATCH 6/7 igb: remove igb_init_managability as it is deprecated

In reply to Jeff Kirsher

From: Alexander Duyck <[email protected]>

igb_init_managability does not actually perform any function as the two registers it attempts to write are both read only on the host. This patch removes the function and all references to it from the driver.

---

 drivers/net/igb/igb_main.c |   25 -------------------------
 1 files changed, 0 insertions(+), 25 deletions(-)
drivers/net/igb/igb_main.c +0 -25
index cfed2b0..8f66e15 100644
@@ -720,28 +720,6 @@ static void igb_get_hw_control(struct igb_adapter *adapter)
 			ctrl_ext | E1000_CTRL_EXT_DRV_LOAD);
 }
 
-static void igb_init_manageability(struct igb_adapter *adapter)
-{
-	struct e1000_hw *hw = &adapter->hw;
-
-	if (adapter->en_mng_pt) {
-		u32 manc2h = rd32(E1000_MANC2H);
-		u32 manc = rd32(E1000_MANC);
-
-		/* enable receiving management packets to the host */
-		/* this will probably generate destination unreachable messages
-		 * from the host OS, but the packets will be handled on SMBUS */
-		manc |= E1000_MANC_EN_MNG2HOST;
-#define E1000_MNG2HOST_PORT_623 (1 << 5)
-#define E1000_MNG2HOST_PORT_664 (1 << 6)
-		manc2h |= E1000_MNG2HOST_PORT_623;
-		manc2h |= E1000_MNG2HOST_PORT_664;
-		wr32(E1000_MANC2H, manc2h);
-
-		wr32(E1000_MANC, manc);
-	}
-}
-
 /**
  * igb_configure - configure the hardware for RX and TX
  * @adapter: private board structure
@@ -755,7 +733,6 @@ static void igb_configure(struct igb_adapter *adapter)
 	igb_set_multi(netdev);
 
 	igb_restore_vlan(adapter);
-	igb_init_manageability(adapter);
 
 	igb_configure_tx(adapter);
 	igb_setup_rctl(adapter);
@@ -4524,8 +4501,6 @@ static void igb_io_resume(struct pci_dev *pdev)
 	struct net_device *netdev = pci_get_drvdata(pdev);
 	struct igb_adapter *adapter = netdev_priv(netdev);
 
-	igb_init_manageability(adapter);
-
 	if (netif_running(netdev)) {
 		if (igb_up(adapter)) {
 			dev_err(&pdev->dev, "igb_up failed after reset\n");
#6 lore raw

PATCH 7/7 igb: remove 82576 quad adapter

In reply to Jeff Kirsher

From: Alexander Duyck <[email protected]>

removing the 82576 quad adapter as it will not have completed testing by the time the kernel has been released.

---

 drivers/net/igb/e1000_82575.c |    1 -
 drivers/net/igb/e1000_hw.h    |    1 -
 drivers/net/igb/igb_ethtool.c |    9 ---------
 drivers/net/igb/igb_main.c    |   11 -----------
 4 files changed, 0 insertions(+), 22 deletions(-)
drivers/net/igb/e1000_82575.c +0 -1
index bb823ac..f5e2e72 100644
@@ -87,7 +87,6 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
 	case E1000_DEV_ID_82576:
 	case E1000_DEV_ID_82576_FIBER:
 	case E1000_DEV_ID_82576_SERDES:
-	case E1000_DEV_ID_82576_QUAD_COPPER:
 		mac->type = e1000_82576;
 		break;
 	default:
drivers/net/igb/e1000_hw.h +0 -1
index a65ccc3..99504a6 100644
@@ -41,7 +41,6 @@ struct e1000_hw;
 #define E1000_DEV_ID_82576                    0x10C9
 #define E1000_DEV_ID_82576_FIBER              0x10E6
 #define E1000_DEV_ID_82576_SERDES             0x10E7
-#define E1000_DEV_ID_82576_QUAD_COPPER        0x10E8
 #define E1000_DEV_ID_82575EB_COPPER           0x10A7
 #define E1000_DEV_ID_82575EB_FIBER_SERDES     0x10A9
 #define E1000_DEV_ID_82575GB_QUAD_COPPER      0x10D6
drivers/net/igb/igb_ethtool.c +0 -9
index 11aee13..6c0a8c2 100644
@@ -1746,15 +1746,6 @@ static int igb_wol_exclusion(struct igb_adapter *adapter,
 		/* return success for non excluded adapter ports */
 		retval = 0;
 		break;
-	case E1000_DEV_ID_82576_QUAD_COPPER:
-		/* quad port adapters only support WoL on port A */
-		if (!(adapter->flags & IGB_FLAG_QUAD_PORT_A)) {
-			wol->supported = 0;
-			break;
-		}
-		/* return success for non excluded adapter ports */
-		retval = 0;
-		break;
 	default:
 		/* dual port cards only support WoL on port A from now on
 		 * unless it was enabled in the eeprom for port B
drivers/net/igb/igb_main.c +0 -11
index 8f66e15..4b19abb 100644
@@ -61,7 +61,6 @@ static struct pci_device_id igb_pci_tbl[] = {
 	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82576), board_82575 },
 	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_FIBER), board_82575 },
 	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_SERDES), board_82575 },
-	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_QUAD_COPPER), board_82575 },
 	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82575EB_COPPER), board_82575 },
 	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82575EB_FIBER_SERDES), board_82575 },
 	{ PCI_VDEVICE(INTEL, E1000_DEV_ID_82575GB_QUAD_COPPER), board_82575 },
@@ -1217,16 +1216,6 @@ static int __devinit igb_probe(struct pci_dev *pdev,
 		if (rd32(E1000_STATUS) & E1000_STATUS_FUNC_1)
 			adapter->eeprom_wol = 0;
 		break;
-	case E1000_DEV_ID_82576_QUAD_COPPER:
-		/* if quad port adapter, disable WoL on all but port A */
-		if (global_quad_port_a != 0)
-			adapter->eeprom_wol = 0;
-		else
-			adapter->flags |= IGB_FLAG_QUAD_PORT_A;
-		/* Reset for multiple quad port adapters */
-		if (++global_quad_port_a == 4)
-			global_quad_port_a = 0;
-		break;
 	}
 
 	/* initialize the wol settings based on the eeprom settings */
#7 lore raw

Re: [UPDATED PATCH 7/7] igb: remove 82576 quad adapter

Quoted 7 lines · Jeff Kirsher

From: Alexander Duyck <[email protected]>

removing the 82576 quad adapter as it will not have completed testing by the time the kernel has been released.

Quoted 7 lines

---

 drivers/net/igb/e1000_82575.c |    1 -
 drivers/net/igb/e1000_hw.h    |    1 -
 drivers/net/igb/igb_ethtool.c |    9 ---------
 drivers/net/igb/igb_main.c    |   11 -----------
 4 files changed, 0 insertions(+), 22 deletions(-)

applied patches 1-6 of 7

Did not apply this patch because we rarely yank code for this reason... typically testing is done in parallel with the open source community. Maybe more explanation is needed, if I'm misunderstanding?