Skip to contentSkip to conversation

e1000e: retire last_tx_tso workaround

PATCH In review Auke Kok 2 participants 4 messages Aug 22, 2007 – Aug 25, 2007

Subsystems (2)
lore
Share & tools
lore

Auke Kok

author
#0 lore raw

PATCH 1/3 e1000e: retire last_tx_tso workaround

This TSO-related workaround is no longer needed since it's only applicable for 8254x silicon.

---

 drivers/net/e1000e/e1000.h  |   15 +++------------
 drivers/net/e1000e/netdev.c |   20 ++------------------
 2 files changed, 5 insertions(+), 30 deletions(-)
drivers/net/e1000e/e1000.h +3 -12
index e3cd877..bbe5faf 100644
@@ -142,18 +142,9 @@ struct e1000_ring {
 	/* array of buffer information structs */
 	struct e1000_buffer *buffer_info;
 
-	union {
-		/* for TX */
-		struct {
-			bool last_tx_tso; /* used to mark tso desc.  */
-		};
-		/* for RX */
-		struct {
-			/* arrays of page information for packet split */
-			struct e1000_ps_page *ps_pages;
-			struct sk_buff *rx_skb_top;
-		};
-	};
+	/* arrays of page information for packet split */
+	struct e1000_ps_page *ps_pages;
+	struct sk_buff *rx_skb_top;
 
 	struct e1000_queue_stats stats;
 };
drivers/net/e1000e/netdev.c +2 -18
index 8ebe238..4916f7c 100644
@@ -1483,7 +1483,6 @@ static void e1000_clean_tx_ring(struct e1000_adapter *adapter)
 
 	tx_ring->next_to_use = 0;
 	tx_ring->next_to_clean = 0;
-	tx_ring->last_tx_tso = 0;
 
 	writel(0, adapter->hw.hw_addr + tx_ring->head);
 	writel(0, adapter->hw.hw_addr + tx_ring->tail);
@@ -3216,15 +3215,6 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
 	while (len) {
 		buffer_info = &tx_ring->buffer_info[i];
 		size = min(len, max_per_txd);
-		/* Workaround for Controller erratum --
-		 * descriptor for non-tso packet in a linear SKB that follows a
-		 * tso gets written back prematurely before the data is fully
-		 * DMA'd to the controller */
-		if (tx_ring->last_tx_tso && !skb_is_gso(skb)) {
-			tx_ring->last_tx_tso = 0;
-			if (!skb->data_len)
-				size -= 4;
-		}
 
 		/* Workaround for premature desc write-backs
 		 * in TSO mode.  Append 4-byte sentinel desc */
@@ -3497,10 +3487,6 @@ static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 		count++;
 	count++;
 
-	/* Controller Erratum workaround */
-	if (!skb->data_len && tx_ring->last_tx_tso && !skb_is_gso(skb))
-		count++;
-
 	count += TXD_USE_COUNT(len, max_txd_pwr);
 
 	nr_frags = skb_shinfo(skb)->nr_frags;
@@ -3536,12 +3522,10 @@ static int e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 		return NETDEV_TX_OK;
 	}
 
-	if (tso) {
-		tx_ring->last_tx_tso = 1;
+	if (tso)
 		tx_flags |= E1000_TX_FLAGS_TSO;
-	} else if (e1000_tx_csum(adapter, skb)) {
+	else if (e1000_tx_csum(adapter, skb))
 		tx_flags |= E1000_TX_FLAGS_CSUM;
-	}
 
 	/* Old method was to assume IPv4 packet by default if TSO was enabled.
 	 * 82571 hardware supports TSO capabilities for IPv6 as well...
author
#1 lore raw

PATCH 2/3 e1000e: Add read code and printout of PBA number (board identifier)

The PBA number allows customers and support to directly identify the type of board and characteristics such as different skews.

Slightly enhance loading messages by adding module name to printout.

---

 drivers/net/e1000e/defines.h |    6 ++++--
 drivers/net/e1000e/e1000.h   |    2 ++
 drivers/net/e1000e/lib.c     |   21 +++++++++++++++++++++
 drivers/net/e1000e/netdev.c  |   12 +++++++++---
 4 files changed, 36 insertions(+), 5 deletions(-)
drivers/net/e1000e/defines.h +4 -2
index ca80fde..b32ed45 100644
@@ -573,9 +573,11 @@
 /* For checksumming, the sum of all words in the NVM should equal 0xBABA. */
 #define NVM_SUM                    0xBABA
 
-#define NVM_WORD_SIZE_BASE_SHIFT   6
+/* PBA (printed board assembly) number words */
+#define NVM_PBA_OFFSET_0           8
+#define NVM_PBA_OFFSET_1           9
 
-/* NVM Commands - Microwire */
+#define NVM_WORD_SIZE_BASE_SHIFT   6
 
 /* NVM Commands - SPI */
 #define NVM_MAX_RETRY_SPI          5000 /* Max wait of 5ms, for RDY signal */
