* [PATCH net 0/7] qlcnic: Bug fixes
@ 2013-04-26 12:09 Shahed Shaikh
2013-04-26 12:09 ` [PATCH net 1/7] qlcnic: Fix setting MAC address Shahed Shaikh
` (6 more replies)
0 siblings, 7 replies; 11+ messages in thread
From: Shahed Shaikh @ 2013-04-26 12:09 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver, Shahed Shaikh
From: Shahed Shaikh <shahed.shaikh@qlogic.com>
This patch series has following bug fixes:
* Fix a bug in unicast MAC address setting in adapter.
Driver was not deleting older unicast MAC while adding new one.
* Fix a bug in offload settings behaviour which is controlled
through an application. LRO was not getting turned on/off when
we turn on/off Rx checksum.
* Fix an ethtool stats string array by adding missing string entry
and fix a typo.
* Add missing bracket ')' in module paramter description.
* Fix port status provided though 'ethtool <device>' for 83xx adapter
* Fix reset recovery path in case of transmit timeout.
* Fix reset revovery during diagnostic tests by preserving
current device status information.
Please apply to net.
Thanks,
Shahed
Himanshu Madhani (2):
qlcnic: Fix missing bracket in module parameter.
qlcnic: Fix ethtool Supported port status for 83xx
Manish Chopra (3):
qlcnic: Fix setting MAC address
qlcnic: Fix bug in tuning offloads using QLogic application
qlcnic: Fix bug in diagnostics test reset recovery path
Shahed Shaikh (1):
qlcnic: Fix ethtool strings
Sony Chacko (1):
qlcnic: Fix reset recovery after transmit timeout
drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 3 +
.../net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 79 +++++++++++++++++++-
.../net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h | 2 +-
.../net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c | 24 ++++--
.../net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 52 ++++++-------
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 65 +++++++++++++---
6 files changed, 172 insertions(+), 53 deletions(-)
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH net 1/7] qlcnic: Fix setting MAC address
2013-04-26 12:09 [PATCH net 0/7] qlcnic: Bug fixes Shahed Shaikh
@ 2013-04-26 12:09 ` Shahed Shaikh
2013-04-26 12:09 ` [PATCH net 2/7] qlcnic: Fix bug in tuning offloads using QLogic application Shahed Shaikh
` (5 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: Shahed Shaikh @ 2013-04-26 12:09 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver, Manish Chopra
From: Manish Chopra <manish.chopra@qlogic.com>
o Delete previous unicast MAC which is already programmed
in adapter before setting new unicast MAC
Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
---
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 28a6d48..8f4ce11 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -220,6 +220,23 @@ qlcnic_read_mac_addr(struct qlcnic_adapter *adapter)
return 0;
}
+static void qlcnic_delete_adapter_mac(struct qlcnic_adapter *adapter)
+{
+ struct qlcnic_mac_list_s *cur;
+ struct list_head *head;
+
+ list_for_each(head, &adapter->mac_list) {
+ cur = list_entry(head, struct qlcnic_mac_list_s, list);
+ if (!memcmp(adapter->mac_addr, cur->mac_addr, ETH_ALEN)) {
+ qlcnic_sre_macaddr_change(adapter, cur->mac_addr,
+ 0, QLCNIC_MAC_DEL);
+ list_del(&cur->list);
+ kfree(cur);
+ return;
+ }
+ }
+}
+
static int qlcnic_set_mac(struct net_device *netdev, void *p)
{
struct qlcnic_adapter *adapter = netdev_priv(netdev);
@@ -231,11 +248,15 @@ static int qlcnic_set_mac(struct net_device *netdev, void *p)
if (!is_valid_ether_addr(addr->sa_data))
return -EINVAL;
+ if (!memcmp(adapter->mac_addr, addr->sa_data, ETH_ALEN))
+ return 0;
+
if (test_bit(__QLCNIC_DEV_UP, &adapter->state)) {
netif_device_detach(netdev);
qlcnic_napi_disable(adapter);
}
+ qlcnic_delete_adapter_mac(adapter);
memcpy(adapter->mac_addr, addr->sa_data, netdev->addr_len);
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
qlcnic_set_multi(adapter->netdev);
--
1.5.6
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH net 2/7] qlcnic: Fix bug in tuning offloads using QLogic application
2013-04-26 12:09 [PATCH net 0/7] qlcnic: Bug fixes Shahed Shaikh
2013-04-26 12:09 ` [PATCH net 1/7] qlcnic: Fix setting MAC address Shahed Shaikh
@ 2013-04-26 12:09 ` Shahed Shaikh
2013-04-26 20:54 ` Ben Hutchings
2013-04-26 12:09 ` [PATCH net 3/7] qlcnic: Fix ethtool strings Shahed Shaikh
` (4 subsequent siblings)
6 siblings, 1 reply; 11+ messages in thread
From: Shahed Shaikh @ 2013-04-26 12:09 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver, Manish Chopra
From: Manish Chopra <manish.chopra@qlogic.com>
o LRO was not getting disabled when disabling checksum offloads
using QLogic application.
o LRO was not getting re-enabled while enabling checksum offloads
back
Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
---
drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 1 +
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 19 +++++++++++++++++--
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index ba3c72f..fe82fbf 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -896,6 +896,7 @@ struct qlcnic_ipaddr {
#define QLCNIC_FW_RESET_OWNER 0x2000
#define QLCNIC_FW_HANG 0x4000
#define QLCNIC_FW_LRO_MSS_CAP 0x8000
+#define QLCNIC_LRO_WAS_ENABLED 0x20000
#define QLCNIC_IS_MSI_FAMILY(adapter) \
((adapter)->flags & (QLCNIC_MSI_ENABLED | QLCNIC_MSIX_ENABLED))
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 8f4ce11..e387bf8 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -975,7 +975,7 @@ qlcnic_set_netdev_features(struct qlcnic_adapter *adapter,
struct qlcnic_esw_func_cfg *esw_cfg)
{
struct net_device *netdev = adapter->netdev;
- unsigned long features, vlan_features;
+ netdev_features_t features, vlan_features;
if (qlcnic_83xx_check(adapter))
return;
@@ -994,8 +994,14 @@ qlcnic_set_netdev_features(struct qlcnic_adapter *adapter,
features |= NETIF_F_LRO;
if (esw_cfg->offload_flags & BIT_0) {
- netdev->features |= features;
adapter->rx_csum = 1;
+ if (adapter->flags & QLCNIC_LRO_WAS_ENABLED) {
+ if (qlcnic_config_hw_lro(adapter, QLCNIC_LRO_ENABLED))
+ return;
+ netdev_info(netdev, "Enabling LRO as Rx checksum is on\n");
+ netdev->features |= NETIF_F_LRO;
+ }
+ netdev->features |= features;
if (!(esw_cfg->offload_flags & BIT_1)) {
netdev->features &= ~NETIF_F_TSO;
features &= ~NETIF_F_TSO;
@@ -1005,6 +1011,15 @@ qlcnic_set_netdev_features(struct qlcnic_adapter *adapter,
features &= ~NETIF_F_TSO6;
}
} else {
+ if (netdev->features & NETIF_F_LRO) {
+ if (qlcnic_config_hw_lro(adapter, QLCNIC_LRO_DISABLED))
+ return;
+
+ if (qlcnic_82xx_check(adapter))
+ qlcnic_send_lro_cleanup(adapter);
+ netdev_info(netdev, "Disabling LRO as rx_csum is off\n");
+ adapter->flags |= QLCNIC_LRO_WAS_ENABLED;
+ }
netdev->features &= ~features;
features &= ~features;
adapter->rx_csum = 0;
--
1.5.6
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH net 3/7] qlcnic: Fix ethtool strings
2013-04-26 12:09 [PATCH net 0/7] qlcnic: Bug fixes Shahed Shaikh
2013-04-26 12:09 ` [PATCH net 1/7] qlcnic: Fix setting MAC address Shahed Shaikh
2013-04-26 12:09 ` [PATCH net 2/7] qlcnic: Fix bug in tuning offloads using QLogic application Shahed Shaikh
@ 2013-04-26 12:09 ` Shahed Shaikh
2013-04-26 12:09 ` [PATCH net 4/7] qlcnic: Fix missing bracket in module parameter Shahed Shaikh
` (3 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: Shahed Shaikh @ 2013-04-26 12:09 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver, Shahed Shaikh
From: Shahed Shaikh <shahed.shaikh@qlogic.com>
o Add missing information in ethtool statistics information array.
o Fix the typo in the statistics information string.
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
---
.../net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
index 5641f8e..d169153 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
@@ -124,12 +124,13 @@ static const char qlcnic_83xx_rx_stats_strings[][ETH_GSTRING_LEN] = {
"ctx_lro_pkt_cnt",
"ctx_ip_csum_error",
"ctx_rx_pkts_wo_ctx",
- "ctx_rx_pkts_dropped_wo_sts",
+ "ctx_rx_pkts_drop_wo_sds_on_card",
+ "ctx_rx_pkts_drop_wo_sds_on_host",
"ctx_rx_osized_pkts",
"ctx_rx_pkts_dropped_wo_rds",
"ctx_rx_unexpected_mcast_pkts",
"ctx_invalid_mac_address",
- "ctx_rx_rds_ring_prim_attemoted",
+ "ctx_rx_rds_ring_prim_attempted",
"ctx_rx_rds_ring_prim_success",
"ctx_num_lro_flows_added",
"ctx_num_lro_flows_removed",
--
1.5.6
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH net 4/7] qlcnic: Fix missing bracket in module parameter.
2013-04-26 12:09 [PATCH net 0/7] qlcnic: Bug fixes Shahed Shaikh
` (2 preceding siblings ...)
2013-04-26 12:09 ` [PATCH net 3/7] qlcnic: Fix ethtool strings Shahed Shaikh
@ 2013-04-26 12:09 ` Shahed Shaikh
2013-04-26 12:09 ` [PATCH net 5/7] qlcnic: Fix ethtool Supported port status for 83xx Shahed Shaikh
` (2 subsequent siblings)
6 siblings, 0 replies; 11+ messages in thread
From: Shahed Shaikh @ 2013-04-26 12:09 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver, Himanshu Madhani
From: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
---
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index e387bf8..3ac73b2 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -36,24 +36,24 @@ MODULE_PARM_DESC(qlcnic_mac_learn,
"Mac Filter (0=learning is disabled, 1=Driver learning is enabled, 2=FDB learning is enabled)");
int qlcnic_use_msi = 1;
-MODULE_PARM_DESC(use_msi, "MSI interrupt (0=disabled, 1=enabled");
+MODULE_PARM_DESC(use_msi, "MSI interrupt (0=disabled, 1=enabled)");
module_param_named(use_msi, qlcnic_use_msi, int, 0444);
int qlcnic_use_msi_x = 1;
-MODULE_PARM_DESC(use_msi_x, "MSI-X interrupt (0=disabled, 1=enabled");
+MODULE_PARM_DESC(use_msi_x, "MSI-X interrupt (0=disabled, 1=enabled)");
module_param_named(use_msi_x, qlcnic_use_msi_x, int, 0444);
int qlcnic_auto_fw_reset = 1;
-MODULE_PARM_DESC(auto_fw_reset, "Auto firmware reset (0=disabled, 1=enabled");
+MODULE_PARM_DESC(auto_fw_reset, "Auto firmware reset (0=disabled, 1=enabled)");
module_param_named(auto_fw_reset, qlcnic_auto_fw_reset, int, 0644);
int qlcnic_load_fw_file;
-MODULE_PARM_DESC(load_fw_file, "Load firmware from (0=flash, 1=file");
+MODULE_PARM_DESC(load_fw_file, "Load firmware from (0=flash, 1=file)");
module_param_named(load_fw_file, qlcnic_load_fw_file, int, 0444);
int qlcnic_config_npars;
module_param(qlcnic_config_npars, int, 0444);
-MODULE_PARM_DESC(qlcnic_config_npars, "Configure NPARs (0=disabled, 1=enabled");
+MODULE_PARM_DESC(qlcnic_config_npars, "Configure NPARs (0=disabled, 1=enabled)");
static int qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent);
static void qlcnic_remove(struct pci_dev *pdev);
--
1.5.6
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH net 5/7] qlcnic: Fix ethtool Supported port status for 83xx
2013-04-26 12:09 [PATCH net 0/7] qlcnic: Bug fixes Shahed Shaikh
` (3 preceding siblings ...)
2013-04-26 12:09 ` [PATCH net 4/7] qlcnic: Fix missing bracket in module parameter Shahed Shaikh
@ 2013-04-26 12:09 ` Shahed Shaikh
2013-04-26 12:09 ` [PATCH net 6/7] qlcnic: Fix reset recovery after transmit timeout Shahed Shaikh
2013-04-26 12:09 ` [PATCH net 7/7] qlcnic: Fix bug in diagnostics test reset recovery path Shahed Shaikh
6 siblings, 0 replies; 11+ messages in thread
From: Shahed Shaikh @ 2013-04-26 12:09 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver, Himanshu Madhani
From: Himanshu Madhani <himanshu.madhani@qlogic.com>
o Fix display for interface while using 'ethtool <device>' for 83xx adapter
Signed-off-by: Himanshu Madhani <himanshu.madhani@qlogic.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
---
drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 2 +
.../net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 65 +++++++++++++++++++-
.../net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h | 2 +-
.../net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 47 +++++++--------
4 files changed, 89 insertions(+), 27 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
index fe82fbf..f75106a 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
@@ -421,6 +421,7 @@ struct qlcnic_hardware_context {
u16 port_type;
u16 board_type;
+ u16 supported_type;
u16 link_speed;
u16 link_duplex;
@@ -1488,6 +1489,7 @@ void qlcnic_create_diag_entries(struct qlcnic_adapter *adapter);
void qlcnic_remove_diag_entries(struct qlcnic_adapter *adapter);
void qlcnic_82xx_add_sysfs(struct qlcnic_adapter *adapter);
void qlcnic_82xx_remove_sysfs(struct qlcnic_adapter *adapter);
+int qlcnic_82xx_get_settings(struct qlcnic_adapter *, struct ethtool_cmd *);
int qlcnicvf_config_bridged_mode(struct qlcnic_adapter *, u32);
int qlcnicvf_config_led(struct qlcnic_adapter *, u32, u32);
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
index edd63f1..6c58406 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
@@ -2658,6 +2658,23 @@ int qlcnic_83xx_test_link(struct qlcnic_adapter *adapter)
break;
}
config = cmd.rsp.arg[3];
+ if (QLC_83XX_SFP_PRESENT(config)) {
+ switch (ahw->module_type) {
+ case LINKEVENT_MODULE_OPTICAL_UNKNOWN:
+ case LINKEVENT_MODULE_OPTICAL_SRLR:
+ case LINKEVENT_MODULE_OPTICAL_LRM:
+ case LINKEVENT_MODULE_OPTICAL_SFP_1G:
+ ahw->supported_type = PORT_FIBRE;
+ break;
+ case LINKEVENT_MODULE_TWINAX_UNSUPPORTED_CABLE:
+ case LINKEVENT_MODULE_TWINAX_UNSUPPORTED_CABLELEN:
+ case LINKEVENT_MODULE_TWINAX:
+ ahw->supported_type = PORT_TP;
+ break;
+ default:
+ ahw->supported_type = PORT_OTHER;
+ }
+ }
if (config & 1)
err = 1;
}
@@ -2666,7 +2683,8 @@ out:
return config;
}
-int qlcnic_83xx_get_settings(struct qlcnic_adapter *adapter)
+int qlcnic_83xx_get_settings(struct qlcnic_adapter *adapter,
+ struct ethtool_cmd *ecmd)
{
u32 config = 0;
int status = 0;
@@ -2679,6 +2697,51 @@ int qlcnic_83xx_get_settings(struct qlcnic_adapter *adapter)
ahw->module_type = QLC_83XX_SFP_MODULE_TYPE(config);
/* hard code until there is a way to get it from flash */
ahw->board_type = QLCNIC_BRDTYPE_83XX_10G;
+
+ if (netif_running(adapter->netdev) && ahw->has_link_events) {
+ ethtool_cmd_speed_set(ecmd, ahw->link_speed);
+ ecmd->duplex = ahw->link_duplex;
+ ecmd->autoneg = ahw->link_autoneg;
+ } else {
+ ethtool_cmd_speed_set(ecmd, SPEED_UNKNOWN);
+ ecmd->duplex = DUPLEX_UNKNOWN;
+ ecmd->autoneg = AUTONEG_DISABLE;
+ }
+
+ if (ahw->port_type == QLCNIC_XGBE) {
+ ecmd->supported = SUPPORTED_1000baseT_Full;
+ ecmd->advertising = ADVERTISED_1000baseT_Full;
+ } else {
+ ecmd->supported = (SUPPORTED_10baseT_Half |
+ SUPPORTED_10baseT_Full |
+ SUPPORTED_100baseT_Half |
+ SUPPORTED_100baseT_Full |
+ SUPPORTED_1000baseT_Half |
+ SUPPORTED_1000baseT_Full);
+ ecmd->advertising = (ADVERTISED_100baseT_Half |
+ ADVERTISED_100baseT_Full |
+ ADVERTISED_1000baseT_Half |
+ ADVERTISED_1000baseT_Full);
+ }
+
+ if (ahw->supported_type == PORT_FIBRE) {
+ ecmd->supported |= SUPPORTED_FIBRE;
+ ecmd->advertising |= ADVERTISED_FIBRE;
+ ecmd->port = PORT_FIBRE;
+ ecmd->transceiver = XCVR_EXTERNAL;
+ } else if (ahw->supported_type == PORT_TP) {
+ ecmd->supported |= SUPPORTED_TP;
+ ecmd->advertising |= ADVERTISED_TP;
+ ecmd->port = PORT_TP;
+ ecmd->transceiver = XCVR_INTERNAL;
+ } else {
+ ecmd->supported |= SUPPORTED_FIBRE;
+ ecmd->advertising |= ADVERTISED_FIBRE;
+ ecmd->port = PORT_OTHER;
+ ecmd->transceiver = XCVR_EXTERNAL;
+ }
+ ecmd->phy_address = ahw->physical_port;
+
return status;
}
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h
index 61f81f6..9d7b650 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h
@@ -422,7 +422,7 @@ int qlcnic_83xx_get_vnic_pf_info(struct qlcnic_adapter *, struct qlcnic_info *);
void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *);
void qlcnic_83xx_get_stats(struct qlcnic_adapter *adapter, u64 *data);
-int qlcnic_83xx_get_settings(struct qlcnic_adapter *);
+int qlcnic_83xx_get_settings(struct qlcnic_adapter *, struct ethtool_cmd *);
int qlcnic_83xx_set_settings(struct qlcnic_adapter *, struct ethtool_cmd *);
void qlcnic_83xx_get_pauseparam(struct qlcnic_adapter *,
struct ethtool_pauseparam *);
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
index d169153..beecff9 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c
@@ -244,6 +244,16 @@ static int
qlcnic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
{
struct qlcnic_adapter *adapter = netdev_priv(dev);
+
+ if (qlcnic_82xx_check(adapter))
+ return qlcnic_82xx_get_settings(adapter, ecmd);
+ else if (qlcnic_83xx_check(adapter))
+ return qlcnic_83xx_get_settings(adapter, ecmd);
+}
+
+int qlcnic_82xx_get_settings(struct qlcnic_adapter *adapter,
+ struct ethtool_cmd *ecmd)
+{
struct qlcnic_hardware_context *ahw = adapter->ahw;
u32 speed, reg;
int check_sfp_module = 0;
@@ -269,10 +279,7 @@ qlcnic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
} else if (adapter->ahw->port_type == QLCNIC_XGBE) {
u32 val = 0;
- if (qlcnic_83xx_check(adapter))
- qlcnic_83xx_get_settings(adapter);
- else
- val = QLCRD32(adapter, QLCNIC_PORT_MODE_ADDR);
+ val = QLCRD32(adapter, QLCNIC_PORT_MODE_ADDR);
if (val == QLCNIC_PORT_MODE_802_3_AP) {
ecmd->supported = SUPPORTED_1000baseT_Full;
@@ -282,16 +289,13 @@ qlcnic_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
ecmd->advertising = ADVERTISED_10000baseT_Full;
}
- if (netif_running(dev) && adapter->ahw->has_link_events) {
- if (qlcnic_82xx_check(adapter)) {
- reg = QLCRD32(adapter,
- P3P_LINK_SPEED_REG(pcifn));
- speed = P3P_LINK_SPEED_VAL(pcifn, reg);
- ahw->link_speed = speed * P3P_LINK_SPEED_MHZ;
- }
- ethtool_cmd_speed_set(ecmd, adapter->ahw->link_speed);
- ecmd->autoneg = adapter->ahw->link_autoneg;
- ecmd->duplex = adapter->ahw->link_duplex;
+ if (netif_running(adapter->netdev) && ahw->has_link_events) {
+ reg = QLCRD32(adapter, P3P_LINK_SPEED_REG(pcifn));
+ speed = P3P_LINK_SPEED_VAL(pcifn, reg);
+ ahw->link_speed = speed * P3P_LINK_SPEED_MHZ;
+ ethtool_cmd_speed_set(ecmd, ahw->link_speed);
+ ecmd->autoneg = ahw->link_autoneg;
+ ecmd->duplex = ahw->link_duplex;
goto skip;
}
@@ -333,8 +337,8 @@ skip:
case QLCNIC_BRDTYPE_P3P_10G_SFP_QT:
ecmd->advertising |= ADVERTISED_TP;
ecmd->supported |= SUPPORTED_TP;
- check_sfp_module = netif_running(dev) &&
- adapter->ahw->has_link_events;
+ check_sfp_module = netif_running(adapter->netdev) &&
+ ahw->has_link_events;
case QLCNIC_BRDTYPE_P3P_10G_XFP:
ecmd->supported |= SUPPORTED_FIBRE;
ecmd->advertising |= ADVERTISED_FIBRE;
@@ -348,8 +352,8 @@ skip:
ecmd->advertising |=
(ADVERTISED_FIBRE | ADVERTISED_TP);
ecmd->port = PORT_FIBRE;
- check_sfp_module = netif_running(dev) &&
- adapter->ahw->has_link_events;
+ check_sfp_module = netif_running(adapter->netdev) &&
+ ahw->has_link_events;
} else {
ecmd->autoneg = AUTONEG_ENABLE;
ecmd->supported |= (SUPPORTED_TP | SUPPORTED_Autoneg);
@@ -358,13 +362,6 @@ skip:
ecmd->port = PORT_TP;
}
break;
- case QLCNIC_BRDTYPE_83XX_10G:
- ecmd->autoneg = AUTONEG_DISABLE;
- ecmd->supported |= (SUPPORTED_FIBRE | SUPPORTED_TP);
- ecmd->advertising |= (ADVERTISED_FIBRE | ADVERTISED_TP);
- ecmd->port = PORT_FIBRE;
- check_sfp_module = netif_running(dev) && ahw->has_link_events;
- break;
default:
dev_err(&adapter->pdev->dev, "Unsupported board model %d\n",
adapter->ahw->board_type);
--
1.5.6
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH net 6/7] qlcnic: Fix reset recovery after transmit timeout
2013-04-26 12:09 [PATCH net 0/7] qlcnic: Bug fixes Shahed Shaikh
` (4 preceding siblings ...)
2013-04-26 12:09 ` [PATCH net 5/7] qlcnic: Fix ethtool Supported port status for 83xx Shahed Shaikh
@ 2013-04-26 12:09 ` Shahed Shaikh
2013-04-26 21:01 ` Ben Hutchings
2013-04-26 12:09 ` [PATCH net 7/7] qlcnic: Fix bug in diagnostics test reset recovery path Shahed Shaikh
6 siblings, 1 reply; 11+ messages in thread
From: Shahed Shaikh @ 2013-04-26 12:09 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver, Sony Chacko
From: Sony Chacko <sony.chacko@qlogic.com>
o When transmit timeout happens, recovery attempt should start with
adapter soft reset. If soft reset fails to resume traffic, firmware
dump will be collected and driver will perform a hard reset of the
adapter. Reset recovery on 83xx was failing after a hard reset.
This patch fixes that issue.
Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
---
.../net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c | 24 ++++++++++++-------
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 15 ++++++++----
2 files changed, 25 insertions(+), 14 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
index 5c033f2..7b103d1 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
@@ -406,10 +406,7 @@ static void qlcnic_83xx_idc_attach_driver(struct qlcnic_adapter *adapter)
}
done:
netif_device_attach(netdev);
- if (netif_running(netdev)) {
- netif_carrier_on(netdev);
- netif_wake_queue(netdev);
- }
+ adapter->netdev->trans_start = jiffies;
}
static int qlcnic_83xx_idc_enter_failed_state(struct qlcnic_adapter *adapter,
@@ -607,15 +604,22 @@ static int qlcnic_83xx_idc_reattach_driver(struct qlcnic_adapter *adapter)
static void qlcnic_83xx_idc_update_idc_params(struct qlcnic_adapter *adapter)
{
+ struct qlcnic_hardware_context *ahw = adapter->ahw;
+
qlcnic_83xx_idc_update_drv_presence_reg(adapter, 1, 1);
- clear_bit(__QLCNIC_RESETTING, &adapter->state);
set_bit(QLC_83XX_MBX_READY, &adapter->ahw->idc.status);
qlcnic_83xx_idc_update_audit_reg(adapter, 0, 1);
set_bit(QLC_83XX_MODULE_LOADED, &adapter->ahw->idc.status);
- adapter->ahw->idc.quiesce_req = 0;
- adapter->ahw->idc.delay = QLC_83XX_IDC_FW_POLL_DELAY;
- adapter->ahw->idc.err_code = 0;
- adapter->ahw->idc.collect_dump = 0;
+
+ ahw->idc.quiesce_req = 0;
+ ahw->idc.delay = QLC_83XX_IDC_FW_POLL_DELAY;
+ ahw->idc.err_code = 0;
+ ahw->idc.collect_dump = 0;
+ ahw->reset_context = 0;
+ adapter->tx_timeo_cnt = 0;
+ adapter->netdev->trans_start = jiffies;
+
+ clear_bit(__QLCNIC_RESETTING, &adapter->state);
}
/**
@@ -816,6 +820,7 @@ static int qlcnic_83xx_idc_ready_state(struct qlcnic_adapter *adapter)
/* Check for soft reset request */
if (ahw->reset_context &&
!(val & QLC_83XX_IDC_DISABLE_FW_RESET_RECOVERY)) {
+ adapter->ahw->reset_context = 0;
qlcnic_83xx_idc_tx_soft_reset(adapter);
return ret;
}
@@ -879,6 +884,7 @@ static int qlcnic_83xx_idc_need_quiesce_state(struct qlcnic_adapter *adapter)
static int qlcnic_83xx_idc_failed_state(struct qlcnic_adapter *adapter)
{
dev_err(&adapter->pdev->dev, "%s: please restart!!\n", __func__);
+ clear_bit(__QLCNIC_RESETTING, &adapter->state);
adapter->ahw->idc.err_code = -EIO;
return 0;
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 3ac73b2..c28f3db 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -2346,12 +2346,17 @@ static void qlcnic_tx_timeout(struct net_device *netdev)
if (test_bit(__QLCNIC_RESETTING, &adapter->state))
return;
- dev_err(&netdev->dev, "transmit timeout, resetting.\n");
-
- if (++adapter->tx_timeo_cnt >= QLCNIC_MAX_TX_TIMEOUTS)
- adapter->need_fw_reset = 1;
- else
+ if (++adapter->tx_timeo_cnt >= QLCNIC_MAX_TX_TIMEOUTS) {
+ netdev_info(netdev, "Tx timeout, reset the adapter.\n");
+ if (qlcnic_82xx_check(adapter))
+ adapter->need_fw_reset = 1;
+ else if (qlcnic_83xx_check(adapter))
+ qlcnic_83xx_idc_request_reset(adapter,
+ QLCNIC_FORCE_FW_DUMP_KEY);
+ } else {
+ netdev_info(netdev, "Tx timeout, reset adapter context.\n");
adapter->ahw->reset_context = 1;
+ }
}
static struct net_device_stats *qlcnic_get_stats(struct net_device *netdev)
--
1.5.6
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH net 7/7] qlcnic: Fix bug in diagnostics test reset recovery path
2013-04-26 12:09 [PATCH net 0/7] qlcnic: Bug fixes Shahed Shaikh
` (5 preceding siblings ...)
2013-04-26 12:09 ` [PATCH net 6/7] qlcnic: Fix reset recovery after transmit timeout Shahed Shaikh
@ 2013-04-26 12:09 ` Shahed Shaikh
6 siblings, 0 replies; 11+ messages in thread
From: Shahed Shaikh @ 2013-04-26 12:09 UTC (permalink / raw)
To: davem; +Cc: netdev, Dept_NX_Linux_NIC_Driver, Manish Chopra
From: Manish Chopra <manish.chopra@qlogic.com>
o In order to perform reset recovery during diagnostics tests,
current device status information need to be preserved.
This patch makes the required changes in diagnostics routines
Signed-off-by: Manish Chopra <manish.chopra@qlogic.com>
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
---
.../net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
index 6c58406..653c48c 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
@@ -1221,11 +1221,13 @@ out:
return err;
}
-static int qlcnic_83xx_diag_alloc_res(struct net_device *netdev, int test)
+static int qlcnic_83xx_diag_alloc_res(struct net_device *netdev, int test,
+ int num_sds_ring)
{
struct qlcnic_adapter *adapter = netdev_priv(netdev);
struct qlcnic_host_sds_ring *sds_ring;
struct qlcnic_host_rds_ring *rds_ring;
+ u16 adapter_state = adapter->is_up;
u8 ring;
int ret;
@@ -1249,6 +1251,10 @@ static int qlcnic_83xx_diag_alloc_res(struct net_device *netdev, int test)
ret = qlcnic_fw_create_ctx(adapter);
if (ret) {
qlcnic_detach(adapter);
+ if (adapter_state == QLCNIC_ADAPTER_UP_MAGIC) {
+ adapter->max_sds_rings = num_sds_ring;
+ qlcnic_attach(adapter);
+ }
netif_device_attach(netdev);
return ret;
}
@@ -1479,7 +1485,8 @@ int qlcnic_83xx_loopback_test(struct net_device *netdev, u8 mode)
if (test_and_set_bit(__QLCNIC_RESETTING, &adapter->state))
return -EBUSY;
- ret = qlcnic_83xx_diag_alloc_res(netdev, QLCNIC_LOOPBACK_TEST);
+ ret = qlcnic_83xx_diag_alloc_res(netdev, QLCNIC_LOOPBACK_TEST,
+ max_sds_rings);
if (ret)
goto fail_diag_alloc;
@@ -2934,7 +2941,8 @@ int qlcnic_83xx_interrupt_test(struct net_device *netdev)
if (test_and_set_bit(__QLCNIC_RESETTING, &adapter->state))
return -EIO;
- ret = qlcnic_83xx_diag_alloc_res(netdev, QLCNIC_INTERRUPT_TEST);
+ ret = qlcnic_83xx_diag_alloc_res(netdev, QLCNIC_INTERRUPT_TEST,
+ max_sds_rings);
if (ret)
goto fail_diag_irq;
--
1.5.6
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH net 2/7] qlcnic: Fix bug in tuning offloads using QLogic application
2013-04-26 12:09 ` [PATCH net 2/7] qlcnic: Fix bug in tuning offloads using QLogic application Shahed Shaikh
@ 2013-04-26 20:54 ` Ben Hutchings
0 siblings, 0 replies; 11+ messages in thread
From: Ben Hutchings @ 2013-04-26 20:54 UTC (permalink / raw)
To: Shahed Shaikh; +Cc: davem, netdev, Dept_NX_Linux_NIC_Driver, Manish Chopra
On Fri, 2013-04-26 at 08:09 -0400, Shahed Shaikh wrote:
> From: Manish Chopra <manish.chopra@qlogic.com>
>
> o LRO was not getting disabled when disabling checksum offloads
> using QLogic application.
> o LRO was not getting re-enabled while enabling checksum offloads
> back
[...]
> --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
> +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
> @@ -975,7 +975,7 @@ qlcnic_set_netdev_features(struct qlcnic_adapter *adapter,
> struct qlcnic_esw_func_cfg *esw_cfg)
> {
> struct net_device *netdev = adapter->netdev;
> - unsigned long features, vlan_features;
> + netdev_features_t features, vlan_features;
>
> if (qlcnic_83xx_check(adapter))
> return;
> @@ -994,8 +994,14 @@ qlcnic_set_netdev_features(struct qlcnic_adapter *adapter,
> features |= NETIF_F_LRO;
>
> if (esw_cfg->offload_flags & BIT_0) {
> - netdev->features |= features;
> adapter->rx_csum = 1;
> + if (adapter->flags & QLCNIC_LRO_WAS_ENABLED) {
> + if (qlcnic_config_hw_lro(adapter, QLCNIC_LRO_ENABLED))
> + return;
> + netdev_info(netdev, "Enabling LRO as Rx checksum is on\n");
> + netdev->features |= NETIF_F_LRO;
> + }
[...]
This is absolutely wrong for mainline Linux. The networking core keeps
track of whether the user wanted a feature enabled in
netdev->wanted_features. You must not try to manage this yourself.
The proper thing to do is to implement ndo_fix_features and mask out
NETIF_F_LRO there whenever it depends on another feature that has been
disabled.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
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] 11+ messages in thread
* Re: [PATCH net 6/7] qlcnic: Fix reset recovery after transmit timeout
2013-04-26 12:09 ` [PATCH net 6/7] qlcnic: Fix reset recovery after transmit timeout Shahed Shaikh
@ 2013-04-26 21:01 ` Ben Hutchings
2013-04-27 19:08 ` Shahed Shaikh
0 siblings, 1 reply; 11+ messages in thread
From: Ben Hutchings @ 2013-04-26 21:01 UTC (permalink / raw)
To: Shahed Shaikh; +Cc: davem, netdev, Dept_NX_Linux_NIC_Driver, Sony Chacko
On Fri, 2013-04-26 at 08:09 -0400, Shahed Shaikh wrote:
> From: Sony Chacko <sony.chacko@qlogic.com>
>
> o When transmit timeout happens, recovery attempt should start with
> adapter soft reset. If soft reset fails to resume traffic, firmware
> dump will be collected and driver will perform a hard reset of the
> adapter. Reset recovery on 83xx was failing after a hard reset.
> This patch fixes that issue.
>
> Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
> Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
> ---
> .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c | 24 ++++++++++++-------
> drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 15 ++++++++----
> 2 files changed, 25 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
> index 5c033f2..7b103d1 100644
> --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
> +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c
> @@ -406,10 +406,7 @@ static void qlcnic_83xx_idc_attach_driver(struct qlcnic_adapter *adapter)
> }
> done:
> netif_device_attach(netdev);
> - if (netif_running(netdev)) {
> - netif_carrier_on(netdev);
> - netif_wake_queue(netdev);
> - }
> + adapter->netdev->trans_start = jiffies;
> }
[...]
The deletions look good, but it should not be necessary to write to
trans_start. Why do you think it is needed?
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
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] 11+ messages in thread
* RE: [PATCH net 6/7] qlcnic: Fix reset recovery after transmit timeout
2013-04-26 21:01 ` Ben Hutchings
@ 2013-04-27 19:08 ` Shahed Shaikh
0 siblings, 0 replies; 11+ messages in thread
From: Shahed Shaikh @ 2013-04-27 19:08 UTC (permalink / raw)
To: Ben Hutchings; +Cc: David Miller, netdev, Dept-NX Linux NIC Driver, Sony Chacko
> From: Ben Hutchings [mailto:bhutchings@solarflare.com]
> Sent: Saturday, April 27, 2013 2:31 AM
> To: Shahed Shaikh
> Cc: David Miller; netdev; Dept-NX Linux NIC Driver; Sony Chacko
> Subject: Re: [PATCH net 6/7] qlcnic: Fix reset recovery after transmit timeout
>
[...]
> > netif_device_attach(netdev);
> > - if (netif_running(netdev)) {
> > - netif_carrier_on(netdev);
> > - netif_wake_queue(netdev);
> > - }
> > + adapter->netdev->trans_start = jiffies;
> > }
> [...]
>
> The deletions look good, but it should not be necessary to write to
> trans_start. Why do you think it is needed?
You are correct, we don't have to update netdev->trans_start.
We were updating netdev->trans_start to prevent watchdog from kicking in.
Watchdog timeout will not happen because we are waking the Tx queue and turning the carrier ON prior to attaching the device.
We will make the required change as you suggested in V2 of the patch series.
Thanks,
Shahed
>
> Ben.
>
> --
> Ben Hutchings, Staff Engineer, Solarflare 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] 11+ messages in thread
end of thread, other threads:[~2013-04-27 19:08 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-26 12:09 [PATCH net 0/7] qlcnic: Bug fixes Shahed Shaikh
2013-04-26 12:09 ` [PATCH net 1/7] qlcnic: Fix setting MAC address Shahed Shaikh
2013-04-26 12:09 ` [PATCH net 2/7] qlcnic: Fix bug in tuning offloads using QLogic application Shahed Shaikh
2013-04-26 20:54 ` Ben Hutchings
2013-04-26 12:09 ` [PATCH net 3/7] qlcnic: Fix ethtool strings Shahed Shaikh
2013-04-26 12:09 ` [PATCH net 4/7] qlcnic: Fix missing bracket in module parameter Shahed Shaikh
2013-04-26 12:09 ` [PATCH net 5/7] qlcnic: Fix ethtool Supported port status for 83xx Shahed Shaikh
2013-04-26 12:09 ` [PATCH net 6/7] qlcnic: Fix reset recovery after transmit timeout Shahed Shaikh
2013-04-26 21:01 ` Ben Hutchings
2013-04-27 19:08 ` Shahed Shaikh
2013-04-26 12:09 ` [PATCH net 7/7] qlcnic: Fix bug in diagnostics test reset recovery path Shahed Shaikh
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).