netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/11] ixgb: driver update (upstream)
@ 2006-04-22  1:00 Jeff Kirsher
  2006-04-22  1:00 ` [PATCH 01/11] ixgb: Fix compilation errors by initializing variables Jeff Kirsher
                   ` (11 more replies)
  0 siblings, 12 replies; 20+ messages in thread
From: Jeff Kirsher @ 2006-04-22  1:00 UTC (permalink / raw)
  To: Jeff Garzik, netdev, David Miller; +Cc: John Rociak, Jesse Brandeburg

The following patches were diff's against Garzik's latest "upstream" branch and can be pulled from the following location:

git://lost.foo-projects.org/linux-2.6.git ixgb-upstream


The following series implements...
01. Fix compilation errors by initializing variables
02. Fix the use of dprintk rather than printk
03. Fix hard coded numbers
04. Fix duplicate code
05. Fix timeout code
06. Fix TSO
07. Fixed flow control parameters
08. Add support for copper 10GbE
09. Add performance enhancements to the buffer_info struct
10. Add whitespace changes
11. Add prefetch
--
Cheers,
Jeff


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

* [PATCH 01/11] ixgb: Fix compilation errors by initializing variables
  2006-04-22  1:00 [PATCH 00/11] ixgb: driver update (upstream) Jeff Kirsher
@ 2006-04-22  1:00 ` Jeff Kirsher
  2006-04-22  8:49   ` Francois Romieu
  2006-04-22  1:00 ` [PATCH 02/11] ixgb: Fix the use of dprintk rather than printk Jeff Kirsher
                   ` (10 subsequent siblings)
  11 siblings, 1 reply; 20+ messages in thread
From: Jeff Kirsher @ 2006-04-22  1:00 UTC (permalink / raw)
  To: Jeff Garzik, netdev, David Miller; +Cc: John Rociak, Jesse Brandeburg


- initialized varaibles
- rev'd driver version

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---

 drivers/net/ixgb/ixgb_main.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index cfd67d8..0b9481a 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -52,7 +52,7 @@ static char ixgb_driver_string[] = "Inte
 #else
 #define DRIVERNAPI "-NAPI"
 #endif
-#define DRV_VERSION		"1.0.100-k2"DRIVERNAPI
+#define DRV_VERSION		"1.0.104-k2"DRIVERNAPI
 char ixgb_driver_version[] = DRV_VERSION;
 static char ixgb_copyright[] = "Copyright (c) 1999-2005 Intel Corporation.";
 
