* [net-next-2.6 PATCH 1/4] ixgbe: fix 82598 SFP initialization after driver load.
@ 2009-05-27 0:54 Jeff Kirsher
2009-05-27 0:54 ` [net-next-2.6 PATCH 2/4] ixgbe: fix driver loading with unsupported module on 82598 Jeff Kirsher
` (3 more replies)
0 siblings, 4 replies; 13+ messages in thread
From: Jeff Kirsher @ 2009-05-27 0:54 UTC (permalink / raw)
To: davem; +Cc: netdev, Don Skidmore, Peter P Waskiewicz Jr, Jeff Kirsher
From: Don Skidmore <donald.c.skidmore@intel.com>
If we loaded the driver with out a SFP module plugged in it would
leave it in a state that make it later unable to link when a module
was plugged in. This patch corrects that by:
ixgbe_probe() - moving the check for IXGBE_ERR_SFP_NOT_PRESENT from
after get_invariants() to after reset_hw() as now reset_hw() is
where this condition will be indentified.
ixgbe_reset_hw_82598() - Enable this function to now return
IXGBE_ERR_SFP_NOT_PRESENT.
ixgbe_identify_sfp_module_generic() - This where the lack of SFP
module is detected. Modifications are added to allow a different
return value for modules that just haven't been plugged in yet.
Other functions were updated to allow correct logging.
Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ixgbe/ixgbe_82598.c | 12 ++++++++++--
drivers/net/ixgbe/ixgbe_main.c | 33 +++++++++++++++++----------------
drivers/net/ixgbe/ixgbe_phy.c | 13 ++++++++++++-
3 files changed, 39 insertions(+), 19 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_82598.c b/drivers/net/ixgbe/ixgbe_82598.c
index afc9fe3..88e8350 100644
--- a/drivers/net/ixgbe/ixgbe_82598.c
+++ b/drivers/net/ixgbe/ixgbe_82598.c
@@ -698,6 +698,7 @@ static s32 ixgbe_setup_copper_link_speed_82598(struct ixgbe_hw *hw,
static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw)
{
s32 status = 0;
+ s32 phy_status = 0;
u32 ctrl;
u32 gheccr;
u32 i;
@@ -745,13 +746,17 @@ static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw)
/* PHY ops must be identified and initialized prior to reset */
/* Init PHY and function pointers, perform SFP setup */
- status = hw->phy.ops.init(hw);
- if (status == IXGBE_ERR_SFP_NOT_SUPPORTED)
+ phy_status = hw->phy.ops.init(hw);
+ if (phy_status == IXGBE_ERR_SFP_NOT_SUPPORTED)
goto reset_hw_out;
+ else if (phy_status == IXGBE_ERR_SFP_NOT_PRESENT)
+ goto no_phy_reset;
+
hw->phy.ops.reset(hw);
}
+no_phy_reset:
/*
* Prevent the PCI-E bus from from hanging by disabling PCI-E master
* access and verify no pending requests before reset
@@ -811,6 +816,9 @@ static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw)
hw->mac.ops.get_mac_addr(hw, hw->mac.perm_addr);
reset_hw_out:
+ if (phy_status)
+ status = phy_status;
+
return status;
}
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index e52798c..f9223ac 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -2599,7 +2599,10 @@ int ixgbe_up(struct ixgbe_adapter *adapter)
void ixgbe_reset(struct ixgbe_adapter *adapter)
{
struct ixgbe_hw *hw = &adapter->hw;
- if (hw->mac.ops.init_hw(hw))
+ int err;
+
+ err = hw->mac.ops.init_hw(hw);
+ if (err && (err != IXGBE_ERR_SFP_NOT_PRESENT))
dev_err(&adapter->pdev->dev, "Hardware Error\n");
/* reprogram the RAR[0] in case user changed it. */
@@ -5167,20 +5170,7 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
INIT_WORK(&adapter->sfp_config_module_task,
ixgbe_sfp_config_module_task);
- err = ii->get_invariants(hw);
- if (err == IXGBE_ERR_SFP_NOT_PRESENT) {
- /* start a kernel thread to watch for a module to arrive */
- set_bit(__IXGBE_SFP_MODULE_NOT_FOUND, &adapter->state);
- mod_timer(&adapter->sfp_timer,
- round_jiffies(jiffies + (2 * HZ)));
- err = 0;
- } else if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) {
- DPRINTK(PROBE, ERR, "failed to load because an "
- "unsupported SFP+ module type was detected.\n");
- goto err_hw_init;
- } else if (err) {
- goto err_hw_init;
- }
+ ii->get_invariants(hw);
/* setup the private structure */
err = ixgbe_sw_init(adapter);
@@ -5200,7 +5190,18 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
/* reset_hw fills in the perm_addr as well */
err = hw->mac.ops.reset_hw(hw);
- if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) {
+ if (err == IXGBE_ERR_SFP_NOT_PRESENT &&
+ hw->mac.type == ixgbe_mac_82598EB) {
+ /*
+ * Start a kernel thread to watch for a module to arrive.
+ * Only do this for 82598, since 82599 will generate
+ * interrupts on module arrival.
+ */
+ set_bit(__IXGBE_SFP_MODULE_NOT_FOUND, &adapter->state);
+ mod_timer(&adapter->sfp_timer,
+ round_jiffies(jiffies + (2 * HZ)));
+ err = 0;
+ } else if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) {
dev_err(&adapter->pdev->dev, "failed to load because an "
"unsupported SFP+ module type was detected.\n");
goto err_sw_init;
diff --git a/drivers/net/ixgbe/ixgbe_phy.c b/drivers/net/ixgbe/ixgbe_phy.c
index 8210b49..e43d624 100644
--- a/drivers/net/ixgbe/ixgbe_phy.c
+++ b/drivers/net/ixgbe/ixgbe_phy.c
@@ -530,11 +530,22 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
u8 cable_tech = 0;
u16 enforce_sfp = 0;
+ if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_fiber) {
+ hw->phy.sfp_type = ixgbe_sfp_type_not_present;
+ status = IXGBE_ERR_SFP_NOT_PRESENT;
+ goto out;
+ }
+
status = hw->phy.ops.read_i2c_eeprom(hw, IXGBE_SFF_IDENTIFIER,
&identifier);
- if (status == IXGBE_ERR_SFP_NOT_PRESENT) {
+ if (status == IXGBE_ERR_SFP_NOT_PRESENT || status == IXGBE_ERR_I2C) {
+ status = IXGBE_ERR_SFP_NOT_PRESENT;
hw->phy.sfp_type = ixgbe_sfp_type_not_present;
+ if (hw->phy.type != ixgbe_phy_nl) {
+ hw->phy.id = 0;
+ hw->phy.type = ixgbe_phy_unknown;
+ }
goto out;
}
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [net-next-2.6 PATCH 2/4] ixgbe: fix driver loading with unsupported module on 82598
2009-05-27 0:54 [net-next-2.6 PATCH 1/4] ixgbe: fix 82598 SFP initialization after driver load Jeff Kirsher
@ 2009-05-27 0:54 ` Jeff Kirsher
2009-05-27 1:28 ` Ben Hutchings
2009-05-27 0:54 ` [net-next-2.6 PATCH 3/4] ixgbe: remove rx_hdr_split debug counter for non-debug configurations Jeff Kirsher
` (2 subsequent siblings)
3 siblings, 1 reply; 13+ messages in thread
From: Jeff Kirsher @ 2009-05-27 0:54 UTC (permalink / raw)
To: davem; +Cc: netdev, Don Skidmore, Peter P Waskiewicz Jr, Jeff Kirsher
From: Don Skidmore <donald.c.skidmore@intel.com>
Driver loads even when an unsupported module inserted. This was
caused by mdio45_probe not returning all the information we needed.
The fix is to replace that call with the new
ixgbe_validate_phy_addr().
We will now need to store the phy address which we do in the hw->phy
struct. Likewise we no longer need the mdio struct in hw->phy along
with the mdio functions ixgbe_mdio_write(read) which have been
removed. ixgbe_ioctl was no longer used and referenced hw->phy.mdio
so it was also removed.
Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ixgbe/ixgbe.h | 1 +
drivers/net/ixgbe/ixgbe_main.c | 42 ----------------------------------------
drivers/net/ixgbe/ixgbe_phy.c | 32 ++++++++++++++++++++++++------
drivers/net/ixgbe/ixgbe_phy.h | 1 +
drivers/net/ixgbe/ixgbe_type.h | 5 ++++-
5 files changed, 31 insertions(+), 50 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h
index 05a2405..0f396d2 100644
--- a/drivers/net/ixgbe/ixgbe.h
+++ b/drivers/net/ixgbe/ixgbe.h
@@ -394,6 +394,7 @@ extern void ixgbe_update_stats(struct ixgbe_adapter *adapter);
extern int ixgbe_init_interrupt_scheme(struct ixgbe_adapter *adapter);
extern void ixgbe_clear_interrupt_scheme(struct ixgbe_adapter *adapter);
extern void ixgbe_write_eitr(struct ixgbe_adapter *, int, u32);
+extern int ethtool_ioctl(struct ifreq *ifr);
#ifdef IXGBE_FCOE
extern void ixgbe_configure_fcoe(struct ixgbe_adapter *adapter);
extern int ixgbe_fso(struct ixgbe_adapter *adapter,
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index f9223ac..373cdc7 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -4914,40 +4914,6 @@ static int ixgbe_set_mac(struct net_device *netdev, void *p)
return 0;
}
-static int
-ixgbe_mdio_read(struct net_device *netdev, int prtad, int devad, u16 addr)
-{
- struct ixgbe_adapter *adapter = netdev_priv(netdev);
- struct ixgbe_hw *hw = &adapter->hw;
- u16 value;
- int rc;
-
- if (prtad != hw->phy.mdio.prtad)
- return -EINVAL;
- rc = hw->phy.ops.read_reg(hw, addr, devad, &value);
- if (!rc)
- rc = value;
- return rc;
-}
-
-static int ixgbe_mdio_write(struct net_device *netdev, int prtad, int devad,
- u16 addr, u16 value)
-{
- struct ixgbe_adapter *adapter = netdev_priv(netdev);
- struct ixgbe_hw *hw = &adapter->hw;
-
- if (prtad != hw->phy.mdio.prtad)
- return -EINVAL;
- return hw->phy.ops.write_reg(hw, addr, devad, value);
-}
-
-static int ixgbe_ioctl(struct net_device *netdev, struct ifreq *req, int cmd)
-{
- struct ixgbe_adapter *adapter = netdev_priv(netdev);
-
- return mdio_mii_ioctl(&adapter->hw.phy.mdio, if_mii(req), cmd);
-}
-
/**
* ixgbe_add_sanmac_netdev - Add the SAN MAC address to the corresponding
* netdev->dev_addr_list
@@ -5023,7 +4989,6 @@ static const struct net_device_ops ixgbe_netdev_ops = {
.ndo_vlan_rx_register = ixgbe_vlan_rx_register,
.ndo_vlan_rx_add_vid = ixgbe_vlan_rx_add_vid,
.ndo_vlan_rx_kill_vid = ixgbe_vlan_rx_kill_vid,
- .ndo_do_ioctl = ixgbe_ioctl,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = ixgbe_netpoll,
#endif
@@ -5146,13 +5111,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
/* PHY */
memcpy(&hw->phy.ops, ii->phy_ops, sizeof(hw->phy.ops));
hw->phy.sfp_type = ixgbe_sfp_type_unknown;
- /* ixgbe_identify_phy_generic will set prtad and mmds properly */
- hw->phy.mdio.prtad = MDIO_PRTAD_NONE;
- hw->phy.mdio.mmds = 0;
- hw->phy.mdio.mode_support = MDIO_SUPPORTS_C45 | MDIO_EMULATE_C22;
- hw->phy.mdio.dev = netdev;
- hw->phy.mdio.mdio_read = ixgbe_mdio_read;
- hw->phy.mdio.mdio_write = ixgbe_mdio_write;
/* set up this timer and work struct before calling get_invariants
* which might start the timer
diff --git a/drivers/net/ixgbe/ixgbe_phy.c b/drivers/net/ixgbe/ixgbe_phy.c
index e43d624..2e87989 100644
--- a/drivers/net/ixgbe/ixgbe_phy.c
+++ b/drivers/net/ixgbe/ixgbe_phy.c
@@ -60,7 +60,7 @@ s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw)
if (hw->phy.type == ixgbe_phy_unknown) {
for (phy_addr = 0; phy_addr < IXGBE_MAX_PHY_ADDR; phy_addr++) {
- if (mdio45_probe(&hw->phy.mdio, phy_addr) == 0) {
+ if (ixgbe_validate_phy_addr(hw, phy_addr)) {
ixgbe_get_phy_id(hw);
hw->phy.type =
ixgbe_get_phy_type_from_id(hw->phy.id);
@@ -76,6 +76,26 @@ s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw)
}
/**
+ * ixgbe_validate_phy_addr - Determines phy address is valid
+ * @hw: pointer to hardware structure
+ *
+ **/
+bool ixgbe_validate_phy_addr(struct ixgbe_hw *hw, u32 phy_addr)
+{
+ u16 phy_id = 0;
+ bool valid = false;
+
+ hw->phy.addr = phy_addr;
+ hw->phy.ops.read_reg(hw, IXGBE_MDIO_PHY_ID_HIGH,
+ IXGBE_MDIO_PMA_PMD_DEV_TYPE, &phy_id);
+
+ if (phy_id != 0xFFFF && phy_id != 0x0)
+ valid = true;
+
+ return valid;
+}
+
+/**
* ixgbe_get_phy_id - Get the phy type
* @hw: pointer to hardware structure
*
@@ -167,7 +187,7 @@ s32 ixgbe_read_phy_reg_generic(struct ixgbe_hw *hw, u32 reg_addr,
/* Setup and write the address cycle command */
command = ((reg_addr << IXGBE_MSCA_NP_ADDR_SHIFT) |
(device_type << IXGBE_MSCA_DEV_TYPE_SHIFT) |
- (hw->phy.mdio.prtad << IXGBE_MSCA_PHY_ADDR_SHIFT) |
+ (hw->phy.addr << IXGBE_MSCA_PHY_ADDR_SHIFT) |
(IXGBE_MSCA_ADDR_CYCLE | IXGBE_MSCA_MDI_COMMAND));
IXGBE_WRITE_REG(hw, IXGBE_MSCA, command);
@@ -198,8 +218,7 @@ s32 ixgbe_read_phy_reg_generic(struct ixgbe_hw *hw, u32 reg_addr,
*/
command = ((reg_addr << IXGBE_MSCA_NP_ADDR_SHIFT) |
(device_type << IXGBE_MSCA_DEV_TYPE_SHIFT) |
- (hw->phy.mdio.prtad <<
- IXGBE_MSCA_PHY_ADDR_SHIFT) |
+ (hw->phy.addr << IXGBE_MSCA_PHY_ADDR_SHIFT) |
(IXGBE_MSCA_READ | IXGBE_MSCA_MDI_COMMAND));
IXGBE_WRITE_REG(hw, IXGBE_MSCA, command);
@@ -268,7 +287,7 @@ s32 ixgbe_write_phy_reg_generic(struct ixgbe_hw *hw, u32 reg_addr,
/* Setup and write the address cycle command */
command = ((reg_addr << IXGBE_MSCA_NP_ADDR_SHIFT) |
(device_type << IXGBE_MSCA_DEV_TYPE_SHIFT) |
- (hw->phy.mdio.prtad << IXGBE_MSCA_PHY_ADDR_SHIFT) |
+ (hw->phy.addr << IXGBE_MSCA_PHY_ADDR_SHIFT) |
(IXGBE_MSCA_ADDR_CYCLE | IXGBE_MSCA_MDI_COMMAND));
IXGBE_WRITE_REG(hw, IXGBE_MSCA, command);
@@ -299,8 +318,7 @@ s32 ixgbe_write_phy_reg_generic(struct ixgbe_hw *hw, u32 reg_addr,
*/
command = ((reg_addr << IXGBE_MSCA_NP_ADDR_SHIFT) |
(device_type << IXGBE_MSCA_DEV_TYPE_SHIFT) |
- (hw->phy.mdio.prtad <<
- IXGBE_MSCA_PHY_ADDR_SHIFT) |
+ (hw->phy.addr << IXGBE_MSCA_PHY_ADDR_SHIFT) |
(IXGBE_MSCA_WRITE | IXGBE_MSCA_MDI_COMMAND));
IXGBE_WRITE_REG(hw, IXGBE_MSCA, command);
diff --git a/drivers/net/ixgbe/ixgbe_phy.h b/drivers/net/ixgbe/ixgbe_phy.h
index 9b700f5..5f76c9c 100644
--- a/drivers/net/ixgbe/ixgbe_phy.h
+++ b/drivers/net/ixgbe/ixgbe_phy.h
@@ -79,6 +79,7 @@
s32 ixgbe_init_phy_ops_generic(struct ixgbe_hw *hw);
+bool ixgbe_validate_phy_addr(struct ixgbe_hw *hw, u32 phy_addr);
s32 ixgbe_identify_phy_generic(struct ixgbe_hw *hw);
s32 ixgbe_reset_phy_generic(struct ixgbe_hw *hw);
s32 ixgbe_read_phy_reg_generic(struct ixgbe_hw *hw, u32 reg_addr,
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h
index ba3ed0f..00c23be 100644
--- a/drivers/net/ixgbe/ixgbe_type.h
+++ b/drivers/net/ixgbe/ixgbe_type.h
@@ -915,6 +915,7 @@
#define IXGBE_CORECTL_WRITE_CMD 0x00010000
/* MDIO definitions */
+#define IXGBE_MDIO_PMA_PMD_DEV_TYPE 0x1
#define IXGBE_MDIO_COMMAND_TIMEOUT 100 /* PHY Timeout for 1 GB mode */
@@ -925,6 +926,8 @@
#define IXGBE_MDIO_VENDOR_SPECIFIC_1_10G_SPEED 0x0018
#define IXGBE_MDIO_VENDOR_SPECIFIC_1_1G_SPEED 0x0010
+#define IXGBE_MDIO_PHY_ID_HIGH 0x2 /* PHY ID High Reg */
+
#define IXGBE_MDIO_PMA_PMD_SDA_SCL_ADDR 0xC30A /* PHY_XS SDA/SCL Addr Reg */
#define IXGBE_MDIO_PMA_PMD_SDA_SCL_DATA 0xC30B /* PHY_XS SDA/SCL Data Reg */
#define IXGBE_MDIO_PMA_PMD_SDA_SCL_STAT 0xC30C /* PHY_XS SDA/SCL Status Reg */
@@ -2286,8 +2289,8 @@ struct ixgbe_mac_info {
struct ixgbe_phy_info {
struct ixgbe_phy_operations ops;
- struct mdio_if_info mdio;
enum ixgbe_phy_type type;
+ u32 addr;
u32 id;
enum ixgbe_sfp_type sfp_type;
bool sfp_setup_needed;
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [net-next-2.6 PATCH 3/4] ixgbe: remove rx_hdr_split debug counter for non-debug configurations
2009-05-27 0:54 [net-next-2.6 PATCH 1/4] ixgbe: fix 82598 SFP initialization after driver load Jeff Kirsher
2009-05-27 0:54 ` [net-next-2.6 PATCH 2/4] ixgbe: fix driver loading with unsupported module on 82598 Jeff Kirsher
@ 2009-05-27 0:54 ` Jeff Kirsher
2009-05-27 3:38 ` David Miller
2009-05-27 0:55 ` [net-next-2.6 PATCH 4/4] ixgbe: Remove device ID 0x10d8 Jeff Kirsher
2009-05-27 3:40 ` [net-next-2.6 PATCH 1/4] ixgbe: fix 82598 SFP initialization after driver load David Miller
3 siblings, 1 reply; 13+ messages in thread
From: Jeff Kirsher @ 2009-05-27 0:54 UTC (permalink / raw)
To: davem; +Cc: netdev, Alexander Duyck, Jeff Kirsher
From: Alexander Duyck <alexander.h.duyck@intel.com>
The counter rx_hdr_split was meant to be a debug counter. As such it
should only be enabled when debugging.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ixgbe/ixgbe.h | 2 ++
drivers/net/ixgbe/ixgbe_ethtool.c | 2 ++
drivers/net/ixgbe/ixgbe_main.c | 2 ++
3 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h
index 0f396d2..f3f67d9 100644
--- a/drivers/net/ixgbe/ixgbe.h
+++ b/drivers/net/ixgbe/ixgbe.h
@@ -284,7 +284,9 @@ struct ixgbe_adapter {
struct ixgbe_ring_feature ring_feature[RING_F_ARRAY_SIZE];
struct msix_entry *msix_entries;
+#ifdef DEBUG
u64 rx_hdr_split;
+#endif
u32 alloc_rx_page_failed;
u32 alloc_rx_buff_failed;
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index 35255b8..f097014 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -87,7 +87,9 @@ static struct ixgbe_stats ixgbe_gstrings_stats[] = {
{"rx_csum_offload_good", IXGBE_STAT(hw_csum_rx_good)},
{"rx_csum_offload_errors", IXGBE_STAT(hw_csum_rx_error)},
{"tx_csum_offload_ctxt", IXGBE_STAT(hw_csum_tx_good)},
+#ifdef DEBUG
{"rx_header_split", IXGBE_STAT(rx_hdr_split)},
+#endif
{"alloc_rx_page_failed", IXGBE_STAT(alloc_rx_page_failed)},
{"alloc_rx_buff_failed", IXGBE_STAT(alloc_rx_buff_failed)},
{"rx_no_dma_resources", IXGBE_STAT(hw_rx_no_dma_resources)},
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 373cdc7..496bffb 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -694,8 +694,10 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
hdr_info = le16_to_cpu(ixgbe_get_hdr_info(rx_desc));
len = (hdr_info & IXGBE_RXDADV_HDRBUFLEN_MASK) >>
IXGBE_RXDADV_HDRBUFLEN_SHIFT;
+#ifdef DEBUG
if (hdr_info & IXGBE_RXDADV_SPH)
adapter->rx_hdr_split++;
+#endif
if (len > IXGBE_RX_HDR_SIZE)
len = IXGBE_RX_HDR_SIZE;
upper_len = le16_to_cpu(rx_desc->wb.upper.length);
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [net-next-2.6 PATCH 4/4] ixgbe: Remove device ID 0x10d8
2009-05-27 0:54 [net-next-2.6 PATCH 1/4] ixgbe: fix 82598 SFP initialization after driver load Jeff Kirsher
2009-05-27 0:54 ` [net-next-2.6 PATCH 2/4] ixgbe: fix driver loading with unsupported module on 82598 Jeff Kirsher
2009-05-27 0:54 ` [net-next-2.6 PATCH 3/4] ixgbe: remove rx_hdr_split debug counter for non-debug configurations Jeff Kirsher
@ 2009-05-27 0:55 ` Jeff Kirsher
2009-05-27 3:40 ` David Miller
2009-05-27 3:40 ` [net-next-2.6 PATCH 1/4] ixgbe: fix 82598 SFP initialization after driver load David Miller
3 siblings, 1 reply; 13+ messages in thread
From: Jeff Kirsher @ 2009-05-27 0:55 UTC (permalink / raw)
To: davem; +Cc: netdev, Peter P Waskiewicz Jr, Jeff Kirsher
From: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Device ID 0x10d8 is the default silicon device ID for 82599. However, the
device will not be functional without an EEPROM, so we want to prevent the
driver from loading on the device. Otherwise, the driver will load, but no
PHY setup or PCIe setup will occur, causing the device to be unusable. To
prevent users from encountering this, just remove the device ID.
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ixgbe/ixgbe_82599.c | 1 -
drivers/net/ixgbe/ixgbe_type.h | 1 -
2 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c
index fef7397..5d27830 100644
--- a/drivers/net/ixgbe/ixgbe_82599.c
+++ b/drivers/net/ixgbe/ixgbe_82599.c
@@ -357,7 +357,6 @@ enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw)
}
switch (hw->device_id) {
- case IXGBE_DEV_ID_82599:
case IXGBE_DEV_ID_82599_KX4:
case IXGBE_DEV_ID_82599_XAUI_LOM:
/* Default device ID is mezzanine card KX/KX4 */
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h
index 00c23be..0c8dee9 100644
--- a/drivers/net/ixgbe/ixgbe_type.h
+++ b/drivers/net/ixgbe/ixgbe_type.h
@@ -46,7 +46,6 @@
#define IXGBE_DEV_ID_82598_DA_DUAL_PORT 0x10F1
#define IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM 0x10E1
#define IXGBE_DEV_ID_82598EB_XF_LR 0x10F4
-#define IXGBE_DEV_ID_82599 0x10D8
#define IXGBE_DEV_ID_82599_KX4 0x10F7
#define IXGBE_DEV_ID_82599_SFP 0x10FB
#define IXGBE_DEV_ID_82599_XAUI_LOM 0x10FC
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [net-next-2.6 PATCH 2/4] ixgbe: fix driver loading with unsupported module on 82598
2009-05-27 0:54 ` [net-next-2.6 PATCH 2/4] ixgbe: fix driver loading with unsupported module on 82598 Jeff Kirsher
@ 2009-05-27 1:28 ` Ben Hutchings
2009-05-27 3:41 ` David Miller
0 siblings, 1 reply; 13+ messages in thread
From: Ben Hutchings @ 2009-05-27 1:28 UTC (permalink / raw)
To: Jeff Kirsher; +Cc: davem, netdev, Don Skidmore, Peter P Waskiewicz Jr
On Tue, 2009-05-26 at 17:54 -0700, Jeff Kirsher wrote:
> From: Don Skidmore <donald.c.skidmore@intel.com>
>
> Driver loads even when an unsupported module inserted.
Why not; they're hot-pluggable.
> This was
> caused by mdio45_probe not returning all the information we needed.
> The fix is to replace that call with the new
> ixgbe_validate_phy_addr().
You could improve mdio45_probe()...
> We will now need to store the phy address which we do in the hw->phy
> struct. Likewise we no longer need the mdio struct in hw->phy along
> with the mdio functions ixgbe_mdio_write(read) which have been
> removed. ixgbe_ioctl was no longer used and referenced hw->phy.mdio
> so it was also removed.
The ioctl is for the benefit of user-space!
[...]
> diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h
> index ba3ed0f..00c23be 100644
> --- a/drivers/net/ixgbe/ixgbe_type.h
> +++ b/drivers/net/ixgbe/ixgbe_type.h
> @@ -915,6 +915,7 @@
> #define IXGBE_CORECTL_WRITE_CMD 0x00010000
>
> /* MDIO definitions */
> +#define IXGBE_MDIO_PMA_PMD_DEV_TYPE 0x1
This is called MDIO_MMD_PMAPMD.
> #define IXGBE_MDIO_COMMAND_TIMEOUT 100 /* PHY Timeout for 1 GB mode */
>
> @@ -925,6 +926,8 @@
> #define IXGBE_MDIO_VENDOR_SPECIFIC_1_10G_SPEED 0x0018
> #define IXGBE_MDIO_VENDOR_SPECIFIC_1_1G_SPEED 0x0010
>
> +#define IXGBE_MDIO_PHY_ID_HIGH 0x2 /* PHY ID High Reg */
> +
This is called MDIO_DEVID1.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [net-next-2.6 PATCH 3/4] ixgbe: remove rx_hdr_split debug counter for non-debug configurations
2009-05-27 0:54 ` [net-next-2.6 PATCH 3/4] ixgbe: remove rx_hdr_split debug counter for non-debug configurations Jeff Kirsher
@ 2009-05-27 3:38 ` David Miller
2009-05-27 11:16 ` Ben Hutchings
0 siblings, 1 reply; 13+ messages in thread
From: David Miller @ 2009-05-27 3:38 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, alexander.h.duyck
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 26 May 2009 17:54:45 -0700
> The counter rx_hdr_split was meant to be a debug counter. As such it
> should only be enabled when debugging.
>
> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
I disagree with this change.
Any statistic is useful for diagnosing problems by users, and
if you hide it behind DEBUG then users never see the facility.
Either it's unconditionally in the driver or it's unconditionally out.
I say keep it in :-)
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [net-next-2.6 PATCH 4/4] ixgbe: Remove device ID 0x10d8
2009-05-27 0:55 ` [net-next-2.6 PATCH 4/4] ixgbe: Remove device ID 0x10d8 Jeff Kirsher
@ 2009-05-27 3:40 ` David Miller
0 siblings, 0 replies; 13+ messages in thread
From: David Miller @ 2009-05-27 3:40 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, peter.p.waskiewicz.jr
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 26 May 2009 17:55:02 -0700
> Device ID 0x10d8 is the default silicon device ID for 82599. However, the
> device will not be functional without an EEPROM, so we want to prevent the
> driver from loading on the device. Otherwise, the driver will load, but no
> PHY setup or PCIe setup will occur, causing the device to be unusable. To
> prevent users from encountering this, just remove the device ID.
>
> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [net-next-2.6 PATCH 1/4] ixgbe: fix 82598 SFP initialization after driver load.
2009-05-27 0:54 [net-next-2.6 PATCH 1/4] ixgbe: fix 82598 SFP initialization after driver load Jeff Kirsher
` (2 preceding siblings ...)
2009-05-27 0:55 ` [net-next-2.6 PATCH 4/4] ixgbe: Remove device ID 0x10d8 Jeff Kirsher
@ 2009-05-27 3:40 ` David Miller
3 siblings, 0 replies; 13+ messages in thread
From: David Miller @ 2009-05-27 3:40 UTC (permalink / raw)
To: jeffrey.t.kirsher; +Cc: netdev, donald.c.skidmore, peter.p.waskiewicz.jr
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue, 26 May 2009 17:54:04 -0700
> If we loaded the driver with out a SFP module plugged in it would
> leave it in a state that make it later unable to link when a module
> was plugged in. This patch corrects that by:
>
> ixgbe_probe() - moving the check for IXGBE_ERR_SFP_NOT_PRESENT from
> after get_invariants() to after reset_hw() as now reset_hw() is
> where this condition will be indentified.
>
> ixgbe_reset_hw_82598() - Enable this function to now return
> IXGBE_ERR_SFP_NOT_PRESENT.
>
> ixgbe_identify_sfp_module_generic() - This where the lack of SFP
> module is detected. Modifications are added to allow a different
> return value for modules that just haven't been plugged in yet.
>
> Other functions were updated to allow correct logging.
>
> Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
> Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Applied.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [net-next-2.6 PATCH 2/4] ixgbe: fix driver loading with unsupported module on 82598
2009-05-27 1:28 ` Ben Hutchings
@ 2009-05-27 3:41 ` David Miller
0 siblings, 0 replies; 13+ messages in thread
From: David Miller @ 2009-05-27 3:41 UTC (permalink / raw)
To: bhutchings
Cc: jeffrey.t.kirsher, netdev, donald.c.skidmore,
peter.p.waskiewicz.jr
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Wed, 27 May 2009 02:28:57 +0100
> On Tue, 2009-05-26 at 17:54 -0700, Jeff Kirsher wrote:
>> From: Don Skidmore <donald.c.skidmore@intel.com>
>>
>> We will now need to store the phy address which we do in the hw->phy
>> struct. Likewise we no longer need the mdio struct in hw->phy along
>> with the mdio functions ixgbe_mdio_write(read) which have been
>> removed. ixgbe_ioctl was no longer used and referenced hw->phy.mdio
>> so it was also removed.
>
> The ioctl is for the benefit of user-space!
Indeed, this is completely bogus. I'm not applying this.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [net-next-2.6 PATCH 3/4] ixgbe: remove rx_hdr_split debug counter for non-debug configurations
2009-05-27 3:38 ` David Miller
@ 2009-05-27 11:16 ` Ben Hutchings
2009-05-27 20:52 ` David Miller
0 siblings, 1 reply; 13+ messages in thread
From: Ben Hutchings @ 2009-05-27 11:16 UTC (permalink / raw)
To: David Miller; +Cc: jeffrey.t.kirsher, netdev, alexander.h.duyck
On Tue, 2009-05-26 at 20:38 -0700, David Miller wrote:
> From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> Date: Tue, 26 May 2009 17:54:45 -0700
>
> > The counter rx_hdr_split was meant to be a debug counter. As such it
> > should only be enabled when debugging.
> >
> > Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
> > Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>
> I disagree with this change.
>
> Any statistic is useful for diagnosing problems by users, and
> if you hide it behind DEBUG then users never see the facility.
>
> Either it's unconditionally in the driver or it's unconditionally out.
> I say keep it in :-)
If rx_hdr_split means the same thing at Intel as it does here, it's a
hardware feature Microsoft wants for use in Hyper-V and it won't be
enabled under Linux.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [net-next-2.6 PATCH 3/4] ixgbe: remove rx_hdr_split debug counter for non-debug configurations
2009-05-27 11:16 ` Ben Hutchings
@ 2009-05-27 20:52 ` David Miller
2009-05-29 0:01 ` Duyck, Alexander H
0 siblings, 1 reply; 13+ messages in thread
From: David Miller @ 2009-05-27 20:52 UTC (permalink / raw)
To: bhutchings; +Cc: jeffrey.t.kirsher, netdev, alexander.h.duyck
From: Ben Hutchings <bhutchings@solarflare.com>
Date: Wed, 27 May 2009 12:16:57 +0100
> If rx_hdr_split means the same thing at Intel as it does here, it's a
> hardware feature Microsoft wants for use in Hyper-V and it won't be
> enabled under Linux.
Nobody explains anything, so it could or it could not be, who knows.
:-)
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: [net-next-2.6 PATCH 3/4] ixgbe: remove rx_hdr_split debug counter for non-debug configurations
2009-05-27 20:52 ` David Miller
@ 2009-05-29 0:01 ` Duyck, Alexander H
2009-05-29 0:04 ` David Miller
0 siblings, 1 reply; 13+ messages in thread
From: Duyck, Alexander H @ 2009-05-29 0:01 UTC (permalink / raw)
To: David Miller, bhutchings@solarflare.com
Cc: Kirsher, Jeffrey T, netdev@vger.kernel.org
David Miller wrote:
> From: Ben Hutchings <bhutchings@solarflare.com>
> Date: Wed, 27 May 2009 12:16:57 +0100
>
>> If rx_hdr_split means the same thing at Intel as it does here, it's a
>> hardware feature Microsoft wants for use in Hyper-V and it won't be
>> enabled under Linux.
>
> Nobody explains anything, so it could or it could not be, who knows.
> :-)
The feature mentioned here is header-data split. When it is enabled the igb driver puts the header into skb data, and the remainder into the page frags list. It is used when we enable jumbo frames on the igb driver. The counter I had removed in the patch was keeping track of the split header bit which is 1 when the header size reflected in the descriptor is correct.
The counter didn't really have much use other than in our early validation work to make certain the silicon was working as documented. If it stays it isn't too big a concern I just figured it might be nice to remove it since igb is a multiqueue driver and having a global counter can cause some cache thrash on multicore systems.
Thanks,
Alex
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [net-next-2.6 PATCH 3/4] ixgbe: remove rx_hdr_split debug counter for non-debug configurations
2009-05-29 0:01 ` Duyck, Alexander H
@ 2009-05-29 0:04 ` David Miller
0 siblings, 0 replies; 13+ messages in thread
From: David Miller @ 2009-05-29 0:04 UTC (permalink / raw)
To: alexander.h.duyck; +Cc: bhutchings, jeffrey.t.kirsher, netdev
From: "Duyck, Alexander H" <alexander.h.duyck@intel.com>
Date: Thu, 28 May 2009 17:01:17 -0700
> The counter didn't really have much use other than in our early
> validation work to make certain the silicon was working as
> documented. If it stays it isn't too big a concern I just figured
> it might be nice to remove it since igb is a multiqueue driver and
> having a global counter can cause some cache thrash on multicore
> systems.
If it really is just a silicon validation thing, then given the
multiqueue concerns it's probably best to just remove it
unconditionaly.
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2009-05-29 0:04 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-27 0:54 [net-next-2.6 PATCH 1/4] ixgbe: fix 82598 SFP initialization after driver load Jeff Kirsher
2009-05-27 0:54 ` [net-next-2.6 PATCH 2/4] ixgbe: fix driver loading with unsupported module on 82598 Jeff Kirsher
2009-05-27 1:28 ` Ben Hutchings
2009-05-27 3:41 ` David Miller
2009-05-27 0:54 ` [net-next-2.6 PATCH 3/4] ixgbe: remove rx_hdr_split debug counter for non-debug configurations Jeff Kirsher
2009-05-27 3:38 ` David Miller
2009-05-27 11:16 ` Ben Hutchings
2009-05-27 20:52 ` David Miller
2009-05-29 0:01 ` Duyck, Alexander H
2009-05-29 0:04 ` David Miller
2009-05-27 0:55 ` [net-next-2.6 PATCH 4/4] ixgbe: Remove device ID 0x10d8 Jeff Kirsher
2009-05-27 3:40 ` David Miller
2009-05-27 3:40 ` [net-next-2.6 PATCH 1/4] ixgbe: fix 82598 SFP initialization after driver load David Miller
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).