drivers/net/e1000e/e1000.h +2 -0
index bbe5faf..c57e35a 100644
@@ -358,6 +358,8 @@ extern struct e1000_info e1000_ich8_info;
 extern struct e1000_info e1000_ich9_info;
 extern struct e1000_info e1000_es2_info;
 
+extern s32 e1000e_read_part_num(struct e1000_hw *hw, u32 *part_num);
+
 extern s32  e1000e_commit_phy(struct e1000_hw *hw);
 
 extern bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw);
drivers/net/e1000e/lib.c +21 -0
index 6645c21..3bbfe60 100644
@@ -2464,3 +2464,24 @@ bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw)
 	return ret_val;
 }
 
+s32 e1000e_read_part_num(struct e1000_hw *hw, u32 *part_num)
+{
+	s32 ret_val;
+	u16 nvm_data;
+
+	ret_val = e1000_read_nvm(hw, NVM_PBA_OFFSET_0, 1, &nvm_data);
+	if (ret_val) {
+		hw_dbg(hw, "NVM Read Error\n");
+		return ret_val;
+	}
+	*part_num = (u32)(nvm_data << 16);
+
+	ret_val = e1000_read_nvm(hw, NVM_PBA_OFFSET_1, 1, &nvm_data);
+	if (ret_val) {
+		hw_dbg(hw, "NVM Read Error\n");
+		return ret_val;
+	}
+	*part_num |= nvm_data;
+
+	return 0;
+}
drivers/net/e1000e/netdev.c +9 -3
index 4916f7c..420e111 100644
@@ -3966,6 +3966,7 @@ static void e1000_print_device_info(struct e1000_adapter *adapter)
 {
 	struct e1000_hw *hw = &adapter->hw;
 	struct net_device *netdev = adapter->netdev;
+	u32 part_num;
 
 	/* print bus type/speed/width info */
 	ndev_info(netdev, "(PCI Express:2.5GB/s:%s) "
@@ -3980,6 +3981,10 @@ static void e1000_print_device_info(struct e1000_adapter *adapter)
 	ndev_info(netdev, "Intel(R) PRO/%s Network Connection\n",
 		  (hw->phy.type == e1000_phy_ife)
 		   ? "10/100" : "1000");
+	e1000e_read_part_num(hw, &part_num);
+	ndev_info(netdev, "MAC: %d, PHY: %d, PBA No: %06x-%03x\n",
+		  hw->mac.type, hw->phy.type,
+		  (part_num >> 8), (part_num & 0xff));
 }
 
 /**
@@ -4414,9 +4419,10 @@ static struct pci_driver e1000_driver = {
 static int __init e1000_init_module(void)
 {
 	int ret;
-	printk(KERN_INFO "Intel(R) PRO/1000 Network Driver - %s\n",
-	       e1000e_driver_version);
-	printk(KERN_INFO "Copyright (c) 1999-2007 Intel Corporation.\n");
+	printk(KERN_INFO "%s: Intel(R) PRO/1000 Network Driver - %s\n",
+	       e1000e_driver_name, e1000e_driver_version);
+	printk(KERN_INFO "%s: Copyright (c) 1999-2007 Intel Corporation.\n",
+	       e1000e_driver_name);
 	ret = pci_register_driver(&e1000_driver);
 
 	return ret;
author
#2 lore raw

PATCH 3/3 e1000e: Remove conditional packet split disable flag

In reply to Auke Kok

This flag conflicts with e1000's Kconfig symbol and we'll leave the feature enabled by default for now.

---

 drivers/net/e1000e/netdev.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/net/e1000e/netdev.c +1 -2
index 420e111..372da46 100644
@@ -2009,7 +2009,6 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)
 		break;
 	}
 
-#ifndef CONFIG_E1000_DISABLE_PACKET_SPLIT
 	/*
 	 * 82571 and greater support packet-split where the protocol
 	 * header is placed in skb->data and the packet data is
@@ -2029,7 +2028,7 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter)
 	pages = PAGE_USE_COUNT(adapter->netdev->mtu);
 	if ((pages <= 3) && (PAGE_SIZE <= 16384) && (rctl & E1000_RCTL_LPE))
 		adapter->rx_ps_pages = pages;
-#endif
+
 	if (adapter->rx_ps_pages) {
 		/* Configure extra packet-split registers */
 		rfctl = er32(RFCTL);
#3 lore raw
In reply to Auke Kok
Quoted 9 lines · Auke Kok

This TSO-related workaround is no longer needed since it's only applicable for 8254x silicon.

---

 drivers/net/e1000e/e1000.h  |   15 +++------------
 drivers/net/e1000e/netdev.c |   20 ++------------------
 2 files changed, 5 insertions(+), 30 deletions(-)

applied 1-3 to #e1000e