@@ -346,7 +346,7 @@ ixgb_probe(struct pci_dev *pdev,
 		const struct pci_device_id *ent)
 {
 	struct net_device *netdev = NULL;
-	struct ixgb_adapter *adapter;
+	struct ixgb_adapter *adapter = NULL;
 	static int cards_found = 0;
 	unsigned long mmio_start;
 	int mmio_len;


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

* [PATCH 02/11] ixgb: Fix the use of dprintk rather than printk
  2006-04-22  1:00 [PATCH 00/11] ixgb: driver update (upstream) Jeff Kirsher
  2006-04-22  1:00 ` [PATCH 01/11] ixgb: Fix compilation errors by initializing variables Jeff Kirsher
@ 2006-04-22  1:00 ` Jeff Kirsher
  2006-04-22  9:03   ` Francois Romieu
  2006-04-22  1:00 ` [PATCH 03/11] ixgb: Fix hard coded numbers Jeff Kirsher
                   ` (9 subsequent siblings)
  11 siblings, 1 reply; 20+ messages in thread
From: Jeff Kirsher @ 2006-04-22  1:00 UTC (permalink / raw)
  To: Jeff Garzik, netdev, David Miller; +Cc: John Rociak, Jesse Brandeburg


- use DPRINTK and msglvl instead of printk
- allow ethtool control of msglvl

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---

 drivers/net/ixgb/ixgb.h         |    8 +++++-
 drivers/net/ixgb/ixgb_ethtool.c |   16 ++++++++++++
 drivers/net/ixgb/ixgb_main.c    |   52 +++++++++++++++++++++++++--------------
 3 files changed, 56 insertions(+), 20 deletions(-)

diff --git a/drivers/net/ixgb/ixgb.h b/drivers/net/ixgb/ixgb.h
index c83271b..a696c33 100644
--- a/drivers/net/ixgb/ixgb.h
+++ b/drivers/net/ixgb/ixgb.h
@@ -84,7 +84,12 @@ struct ixgb_adapter;
 #define IXGB_DBG(args...)
 #endif
 
-#define IXGB_ERR(args...) printk(KERN_ERR "ixgb: " args)
+#define PFX "ixgb: "
+#define DPRINTK(nlevel, klevel, fmt, args...) \
+   (void)((NETIF_MSG_##nlevel & adapter->msg_enable) && \
+   printk(KERN_##klevel PFX "%s: %s: " fmt, adapter->netdev->name, \
+       __FUNCTION__ , ## args))
+
 
 /* TX/RX descriptor defines */
 #define DEFAULT_TXD	 256
@@ -192,6 +197,7 @@ struct ixgb_adapter {
 
 	/* structs defined in ixgb_hw.h */
 	struct ixgb_hw hw;
+	u16 msg_enable;
 	struct ixgb_hw_stats stats;
 #ifdef CONFIG_PCI_MSI
 	boolean_t have_msi;
diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c
index d38ade5..e8d83de 100644
--- a/drivers/net/ixgb/ixgb_ethtool.c
+++ b/drivers/net/ixgb/ixgb_ethtool.c
@@ -251,6 +251,20 @@ ixgb_set_tso(struct net_device *netdev, 
 } 
 #endif /* NETIF_F_TSO */
 
+static uint32_t
+ixgb_get_msglevel(struct net_device *netdev)
+{
+	struct ixgb_adapter *adapter = netdev->priv;
+	return adapter->msg_enable;
+}
+
+static void
+ixgb_set_msglevel(struct net_device *netdev, uint32_t data)
+{
+	struct ixgb_adapter *adapter = netdev->priv;
+	adapter->msg_enable = data;
+}
+
 #define IXGB_GET_STAT(_A_, _R_) _A_->stats._R_
 
 static int 
@@ -714,6 +728,8 @@ static struct ethtool_ops ixgb_ethtool_o
 	.set_tx_csum = ixgb_set_tx_csum,
 	.get_sg	= ethtool_op_get_sg,
 	.set_sg	= ethtool_op_set_sg,
+	.get_msglevel = ixgb_get_msglevel,
+	.set_msglevel = ixgb_set_msglevel,
 #ifdef NETIF_F_TSO
 	.get_tso = ethtool_op_get_tso,
 	.set_tso = ixgb_set_tso,
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index 0b9481a..6f8fd6f 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -148,6 +148,11 @@ MODULE_DESCRIPTION("Intel(R) PRO/10GbE N
 MODULE_LICENSE("GPL");
 MODULE_VERSION(DRV_VERSION);
 
+#define DEFAULT_DEBUG_LEVEL_SHIFT 3
+static int debug = DEFAULT_DEBUG_LEVEL_SHIFT;
+module_param(debug, int, 0);
+MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
+
 /* some defines for controlling descriptor fetches in h/w */
 #define RXDCTL_WTHRESH_DEFAULT 16	/* chip writes back at this many or RXT0 */
 #define RXDCTL_PTHRESH_DEFAULT 0		/* chip considers prefech below
@@ -248,19 +253,20 @@ ixgb_up(struct ixgb_adapter *adapter)
 
 	if (!pcix)
 	   adapter->have_msi = FALSE;
-	else if((err = pci_enable_msi(adapter->pdev))) {
-		printk (KERN_ERR
+	else if ((err = pci_enable_msi(adapter->pdev))) {
+		DPRINTK(PROBE, ERR,
 		 "Unable to allocate MSI interrupt Error: %d\n", err);
 		adapter->have_msi = FALSE;
 		/* proceed to try to request regular interrupt */
 	}
-	}
 
 #endif
-	if((err = request_irq(adapter->pdev->irq, &ixgb_intr,
-				  SA_SHIRQ | SA_SAMPLE_RANDOM,
-				  netdev->name, netdev)))
+	if ((err = request_irq(adapter->pdev->irq, &ixgb_intr,
+		 SA_SHIRQ | SA_SAMPLE_RANDOM, netdev->name, netdev))) {
+		DPRINTK(PROBE, ERR,
+		 "Unable to allocate interrupt Error: %d\n", err);		 
 		return err;
+	}
 
 	/* disable interrupts and get the hardware into a known state */
 	IXGB_WRITE_REG(&adapter->hw, IMC, 0xffffffff);
@@ -326,7 +332,7 @@ ixgb_reset(struct ixgb_adapter *adapter)
 
 	ixgb_adapter_stop(&adapter->hw);
 	if(!ixgb_init_hw(&adapter->hw))
-		IXGB_DBG("ixgb_init_hw failed.\n");
+		DPRINTK(PROBE, ERR, "ixgb_init_hw failed.\n");
 }
 
 /**
@@ -363,7 +369,7 @@ ixgb_probe(struct pci_dev *pdev,
 	} else {
 		if((err = pci_set_dma_mask(pdev, DMA_32BIT_MASK)) ||
 		   (err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK))) {
-			IXGB_ERR("No usable DMA configuration, aborting\n");
+			DPRINTK(PROBE, ERR, "No usable DMA configuration, aborting\n");
 			goto err_dma_mask;
 		}
 		pci_using_dac = 0;
@@ -388,6 +394,7 @@ ixgb_probe(struct pci_dev *pdev,
 	adapter->netdev = netdev;
 	adapter->pdev = pdev;
 	adapter->hw.back = adapter;
+	adapter->msg_enable = netif_msg_init(debug, DEFAULT_DEBUG_LEVEL_SHIFT);
 
 	mmio_start = pci_resource_start(pdev, BAR_0);
 	mmio_len = pci_resource_len(pdev, BAR_0);
@@ -456,7 +463,7 @@ ixgb_probe(struct pci_dev *pdev,
 	/* make sure the EEPROM is good */
 
 	if(!ixgb_validate_eeprom_checksum(&adapter->hw)) {
-		printk(KERN_ERR "The EEPROM Checksum Is Not Valid\n");
+		DPRINTK(PROBE, ERR, "The EEPROM Checksum Is Not Valid\n");
 		err = -EIO;
 		goto err_eeprom;
 	}
@@ -464,7 +471,8 @@ ixgb_probe(struct pci_dev *pdev,
 	ixgb_get_ee_mac_addr(&adapter->hw, netdev->dev_addr);
 	memcpy(netdev->perm_addr, netdev->dev_addr, netdev->addr_len);
 
-	if(!is_valid_ether_addr(netdev->perm_addr)) {
+	if (!is_valid_ether_addr(netdev->perm_addr)) {
+		DPRINTK(PROBE, ERR, "Invalid MAC Address\n");
 		err = -EIO;
 		goto err_eeprom;
 	}
@@ -478,6 +486,7 @@ ixgb_probe(struct pci_dev *pdev,
 	INIT_WORK(&adapter->tx_timeout_task,
 		  (void (*)(void *))ixgb_tx_timeout_task, netdev);
 
+	strcpy(netdev->name, "eth%d");
 	if((err = register_netdev(netdev)))
 		goto err_register;
 
@@ -486,8 +495,7 @@ ixgb_probe(struct pci_dev *pdev,
 	netif_carrier_off(netdev);
 	netif_stop_queue(netdev);
 
-	printk(KERN_INFO "%s: Intel(R) PRO/10GbE Network Connection\n",
-		   netdev->name);
+	DPRINTK(PROBE, INFO, "Intel(R) PRO/10GbE Network Connection\n");
 	ixgb_check_options(adapter);
 	/* reset the hardware with the new settings */
 
@@ -567,7 +575,7 @@ ixgb_sw_init(struct ixgb_adapter *adapte
 			hw->mac_type = ixgb_82597;
 	else {
 		/* should never have loaded on this device */
-		printk(KERN_ERR "ixgb: unsupported device id\n");
+		DPRINTK(PROBE, ERR, "unsupported device id\n");
 	}
 
 	/* enable flow control to be programmed */
@@ -665,6 +673,8 @@ ixgb_setup_tx_resources(struct ixgb_adap
 	size = sizeof(struct ixgb_buffer) * txdr->count;
 	txdr->buffer_info = vmalloc(size);
 	if(!txdr->buffer_info) {
+		DPRINTK(PROBE, ERR,
+		 "Unable to allocate transmit descriptor ring memory\n");
 		return -ENOMEM;
 	}
 	memset(txdr->buffer_info, 0, size);
@@ -677,6 +687,8 @@ ixgb_setup_tx_resources(struct ixgb_adap
 	txdr->desc = pci_alloc_consistent(pdev, txdr->size, &txdr->dma);
 	if(!txdr->desc) {
 		vfree(txdr->buffer_info);
+		DPRINTK(PROBE, ERR,
+		 "Unable to allocate transmit descriptor memory\n");
 		return -ENOMEM;
 	}
 	memset(txdr->desc, 0, txdr->size);
@@ -750,6 +762,8 @@ ixgb_setup_rx_resources(struct ixgb_adap
 	size = sizeof(struct ixgb_buffer) * rxdr->count;
 	rxdr->buffer_info = vmalloc(size);
 	if(!rxdr->buffer_info) {
+		DPRINTK(PROBE, ERR,
+		 "Unable to allocate receive descriptor ring\n");
 		return -ENOMEM;
 	}
 	memset(rxdr->buffer_info, 0, size);
@@ -763,6 +777,8 @@ ixgb_setup_rx_resources(struct ixgb_adap
 
 	if(!rxdr->desc) {
 		vfree(rxdr->buffer_info);
+		DPRINTK(PROBE, ERR,
+		 "Unable to allocate receive descriptors\n");
 		return -ENOMEM;
 	}
 	memset(rxdr->desc, 0, rxdr->size);
@@ -1112,8 +1128,8 @@ ixgb_watchdog(unsigned long data)
 
 	if(adapter->hw.link_up) {
 		if(!netif_carrier_ok(netdev)) {
-			printk(KERN_INFO "ixgb: %s NIC Link is Up %d Mbps %s\n",
-				   netdev->name, 10000, "Full Duplex");
+			DPRINTK(LINK, INFO,
+			 "NIC Link is Up 10000 Mbps Full Duplex\n");
 			adapter->link_speed = 10000;
 			adapter->link_duplex = FULL_DUPLEX;
 			netif_carrier_on(netdev);
@@ -1123,9 +1139,7 @@ ixgb_watchdog(unsigned long data)
 		if(netif_carrier_ok(netdev)) {
 			adapter->link_speed = 0;
 			adapter->link_duplex = 0;
-			printk(KERN_INFO
-				   "ixgb: %s NIC Link is Down\n",
-				   netdev->name);
+			DPRINTK(LINK, INFO, "NIC Link is Down\n");
 			netif_carrier_off(netdev);
 			netif_stop_queue(netdev);
 
@@ -1486,7 +1500,7 @@ ixgb_change_mtu(struct net_device *netde
 
 	if((max_frame < IXGB_MIN_ENET_FRAME_SIZE_WITHOUT_FCS + ENET_FCS_LENGTH)
 	   || (max_frame > IXGB_MAX_JUMBO_FRAME_SIZE + ENET_FCS_LENGTH)) {
-		IXGB_ERR("Invalid MTU setting\n");
+		DPRINTK(PROBE, ERR, "Invalid MTU setting %d\n", new_mtu);
 		return -EINVAL;
 	}
 


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

* [PATCH 03/11] ixgb: Fix hard coded numbers
  2006-04-22  1:00 [PATCH 00/11] ixgb: driver update (upstream) Jeff Kirsher
  2006-04-22  1:00 ` [PATCH 01/11] ixgb: Fix compilation errors by initializing variables Jeff Kirsher
  2006-04-22  1:00 ` [PATCH 02/11] ixgb: Fix the use of dprintk rather than printk Jeff Kirsher
@ 2006-04-22  1:00 ` Jeff Kirsher
  2006-04-22  9:17   ` Francois Romieu
  2006-04-22  1:00 ` [PATCH 04/11] ixgb: Fix duplicate code Jeff Kirsher
                   ` (8 subsequent siblings)
  11 siblings, 1 reply; 20+ messages in thread
From: Jeff Kirsher @ 2006-04-22  1:00 UTC (permalink / raw)
  To: Jeff Garzik, netdev, David Miller; +Cc: John Rociak, Jesse Brandeburg


- removed hard coded numbers and used constants instead

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---

 drivers/net/ixgb/ixgb_ethtool.c |    4 +++-
 drivers/net/ixgb/ixgb_main.c    |    8 ++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c
index e8d83de..978be30 100644
--- a/drivers/net/ixgb/ixgb_ethtool.c
+++ b/drivers/net/ixgb/ixgb_ethtool.c
@@ -44,6 +44,8 @@ extern void ixgb_free_rx_resources(struc
 extern void ixgb_free_tx_resources(struct ixgb_adapter *adapter);
 extern void ixgb_update_stats(struct ixgb_adapter *adapter);
 
+#define IXGB_ALL_RAR_ENTRIES 16
+
 struct ixgb_stats {
 	char stat_string[ETH_GSTRING_LEN];
 	int sizeof_stat;
@@ -317,7 +319,7 @@ ixgb_get_regs(struct net_device *netdev,
 	*reg++ = IXGB_READ_REG(hw, RXCSUM);	/*  20 */
 
 	/* there are 16 RAR entries in hardware, we only use 3 */
-	for(i = 0; i < 16; i++) {
+	for(i = 0; i < IXGB_ALL_RAR_ENTRIES; i++) {
 		*reg++ = IXGB_READ_REG_ARRAY(hw, RAL, (i << 1)); /*21,...,51 */
 		*reg++ = IXGB_READ_REG_ARRAY(hw, RAH, (i << 1)); /*22,...,52 */
 	}
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index 6f8fd6f..f468d5d 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -1227,11 +1227,11 @@ ixgb_tso(struct ixgb_adapter *adapter, s
 		if(++i == adapter->tx_ring.count) i = 0;
 		adapter->tx_ring.next_to_use = i;
 
-		return 1;
+		return TRUE;
 	}
 #endif
 
-	return 0;
+	return FALSE;
 }
 
 static inline boolean_t
@@ -1413,7 +1413,7 @@ ixgb_xmit_frame(struct sk_buff *skb, str
 	if(unlikely(IXGB_DESC_UNUSED(&adapter->tx_ring) < DESC_NEEDED)) {
 		netif_stop_queue(netdev);
 		spin_unlock_irqrestore(&adapter->tx_lock, flags);
-		return 1;
+		return NETDEV_TX_BUSY;
 	}
 	spin_unlock_irqrestore(&adapter->tx_lock, flags);
 
@@ -1440,7 +1440,7 @@ ixgb_xmit_frame(struct sk_buff *skb, str
 
 	netdev->trans_start = jiffies;
 
-	return 0;
+	return NETDEV_TX_OK;
 }
 
 /**


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

* [PATCH 04/11] ixgb: Fix duplicate code
  2006-04-22  1:00 [PATCH 00/11] ixgb: driver update (upstream) Jeff Kirsher
                   ` (2 preceding siblings ...)
  2006-04-22  1:00 ` [PATCH 03/11] ixgb: Fix hard coded numbers Jeff Kirsher
@ 2006-04-22  1:00 ` Jeff Kirsher
  2006-04-22  1:00 ` [PATCH 05/11] ixgb: Fix timeout code Jeff Kirsher
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 20+ messages in thread
From: Jeff Kirsher @ 2006-04-22  1:00 UTC (permalink / raw)
  To: Jeff Garzik, netdev, David Miller; +Cc: John Rociak, Jesse Brandeburg


- created function ixgb_set_speed_duplex to remove duplicate code

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---

 drivers/net/ixgb/ixgb_ethtool.c |   35 ++++++++++++++---------------------
 1 files changed, 14 insertions(+), 21 deletions(-)

diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c
index 978be30..55a54bb 100644
--- a/drivers/net/ixgb/ixgb_ethtool.c
+++ b/drivers/net/ixgb/ixgb_ethtool.c
@@ -119,6 +119,16 @@ ixgb_get_settings(struct net_device *net
 	return 0;
 }
 
+static void ixgb_set_speed_duplex(struct net_device *netdev)
+{
+	struct ixgb_adapter *adapter = netdev_priv(netdev);
+	/* be optimistic about our link, since we were up before */
+	adapter->link_speed = 10000;
+	adapter->link_duplex = FULL_DUPLEX;
+	netif_carrier_on(netdev);
+	netif_wake_queue(netdev);
+}
+
 static int
 ixgb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
 {
@@ -132,12 +142,7 @@ ixgb_set_settings(struct net_device *net
 		ixgb_down(adapter, TRUE);
 		ixgb_reset(adapter);
 		ixgb_up(adapter);
-		/* be optimistic about our link, since we were up before */
-		adapter->link_speed = 10000;
-		adapter->link_duplex = FULL_DUPLEX;
-		netif_carrier_on(netdev);
-		netif_wake_queue(netdev);
-		
+		ixgb_set_speed_duplex(netdev);
 	} else
 		ixgb_reset(adapter);
 
@@ -185,11 +190,7 @@ ixgb_set_pauseparam(struct net_device *n
 	if(netif_running(adapter->netdev)) {
 		ixgb_down(adapter, TRUE);
 		ixgb_up(adapter);
-		/* be optimistic about our link, since we were up before */
-		adapter->link_speed = 10000;
-		adapter->link_duplex = FULL_DUPLEX;
-		netif_carrier_on(netdev);
-		netif_wake_queue(netdev);
+		ixgb_set_speed_duplex(netdev);
 	} else
 		ixgb_reset(adapter);
 		
@@ -214,11 +215,7 @@ ixgb_set_rx_csum(struct net_device *netd
 	if(netif_running(netdev)) {
 		ixgb_down(adapter,TRUE);
 		ixgb_up(adapter);
-		/* be optimistic about our link, since we were up before */
-		adapter->link_speed = 10000;
-		adapter->link_duplex = FULL_DUPLEX;
-		netif_carrier_on(netdev);
-		netif_wake_queue(netdev);
+		ixgb_set_speed_duplex(netdev);
 	} else
 		ixgb_reset(adapter);
 	return 0;
@@ -609,11 +606,7 @@ ixgb_set_ringparam(struct net_device *ne
 		adapter->tx_ring = tx_new;
 		if((err = ixgb_up(adapter)))
 			return err;
-		/* be optimistic about our link, since we were up before */
-		adapter->link_speed = 10000;
-		adapter->link_duplex = FULL_DUPLEX;
-		netif_carrier_on(netdev);
-		netif_wake_queue(netdev);
+		ixgb_set_speed_duplex(netdev);
 	}
 
 	return 0;


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

* [PATCH 05/11] ixgb: Fix timeout code
  2006-04-22  1:00 [PATCH 00/11] ixgb: driver update (upstream) Jeff Kirsher
                   ` (3 preceding siblings ...)
  2006-04-22  1:00 ` [PATCH 04/11] ixgb: Fix duplicate code Jeff Kirsher
@ 2006-04-22  1:00 ` Jeff Kirsher
  2006-04-22  1:00 ` [PATCH 06/11] ixgb: Fix TSO Jeff Kirsher
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 20+ messages in thread
From: Jeff Kirsher @ 2006-04-22  1:00 UTC (permalink / raw)
  To: Jeff Garzik, netdev, David Miller; +Cc: John Rociak, Jesse Brandeburg


- aligned timeout code to match e1000

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---

 drivers/net/ixgb/ixgb.h         |    1 +
 drivers/net/ixgb/ixgb_ethtool.c |    1 +
 drivers/net/ixgb/ixgb_main.c    |   29 +++++++++++++++++++++++++----
 3 files changed, 27 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ixgb/ixgb.h b/drivers/net/ixgb/ixgb.h
index a696c33..f23e04f 100644
--- a/drivers/net/ixgb/ixgb.h
+++ b/drivers/net/ixgb/ixgb.h
@@ -180,6 +180,7 @@ struct ixgb_adapter {
 	uint64_t hw_csum_tx_good;
 	uint64_t hw_csum_tx_error;
 	uint32_t tx_int_delay;
+	uint32_t tx_timeout_count;
 	boolean_t tx_int_delay_enable;
 	boolean_t detect_tx_hung;
 
diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c
index 55a54bb..1e06f26 100644
--- a/drivers/net/ixgb/ixgb_ethtool.c
+++ b/drivers/net/ixgb/ixgb_ethtool.c
@@ -78,6 +78,7 @@ static struct ixgb_stats ixgb_gstrings_s
 	{"tx_heartbeat_errors", IXGB_STAT(net_stats.tx_heartbeat_errors)},
 	{"tx_window_errors", IXGB_STAT(net_stats.tx_window_errors)},
 	{"tx_deferred_ok", IXGB_STAT(stats.dc)},
+	{"tx_timeout_count", IXGB_STAT(tx_timeout_count) },
 	{"rx_long_length_errors", IXGB_STAT(stats.roc)},
 	{"rx_short_length_errors", IXGB_STAT(stats.ruc)},
 #ifdef NETIF_F_TSO
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index f468d5d..93a518f 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -423,7 +423,7 @@ ixgb_probe(struct pci_dev *pdev,
 	netdev->change_mtu = &ixgb_change_mtu;
 	ixgb_set_ethtool_ops(netdev);
 	netdev->tx_timeout = &ixgb_tx_timeout;
-	netdev->watchdog_timeo = HZ;
+	netdev->watchdog_timeo = 5 * HZ;
 #ifdef CONFIG_IXGB_NAPI
 	netdev->poll = &ixgb_clean;
 	netdev->weight = 64;
@@ -1462,6 +1462,7 @@ ixgb_tx_timeout_task(struct net_device *
 {
 	struct ixgb_adapter *adapter = netdev_priv(netdev);
 
+	adapter->tx_timeout_count++;
 	ixgb_down(adapter, TRUE);
 	ixgb_up(adapter);
 }
@@ -1791,11 +1792,31 @@ ixgb_clean_tx_irq(struct ixgb_adapter *a
 		/* detect a transmit hang in hardware, this serializes the
 		 * check with the clearing of time_stamp and movement of i */
 		adapter->detect_tx_hung = FALSE;
-		if(tx_ring->buffer_info[i].dma &&
-		   time_after(jiffies, tx_ring->buffer_info[i].time_stamp + HZ)
+		if(tx_ring->buffer_info[eop].dma &&
+		   time_after(jiffies, tx_ring->buffer_info[eop].time_stamp + HZ)
 		   && !(IXGB_READ_REG(&adapter->hw, STATUS) &
-			IXGB_STATUS_TXOFF))
+				IXGB_STATUS_TXOFF)) {
+			/* detected Tx unit hang */
+			DPRINTK(DRV, ERR, "Detected Tx Unit Hang\n"
+					"  TDH				  <%x>\n"
+					"  TDT				  <%x>\n"
+					"  next_to_use		  <%x>\n"
+					"  next_to_clean		<%x>\n"
+					"buffer_info[next_to_clean]\n"
+					"  time_stamp		   <%lx>\n"
+					"  next_to_watch		<%x>\n"
+					"  jiffies			  <%lx>\n"
+					"  next_to_watch.status <%x>\n",
+				IXGB_READ_REG(&adapter->hw, TDH),
+				IXGB_READ_REG(&adapter->hw, TDT),
+				tx_ring->next_to_use,
+				tx_ring->next_to_clean,
+				tx_ring->buffer_info[eop].time_stamp,
+				eop,
+				jiffies,
+				eop_desc->status);
 			netif_stop_queue(netdev);
+		}
 	}
 
 	return cleaned;


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

* [PATCH 06/11] ixgb: Fix TSO
  2006-04-22  1:00 [PATCH 00/11] ixgb: driver update (upstream) Jeff Kirsher
                   ` (4 preceding siblings ...)
  2006-04-22  1:00 ` [PATCH 05/11] ixgb: Fix timeout code Jeff Kirsher
@ 2006-04-22  1:00 ` Jeff Kirsher
  2006-04-22  1:00 ` [PATCH 07/11] ixgb: Fixed flow control parameters Jeff Kirsher
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 20+ messages in thread
From: Jeff Kirsher @ 2006-04-22  1:00 UTC (permalink / raw)
  To: Jeff Garzik, netdev, David Miller; +Cc: John Rociak, Jesse Brandeburg


- this fixes an issue of premature desc writeback by hardware

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---

 drivers/net/ixgb/ixgb_main.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index 93a518f..9d262c8 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -1280,6 +1280,7 @@ ixgb_tx_map(struct ixgb_adapter *adapter
 	struct ixgb_buffer *buffer_info;
 	int len = skb->len;
 	unsigned int offset = 0, size, count = 0, i;
+	unsigned int mss = skb_shinfo(skb)->tso_size;
 
 	unsigned int nr_frags = skb_shinfo(skb)->nr_frags;
 	unsigned int f;
@@ -1291,6 +1292,11 @@ ixgb_tx_map(struct ixgb_adapter *adapter
 	while(len) {
 		buffer_info = &tx_ring->buffer_info[i];
 		size = min(len, IXGB_MAX_JUMBO_FRAME_SIZE);
+		/* Workaround for premature desc write-backs
+		 * in TSO mode.  Append 4-byte sentinel desc */
+		if(unlikely(mss && !nr_frags && size == len && size > 8))
+			size -= 4;
+
 		buffer_info->length = size;
 		buffer_info->dma =
 			pci_map_single(adapter->pdev,
@@ -1315,6 +1321,12 @@ ixgb_tx_map(struct ixgb_adapter *adapter
 		while(len) {
 			buffer_info = &tx_ring->buffer_info[i];
 			size = min(len, IXGB_MAX_JUMBO_FRAME_SIZE);
+			/* Workaround for premature desc write-backs
+			 * in TSO mode.  Append 4-byte sentinel desc */
+			if(unlikely(mss && (f == (nr_frags-1)) && (size == len)
+						&& (size > 8)))
+				size -= 4;
+
 			buffer_info->length = size;
 			buffer_info->dma =
 				pci_map_page(adapter->pdev,
@@ -1392,7 +1404,8 @@ ixgb_tx_queue(struct ixgb_adapter *adapt
 #define TXD_USE_COUNT(S) (((S) >> IXGB_MAX_TXD_PWR) + \
 			 (((S) & (IXGB_MAX_DATA_PER_TXD - 1)) ? 1 : 0))
 #define DESC_NEEDED TXD_USE_COUNT(IXGB_MAX_DATA_PER_TXD) + \
-	MAX_SKB_FRAGS * TXD_USE_COUNT(PAGE_SIZE) + 1
+	MAX_SKB_FRAGS * TXD_USE_COUNT(PAGE_SIZE) + 1 \
+	/* one more for TSO workaround */ + 1
 
 static int
 ixgb_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
@@ -1430,7 +1443,7 @@ ixgb_xmit_frame(struct sk_buff *skb, str
 		return NETDEV_TX_OK;
 	}
 
-	if (tso)
+	if (likely(tso))
 		tx_flags |= IXGB_TX_FLAGS_TSO;
 	else if(ixgb_tx_csum(adapter, skb))
 		tx_flags |= IXGB_TX_FLAGS_CSUM;


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

* [PATCH 07/11] ixgb: Fixed flow control parameters
  2006-04-22  1:00 [PATCH 00/11] ixgb: driver update (upstream) Jeff Kirsher
                   ` (5 preceding siblings ...)
  2006-04-22  1:00 ` [PATCH 06/11] ixgb: Fix TSO Jeff Kirsher
@ 2006-04-22  1:00 ` Jeff Kirsher
  2006-04-22  1:00 ` [PATCH 08/11] ixgb: Add support for copper 10GbE Jeff Kirsher
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 20+ messages in thread
From: Jeff Kirsher @ 2006-04-22  1:00 UTC (permalink / raw)
  To: Jeff Garzik, netdev, David Miller; +Cc: John Rociak, Jesse Brandeburg


- make default flow control only have *sending* of flow control packets enabled
- fix to disable / enable flow control correctly

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---

 drivers/net/ixgb/ixgb_param.c |   22 ++++++++++------------
 1 files changed, 10 insertions(+), 12 deletions(-)

diff --git a/drivers/net/ixgb/ixgb_param.c b/drivers/net/ixgb/ixgb_param.c
index 8a83dfd..39e0a47 100644
--- a/drivers/net/ixgb/ixgb_param.c
+++ b/drivers/net/ixgb/ixgb_param.c
@@ -137,7 +137,7 @@ IXGB_PARAM(RxFCLowThresh, "Receive Flow 
  *
  * Valid Range: 1 - 65535 
  *
- * Default Value:  256 (0x100)
+ * Default Value:  65535 (0xffff) (we'll send an xon if we recover)
  */
 
 IXGB_PARAM(FCReqTimeout, "Flow Control Request Timeout");
@@ -165,8 +165,6 @@ IXGB_PARAM(IntDelayEnable, "Transmit Int
 
 #define XSUMRX_DEFAULT		 OPTION_ENABLED
 
-#define FLOW_CONTROL_FULL	   ixgb_fc_full
-#define FLOW_CONTROL_DEFAULT  FLOW_CONTROL_FULL
 #define DEFAULT_FCRTL	  		0x28000
 #define DEFAULT_FCRTH			0x30000
 #define MIN_FCRTL			      0
@@ -174,9 +172,9 @@ IXGB_PARAM(IntDelayEnable, "Transmit Int
 #define MIN_FCRTH			      8
 #define MAX_FCRTH			0x3FFF0
 
-#define DEFAULT_FCPAUSE		  	0x100	/* this may be too long */
 #define MIN_FCPAUSE			      1
 #define MAX_FCPAUSE			 0xffff
+#define DEFAULT_FCPAUSE		  	 0xFFFF /* this may be too long */
 
 struct ixgb_option {
 	enum { enable_option, range_option, list_option } type;
@@ -336,7 +334,7 @@ ixgb_check_options(struct ixgb_adapter *
 			.type = list_option,
 			.name = "Flow Control",
 			.err  = "reading default settings from EEPROM",
-			.def  = ixgb_fc_full,
+			.def  = ixgb_fc_tx_pause,
 			.arg  = { .l = { .nr = LIST_LEN(fc_list),
 					 .p = fc_list }}
 		};
@@ -365,8 +363,8 @@ ixgb_check_options(struct ixgb_adapter *
 		} else {
 			adapter->hw.fc.high_water = opt.def;
 		}
-		if(!(adapter->hw.fc.type & ixgb_fc_rx_pause) )
-			printk (KERN_INFO 
+		if( !(adapter->hw.fc.type & ixgb_fc_tx_pause) )
+			printk (KERN_INFO
 				"Ignoring RxFCHighThresh when no RxFC\n");
 	}
 	{ /* Receive Flow Control Low Threshold */
@@ -385,8 +383,8 @@ ixgb_check_options(struct ixgb_adapter *
 		} else {
 			adapter->hw.fc.low_water = opt.def;
 		}
-		if(!(adapter->hw.fc.type & ixgb_fc_rx_pause) )
-			printk (KERN_INFO 
+		if( !(adapter->hw.fc.type & ixgb_fc_tx_pause) )
+			printk (KERN_INFO
 				"Ignoring RxFCLowThresh when no RxFC\n");
 	}
 	{ /* Flow Control Pause Time Request*/
@@ -406,12 +404,12 @@ ixgb_check_options(struct ixgb_adapter *
 		} else {
 			adapter->hw.fc.pause_time = opt.def;
 		}
-		if(!(adapter->hw.fc.type & ixgb_fc_rx_pause) )
-			printk (KERN_INFO 
+		if( !(adapter->hw.fc.type & ixgb_fc_tx_pause) )
+			printk (KERN_INFO
 				"Ignoring FCReqTimeout when no RxFC\n");
 	}
 	/* high low and spacing check for rx flow control thresholds */
-	if (adapter->hw.fc.type & ixgb_fc_rx_pause) {
+	if (adapter->hw.fc.type & ixgb_fc_tx_pause) {
 		/* high must be greater than low */
 		if (adapter->hw.fc.high_water < (adapter->hw.fc.low_water + 8)) {
 			/* set defaults */


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

* [PATCH 08/11] ixgb: Add support for copper 10GbE
  2006-04-22  1:00 [PATCH 00/11] ixgb: driver update (upstream) Jeff Kirsher
                   ` (6 preceding siblings ...)
  2006-04-22  1:00 ` [PATCH 07/11] ixgb: Fixed flow control parameters Jeff Kirsher
@ 2006-04-22  1:00 ` Jeff Kirsher
  2006-04-22  1:00 ` [PATCH 09/11] ixgb: Add performance enhancements to the buffer_info struct Jeff Kirsher
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 20+ messages in thread
From: Jeff Kirsher @ 2006-04-22  1:00 UTC (permalink / raw)
  To: Jeff Garzik, netdev, David Miller; +Cc: John Rociak, Jesse Brandeburg


- Add support for Copper 10GbE device ID 109E

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---

 drivers/net/ixgb/ixgb_hw.h   |    1 +
 drivers/net/ixgb/ixgb_ids.h  |    4 +++-
 drivers/net/ixgb/ixgb_main.c |    7 +++++--
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ixgb/ixgb_hw.h b/drivers/net/ixgb/ixgb_hw.h
index 382c630..19513c6 100644
--- a/drivers/net/ixgb/ixgb_hw.h
+++ b/drivers/net/ixgb/ixgb_hw.h
@@ -57,6 +57,7 @@ typedef enum {
 typedef enum {
 	ixgb_media_type_unknown = 0,
 	ixgb_media_type_fiber = 1,
+	ixgb_media_type_copper = 2,
 	ixgb_num_media_types
 } ixgb_media_type;
 
diff --git a/drivers/net/ixgb/ixgb_ids.h b/drivers/net/ixgb/ixgb_ids.h
index aee207e..e119c05 100644
--- a/drivers/net/ixgb/ixgb_ids.h
+++ b/drivers/net/ixgb/ixgb_ids.h
@@ -43,6 +43,8 @@
 #define IXGB_SUBDEVICE_ID_A11F      0xA11F   
 #define IXGB_SUBDEVICE_ID_A01F      0xA01F   
 
-#endif /* #ifndef _IXGB_IDS_H_ */
+#define IXGB_DEVICE_ID_82597EX_CX4   0x109E
+#define IXGB_SUBDEVICE_ID_A00C  0xA00C
 
+#endif /* #ifndef _IXGB_IDS_H_ */
 /* End of File */
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index 9d262c8..be7b43b 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -67,6 +67,8 @@ static char ixgb_copyright[] = "Copyrigh
 static struct pci_device_id ixgb_pci_tbl[] = {
 	{INTEL_VENDOR_ID, IXGB_DEVICE_ID_82597EX,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+	{INTEL_VENDOR_ID, IXGB_DEVICE_ID_82597EX_CX4,
+	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{INTEL_VENDOR_ID, IXGB_DEVICE_ID_82597EX_SR,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{INTEL_VENDOR_ID, IXGB_DEVICE_ID_82597EX_LR,  
@@ -570,8 +572,9 @@ ixgb_sw_init(struct ixgb_adapter *adapte
 	hw->max_frame_size = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH;
 
 	if((hw->device_id == IXGB_DEVICE_ID_82597EX)
-	   ||(hw->device_id == IXGB_DEVICE_ID_82597EX_LR)
-	   ||(hw->device_id == IXGB_DEVICE_ID_82597EX_SR))
+	   || (hw->device_id == IXGB_DEVICE_ID_82597EX_CX4)
+	   || (hw->device_id == IXGB_DEVICE_ID_82597EX_LR)
+	   || (hw->device_id == IXGB_DEVICE_ID_82597EX_SR))
 			hw->mac_type = ixgb_82597;
 	else {
 		/* should never have loaded on this device */


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

* [PATCH 09/11] ixgb: Add performance enhancements to the buffer_info struct
  2006-04-22  1:00 [PATCH 00/11] ixgb: driver update (upstream) Jeff Kirsher
                   ` (7 preceding siblings ...)
  2006-04-22  1:00 ` [PATCH 08/11] ixgb: Add support for copper 10GbE Jeff Kirsher
@ 2006-04-22  1:00 ` Jeff Kirsher
  2006-04-22  1:00 ` [PATCH 10/11] ixgb: clean up whitespace Jeff Kirsher
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 20+ messages in thread
From: Jeff Kirsher @ 2006-04-22  1:00 UTC (permalink / raw)
  To: Jeff Garzik, netdev, David Miller; +Cc: John Rociak, Jesse Brandeburg


Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---

 drivers/net/ixgb/ixgb_main.c |   36 ++++++++++++++++++++----------------
 1 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index be7b43b..443d675 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -922,17 +922,20 @@ ixgb_unmap_and_free_tx_resource(struct i
 					struct ixgb_buffer *buffer_info)
 {
 	struct pci_dev *pdev = adapter->pdev;
-	if(buffer_info->dma) {
-		pci_unmap_page(pdev,
-			   buffer_info->dma,
-			   buffer_info->length,
-			   PCI_DMA_TODEVICE);
-		buffer_info->dma = 0;
-	}
-	if(buffer_info->skb) {
+
+	if (buffer_info->dma)
+		pci_unmap_page(pdev, buffer_info->dma, buffer_info->length,
+					   PCI_DMA_TODEVICE);
+
+	if (buffer_info->skb)
 		dev_kfree_skb_any(buffer_info->skb);
-		buffer_info->skb = NULL;
-	}
+
+	buffer_info->skb = NULL;
+	buffer_info->dma = 0;
+	buffer_info->time_stamp = 0;
+	/* these fields must always be initialized in tx
+	 * buffer_info->length = 0;
+	 * buffer_info->next_to_watch = 0; */
 }
 
 /**
@@ -1307,6 +1310,7 @@ ixgb_tx_map(struct ixgb_adapter *adapter
 				size,
 				PCI_DMA_TODEVICE);
 		buffer_info->time_stamp = jiffies;
+		buffer_info->next_to_watch = 0;
 
 		len -= size;
 		offset += size;
@@ -1338,6 +1342,7 @@ ixgb_tx_map(struct ixgb_adapter *adapter
 					size,
 					PCI_DMA_TODEVICE);
 			buffer_info->time_stamp = jiffies;
+			buffer_info->next_to_watch = 0;
 
 			len -= size;
 			offset += size;
@@ -1909,6 +1914,7 @@ ixgb_clean_rx_irq(struct ixgb_adapter *a
 #endif
 		status = rx_desc->status;
 		skb = buffer_info->skb;
+		buffer_info->skb = NULL;
 
 		prefetch(skb->data);
 
@@ -1982,7 +1988,6 @@ ixgb_clean_rx_irq(struct ixgb_adapter *a
 rxdesc_done:
 		/* clean up descriptor, might be written over by hw */
 		rx_desc->status = 0;
-		buffer_info->skb = NULL;
 
 		/* use prefetched values */
 		rx_desc = next_rxd;
@@ -2041,11 +2046,10 @@ ixgb_alloc_rx_buffers(struct ixgb_adapte
 
 		buffer_info->skb = skb;
 		buffer_info->length = adapter->rx_buffer_len;
-		buffer_info->dma =
-			pci_map_single(pdev,
-				   skb->data,
-				   adapter->rx_buffer_len,
-				   PCI_DMA_FROMDEVICE);
+		buffer_info->dma = pci_map_single(pdev,
+										  skb->data,
+										  adapter->rx_buffer_len,
+										  PCI_DMA_FROMDEVICE);
 
 		rx_desc->buff_addr = cpu_to_le64(buffer_info->dma);
 		/* guarantee DD bit not set now before h/w gets descriptor


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

* [PATCH 10/11] ixgb: clean up whitespace
  2006-04-22  1:00 [PATCH 00/11] ixgb: driver update (upstream) Jeff Kirsher
                   ` (8 preceding siblings ...)
  2006-04-22  1:00 ` [PATCH 09/11] ixgb: Add performance enhancements to the buffer_info struct Jeff Kirsher
@ 2006-04-22  1:00 ` Jeff Kirsher
  2006-04-22  1:00 ` [PATCH 11/11] ixgb: Add prefetch Jeff Kirsher
  2006-04-26 10:22 ` [PATCH 00/11] ixgb: driver update (upstream) Jeff Garzik
  11 siblings, 0 replies; 20+ messages in thread
From: Jeff Kirsher @ 2006-04-22  1:00 UTC (permalink / raw)
  To: Jeff Garzik, netdev, David Miller; +Cc: John Rociak, Jesse Brandeburg


- remove trailing whitespace

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---

 drivers/net/ixgb/ixgb.h         |   28 ++++++++--------
 drivers/net/ixgb/ixgb_ethtool.c |   68 ++++++++++++++++++++-------------------
 drivers/net/ixgb/ixgb_main.c    |   62 ++++++++++++++++++------------------
 drivers/net/ixgb/ixgb_osdep.h   |   26 +++++++--------
 4 files changed, 92 insertions(+), 92 deletions(-)

diff --git a/drivers/net/ixgb/ixgb.h b/drivers/net/ixgb/ixgb.h
index f23e04f..e968f64 100644
--- a/drivers/net/ixgb/ixgb.h
+++ b/drivers/net/ixgb/ixgb.h
@@ -1,25 +1,25 @@
 /*******************************************************************************
 
-  
+
   Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
-  
-  This program is free software; you can redistribute it and/or modify it 
-  under the terms of the GNU General Public License as published by the Free 
-  Software Foundation; either version 2 of the License, or (at your option) 
+
+  This program is free software; you can redistribute it and/or modify it
+  under the terms of the GNU General Public License as published by the Free
+  Software Foundation; either version 2 of the License, or (at your option)
   any later version.
-  
-  This program is distributed in the hope that it will be useful, but WITHOUT 
-  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+
+  This program is distributed in the hope that it will be useful, but WITHOUT
+  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
-  
+
   You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc., 59 
+  this program; if not, write to the Free Software Foundation, Inc., 59
   Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-  
+
   The full GNU General Public License is included in this distribution in the
   file called LICENSE.
-  
+
   Contact Information:
   Linux NICS <linux.nics@intel.com>
   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
@@ -97,7 +97,7 @@ struct ixgb_adapter;
 #define MIN_TXD	  64
 
 /* hardware cannot reliably support more than 512 descriptors owned by
- * hardware descrioptor cache otherwise an unreliable ring under heavy 
+ * hardware descrioptor cache otherwise an unreliable ring under heavy
  * recieve load may result */
 /* #define DEFAULT_RXD	   1024 */
 /* #define MAX_RXD	   4096 */
diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c
index 1e06f26..2388021 100644
--- a/drivers/net/ixgb/ixgb_ethtool.c
+++ b/drivers/net/ixgb/ixgb_ethtool.c
@@ -1,25 +1,25 @@
 /*******************************************************************************
 
-  
+
   Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
-  
-  This program is free software; you can redistribute it and/or modify it 
-  under the terms of the GNU General Public License as published by the Free 
-  Software Foundation; either version 2 of the License, or (at your option) 
+
+  This program is free software; you can redistribute it and/or modify it
+  under the terms of the GNU General Public License as published by the Free
+  Software Foundation; either version 2 of the License, or (at your option)
   any later version.
-  
-  This program is distributed in the hope that it will be useful, but WITHOUT 
-  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+
+  This program is distributed in the hope that it will be useful, but WITHOUT
+  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
-  
+
   You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc., 59 
+  this program; if not, write to the Free Software Foundation, Inc., 59
   Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-  
+
   The full GNU General Public License is included in this distribution in the
   file called LICENSE.
-  
+
   Contact Information:
   Linux NICS <linux.nics@intel.com>
   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
@@ -138,7 +138,7 @@ ixgb_set_settings(struct net_device *net
 	if(ecmd->autoneg == AUTONEG_ENABLE ||
 	   ecmd->speed + ecmd->duplex != SPEED_10000 + DUPLEX_FULL)
 		return -EINVAL;
-	
+
 	if(netif_running(adapter->netdev)) {
 		ixgb_down(adapter, TRUE);
 		ixgb_reset(adapter);
@@ -156,9 +156,9 @@ ixgb_get_pauseparam(struct net_device *n
 {
 	struct ixgb_adapter *adapter = netdev_priv(netdev);
 	struct ixgb_hw *hw = &adapter->hw;
-	
+
 	pause->autoneg = AUTONEG_DISABLE;
-		
+
 	if(hw->fc.type == ixgb_fc_rx_pause)
 		pause->rx_pause = 1;
 	else if(hw->fc.type == ixgb_fc_tx_pause)
@@ -175,7 +175,7 @@ ixgb_set_pauseparam(struct net_device *n
 {
 	struct ixgb_adapter *adapter = netdev_priv(netdev);
 	struct ixgb_hw *hw = &adapter->hw;
-	
+
 	if(pause->autoneg == AUTONEG_ENABLE)
 		return -EINVAL;
 
@@ -194,7 +194,7 @@ ixgb_set_pauseparam(struct net_device *n
 		ixgb_set_speed_duplex(netdev);
 	} else
 		ixgb_reset(adapter);
-		
+
 	return 0;
 }
 
@@ -221,7 +221,7 @@ ixgb_set_rx_csum(struct net_device *netd
 		ixgb_reset(adapter);
 	return 0;
 }
-	
+
 static uint32_t
 ixgb_get_tx_csum(struct net_device *netdev)
 {
@@ -248,7 +248,7 @@ ixgb_set_tso(struct net_device *netdev, 
 	else
 		netdev->features &= ~NETIF_F_TSO;
 	return 0;
-} 
+}
 #endif /* NETIF_F_TSO */
 
 static uint32_t
@@ -267,7 +267,7 @@ ixgb_set_msglevel(struct net_device *net
 
 #define IXGB_GET_STAT(_A_, _R_) _A_->stats._R_
 
-static int 
+static int
 ixgb_get_regs_len(struct net_device *netdev)
 {
 #define IXGB_REG_DUMP_LEN  136*sizeof(uint32_t)
@@ -511,7 +511,7 @@ ixgb_set_eeprom(struct net_device *netde
 	if((eeprom->offset + eeprom->len) & 1) {
 		/* need read/modify/write of last changed EEPROM word */
 		/* only the first byte of the word is being modified */
-		eeprom_buff[last_word - first_word] 
+		eeprom_buff[last_word - first_word]
 			= ixgb_read_eeprom(hw, last_word);
 	}
 
@@ -550,7 +550,7 @@ ixgb_get_ringparam(struct net_device *ne
 	struct ixgb_desc_ring *txdr = &adapter->tx_ring;
 	struct ixgb_desc_ring *rxdr = &adapter->rx_ring;
 
-	ring->rx_max_pending = MAX_RXD; 
+	ring->rx_max_pending = MAX_RXD;
 	ring->tx_max_pending = MAX_TXD;
 	ring->rx_mini_max_pending = 0;
 	ring->rx_jumbo_max_pending = 0;
@@ -560,7 +560,7 @@ ixgb_get_ringparam(struct net_device *ne
 	ring->rx_jumbo_pending = 0;
 }
 
-static int 
+static int
 ixgb_set_ringparam(struct net_device *netdev,
 		struct ethtool_ringparam *ring)
 {
@@ -573,7 +573,7 @@ ixgb_set_ringparam(struct net_device *ne
 	tx_old = adapter->tx_ring;
 	rx_old = adapter->rx_ring;
 
-	if((ring->rx_mini_pending) || (ring->rx_jumbo_pending)) 
+	if((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
 		return -EINVAL;
 
 	if(netif_running(adapter->netdev))
@@ -581,11 +581,11 @@ ixgb_set_ringparam(struct net_device *ne
 
 	rxdr->count = max(ring->rx_pending,(uint32_t)MIN_RXD);
 	rxdr->count = min(rxdr->count,(uint32_t)MAX_RXD);
-	IXGB_ROUNDUP(rxdr->count, IXGB_REQ_RX_DESCRIPTOR_MULTIPLE); 
+	IXGB_ROUNDUP(rxdr->count, IXGB_REQ_RX_DESCRIPTOR_MULTIPLE);
 
 	txdr->count = max(ring->tx_pending,(uint32_t)MIN_TXD);
 	txdr->count = min(txdr->count,(uint32_t)MAX_TXD);
-	IXGB_ROUNDUP(txdr->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE); 
+	IXGB_ROUNDUP(txdr->count, IXGB_REQ_TX_DESCRIPTOR_MULTIPLE);
 
 	if(netif_running(adapter->netdev)) {
 		/* Try to get new resources before deleting old */
@@ -667,14 +667,14 @@ ixgb_phys_id(struct net_device *netdev, 
 	return 0;
 }
 
-static int 
+static int
 ixgb_get_stats_count(struct net_device *netdev)
 {
 	return IXGB_STATS_LEN;
 }
 
-static void 
-ixgb_get_ethtool_stats(struct net_device *netdev, 
+static void
+ixgb_get_ethtool_stats(struct net_device *netdev,
 		struct ethtool_stats *stats, uint64_t *data)
 {
 	struct ixgb_adapter *adapter = netdev_priv(netdev);
@@ -682,13 +682,13 @@ ixgb_get_ethtool_stats(struct net_device
 
 	ixgb_update_stats(adapter);
 	for(i = 0; i < IXGB_STATS_LEN; i++) {
-		char *p = (char *)adapter+ixgb_gstrings_stats[i].stat_offset;	
-		data[i] = (ixgb_gstrings_stats[i].sizeof_stat == 
+		char *p = (char *)adapter+ixgb_gstrings_stats[i].stat_offset;
+		data[i] = (ixgb_gstrings_stats[i].sizeof_stat ==
 			sizeof(uint64_t)) ? *(uint64_t *)p : *(uint32_t *)p;
 	}
 }
 
-static void 
+static void
 ixgb_get_strings(struct net_device *netdev, uint32_t stringset, uint8_t *data)
 {
 	int i;
@@ -696,7 +696,7 @@ ixgb_get_strings(struct net_device *netd
 	switch(stringset) {
 	case ETH_SS_STATS:
 		for(i=0; i < IXGB_STATS_LEN; i++) {
-			memcpy(data + i * ETH_GSTRING_LEN, 
+			memcpy(data + i * ETH_GSTRING_LEN,
 			ixgb_gstrings_stats[i].stat_string,
 			ETH_GSTRING_LEN);
 		}
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index 443d675..26cb0d5 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -1,25 +1,25 @@
 /*******************************************************************************
 
-  
+
   Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
-  
-  This program is free software; you can redistribute it and/or modify it 
-  under the terms of the GNU General Public License as published by the Free 
-  Software Foundation; either version 2 of the License, or (at your option) 
+
+  This program is free software; you can redistribute it and/or modify it
+  under the terms of the GNU General Public License as published by the Free
+  Software Foundation; either version 2 of the License, or (at your option)
   any later version.
-  
-  This program is distributed in the hope that it will be useful, but WITHOUT 
-  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+
+  This program is distributed in the hope that it will be useful, but WITHOUT
+  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
-  
+
   You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc., 59 
+  this program; if not, write to the Free Software Foundation, Inc., 59
   Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-  
+
   The full GNU General Public License is included in this distribution in the
   file called LICENSE.
-  
+
   Contact Information:
   Linux NICS <linux.nics@intel.com>
   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
@@ -71,7 +71,7 @@ static struct pci_device_id ixgb_pci_tbl
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 	{INTEL_VENDOR_ID, IXGB_DEVICE_ID_82597EX_SR,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
-	{INTEL_VENDOR_ID, IXGB_DEVICE_ID_82597EX_LR,  
+	{INTEL_VENDOR_ID, IXGB_DEVICE_ID_82597EX_LR,
 	 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
 
 	/* required last entry */
@@ -249,7 +249,7 @@ ixgb_up(struct ixgb_adapter *adapter)
 
 #ifdef CONFIG_PCI_MSI
 	{
-	boolean_t pcix = (IXGB_READ_REG(&adapter->hw, STATUS) & 
+	boolean_t pcix = (IXGB_READ_REG(&adapter->hw, STATUS) &
 						  IXGB_STATUS_PCIX_MODE) ? TRUE : FALSE;
 	adapter->have_msi = TRUE;
 
@@ -266,7 +266,7 @@ ixgb_up(struct ixgb_adapter *adapter)
 	if ((err = request_irq(adapter->pdev->irq, &ixgb_intr,
 		 SA_SHIRQ | SA_SAMPLE_RANDOM, netdev->name, netdev))) {
 		DPRINTK(PROBE, ERR,
-		 "Unable to allocate interrupt Error: %d\n", err);		 
+		 "Unable to allocate interrupt Error: %d\n", err);
 		return err;
 	}
 
@@ -717,8 +717,8 @@ ixgb_configure_tx(struct ixgb_adapter *a
 	uint32_t tctl;
 	struct ixgb_hw *hw = &adapter->hw;
 
-	/* Setup the Base and Length of the Tx Descriptor Ring 
-	 * tx_ring.dma can be either a 32 or 64 bit value 
+	/* Setup the Base and Length of the Tx Descriptor Ring
+	 * tx_ring.dma can be either a 32 or 64 bit value
 	 */
 
 	IXGB_WRITE_REG(hw, TDBAL, (tdba & 0x00000000ffffffffULL));
@@ -744,7 +744,7 @@ ixgb_configure_tx(struct ixgb_adapter *a
 
 	/* Setup Transmit Descriptor Settings for this adapter */
 	adapter->tx_cmd_type =
-		IXGB_TX_DESC_TYPE 
+		IXGB_TX_DESC_TYPE
 		| (adapter->tx_int_delay_enable ? IXGB_TX_DESC_CMD_IDE : 0);
 }
 
@@ -807,8 +807,8 @@ ixgb_setup_rctl(struct ixgb_adapter *ada
 	rctl &= ~(3 << IXGB_RCTL_MO_SHIFT);
 
 	rctl |=
-		IXGB_RCTL_BAM | IXGB_RCTL_RDMTS_1_2 | 
-		IXGB_RCTL_RXEN | IXGB_RCTL_CFF | 
+		IXGB_RCTL_BAM | IXGB_RCTL_RDMTS_1_2 |
+		IXGB_RCTL_RXEN | IXGB_RCTL_CFF |
 		(adapter->hw.mc_filter_type << IXGB_RCTL_MO_SHIFT);
 
 	rctl |= IXGB_RCTL_SECRC;
@@ -1222,7 +1222,7 @@ ixgb_tso(struct ixgb_adapter *adapter, s
 		context_desc->hdr_len = hdr_len;
 		context_desc->status = 0;
 		context_desc->cmd_type_len = cpu_to_le32(
-						  IXGB_CONTEXT_DESC_TYPE 
+						  IXGB_CONTEXT_DESC_TYPE
 						| IXGB_CONTEXT_DESC_CMD_TSE
 						| IXGB_CONTEXT_DESC_CMD_IP
 						| IXGB_CONTEXT_DESC_CMD_TCP
@@ -1395,7 +1395,7 @@ ixgb_tx_queue(struct ixgb_adapter *adapt
 		if(++i == tx_ring->count) i = 0;
 	}
 
-	tx_desc->cmd_type_len |= cpu_to_le32(IXGB_TX_DESC_CMD_EOP 
+	tx_desc->cmd_type_len |= cpu_to_le32(IXGB_TX_DESC_CMD_EOP
 				| IXGB_TX_DESC_CMD_RS );
 
 	/* Force memory writes to complete before letting h/w
@@ -1444,7 +1444,7 @@ ixgb_xmit_frame(struct sk_buff *skb, str
 	}
 
 	first = adapter->tx_ring.next_to_use;
-	
+
 	tso = ixgb_tso(adapter, skb);
 	if (tso < 0) {
 		dev_kfree_skb_any(skb);
@@ -1566,16 +1566,16 @@ ixgb_update_stats(struct ixgb_adapter *a
 		u64 multi = IXGB_READ_REG(&adapter->hw, MPRCL);
 		u32 bcast_l = IXGB_READ_REG(&adapter->hw, BPRCL);
 		u32 bcast_h = IXGB_READ_REG(&adapter->hw, BPRCH);
-		u64 bcast = ((u64)bcast_h << 32) | bcast_l; 
+		u64 bcast = ((u64)bcast_h << 32) | bcast_l;
 
 		multi |= ((u64)IXGB_READ_REG(&adapter->hw, MPRCH) << 32);
 		/* fix up multicast stats by removing broadcasts */
 		if(multi >= bcast)
 			multi -= bcast;
-		
+
 		adapter->stats.mprcl += (multi & 0xFFFFFFFF);
 		adapter->stats.mprch += (multi >> 32);
-		adapter->stats.bprcl += bcast_l; 
+		adapter->stats.bprcl += bcast_l;
 		adapter->stats.bprch += bcast_h;
 	} else {
 		adapter->stats.mprcl += IXGB_READ_REG(&adapter->hw, MPRCL);
@@ -1705,7 +1705,7 @@ ixgb_intr(int irq, void *data, struct pt
 #ifdef CONFIG_IXGB_NAPI
 	if(netif_rx_schedule_prep(netdev)) {
 
-		/* Disable interrupts and register for poll. The flush 
+		/* Disable interrupts and register for poll. The flush
 		  of the posted write is intentionally left out.
 		*/
 
@@ -1722,7 +1722,7 @@ ixgb_intr(int irq, void *data, struct pt
 		if(!ixgb_clean_rx_irq(adapter) &
 		   !ixgb_clean_tx_irq(adapter))
 			break;
-#endif 
+#endif
 	return IRQ_HANDLED;
 }
 
@@ -2053,7 +2053,7 @@ ixgb_alloc_rx_buffers(struct ixgb_adapte
 
 		rx_desc->buff_addr = cpu_to_le64(buffer_info->dma);
 		/* guarantee DD bit not set now before h/w gets descriptor
-		 * this is the rest of the workaround for h/w double 
+		 * this is the rest of the workaround for h/w double
 		 * writeback. */
 		rx_desc->status = 0;
 
@@ -2076,7 +2076,7 @@ ixgb_alloc_rx_buffers(struct ixgb_adapte
 
 /**
  * ixgb_vlan_rx_register - enables or disables vlan tagging/stripping.
- * 
+ *
  * @param netdev network interface device structure
  * @param grp indicates to enable or disable tagging/stripping
  **/
diff --git a/drivers/net/ixgb/ixgb_osdep.h b/drivers/net/ixgb/ixgb_osdep.h
index dba2048..d96d13f 100644
--- a/drivers/net/ixgb/ixgb_osdep.h
+++ b/drivers/net/ixgb/ixgb_osdep.h
@@ -1,25 +1,25 @@
 /*******************************************************************************
 
-  
+
   Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
-  
-  This program is free software; you can redistribute it and/or modify it 
-  under the terms of the GNU General Public License as published by the Free 
-  Software Foundation; either version 2 of the License, or (at your option) 
+
+  This program is free software; you can redistribute it and/or modify it
+  under the terms of the GNU General Public License as published by the Free
+  Software Foundation; either version 2 of the License, or (at your option)
   any later version.
-  
-  This program is distributed in the hope that it will be useful, but WITHOUT 
-  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
-  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for 
+
+  This program is distributed in the hope that it will be useful, but WITHOUT
+  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   more details.
-  
+
   You should have received a copy of the GNU General Public License along with
-  this program; if not, write to the Free Software Foundation, Inc., 59 
+  this program; if not, write to the Free Software Foundation, Inc., 59
   Temple Place - Suite 330, Boston, MA  02111-1307, USA.
-  
+
   The full GNU General Public License is included in this distribution in the
   file called LICENSE.
-  
+
   Contact Information:
   Linux NICS <linux.nics@intel.com>
   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497


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

* [PATCH 11/11] ixgb: Add prefetch
  2006-04-22  1:00 [PATCH 00/11] ixgb: driver update (upstream) Jeff Kirsher
                   ` (9 preceding siblings ...)
  2006-04-22  1:00 ` [PATCH 10/11] ixgb: clean up whitespace Jeff Kirsher
@ 2006-04-22  1:00 ` Jeff Kirsher
  2006-04-22  5:34   ` Eric Dumazet
  2006-04-26 10:22 ` [PATCH 00/11] ixgb: driver update (upstream) Jeff Garzik
  11 siblings, 1 reply; 20+ messages in thread
From: Jeff Kirsher @ 2006-04-22  1:00 UTC (permalink / raw)
  To: Jeff Garzik, netdev, David Miller; +Cc: John Rociak, Jesse Brandeburg


- This patch is to improve performance by adding prefetch to the ixgb driver
- Add driver comments

Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---

 drivers/net/ixgb/ixgb_main.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index 26cb0d5..98303cb 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -29,6 +29,13 @@
 #include "ixgb.h"
 
 /* Change Log
+ * 1.0.104 10-Jan-2006
+ * - fix for copybreak/recycle
+ * 1.0.103 Oct-3
+ * - suck in some e1000 changes, including copybreak and LLTX
+ * - support for CX4 adapters
+ * 1.0.102 June-20-2005
+ * - add a workaround for a hardware issue when using TSO
  * 1.0.96 04/19/05
  * - Make needlessly global code static -- bunk@stusta.de
  * - ethtool cleanup -- shemminger@osdl.org
@@ -1916,7 +1923,7 @@ ixgb_clean_rx_irq(struct ixgb_adapter *a
 		skb = buffer_info->skb;
 		buffer_info->skb = NULL;
 
-		prefetch(skb->data);
+		prefetch(skb->data - NET_IP_ALIGN);
 
 		if(++i == rx_ring->count) i = 0;
 		next_rxd = IXGB_RX_DESC(*rx_ring, i);
@@ -1929,6 +1936,7 @@ ixgb_clean_rx_irq(struct ixgb_adapter *a
 		next_buffer = &rx_ring->buffer_info[i];
 		next_skb = next_buffer->skb;
 		prefetch(next_skb);
+		prefetch(next_skb->data - NET_IP_ALIGN);
 
 		cleaned = TRUE;
 


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

* Re: [PATCH 11/11] ixgb: Add prefetch
  2006-04-22  1:00 ` [PATCH 11/11] ixgb: Add prefetch Jeff Kirsher
@ 2006-04-22  5:34   ` Eric Dumazet
  0 siblings, 0 replies; 20+ messages in thread
From: Eric Dumazet @ 2006-04-22  5:34 UTC (permalink / raw)
  To: Jeff Kirsher
  Cc: Jeff Garzik, netdev, David Miller, John Rociak, Jesse Brandeburg

Jeff Kirsher a écrit :
> - This patch is to improve performance by adding prefetch to the ixgb driver
> - Add driver comments
> 
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> Signed-off-by: John Ronciak <john.ronciak@intel.com>
> ---
> 
>  drivers/net/ixgb/ixgb_main.c |   10 +++++++++-
>  1 files changed, 9 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
> index 26cb0d5..98303cb 100644
> --- a/drivers/net/ixgb/ixgb_main.c
> +++ b/drivers/net/ixgb/ixgb_main.c
> @@ -29,6 +29,13 @@
>  #include "ixgb.h"
>  
>  /* Change Log
> + * 1.0.104 10-Jan-2006
> + * - fix for copybreak/recycle
> + * 1.0.103 Oct-3
> + * - suck in some e1000 changes, including copybreak and LLTX
> + * - support for CX4 adapters
> + * 1.0.102 June-20-2005
> + * - add a workaround for a hardware issue when using TSO
>   * 1.0.96 04/19/05
>   * - Make needlessly global code static -- bunk@stusta.de
>   * - ethtool cleanup -- shemminger@osdl.org
> @@ -1916,7 +1923,7 @@ ixgb_clean_rx_irq(struct ixgb_adapter *a
>  		skb = buffer_info->skb;
>  		buffer_info->skb = NULL;
>  
> -		prefetch(skb->data);
> +		prefetch(skb->data - NET_IP_ALIGN);

I doubt this change is usefull.

skb->data and dkb->dta - NET_IP_ALIGN are on the same cache line.
So prefetch(skb->data) is cheaper for he compiler and has the same effect on 
the memory prefetch that is eventually done by the cpu.


>  
>  		if(++i == rx_ring->count) i = 0;
>  		next_rxd = IXGB_RX_DESC(*rx_ring, i);
> @@ -1929,6 +1936,7 @@ ixgb_clean_rx_irq(struct ixgb_adapter *a
>  		next_buffer = &rx_ring->buffer_info[i];
>  		next_skb = next_buffer->skb;
>  		prefetch(next_skb);
> +		prefetch(next_skb->data - NET_IP_ALIGN);

I doubt that next->skb_data is available for free just after a 
prefetch(next_skb). This second prefetch has a hidden cost : The memory 
location (&next_skb->data) must be in L1 cache. So basically the 
prefetch(next_skb) is useless...

prefetch are not magic things. They have a cost (they increase the code size), 
and should be used carefully.

Eric

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

* Re: [PATCH 01/11] ixgb: Fix compilation errors by initializing variables
  2006-04-22  1:00 ` [PATCH 01/11] ixgb: Fix compilation errors by initializing variables Jeff Kirsher
@ 2006-04-22  8:49   ` Francois Romieu
  0 siblings, 0 replies; 20+ messages in thread
From: Francois Romieu @ 2006-04-22  8:49 UTC (permalink / raw)
  To: Jeff Kirsher
  Cc: Jeff Garzik, netdev, David Miller, John Rociak, Jesse Brandeburg

Jeff Kirsher <jeffrey.t.kirsher@intel.com> :
> diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
> index cfd67d8..0b9481a 100644
> --- a/drivers/net/ixgb/ixgb_main.c
> +++ b/drivers/net/ixgb/ixgb_main.c
[...]
> @@ -346,7 +346,7 @@ ixgb_probe(struct pci_dev *pdev,
>  		const struct pci_device_id *ent)
>  {
>  	struct net_device *netdev = NULL;
> -	struct ixgb_adapter *adapter;
> +	struct ixgb_adapter *adapter = NULL;

Afaiks the warning/error from the compiler is bogus.

netdev initialization is useless as well.

Are we supposed to bloat the kernel code on a large scale just
to please a compiler which emits bogus warning or is the option
left to the maintainer ?


-- 
Ueimor

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

* Re: [PATCH 02/11] ixgb: Fix the use of dprintk rather than printk
  2006-04-22  1:00 ` [PATCH 02/11] ixgb: Fix the use of dprintk rather than printk Jeff Kirsher
@ 2006-04-22  9:03   ` Francois Romieu
  2006-04-24 17:24     ` Stephen Hemminger
  2006-05-19 18:35     ` Auke Kok
  0 siblings, 2 replies; 20+ messages in thread
From: Francois Romieu @ 2006-04-22  9:03 UTC (permalink / raw)
  To: Jeff Kirsher
  Cc: Jeff Garzik, netdev, David Miller, John Rociak, Jesse Brandeburg

Jeff Kirsher <jeffrey.t.kirsher@intel.com> :
[...]
> diff --git a/drivers/net/ixgb/ixgb.h b/drivers/net/ixgb/ixgb.h
> index c83271b..a696c33 100644
> --- a/drivers/net/ixgb/ixgb.h
> +++ b/drivers/net/ixgb/ixgb.h
[...]
> @@ -192,6 +197,7 @@ struct ixgb_adapter {
>  
>  	/* structs defined in ixgb_hw.h */
>  	struct ixgb_hw hw;
> +	u16 msg_enable;
>  	struct ixgb_hw_stats stats;
>  #ifdef CONFIG_PCI_MSI
>  	boolean_t have_msi;
> diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c
> index d38ade5..e8d83de 100644
> --- a/drivers/net/ixgb/ixgb_ethtool.c
> +++ b/drivers/net/ixgb/ixgb_ethtool.c
> @@ -251,6 +251,20 @@ ixgb_set_tso(struct net_device *netdev, 
>  } 
>  #endif /* NETIF_F_TSO */
>  
> +static uint32_t
> +ixgb_get_msglevel(struct net_device *netdev)
> +{
> +	struct ixgb_adapter *adapter = netdev->priv;
> +	return adapter->msg_enable;
> +}
> +
> +static void
> +ixgb_set_msglevel(struct net_device *netdev, uint32_t data)
> +{
> +	struct ixgb_adapter *adapter = netdev->priv;
> +	adapter->msg_enable = data;
> +}
> +

Minor nits:
- you may consider removing the u{8/16/32} in drivers/net/ixgb
  for consistency sake in a different patch (there is a strong
  majority of uint_something in the driver).

- s/netdev->priv/netdev_priv(netdev)/ ?

[...]
> @@ -486,8 +495,7 @@ ixgb_probe(struct pci_dev *pdev,
>  	netif_carrier_off(netdev);
>  	netif_stop_queue(netdev);
>  
> -	printk(KERN_INFO "%s: Intel(R) PRO/10GbE Network Connection\n",
> -		   netdev->name);
> +	DPRINTK(PROBE, INFO, "Intel(R) PRO/10GbE Network Connection\n");

It could probably be factored out with ixgb_driver_string.

-- 
Ueimor

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

* Re: [PATCH 03/11] ixgb: Fix hard coded numbers
  2006-04-22  1:00 ` [PATCH 03/11] ixgb: Fix hard coded numbers Jeff Kirsher
@ 2006-04-22  9:17   ` Francois Romieu
  0 siblings, 0 replies; 20+ messages in thread
From: Francois Romieu @ 2006-04-22  9:17 UTC (permalink / raw)
  To: Jeff Kirsher
  Cc: Jeff Garzik, netdev, David Miller, John Rociak, Jesse Brandeburg

Jeff Kirsher <jeffrey.t.kirsher@intel.com> :
[...]
> diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c
> index e8d83de..978be30 100644
> --- a/drivers/net/ixgb/ixgb_ethtool.c
> +++ b/drivers/net/ixgb/ixgb_ethtool.c
[...]
> diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
> index 6f8fd6f..f468d5d 100644
> --- a/drivers/net/ixgb/ixgb_main.c
> +++ b/drivers/net/ixgb/ixgb_main.c
> @@ -1227,11 +1227,11 @@ ixgb_tso(struct ixgb_adapter *adapter, s
>  		if(++i == adapter->tx_ring.count) i = 0;
>  		adapter->tx_ring.next_to_use = i;
>  
> -		return 1;
> +		return TRUE;
>  	}
>  #endif
>  
> -	return 0;
> +	return FALSE;
>  }

Grmbl... TRUE/FALSE

More importantly, it seems bogus. See below:

drivers/net/ixgb/ixgb_main.c::ixgb_xmit_frame
[...]
        tso = ixgb_tso(adapter, skb);
        if (tso < 0) {
               ^^^
                dev_kfree_skb_any(skb);
                return N

[...]
> @@ -1413,7 +1413,7 @@ ixgb_xmit_frame(struct sk_buff *skb, str
>  	if(unlikely(IXGB_DESC_UNUSED(&adapter->tx_ring) < DESC_NEEDED)) {
>  		netif_stop_queue(netdev);
>  		spin_unlock_irqrestore(&adapter->tx_lock, flags);
> -		return 1;
> +		return NETDEV_TX_BUSY;
>  	}

It is considered a bug. You can check for this situation on the current
skb but the driver should check if there is enough room for the *next*
packet before it leaves ixgb_xmit_frame().

-- 
Ueimor

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

* Re: [PATCH 02/11] ixgb: Fix the use of dprintk rather than printk
  2006-04-22  9:03   ` Francois Romieu
@ 2006-04-24 17:24     ` Stephen Hemminger
  2006-05-19 18:35     ` Auke Kok
  1 sibling, 0 replies; 20+ messages in thread
From: Stephen Hemminger @ 2006-04-24 17:24 UTC (permalink / raw)
  To: Francois Romieu
  Cc: Jeff Kirsher, Jeff Garzik, netdev, David Miller, John Rociak,
	Jesse Brandeburg

On Sat, 22 Apr 2006 11:03:01 +0200
Francois Romieu <romieu@fr.zoreil.com> wrote:

> Jeff Kirsher <jeffrey.t.kirsher@intel.com> :
> [...]
> > diff --git a/drivers/net/ixgb/ixgb.h b/drivers/net/ixgb/ixgb.h
> > index c83271b..a696c33 100644
> > --- a/drivers/net/ixgb/ixgb.h
> > +++ b/drivers/net/ixgb/ixgb.h
> [...]
> > @@ -192,6 +197,7 @@ struct ixgb_adapter {
> >  
> >  	/* structs defined in ixgb_hw.h */
> >  	struct ixgb_hw hw;
> > +	u16 msg_enable;
> >  	struct ixgb_hw_stats stats;
> >  #ifdef CONFIG_PCI_MSI
> >  	boolean_t have_msi;
> > diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c
> > index d38ade5..e8d83de 100644
> > --- a/drivers/net/ixgb/ixgb_ethtool.c
> > +++ b/drivers/net/ixgb/ixgb_ethtool.c
> > @@ -251,6 +251,20 @@ ixgb_set_tso(struct net_device *netdev, 
> >  } 
> >  #endif /* NETIF_F_TSO */
> >  
> > +static uint32_t
> > +ixgb_get_msglevel(struct net_device *netdev)
> > +{
> > +	struct ixgb_adapter *adapter = netdev->priv;
> > +	return adapter->msg_enable;
> > +}
> > +
> > +static void
> > +ixgb_set_msglevel(struct net_device *netdev, uint32_t data)
> > +{
> > +	struct ixgb_adapter *adapter = netdev->priv;
> > +	adapter->msg_enable = data;
> > +}
> > +
> 
> Minor nits:
> - you may consider removing the u{8/16/32} in drivers/net/ixgb
>   for consistency sake in a different patch (there is a strong
>   majority of uint_something in the driver).


All the uint32_t should be removed.  Kernel style is u32.

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

* Re: [PATCH 00/11] ixgb: driver update (upstream)
  2006-04-22  1:00 [PATCH 00/11] ixgb: driver update (upstream) Jeff Kirsher
                   ` (10 preceding siblings ...)
  2006-04-22  1:00 ` [PATCH 11/11] ixgb: Add prefetch Jeff Kirsher
@ 2006-04-26 10:22 ` Jeff Garzik
  11 siblings, 0 replies; 20+ messages in thread
From: Jeff Garzik @ 2006-04-26 10:22 UTC (permalink / raw)
  To: Jeff Kirsher; +Cc: netdev, David Miller, John Rociak, Jesse Brandeburg

Jeff Kirsher wrote:
> The following patches were diff's against Garzik's latest "upstream" branch and can be pulled from the following location:
> 
> git://lost.foo-projects.org/linux-2.6.git ixgb-upstream

pull failed:


[jgarzik@pretzel netdev-2.6]$ git pull 
git://lost.foo-projects.org/linux-2.6.git ixgb-upstream
error: no such remote ref refs/heads/ixgb-upstream
Fetch failure: git://lost.foo-projects.org/linux-2.6.git

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

* RE: [PATCH 00/11] ixgb: driver update (upstream)
@ 2006-04-26 19:21 Kirsher, Jeffrey T
  0 siblings, 0 replies; 20+ messages in thread
From: Kirsher, Jeffrey T @ 2006-04-26 19:21 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev, David Miller, Ronciak, John, Brandeburg, Jesse


Jeff Garzik wrote: 

>pull failed:


>[jgarzik@pretzel netdev-2.6]$ git pull 
>git://lost.foo-projects.org/linux-2.6.git ixgb-upstream
>error: no such remote ref refs/heads/ixgb-upstream
>Fetch failure: git://lost.foo-projects.org/linux-2.6.git

Hmm, I apologize, I gave the wrong URL.

git://lost.foo-projects.org/~jtkirshe/netdev-2.6 ixgb-upstream

cheers,
Jeff

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

* Re: [PATCH 02/11] ixgb: Fix the use of dprintk rather than printk
  2006-04-22  9:03   ` Francois Romieu
  2006-04-24 17:24     ` Stephen Hemminger
@ 2006-05-19 18:35     ` Auke Kok
  1 sibling, 0 replies; 20+ messages in thread
From: Auke Kok @ 2006-05-19 18:35 UTC (permalink / raw)
  To: Francois Romieu
  Cc: Jeff Kirsher, Jeff Garzik, netdev, David Miller, John Rociak,
	Jesse Brandeburg

Francois Romieu wrote:
> Jeff Kirsher <jeffrey.t.kirsher@intel.com> :
>> @@ -486,8 +495,7 @@ ixgb_probe(struct pci_dev *pdev,
>>  	netif_carrier_off(netdev);
>>  	netif_stop_queue(netdev);
>>  
>> -	printk(KERN_INFO "%s: Intel(R) PRO/10GbE Network Connection\n",
>> -		   netdev->name);
>> +	DPRINTK(PROBE, INFO, "Intel(R) PRO/10GbE Network Connection\n");
> 
> It could probably be factored out with ixgb_driver_string.

the driver name is different from the interface/device that it drives - Hence 
the different name. The 'Connection' name as above is the branding name as 
well, and that's why we print it here as such. e1000 does the same thing for 
the same reason.

Auke

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

end of thread, other threads:[~2006-05-19 18:36 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-22  1:00 [PATCH 00/11] ixgb: driver update (upstream) Jeff Kirsher
2006-04-22  1:00 ` [PATCH 01/11] ixgb: Fix compilation errors by initializing variables Jeff Kirsher
2006-04-22  8:49   ` Francois Romieu
2006-04-22  1:00 ` [PATCH 02/11] ixgb: Fix the use of dprintk rather than printk Jeff Kirsher
2006-04-22  9:03   ` Francois Romieu
2006-04-24 17:24     ` Stephen Hemminger
2006-05-19 18:35     ` Auke Kok
2006-04-22  1:00 ` [PATCH 03/11] ixgb: Fix hard coded numbers Jeff Kirsher
2006-04-22  9:17   ` Francois Romieu
2006-04-22  1:00 ` [PATCH 04/11] ixgb: Fix duplicate code Jeff Kirsher
2006-04-22  1:00 ` [PATCH 05/11] ixgb: Fix timeout code Jeff Kirsher
2006-04-22  1:00 ` [PATCH 06/11] ixgb: Fix TSO Jeff Kirsher
2006-04-22  1:00 ` [PATCH 07/11] ixgb: Fixed flow control parameters Jeff Kirsher
2006-04-22  1:00 ` [PATCH 08/11] ixgb: Add support for copper 10GbE Jeff Kirsher
2006-04-22  1:00 ` [PATCH 09/11] ixgb: Add performance enhancements to the buffer_info struct Jeff Kirsher
2006-04-22  1:00 ` [PATCH 10/11] ixgb: clean up whitespace Jeff Kirsher
2006-04-22  1:00 ` [PATCH 11/11] ixgb: Add prefetch Jeff Kirsher
2006-04-22  5:34   ` Eric Dumazet
2006-04-26 10:22 ` [PATCH 00/11] ixgb: driver update (upstream) Jeff Garzik
  -- strict thread matches above, loose matches on Subject: below --
2006-04-26 19:21 Kirsher, Jeffrey T

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).