* Re: [PATCH] e1000: endian fixes
From: Auke Kok @ 2006-05-23 21:30 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Alexey Dobriyan, Andrew Morton, netdev, Jesse Brandeburg
In-Reply-To: <20060515225432.GG10143@mipter.zuzino.mipt.ru>
Ack, please apply and add my acked-by/signed-off-by.
Cheers,
Auke
---
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Alexey Dobriyan wrote:
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> ---
>
> drivers/net/e1000/e1000_main.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> --- 1/drivers/net/e1000/e1000_main.c
> +++ 1/drivers/net/e1000/e1000_main.c
> @@ -2451,7 +2451,7 @@ e1000_tso(struct e1000_adapter *adapter,
>
> hdr_len = ((skb->h.raw - skb->data) + (skb->h.th->doff << 2));
> mss = skb_shinfo(skb)->tso_size;
> - if (skb->protocol == ntohs(ETH_P_IP)) {
> + if (skb->protocol == htons(ETH_P_IP)) {
> skb->nh.iph->tot_len = 0;
> skb->nh.iph->check = 0;
> skb->h.th->check =
> @@ -2930,7 +2930,7 @@ e1000_xmit_frame(struct sk_buff *skb, st
> /* Old method was to assume IPv4 packet by default if TSO was enabled.
> * 82571 hardware supports TSO capabilities for IPv6 as well...
> * no longer assume, we must. */
> - if (likely(skb->protocol == ntohs(ETH_P_IP)))
> + if (likely(skb->protocol == htons(ETH_P_IP)))
> tx_flags |= E1000_TX_FLAGS_IPV4;
>
> e1000_tx_queue(adapter, tx_ring, tx_flags,
>
> -
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH 0/6] e1000: update to 7.0.38-k4
From: Jeff Garzik @ 2006-05-23 21:22 UTC (permalink / raw)
To: Kok, Auke; +Cc: netdev, Brandeburg, Jesse, Kok, Auke
In-Reply-To: <20060523210740.18540.56647.stgit@gitlost.site>
Kok, Auke wrote:
> Hi,
>
> These e1000 patches include a fix for WOL and some driver cleanups:
>
> [1]: add shutdown handler back to fix WOL
> [2]: remove backslash r debug printfs
> [3]: remove leading and trailing whitespace.
> [4]: Fix date string in Makefile
> [5]: remove changelog in driver
> [6]: bump version to 7.0.38-k4
>
>
> Jeff, please pull from:
>
> git://lost.foo-projects.org/~ahkok/git/netdev-2.6 e1000-7.0.38-k4
pulled
^ permalink raw reply
* [PATCH 6/6] e1000: bump version to 7.0.38-k4
From: Kok, Auke @ 2006-05-23 21:08 UTC (permalink / raw)
To: Garzik, Jeff; +Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke
In-Reply-To: <20060523210740.18540.56647.stgit@gitlost.site>
Signed-off-by: Auke Kok <auke.jan.h.kok@intel.com>
---
drivers/net/e1000/e1000_main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index 95069ac..258c7d5 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -36,7 +36,7 @@ static char e1000_driver_string[] = "Int
#else
#define DRIVERNAPI "-NAPI"
#endif
-#define DRV_VERSION "7.0.38-k2"DRIVERNAPI
+#define DRV_VERSION "7.0.38-k4"DRIVERNAPI
char e1000_driver_version[] = DRV_VERSION;
static char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";
--
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related
* [PATCH 5/6] e1000: remove changelog in driver
From: Kok, Auke @ 2006-05-23 21:08 UTC (permalink / raw)
To: Garzik, Jeff; +Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke
In-Reply-To: <20060523210740.18540.56647.stgit@gitlost.site>
This honours the request to remove the changelog in the driver code.
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/e1000/e1000_main.c | 39 ---------------------------------------
1 files changed, 0 insertions(+), 39 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index ccbe342..95069ac 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -29,45 +29,6 @@
#include "e1000.h"
-/* Change Log
- * 7.0.33 3-Feb-2006
- * o Added another fix for the pass false carrier bit
- * 7.0.32 24-Jan-2006
- * o Need to rebuild with noew version number for the pass false carrier
- * fix in e1000_hw.c
- * 7.0.30 18-Jan-2006
- * o fixup for tso workaround to disable it for pci-x
- * o fix mem leak on 82542
- * o fixes for 10 Mb/s connections and incorrect stats
- * 7.0.28 01/06/2006
- * o hardware workaround to only set "speed mode" bit for 1G link.
- * 7.0.26 12/23/2005
- * o wake on lan support modified for device ID 10B5
- * o fix dhcp + vlan issue not making it to the iAMT firmware
- * 7.0.24 12/9/2005
- * o New hardware support for the Gigabit NIC embedded in the south bridge
- * o Fixes to the recycling logic (skb->tail) from IBM LTC
- * 6.3.9 12/16/2005
- * o incorporate fix for recycled skbs from IBM LTC
- * 6.3.7 11/18/2005
- * o Honor eeprom setting for enabling/disabling Wake On Lan
- * 6.3.5 11/17/2005
- * o Fix memory leak in rx ring handling for PCI Express adapters
- * 6.3.4 11/8/05
- * o Patch from Jesper Juhl to remove redundant NULL checks for kfree
- * 6.3.2 9/20/05
- * o Render logic that sets/resets DRV_LOAD as inline functions to
- * avoid code replication. If f/w is AMT then set DRV_LOAD only when
- * network interface is open.
- * o Handle DRV_LOAD set/reset in cases where AMT uses VLANs.
- * o Adjust PBA partioning for Jumbo frames using MTU size and not
- * rx_buffer_len
- * 6.3.1 9/19/05
- * o Use adapter->tx_timeout_factor in Tx Hung Detect logic
- * (e1000_clean_tx_irq)
- * o Support for 8086:10B5 device (Quad Port)
- */
-
char e1000_driver_name[] = "e1000";
static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
#ifndef CONFIG_E1000_NAPI
--
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related
* [PATCH 4/6] e1000: Fix date string in Makefile
From: Kok, Auke @ 2006-05-23 21:08 UTC (permalink / raw)
To: Garzik, Jeff; +Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke
In-Reply-To: <20060523210740.18540.56647.stgit@gitlost.site>
I forgot to update the date string in the Makefile last time.
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/e1000/Makefile | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/e1000/Makefile b/drivers/net/e1000/Makefile
index 92823ac..5dea2b7 100644
--- a/drivers/net/e1000/Makefile
+++ b/drivers/net/e1000/Makefile
@@ -1,7 +1,7 @@
################################################################################
#
#
-# Copyright(c) 1999 - 2003 Intel Corporation. All rights reserved.
+# Copyright(c) 1999 - 2006 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
--
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related
* [PATCH 3/6] e1000: remove leading and trailing whitespace.
From: Kok, Auke @ 2006-05-23 21:08 UTC (permalink / raw)
To: Garzik, Jeff; +Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke
In-Reply-To: <20060523210740.18540.56647.stgit@gitlost.site>
Some leading and trailing whitespace made it into the driver code here.
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/e1000/e1000_ethtool.c | 44 +++++++++----------
drivers/net/e1000/e1000_hw.c | 88 +++++++++++++++++++------------------
drivers/net/e1000/e1000_hw.h | 4 +-
drivers/net/e1000/e1000_main.c | 26 +++++------
4 files changed, 81 insertions(+), 81 deletions(-)
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index e48dc57..cfdf0b2 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -865,15 +865,15 @@ static int
e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data)
{
struct net_device *netdev = adapter->netdev;
- uint32_t mask, i=0, shared_int = TRUE;
- uint32_t irq = adapter->pdev->irq;
+ uint32_t mask, i=0, shared_int = TRUE;
+ uint32_t irq = adapter->pdev->irq;
*data = 0;
/* Hook up test interrupt handler just for this test */
- if (!request_irq(irq, &e1000_test_intr, 0, netdev->name, netdev)) {
- shared_int = FALSE;
- } else if (request_irq(irq, &e1000_test_intr, SA_SHIRQ,
+ if (!request_irq(irq, &e1000_test_intr, 0, netdev->name, netdev)) {
+ shared_int = FALSE;
+ } else if (request_irq(irq, &e1000_test_intr, SA_SHIRQ,
netdev->name, netdev)){
*data = 1;
return -1;
@@ -889,22 +889,22 @@ e1000_intr_test(struct e1000_adapter *ad
/* Interrupt to test */
mask = 1 << i;
- if (!shared_int) {
- /* Disable the interrupt to be reported in
- * the cause register and then force the same
- * interrupt and see if one gets posted. If
- * an interrupt was posted to the bus, the
- * test failed.
- */
- adapter->test_icr = 0;
- E1000_WRITE_REG(&adapter->hw, IMC, mask);
- E1000_WRITE_REG(&adapter->hw, ICS, mask);
- msec_delay(10);
-
- if (adapter->test_icr & mask) {
- *data = 3;
- break;
- }
+ if (!shared_int) {
+ /* Disable the interrupt to be reported in
+ * the cause register and then force the same
+ * interrupt and see if one gets posted. If
+ * an interrupt was posted to the bus, the
+ * test failed.
+ */
+ adapter->test_icr = 0;
+ E1000_WRITE_REG(&adapter->hw, IMC, mask);
+ E1000_WRITE_REG(&adapter->hw, ICS, mask);
+ msec_delay(10);
+
+ if (adapter->test_icr & mask) {
+ *data = 3;
+ break;
+ }
}
/* Enable the interrupt to be reported in
@@ -923,7 +923,7 @@ e1000_intr_test(struct e1000_adapter *ad
break;
}
- if (!shared_int) {
+ if (!shared_int) {
/* Disable the other interrupts to be reported in
* the cause register and then force the other
* interrupts and see if any get posted. If
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index 2e211df..3959039 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -765,7 +765,7 @@ e1000_init_hw(struct e1000_hw *hw)
}
if (hw->mac_type == e1000_82573) {
- e1000_enable_tx_pkt_filtering(hw);
+ e1000_enable_tx_pkt_filtering(hw);
}
switch (hw->mac_type) {
@@ -861,7 +861,7 @@ e1000_adjust_serdes_amplitude(struct e10
if(eeprom_data != EEPROM_RESERVED_WORD) {
/* Adjust SERDES output amplitude only. */
- eeprom_data &= EEPROM_SERDES_AMPLITUDE_MASK;
+ eeprom_data &= EEPROM_SERDES_AMPLITUDE_MASK;
ret_val = e1000_write_phy_reg(hw, M88E1000_PHY_EXT_CTRL, eeprom_data);
if(ret_val)
return ret_val;
@@ -1228,7 +1228,7 @@ e1000_copper_link_igp_setup(struct e1000
if (hw->phy_reset_disable)
return E1000_SUCCESS;
-
+
ret_val = e1000_phy_reset(hw);
if (ret_val) {
DEBUGOUT("Error Resetting the PHY\n");
@@ -1370,7 +1370,7 @@ e1000_copper_link_ggp_setup(struct e1000
DEBUGFUNC("e1000_copper_link_ggp_setup");
if(!hw->phy_reset_disable) {
-
+
/* Enable CRS on TX for half-duplex operation. */
ret_val = e1000_read_phy_reg(hw, GG82563_PHY_MAC_SPEC_CTRL,
&phy_data);
@@ -1519,7 +1519,7 @@ e1000_copper_link_mgp_setup(struct e1000
if(hw->phy_reset_disable)
return E1000_SUCCESS;
-
+
/* Enable CRS on TX. This must be set for half-duplex operation. */
ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
if(ret_val)
@@ -1665,7 +1665,7 @@ e1000_copper_link_autoneg(struct e1000_h
* collision distance in the Transmit Control Register.
* 2) Set up flow control on the MAC to that established with
* the link partner.
-* 3) Config DSP to improve Gigabit link quality for some PHY revisions.
+* 3) Config DSP to improve Gigabit link quality for some PHY revisions.
*
* hw - Struct containing variables accessed by shared code
******************************************************************************/
@@ -1674,7 +1674,7 @@ e1000_copper_link_postconfig(struct e100
{
int32_t ret_val;
DEBUGFUNC("e1000_copper_link_postconfig");
-
+
if(hw->mac_type >= e1000_82544) {
e1000_config_collision_dist(hw);
} else {
@@ -1698,7 +1698,7 @@ e1000_copper_link_postconfig(struct e100
return ret_val;
}
}
-
+
return E1000_SUCCESS;
}
@@ -1754,11 +1754,11 @@ e1000_setup_copper_link(struct e1000_hw
}
if(hw->autoneg) {
- /* Setup autoneg and flow control advertisement
- * and perform autonegotiation */
+ /* Setup autoneg and flow control advertisement
+ * and perform autonegotiation */
ret_val = e1000_copper_link_autoneg(hw);
if(ret_val)
- return ret_val;
+ return ret_val;
} else {
/* PHY will be set to 10H, 10F, 100H,or 100F
* depending on value from forced_speed_duplex. */
@@ -1786,7 +1786,7 @@ e1000_setup_copper_link(struct e1000_hw
ret_val = e1000_copper_link_postconfig(hw);
if(ret_val)
return ret_val;
-
+
DEBUGOUT("Valid link established!!!\n");
return E1000_SUCCESS;
}
@@ -1984,7 +1984,7 @@ e1000_phy_setup_autoneg(struct e1000_hw
DEBUGOUT1("Auto-Neg Advertising %x\n", mii_autoneg_adv_reg);
- ret_val = e1000_write_phy_reg(hw, PHY_1000T_CTRL, mii_1000t_ctrl_reg);
+ ret_val = e1000_write_phy_reg(hw, PHY_1000T_CTRL, mii_1000t_ctrl_reg);
if(ret_val)
return ret_val;
@@ -2273,7 +2273,7 @@ e1000_config_mac_to_phy(struct e1000_hw
DEBUGFUNC("e1000_config_mac_to_phy");
- /* 82544 or newer MAC, Auto Speed Detection takes care of
+ /* 82544 or newer MAC, Auto Speed Detection takes care of
* MAC speed/duplex configuration.*/
if (hw->mac_type >= e1000_82544)
return E1000_SUCCESS;
@@ -2292,9 +2292,9 @@ e1000_config_mac_to_phy(struct e1000_hw
if(ret_val)
return ret_val;
- if(phy_data & M88E1000_PSSR_DPLX)
+ if(phy_data & M88E1000_PSSR_DPLX)
ctrl |= E1000_CTRL_FD;
- else
+ else
ctrl &= ~E1000_CTRL_FD;
e1000_config_collision_dist(hw);
@@ -2884,7 +2884,7 @@ e1000_get_speed_and_duplex(struct e1000_
}
}
- if ((hw->mac_type == e1000_80003es2lan) &&
+ if ((hw->mac_type == e1000_80003es2lan) &&
(hw->media_type == e1000_media_type_copper)) {
if (*speed == SPEED_1000)
ret_val = e1000_configure_kmrn_for_1000(hw);
@@ -3160,7 +3160,7 @@ e1000_read_phy_reg(struct e1000_hw *hw,
if (e1000_swfw_sync_acquire(hw, swfw))
return -E1000_ERR_SWFW_SYNC;
- if((hw->phy_type == e1000_phy_igp ||
+ if((hw->phy_type == e1000_phy_igp ||
hw->phy_type == e1000_phy_igp_2) &&
(reg_addr > MAX_PHY_MULTI_PAGE_REG)) {
ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT,
@@ -3299,7 +3299,7 @@ e1000_write_phy_reg(struct e1000_hw *hw,
if (e1000_swfw_sync_acquire(hw, swfw))
return -E1000_ERR_SWFW_SYNC;
- if((hw->phy_type == e1000_phy_igp ||
+ if((hw->phy_type == e1000_phy_igp ||
hw->phy_type == e1000_phy_igp_2) &&
(reg_addr > MAX_PHY_MULTI_PAGE_REG)) {
ret_val = e1000_write_phy_reg_ex(hw, IGP01E1000_PHY_PAGE_SELECT,
@@ -3497,22 +3497,22 @@ e1000_phy_hw_reset(struct e1000_hw *hw)
}
/* Read the device control register and assert the E1000_CTRL_PHY_RST
* bit. Then, take it out of reset.
- * For pre-e1000_82571 hardware, we delay for 10ms between the assert
+ * For pre-e1000_82571 hardware, we delay for 10ms between the assert
* and deassert. For e1000_82571 hardware and later, we instead delay
* for 50us between and 10ms after the deassertion.
*/
ctrl = E1000_READ_REG(hw, CTRL);
E1000_WRITE_REG(hw, CTRL, ctrl | E1000_CTRL_PHY_RST);
E1000_WRITE_FLUSH(hw);
-
- if (hw->mac_type < e1000_82571)
+
+ if (hw->mac_type < e1000_82571)
msec_delay(10);
else
udelay(100);
-
+
E1000_WRITE_REG(hw, CTRL, ctrl);
E1000_WRITE_FLUSH(hw);
-
+
if (hw->mac_type >= e1000_82571)
msec_delay(10);
e1000_swfw_sync_release(hw, swfw);
@@ -3816,7 +3816,7 @@ e1000_phy_m88_get_info(struct e1000_hw *
/* Check polarity status */
ret_val = e1000_check_polarity(hw, &polarity);
if(ret_val)
- return ret_val;
+ return ret_val;
phy_info->cable_polarity = polarity;
ret_val = e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, &phy_data);
@@ -4541,14 +4541,14 @@ e1000_read_eeprom_eerd(struct e1000_hw *
E1000_WRITE_REG(hw, EERD, eerd);
error = e1000_poll_eerd_eewr_done(hw, E1000_EEPROM_POLL_READ);
-
+
if(error) {
break;
}
data[i] = (E1000_READ_REG(hw, EERD) >> E1000_EEPROM_RW_REG_DATA);
-
+
}
-
+
return error;
}
@@ -4574,24 +4574,24 @@ e1000_write_eeprom_eewr(struct e1000_hw
return -E1000_ERR_SWFW_SYNC;
for (i = 0; i < words; i++) {
- register_value = (data[i] << E1000_EEPROM_RW_REG_DATA) |
- ((offset+i) << E1000_EEPROM_RW_ADDR_SHIFT) |
+ register_value = (data[i] << E1000_EEPROM_RW_REG_DATA) |
+ ((offset+i) << E1000_EEPROM_RW_ADDR_SHIFT) |
E1000_EEPROM_RW_REG_START;
error = e1000_poll_eerd_eewr_done(hw, E1000_EEPROM_POLL_WRITE);
if(error) {
break;
- }
+ }
E1000_WRITE_REG(hw, EEWR, register_value);
-
+
error = e1000_poll_eerd_eewr_done(hw, E1000_EEPROM_POLL_WRITE);
-
+
if(error) {
break;
- }
+ }
}
-
+
e1000_swfw_sync_release(hw, E1000_SWFW_EEP_SM);
return error;
}
@@ -4611,7 +4611,7 @@ e1000_poll_eerd_eewr_done(struct e1000_h
for(i = 0; i < attempts; i++) {
if(eerd == E1000_EEPROM_POLL_READ)
reg = E1000_READ_REG(hw, EERD);
- else
+ else
reg = E1000_READ_REG(hw, EEWR);
if(reg & E1000_EEPROM_RW_REG_DONE) {
@@ -5136,7 +5136,7 @@ e1000_mc_addr_list_update(struct e1000_h
uint32_t i;
uint32_t num_rar_entry;
uint32_t num_mta_entry;
-
+
DEBUGFUNC("e1000_mc_addr_list_update");
/* Set the new number of MC addresses that we are being requested to use. */
@@ -6241,7 +6241,7 @@ e1000_check_polarity(struct e1000_hw *hw
* 1 - Downshift ocured.
*
* returns: - E1000_ERR_XXX
- * E1000_SUCCESS
+ * E1000_SUCCESS
*
* For phy's older then IGP, this function reads the Downshift bit in the Phy
* Specific Status register. For IGP phy's, it reads the Downgrade bit in the
@@ -6256,7 +6256,7 @@ e1000_check_downshift(struct e1000_hw *h
DEBUGFUNC("e1000_check_downshift");
- if(hw->phy_type == e1000_phy_igp ||
+ if(hw->phy_type == e1000_phy_igp ||
hw->phy_type == e1000_phy_igp_2) {
ret_val = e1000_read_phy_reg(hw, IGP01E1000_PHY_LINK_HEALTH,
&phy_data);
@@ -6685,8 +6685,8 @@ e1000_set_d0_lplu_state(struct e1000_hw
} else {
-
- phy_data |= IGP02E1000_PM_D0_LPLU;
+
+ phy_data |= IGP02E1000_PM_D0_LPLU;
ret_val = e1000_write_phy_reg(hw, IGP02E1000_PHY_POWER_MGMT, phy_data);
if (ret_val)
return ret_val;
@@ -6778,7 +6778,7 @@ int32_t
e1000_host_if_read_cookie(struct e1000_hw * hw, uint8_t *buffer)
{
uint8_t i;
- uint32_t offset = E1000_MNG_DHCP_COOKIE_OFFSET;
+ uint32_t offset = E1000_MNG_DHCP_COOKIE_OFFSET;
uint8_t length = E1000_MNG_DHCP_COOKIE_LENGTH;
length = (length >> 2);
@@ -6797,7 +6797,7 @@ e1000_host_if_read_cookie(struct e1000_h
* and also checks whether the previous command is completed.
* It busy waits in case of previous command is not completed.
*
- * returns: - E1000_ERR_HOST_INTERFACE_COMMAND in case if is not ready or
+ * returns: - E1000_ERR_HOST_INTERFACE_COMMAND in case if is not ready or
* timeout
* - E1000_SUCCESS for success.
****************************************************************************/
@@ -6821,7 +6821,7 @@ e1000_mng_enable_host_if(struct e1000_hw
msec_delay_irq(1);
}
- if (i == E1000_MNG_DHCP_COMMAND_TIMEOUT) {
+ if (i == E1000_MNG_DHCP_COMMAND_TIMEOUT) {
DEBUGOUT("Previous command timeout failed .\n");
return -E1000_ERR_HOST_INTERFACE_COMMAND;
}
diff --git a/drivers/net/e1000/e1000_hw.h b/drivers/net/e1000/e1000_hw.h
index 03d07eb..467c9ed 100644
--- a/drivers/net/e1000/e1000_hw.h
+++ b/drivers/net/e1000/e1000_hw.h
@@ -375,7 +375,7 @@ struct e1000_host_mng_dhcp_cookie{
};
#endif
-int32_t e1000_mng_write_dhcp_info(struct e1000_hw *hw, uint8_t *buffer,
+int32_t e1000_mng_write_dhcp_info(struct e1000_hw *hw, uint8_t *buffer,
uint16_t length);
boolean_t e1000_check_mng_mode(struct e1000_hw *hw);
boolean_t e1000_enable_tx_pkt_filtering(struct e1000_hw *hw);
@@ -1802,7 +1802,7 @@ struct e1000_hw {
* value2 = [0..64512], default=4096
* value3 = [0..64512], default=0
*/
-
+
#define E1000_PSRCTL_BSIZE0_MASK 0x0000007F
#define E1000_PSRCTL_BSIZE1_MASK 0x00003F00
#define E1000_PSRCTL_BSIZE2_MASK 0x003F0000
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index df819c1..ccbe342 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -349,7 +349,7 @@ e1000_update_mng_vlan(struct e1000_adapt
* For ASF and Pass Through versions of f/w this means that the
* driver is no longer loaded. For AMT version (only with 82573) i
* of the f/w this means that the netowrk i/f is closed.
- *
+ *
**/
static void
@@ -381,10 +381,10 @@ e1000_release_hw_control(struct e1000_ad
* @adapter: address of board private structure
*
* e1000_get_hw_control sets {CTRL_EXT|FWSM}:DRV_LOAD bit.
- * For ASF and Pass Through versions of f/w this means that
- * the driver is loaded. For AMT version (only with 82573)
+ * For ASF and Pass Through versions of f/w this means that
+ * the driver is loaded. For AMT version (only with 82573)
* of the f/w this means that the netowrk i/f is open.
- *
+ *
**/
static void
@@ -714,8 +714,8 @@ e1000_probe(struct pci_dev *pdev,
DPRINTK(PROBE, INFO, "PHY reset is blocked due to SOL/IDER session.\n");
/* if ksp3, indicate if it's port a being setup */
- if (pdev->device == E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3 &&
- e1000_ksp3_port_a == 0)
+ if (pdev->device == E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3 &&
+ e1000_ksp3_port_a == 0)
adapter->ksp3_port_a = 1;
e1000_ksp3_port_a++;
/* Reset for multiple KP3 adapters */
@@ -743,9 +743,9 @@ e1000_probe(struct pci_dev *pdev,
if (pci_using_dac)
netdev->features |= NETIF_F_HIGHDMA;
- /* hard_start_xmit is safe against parallel locking */
- netdev->features |= NETIF_F_LLTX;
-
+ /* hard_start_xmit is safe against parallel locking */
+ netdev->features |= NETIF_F_LLTX;
+
adapter->en_mng_pt = e1000_enable_mng_pass_thru(&adapter->hw);
/* before reading the EEPROM, reset the controller to
@@ -2773,7 +2773,7 @@ e1000_xmit_frame(struct sk_buff *skb, st
unsigned int nr_frags = 0;
unsigned int mss = 0;
int count = 0;
- int tso;
+ int tso;
unsigned int f;
len -= skb->data_len;
@@ -2786,7 +2786,7 @@ e1000_xmit_frame(struct sk_buff *skb, st
#ifdef NETIF_F_TSO
mss = skb_shinfo(skb)->tso_size;
- /* The controller does a simple calculation to
+ /* The controller does a simple calculation to
* make sure there is enough room in the FIFO before
* initiating the DMA for each buffer. The calc is:
* 4 = ceil(buffer len/mss). To make sure we don't
@@ -2809,7 +2809,7 @@ e1000_xmit_frame(struct sk_buff *skb, st
case e1000_82573:
pull_size = min((unsigned int)4, skb->data_len);
if (!__pskb_pull_tail(skb, pull_size)) {
- printk(KERN_ERR
+ printk(KERN_ERR
"__pskb_pull_tail failed.\n");
dev_kfree_skb_any(skb);
return NETDEV_TX_OK;
@@ -3755,7 +3755,7 @@ e1000_clean_rx_irq_ps(struct e1000_adapt
* throughput, so unsplit small packets and save the alloc/put*/
if (l1 && ((length + l1) <= adapter->rx_ps_bsize0)) {
u8 *vaddr;
- /* there is no documentation about how to call
+ /* there is no documentation about how to call
* kmap_atomic, so we can't hold the mapping
* very long */
pci_dma_sync_single_for_cpu(pdev,
--
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related
* [PATCH 2/6] e1000: remove backslash r debug printfs
From: Kok, Auke @ 2006-05-23 21:08 UTC (permalink / raw)
To: Garzik, Jeff; +Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke
In-Reply-To: <20060523210740.18540.56647.stgit@gitlost.site>
This removes unwanted characters in the debug output that should have
never been there.
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/e1000/e1000_hw.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c
index 4c796e5..2e211df 100644
--- a/drivers/net/e1000/e1000_hw.c
+++ b/drivers/net/e1000/e1000_hw.c
@@ -2493,10 +2493,10 @@ e1000_config_fc_after_link_up(struct e10
*/
if(hw->original_fc == e1000_fc_full) {
hw->fc = e1000_fc_full;
- DEBUGOUT("Flow Control = FULL.\r\n");
+ DEBUGOUT("Flow Control = FULL.\n");
} else {
hw->fc = e1000_fc_rx_pause;
- DEBUGOUT("Flow Control = RX PAUSE frames only.\r\n");
+ DEBUGOUT("Flow Control = RX PAUSE frames only.\n");
}
}
/* For receiving PAUSE frames ONLY.
@@ -2512,7 +2512,7 @@ e1000_config_fc_after_link_up(struct e10
(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) &&
(mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) {
hw->fc = e1000_fc_tx_pause;
- DEBUGOUT("Flow Control = TX PAUSE frames only.\r\n");
+ DEBUGOUT("Flow Control = TX PAUSE frames only.\n");
}
/* For transmitting PAUSE frames ONLY.
*
@@ -2527,7 +2527,7 @@ e1000_config_fc_after_link_up(struct e10
!(mii_nway_lp_ability_reg & NWAY_LPAR_PAUSE) &&
(mii_nway_lp_ability_reg & NWAY_LPAR_ASM_DIR)) {
hw->fc = e1000_fc_rx_pause;
- DEBUGOUT("Flow Control = RX PAUSE frames only.\r\n");
+ DEBUGOUT("Flow Control = RX PAUSE frames only.\n");
}
/* Per the IEEE spec, at this point flow control should be
* disabled. However, we want to consider that we could
@@ -2553,10 +2553,10 @@ e1000_config_fc_after_link_up(struct e10
hw->original_fc == e1000_fc_tx_pause) ||
hw->fc_strict_ieee) {
hw->fc = e1000_fc_none;
- DEBUGOUT("Flow Control = NONE.\r\n");
+ DEBUGOUT("Flow Control = NONE.\n");
} else {
hw->fc = e1000_fc_rx_pause;
- DEBUGOUT("Flow Control = RX PAUSE frames only.\r\n");
+ DEBUGOUT("Flow Control = RX PAUSE frames only.\n");
}
/* Now we need to do one last check... If we auto-
@@ -2581,7 +2581,7 @@ e1000_config_fc_after_link_up(struct e10
return ret_val;
}
} else {
- DEBUGOUT("Copper PHY and Auto Neg has not completed.\r\n");
+ DEBUGOUT("Copper PHY and Auto Neg has not completed.\n");
}
}
return E1000_SUCCESS;
@@ -2764,7 +2764,7 @@ e1000_check_for_link(struct e1000_hw *hw
hw->autoneg_failed = 1;
return 0;
}
- DEBUGOUT("NOT RXing /C/, disable AutoNeg and force link.\r\n");
+ DEBUGOUT("NOT RXing /C/, disable AutoNeg and force link.\n");
/* Disable auto-negotiation in the TXCW register */
E1000_WRITE_REG(hw, TXCW, (hw->txcw & ~E1000_TXCW_ANE));
@@ -2789,7 +2789,7 @@ e1000_check_for_link(struct e1000_hw *hw
else if(((hw->media_type == e1000_media_type_fiber) ||
(hw->media_type == e1000_media_type_internal_serdes)) &&
(ctrl & E1000_CTRL_SLU) && (rxcw & E1000_RXCW_C)) {
- DEBUGOUT("RXing /C/, enable AutoNeg and stop forcing link.\r\n");
+ DEBUGOUT("RXing /C/, enable AutoNeg and stop forcing link.\n");
E1000_WRITE_REG(hw, TXCW, hw->txcw);
E1000_WRITE_REG(hw, CTRL, (ctrl & ~E1000_CTRL_SLU));
@@ -2852,13 +2852,13 @@ e1000_get_speed_and_duplex(struct e1000_
if(status & E1000_STATUS_FD) {
*duplex = FULL_DUPLEX;
- DEBUGOUT("Full Duplex\r\n");
+ DEBUGOUT("Full Duplex\n");
} else {
*duplex = HALF_DUPLEX;
- DEBUGOUT(" Half Duplex\r\n");
+ DEBUGOUT(" Half Duplex\n");
}
} else {
- DEBUGOUT("1000 Mbs, Full Duplex\r\n");
+ DEBUGOUT("1000 Mbs, Full Duplex\n");
*speed = SPEED_1000;
*duplex = FULL_DUPLEX;
}
--
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related
* [PATCH 1/6] e1000: add shutdown handler back to fix WOL
From: Kok, Auke @ 2006-05-23 21:08 UTC (permalink / raw)
To: Garzik, Jeff; +Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke
In-Reply-To: <20060523210740.18540.56647.stgit@gitlost.site>
Someone was waaay too aggressive and removed e1000's reboot notifier
instead of porting it to the new way of the shutdown handler. This change
broke wake on lan. Add the shutdown handler back in using the same method
as e100 uses.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
---
drivers/net/e1000/e1000_main.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index fb8cef6..df819c1 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -221,6 +221,7 @@ static void e1000_restore_vlan(struct e1
static int e1000_suspend(struct pci_dev *pdev, pm_message_t state);
static int e1000_resume(struct pci_dev *pdev);
#endif
+static void e1000_shutdown(struct pci_dev *pdev);
#ifdef CONFIG_NET_POLL_CONTROLLER
/* for netdump / net console */
@@ -236,8 +237,9 @@ static struct pci_driver e1000_driver =
/* Power Managment Hooks */
#ifdef CONFIG_PM
.suspend = e1000_suspend,
- .resume = e1000_resume
+ .resume = e1000_resume,
#endif
+ .shutdown = e1000_shutdown
};
MODULE_AUTHOR("Intel Corporation, <linux.nics@intel.com>");
@@ -4605,6 +4607,12 @@ e1000_resume(struct pci_dev *pdev)
return 0;
}
#endif
+
+static void e1000_shutdown(struct pci_dev *pdev)
+{
+ e1000_suspend(pdev, PMSG_SUSPEND);
+}
+
#ifdef CONFIG_NET_POLL_CONTROLLER
/*
* Polling 'interrupt' - used by things like netconsole to send skbs
--
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related
* [PATCH 0/6] e1000: update to 7.0.38-k4
From: Kok, Auke @ 2006-05-23 21:07 UTC (permalink / raw)
To: Garzik, Jeff; +Cc: netdev, Brandeburg, Jesse, Kok, Auke, Kok, Auke
Hi,
These e1000 patches include a fix for WOL and some driver cleanups:
[1]: add shutdown handler back to fix WOL
[2]: remove backslash r debug printfs
[3]: remove leading and trailing whitespace.
[4]: Fix date string in Makefile
[5]: remove changelog in driver
[6]: bump version to 7.0.38-k4
Jeff, please pull from:
git://lost.foo-projects.org/~ahkok/git/netdev-2.6 e1000-7.0.38-k4
These patches are against
netdev-2.6#upstream 4e3ceac609cce39cb96e0eb8604934592371ed8c
Cheers,
Auke
---
drivers/net/e1000/Makefile | 2 -
drivers/net/e1000/e1000_ethtool.c | 44 +++++++--------
drivers/net/e1000/e1000_hw.c | 112 +++++++++++++++++++------------------
drivers/net/e1000/e1000_hw.h | 4 +
drivers/net/e1000/e1000_main.c | 77 ++++++++-----------------
5 files changed, 104 insertions(+), 135 deletions(-)
--
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply
* Re: NETDEV WATCHDOG: eth2: transmit timed out with 3c905C-TX
From: Steffen Klassert @ 2006-05-23 20:58 UTC (permalink / raw)
To: Marco Berizzi; +Cc: netdev
In-Reply-To: <BAY103-F2462FDDB9BC08C70A15B89B29B0@phx.gbl>
On Tue, May 23, 2006 at 03:36:35PM +0200, Marco Berizzi wrote:
> Steffen Klassert wrote:
>
> >On Wed, Apr 05, 2006 at 06:33:18PM +0200, Marco Berizzi wrote:
> >> Hello everybody.
> >> I'm getting these errors (with packet/connectivity loss) on
> >> our firewall after I have plugged in a 3c905C nic. Linux is
> >> Slackware 10.2 with vanilla 2.6.16.1.
> >>
> >> Hints?
> >>
> >> PS: I have temporary resolved the problem running 'ifconfig
> >> eth2 down' and 'ifconfig eth2 up'
> >>
> >> Apr 5 17:47:07 Teti kernel: eth2: Resetting the Tx ring pointer.
> >> Apr 5 17:47:47 Teti last message repeated 4 times
> >> Apr 5 17:48:57 Teti last message repeated 7 times
> >> Apr 5 17:49:57 Teti last message repeated 6 times
> >> Apr 5 17:50:57 Teti last message repeated 6 times
> >>
> >> Apr 5 17:47:07 Teti kernel: NETDEV WATCHDOG: eth2: transmit timed out
> >
> >There were some problems of this kind with 10base2 networks in 2.6.16.
> >Could you please try whether 2.6.17-rc1 has this problems too?
>
> [Sorry for the very huge delay, but after 2.6.17-rc1 upgrade
> xfs filesystem crashed].
>
> Same problem here with 2.6.17-rc3-git18. Running ifconfig
> eth2 down and ifconfig eth2 up resolves the problem for
> a while.
Actually I have not really an idea what is going on here,
but increasing the debug level could give some more informations.
Setting debug=4 is a good start.
Did you try older kernel versions too?
Steffen
^ permalink raw reply
* Re: [PATCH 0/9] ixgb: driver update to 1.0.104-k2
From: Jeff Garzik @ 2006-05-23 18:42 UTC (permalink / raw)
To: Kok, Auke
Cc: netdev, Brandeburg, Jesse, "Kok, Auke <auke-jan.h.kok",
Kok, Auke
In-Reply-To: <20060523180302.17428.89125.stgit@gitlost.site>
Kok, Auke wrote:
> Hi,
>
> This is a resend/updated set of patches for ixgb. They were originally
> sent earlier on 2005-04-21 by Jeff Kirsher. Some modifications were made
> after comments, and this series does not include 2 of the patches sent
> at that time (I will resend those modified later).
>
> Summary:
>
> [1] fix rare early tso completion
> [2] remove duplicate code setting duplex and speed
> [3] fix flow control
> [4] add NETIF_F_LLTX analogous to e1000
> [5] add copper 10gig driver id
> [6] remove hardcoded number
> [7] use DPRINTK and msglvl, and ethtool to control it
> [8] add tx timeout counter
> [9] increment version to 1.0.104-k2
>
>
> These changes are available through git.
>
> git pull git://lost.foo-projects.org/~ahkok/git/netdev-2.6 ixgb-1.0.104-k2
>
> these patches are against
> netdev-2.6#upstream 4e3ceac609cce39cb96e0eb8604934592371ed8c
pulled, thanks
^ permalink raw reply
* [PATCH 9/9] ixgb: increment version to 1.0.104-k2
From: Kok, Auke @ 2006-05-23 18:04 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, "Kok, Auke <auke-jan.h.kok",
Kok, Auke
In-Reply-To: <20060523180302.17428.89125.stgit@gitlost.site>
Increment the driver version to 1.0.104-k2
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---
drivers/net/ixgb/ixgb_main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index da0b919..0905a82 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.";
--
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related
* [PATCH 8/9] ixgb: add tx timeout counter
From: Kok, Auke @ 2006-05-23 18:04 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, "Kok, Auke <auke-jan.h.kok",
Kok, Auke
In-Reply-To: <20060523180302.17428.89125.stgit@gitlost.site>
This adds a TX timeout counter to the ethtool stats, a tx timeout
debug message, and sets the timer to 5 seconds.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@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 a687f12..b9c37fd 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 560b4b6..6d8192f 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 4115bf3..da0b919 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -428,7 +428,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;
@@ -1509,6 +1509,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);
}
@@ -1838,11 +1839,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;
--
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related
* [PATCH 7/9] ixgb: use DPRINTK and msglvl, and ethtool to control it
From: Kok, Auke @ 2006-05-23 18:04 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, "Kok, Auke <auke-jan.h.kok",
Kok, Auke
In-Reply-To: <20060523180302.17428.89125.stgit@gitlost.site>
Use DPRINTK and msglvl, and ethtool to control it. Add proper names
to netdev structs and mappings.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---
drivers/net/ixgb/ixgb.h | 8 ++++++-
drivers/net/ixgb/ixgb_ethtool.c | 15 +++++++++++++
drivers/net/ixgb/ixgb_main.c | 46 +++++++++++++++++++++++++++------------
3 files changed, 54 insertions(+), 15 deletions(-)
diff --git a/drivers/net/ixgb/ixgb.h b/drivers/net/ixgb/ixgb.h
index c83271b..a687f12 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 f6baf28..560b4b6 100644
--- a/drivers/net/ixgb/ixgb_ethtool.c
+++ b/drivers/net/ixgb/ixgb_ethtool.c
@@ -250,6 +250,19 @@ 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
@@ -709,6 +722,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 0de3ed0..4115bf3 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -150,6 +150,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
@@ -251,7 +256,7 @@ ixgb_up(struct ixgb_adapter *adapter)
if (!pcix)
adapter->have_msi = FALSE;
else if((err = pci_enable_msi(adapter->pdev))) {
- printk (KERN_ERR
+ DPRINTK(PROBE, ERR,
"Unable to allocate MSI interrupt Error: %d\n", err);
adapter->have_msi = FALSE;
/* proceed to try to request regular interrupt */
@@ -261,8 +266,11 @@ ixgb_up(struct ixgb_adapter *adapter)
#endif
if((err = request_irq(adapter->pdev->irq, &ixgb_intr,
SA_SHIRQ | SA_SAMPLE_RANDOM,
- netdev->name, netdev)))
+ 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);
@@ -328,7 +336,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");
}
/**
@@ -365,7 +373,8 @@ 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");
+ printk(KERN_ERR
+ "ixgb: No usable DMA configuration, aborting\n");
goto err_dma_mask;
}
pci_using_dac = 0;
@@ -390,6 +399,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);
@@ -430,6 +440,7 @@ ixgb_probe(struct pci_dev *pdev,
netdev->poll_controller = ixgb_netpoll;
#endif
+ strcpy(netdev->name, pci_name(pdev));
netdev->mem_start = mmio_start;
netdev->mem_end = mmio_start + mmio_len;
netdev->base_addr = adapter->hw.io_base;
@@ -461,7 +472,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;
}
@@ -470,6 +481,7 @@ ixgb_probe(struct pci_dev *pdev,
memcpy(netdev->perm_addr, netdev->dev_addr, netdev->addr_len);
if(!is_valid_ether_addr(netdev->perm_addr)) {
+ DPRINTK(PROBE, ERR, "Invalid MAC Address\n");
err = -EIO;
goto err_eeprom;
}
@@ -483,6 +495,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;
@@ -491,8 +504,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 */
@@ -573,7 +585,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 */
@@ -671,6 +683,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);
@@ -683,6 +697,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);
@@ -756,6 +772,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);
@@ -769,6 +787,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);
@@ -1118,8 +1138,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);
@@ -1129,9 +1149,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);
@@ -1529,7 +1547,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;
}
--
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related
* [PATCH 6/9] ixgb: remove hardcoded number
From: Kok, Auke @ 2006-05-23 18:04 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, "Kok, Auke <auke-jan.h.kok",
Kok, Auke
In-Reply-To: <20060523180302.17428.89125.stgit@gitlost.site>
This adds a define for an awkward and uncommented value.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---
drivers/net/ixgb/ixgb_ethtool.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ixgb/ixgb_ethtool.c b/drivers/net/ixgb/ixgb_ethtool.c
index 4db63e0..f6baf28 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;
@@ -300,7 +302,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 */
}
--
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related
* [PATCH 5/9] ixgb: add copper 10gig driver id
From: Kok, Auke @ 2006-05-23 18:04 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, "Kok, Auke <auke-jan.h.kok",
Kok, Auke
In-Reply-To: <20060523180302.17428.89125.stgit@gitlost.site>
Add support for Copper 10GbE device ID 109E
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@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 466cbe2..0de3ed0 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,
@@ -565,8 +567,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 */
--
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related
* [PATCH 4/9] ixgb: add NETIF_F_LLTX analogous to e1000
From: Kok, Auke @ 2006-05-23 18:04 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, "Kok, Auke <auke-jan.h.kok",
Kok, Auke
In-Reply-To: <20060523180302.17428.89125.stgit@gitlost.site>
add NETIF_F_LLTX code like e1000 has
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---
drivers/net/ixgb/ixgb_main.c | 31 +++++++++++++++++++++++++++++--
1 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index 13181c4..466cbe2 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -449,6 +449,9 @@ ixgb_probe(struct pci_dev *pdev,
#ifdef NETIF_F_TSO
netdev->features |= NETIF_F_TSO;
#endif
+#ifdef NETIF_F_LLTX
+ netdev->features |= NETIF_F_LLTX;
+#endif
if(pci_using_dac)
netdev->features |= NETIF_F_HIGHDMA;
@@ -1408,13 +1411,26 @@ ixgb_xmit_frame(struct sk_buff *skb, str
return 0;
}
+#ifdef NETIF_F_LLTX
+ local_irq_save(flags);
+ if (!spin_trylock(&adapter->tx_lock)) {
+ /* Collision - tell upper layer to requeue */
+ local_irq_restore(flags);
+ return NETDEV_TX_LOCKED;
+ }
+#else
spin_lock_irqsave(&adapter->tx_lock, flags);
+#endif
+
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;
}
+
+#ifndef NETIF_F_LLTX
spin_unlock_irqrestore(&adapter->tx_lock, flags);
+#endif
if(adapter->vlgrp && vlan_tx_tag_present(skb)) {
tx_flags |= IXGB_TX_FLAGS_VLAN;
@@ -1426,6 +1442,9 @@ ixgb_xmit_frame(struct sk_buff *skb, str
tso = ixgb_tso(adapter, skb);
if (tso < 0) {
dev_kfree_skb_any(skb);
+#ifdef NETIF_F_LLTX
+ spin_unlock_irqrestore(&adapter->tx_lock, flags);
+#endif
return NETDEV_TX_OK;
}
@@ -1439,7 +1458,15 @@ ixgb_xmit_frame(struct sk_buff *skb, str
netdev->trans_start = jiffies;
- return 0;
+#ifdef NETIF_F_LLTX
+ /* Make sure there is space in the ring for the next send. */
+ if(unlikely(IXGB_DESC_UNUSED(&adapter->tx_ring) < DESC_NEEDED))
+ netif_stop_queue(netdev);
+
+ spin_unlock_irqrestore(&adapter->tx_lock, flags);
+
+#endif
+ return NETDEV_TX_OK;
}
/**
--
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related
* [PATCH 3/9] ixgb: fix flow control
From: Kok, Auke @ 2006-05-23 18:04 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, "Kok, Auke <auke-jan.h.kok",
Kok, Auke
In-Reply-To: <20060523180302.17428.89125.stgit@gitlost.site>
Make default flow control only have *sending* of flow control packets
enabled, and fix to disable / enable flow control correctly. Set flow
control defaults to disable receiving flow control from the link
partner, to fix the transmit fifo overlow errata
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: John Ronciak <john.ronciak@intel.com>
---
drivers/net/ixgb/ixgb_param.c | 24 +++++++++++-------------
1 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/drivers/net/ixgb/ixgb_param.c b/drivers/net/ixgb/ixgb_param.c
index 8a83dfd..388462c 100644
--- a/drivers/net/ixgb/ixgb_param.c
+++ b/drivers/net/ixgb/ixgb_param.c
@@ -76,7 +76,7 @@ IXGB_PARAM(RxDescriptors, "Number of rec
* - 2 - Tx only, generate PAUSE frames but ignore them on receive
* - 3 - Full Flow Control Support
*
- * Default Value: Read flow control settings from the EEPROM
+ * Default Value: 2 - Tx only (silicon bug avoidance)
*/
IXGB_PARAM(FlowControl, "Flow Control setting");
@@ -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 */
--
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related
* [PATCH 2/9] ixgb: remove duplicate code setting duplex and speed
From: Kok, Auke @ 2006-05-23 18:04 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, "Kok, Auke <auke-jan.h.kok",
Kok, Auke
In-Reply-To: <20060523180302.17428.89125.stgit@gitlost.site>
Removed duplicate code. Create ixgb_set_speed_duplex function to contain
duplicate code.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@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 d38ade5..4db63e0 100644
--- a/drivers/net/ixgb/ixgb_ethtool.c
+++ b/drivers/net/ixgb/ixgb_ethtool.c
@@ -117,6 +117,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)
{
@@ -130,12 +140,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);
@@ -183,11 +188,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);
@@ -212,11 +213,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;
@@ -593,11 +590,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;
--
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related
* [PATCH 1/9] ixgb: fix rare early tso completion
From: Kok, Auke @ 2006-05-23 18:04 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, "Kok, Auke <auke-jan.h.kok",
Kok, Auke
In-Reply-To: <20060523180302.17428.89125.stgit@gitlost.site>
Fix rare early completion when using TSO. This essentially is the
e1000 fix, with code that was mostly already written. Another skb frag
was also needed.
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@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 cfd67d8..13181c4 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -1266,6 +1266,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;
@@ -1277,6 +1278,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,
@@ -1301,6 +1307,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,
@@ -1378,7 +1390,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)
@@ -1416,7 +1429,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;
--
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply related
* [PATCH 0/9] ixgb: driver update to 1.0.104-k2
From: Kok, Auke @ 2006-05-23 18:03 UTC (permalink / raw)
To: Garzik, Jeff
Cc: netdev, Brandeburg, Jesse, "Kok, Auke <auke-jan.h.kok",
Kok, Auke
Hi,
This is a resend/updated set of patches for ixgb. They were originally
sent earlier on 2005-04-21 by Jeff Kirsher. Some modifications were made
after comments, and this series does not include 2 of the patches sent
at that time (I will resend those modified later).
Summary:
[1] fix rare early tso completion
[2] remove duplicate code setting duplex and speed
[3] fix flow control
[4] add NETIF_F_LLTX analogous to e1000
[5] add copper 10gig driver id
[6] remove hardcoded number
[7] use DPRINTK and msglvl, and ethtool to control it
[8] add tx timeout counter
[9] increment version to 1.0.104-k2
These changes are available through git.
git pull git://lost.foo-projects.org/~ahkok/git/netdev-2.6 ixgb-1.0.104-k2
these patches are against
netdev-2.6#upstream 4e3ceac609cce39cb96e0eb8604934592371ed8c
Cheers,
Auke
---
drivers/net/ixgb/ixgb.h | 9 ++-
drivers/net/ixgb/ixgb_ethtool.c | 55 ++++++++++------
drivers/net/ixgb/ixgb_hw.h | 1
drivers/net/ixgb/ixgb_ids.h | 4 +
drivers/net/ixgb/ixgb_main.c | 132 ++++++++++++++++++++++++++++++++-------
drivers/net/ixgb/ixgb_param.c | 24 +++----
6 files changed, 163 insertions(+), 62 deletions(-)
--
Auke Kok <auke-jan.h.kok@intel.com>
^ permalink raw reply
* Re: r8169 cardbus device naming weirdness
From: Stephen Hemminger @ 2006-05-23 17:51 UTC (permalink / raw)
To: Martin Hicks; +Cc: romieu, netdev
In-Reply-To: <20060523174402.GG29687@bork.org>
On Tue, 23 May 2006 13:44:02 -0400
Martin Hicks <mort@bork.org> wrote:
>
> Hi,
>
> I've got a D-Link DGE-660TD that the driver claims to register as eth1,
> but it actually ends up being eth2. (eth0 is the on-board NIC).
>
> mort@socrates:~$ dmesg
>
> [...]
>
> r8169 Gigabit Ethernet driver 2.2LK-NAPI loaded
> ACPI: PCI Interrupt 0000:07:00.0[A] -> Link [LNKB] -> GSI 5 (level, low) -> IRQ 5
> eth1: Identified chip type is 'RTL8169s/8110s'.
> eth1: RTL8169 at 0xe8a36000, 00:13:46:29:65:62, IRQ 5
> mort@socrates:~$ sudo /sbin/ifconfig eth1 192.168.1.102 netmask 255.255.255.0
> SIOCSIFADDR: No such device
> eth1: ERROR while getting interface flags: No such device
> SIOCSIFNETMASK: No such device
> mort@socrates:~$ sudo /sbin/ifconfig eth2 192.168.1.102 netmask 255.255.255.0
> mort@socrates:~$ sudo /usr/sbin/ethtool -i eth2
> driver: r8169
> version: 2.2LK-NAPI
> firmware-version:
> bus-info: 0000:07:00.0
> mort@socrates:~$ sudo /usr/sbin/ethtool -i eth1
> Cannot get driver information: No such device
> mort@socrates:~$
>
>
> On a IBM T23 laptop running 2.6.16.14.
Most likely some user space script is renaming it.
Each distro seems to have it's own way of doing configuration, and most
do something in response to the hotplug event from device registration.
So it was eth1 until what ever ran in response to the hotplug event
decide to change it.
^ permalink raw reply
* r8169 cardbus device naming weirdness
From: Martin Hicks @ 2006-05-23 17:44 UTC (permalink / raw)
To: romieu; +Cc: netdev
[-- Attachment #1: Type: text/plain, Size: 1051 bytes --]
Hi,
I've got a D-Link DGE-660TD that the driver claims to register as eth1,
but it actually ends up being eth2. (eth0 is the on-board NIC).
mort@socrates:~$ dmesg
[...]
r8169 Gigabit Ethernet driver 2.2LK-NAPI loaded
ACPI: PCI Interrupt 0000:07:00.0[A] -> Link [LNKB] -> GSI 5 (level, low) -> IRQ 5
eth1: Identified chip type is 'RTL8169s/8110s'.
eth1: RTL8169 at 0xe8a36000, 00:13:46:29:65:62, IRQ 5
mort@socrates:~$ sudo /sbin/ifconfig eth1 192.168.1.102 netmask 255.255.255.0
SIOCSIFADDR: No such device
eth1: ERROR while getting interface flags: No such device
SIOCSIFNETMASK: No such device
mort@socrates:~$ sudo /sbin/ifconfig eth2 192.168.1.102 netmask 255.255.255.0
mort@socrates:~$ sudo /usr/sbin/ethtool -i eth2
driver: r8169
version: 2.2LK-NAPI
firmware-version:
bus-info: 0000:07:00.0
mort@socrates:~$ sudo /usr/sbin/ethtool -i eth1
Cannot get driver information: No such device
mort@socrates:~$
On a IBM T23 laptop running 2.6.16.14.
--
Martin Hicks || mort@bork.org || PGP/GnuPG: 0x4C7F2BEE
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: [ANNOUNCE] FLAME: external kernel module for L2.5 meshing
From: Simon Oosthoek @ 2006-05-23 17:43 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev, linux-kernel
In-Reply-To: <20060523094324.11926fcc@localhost.localdomain>
Stephen Hemminger wrote:
> On Tue, 23 May 2006 16:07:47 +0200
> Herman Elfrink <herman.elfrink@ti-wmc.nl> wrote:
>
>>
>> FLAME stands for "Forwarding Layer for Meshing"
>>
>
> Didn't you just reinvent 802.1d bridging? and/or WDS?
I wouldn't say "reinvent", but the difference is small but significant.
FLAME could be seen as ad hoc WDS, I think. It doesn't need to know
about the other "base-stations", which I think WDS does.
> As far as the Ethernet protocol field. Getting a real assigned number
> would have to come out of the IEEE 802.
>
> You would need
> http://standards.ieee.org/regauth/ethertype/forms/index.html
>
> It is cheaper (free vs $2500) to get a LLC sap assigned, but then
> you would have to change the protocol.
> http://standards.ieee.org/regauth/llc/index.html
Wow, thanks, $2500 is a bit steep for a useful experiment ;-)
The free option could be interesting though...
Cheers
Simon
^ permalink raw reply
* Re: [ANNOUNCE] FLAME: external kernel module for L2.5 meshing
From: Stephen Hemminger @ 2006-05-23 16:43 UTC (permalink / raw)
To: Herman Elfrink; +Cc: netdev, linux-kernel
In-Reply-To: <44731733.7000204@ti-wmc.nl>
On Tue, 23 May 2006 16:07:47 +0200
Herman Elfrink <herman.elfrink@ti-wmc.nl> wrote:
>
> FLAME stands for "Forwarding Layer for Meshing"
>
> FLAME provides an intermediate layer between the network layer (e.g.
> IPv4/IPv6) and the link (MAC) layer, providing L2.5 meshing. Both
> network layer and MAC layer can be used unchanged: to the network layer
> FLAME appears as a normal Ethernet-type MAC layer, and the underlying
> `real' MAC layer will see it as just another type of network layer.
>
Didn't you just reinvent 802.1d bridging? and/or WDS?
As far as the Ethernet protocol field. Getting a real assigned number
would have to come out of the IEEE 802.
You would need
http://standards.ieee.org/regauth/ethertype/forms/index.html
It is cheaper (free vs $2500) to get a LLC sap assigned, but then
you would have to change the protocol.
http://standards.ieee.org/regauth/llc/index.html
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox