qlcnic: Refactoring and enhancements for all adapters.
Subsystems (3)
cover qlcnic: Refactoring and enhancements for all adapters.
From: Himanshu Madhani <[email protected]>
This patch series contains following patches.
o Enhanced debug data collection when we are in Tx-timeout situation.
o Enhanced MSI-x vector calculation for defualt load path as well as for TSS/RSS ring change path.
o Refactored interrupt coalescing code for all adapters.
o Refactored interrupt handling as well as cleanup of poll controller code patch for all adapters.
o changed rx_mac_learn type to boolean.
Please apply to net-next.
Thanks,
Himanshu
Himanshu Madhani (4):
qlcnic: Enhance Tx timeout debugging.
qlcnic: Refactor interrupt coalescing code for all adapters.
qlcnic: Enhance logic to calculate msix vectors.
qlcnic: update version to 5.3.55
Manish chopra (2):
qlcnic: Interrupt code cleanup
qlcnic: Update poll controller code path
Sucheta Chakraborty (1):
qlcnic: Use bool for rx_mac_learn.
drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 129 ++++++-- .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 235 ++++++++++---- .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h | 9 +- .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c | 4 +- .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_vnic.c | 4 +- .../net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 106 ++----- drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c | 31 +- drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h | 4 +- drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | 55 +--- drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 343 ++++++++++++++------- .../ethernet/qlogic/qlcnic/qlcnic_sriov_common.c | 2 + 11 files changed, 601 insertions(+), 321 deletions(-)
Signature · 1 line
1.8.1.4
PATCH 1/7 qlcnic: Use bool for rx_mac_learn.
From: Sucheta Chakraborty <[email protected]>
o Use boolean type instead of u8.
--- drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 2 +- drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 2 +- drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c | 2 +- drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_vnic.c | 4 ++-- drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-)
drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +1 -1
@@ -1082,7 +1082,7 @@ struct qlcnic_adapter {u64 dev_rst_time;bool drv_mac_learn;bool fdb_mac_learn; -u8 rx_mac_learn; +bool rx_mac_learn;unsigned long vlans[BITS_TO_LONGS (VLAN_N_VID )];u8 flash_mfg_id;struct qlcnic_npar_info *npars;
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +1 -1
@@ -1637,7 +1637,7 @@ static void qlcnic_83xx_set_interface_id_promisc(struct qlcnic_adapter *adapter,if (qlcnic_sriov_pf_check (adapter)) {qlcnic_alloc_lb_filters_mem (adapter);qlcnic_pf_set_interface_id_promisc (adapter, interface_id); - adapter->rx_mac_learn =1 ; + adapter->rx_mac_learn = true; }else {if (!qlcnic_sriov_vf_check (adapter)) *interface_id = adapter->recv_ctx->context_id <<16 ;
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c +1 -1
@@ -2217,7 +2217,7 @@ int qlcnic_83xx_init(struct qlcnic_adapter *adapter, int pci_using_dac)struct qlcnic_hardware_context *ahw = adapter->ahw;int err =0 ; - adapter->rx_mac_learn =0 ; + adapter->rx_mac_learn = false; ahw->msix_supported = !!qlcnic_use_msi_x;qlcnic_83xx_init_rings (adapter);
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_vnic.c +2 -2
@@ -227,10 +227,10 @@ int qlcnic_83xx_config_vnic_opmode(struct qlcnic_adapter *adapter)if (ahw->capabilities &QLC_83XX_ESWITCH_CAPABILITY ) { adapter->flags |=QLCNIC_ESWITCH_ENABLED ;if (adapter->drv_mac_learn) - adapter->rx_mac_learn =1 ; + adapter->rx_mac_learn = true; }else { adapter->flags &= ~QLCNIC_ESWITCH_ENABLED ; - adapter->rx_mac_learn =0 ; + adapter->rx_mac_learn = false; } ahw->idc.vnic_state =QLCNIC_DEV_NPAR_NON_OPER ;
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c +2 -2
@@ -547,10 +547,10 @@ static void __qlcnic_set_multi(struct net_device *netdev, u16 vlan)qlcnic_alloc_lb_filters_mem (adapter); adapter->drv_mac_learn =1 ;if (adapter->flags &QLCNIC_ESWITCH_ENABLED ) - adapter->rx_mac_learn =1 ; + adapter->rx_mac_learn = true; }else { adapter->drv_mac_learn =0 ; - adapter->rx_mac_learn =0 ; + adapter->rx_mac_learn = false; }qlcnic_nic_set_promisc (adapter, mode);
Signature · 1 line
1.8.1.4
PATCH 2/7 qlcnic: Enhance Tx timeout debugging.
In reply to Himanshu MadhaniFrom: Himanshu Madhani <[email protected]>
o Dump each Tx queue details with all descriptors, queue indices and Tx queue stats to imporve data colletion in situations where Tx timeout occurs.
--- .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c | 2 +- drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 69 ++++++++++++++++------ 2 files changed, 51 insertions(+), 20 deletions(-)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c +1 -1
@@ -383,7 +383,7 @@ static int qlcnic_83xx_idc_tx_soft_reset(struct qlcnic_adapter *adapter)qlcnic_up (adapter, netdev);netif_device_attach (netdev);clear_bit (__QLCNIC_RESETTING, &adapter->state); -dev_err (&adapter->pdev->dev,"%s:\n" , __func__); +netdev_info (adapter->netdev,"%s: soft reset complete.\n" , __func__);return 0 ; }
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +50 -19
91 lines not on this page · raw message
Signature · 1 line
1.8.1.4
PATCH 3/7 qlcnic: Interrupt code cleanup
In reply to Himanshu MadhaniFrom: Manish chopra <[email protected]>
o Added hardware ops for interrupt enable/disable functions
--- drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 97 ++++++++++++++++++++-- .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 25 ++---- .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h | 4 - drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | 55 +++--------- drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 10 ++- .../ethernet/qlogic/qlcnic/qlcnic_sriov_common.c | 2 + 6 files changed, 121 insertions(+), 72 deletions(-)
drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +91 -6
@@ -1756,6 +1756,14 @@ struct qlcnic_hardware_ops {pci_ers_result_t (*io_slot_reset) (struct pci_dev *);void (*io_resume) (struct pci_dev *);void (*get_beacon_state)(struct qlcnic_adapter *); +void (*enable_sds_intr) (struct qlcnic_adapter *, +struct qlcnic_host_sds_ring *); +void (*disable_sds_intr) (struct qlcnic_adapter *, +struct qlcnic_host_sds_ring *); +void (*enable_tx_intr) (struct qlcnic_adapter *, +struct qlcnic_host_tx_ring *); +void (*disable_tx_intr) (struct qlcnic_adapter *, +struct qlcnic_host_tx_ring *); };extern struct qlcnic_nic_template qlcnic_vf_ops;
@@ -2029,6 +2037,54 @@ static inline bool qlcnic_check_multi_tx(struct qlcnic_adapter *adapter)return test_bit (__QLCNIC_MULTI_TX_UNIQUE, &adapter->state); } +static inline void +qlcnic_82xx_enable_tx_intr (struct qlcnic_adapter *adapter, +struct qlcnic_host_tx_ring *tx_ring) +{ +if (qlcnic_check_multi_tx (adapter) && + !adapter->ahw->diag_test) +writel (0x0 , tx_ring->crb_intr_mask); +} + +static inline void +qlcnic_82xx_disable_tx_intr (struct qlcnic_adapter *adapter, +struct qlcnic_host_tx_ring *tx_ring) +{ +if (qlcnic_check_multi_tx (adapter) && + !adapter->ahw->diag_test) +writel (1 , tx_ring->crb_intr_mask); +} + +static inline void +qlcnic_83xx_enable_tx_intr (struct qlcnic_adapter *adapter, +struct qlcnic_host_tx_ring *tx_ring) +{ +writel (0 , tx_ring->crb_intr_mask); +} + +static inline void +qlcnic_83xx_disable_tx_intr (struct qlcnic_adapter *adapter, +struct qlcnic_host_tx_ring *tx_ring) +{ +writel (1 , tx_ring->crb_intr_mask); +} + +/* Enable MSI-x and INT-x interrupts */ +static inline void +qlcnic_83xx_enable_sds_intr (struct qlcnic_adapter *adapter, +struct qlcnic_host_sds_ring *sds_ring) +{ +writel (0 , sds_ring->crb_intr_mask); +} + +/* Disable MSI-x and INT-x interrupts */ +static inline void +qlcnic_83xx_disable_sds_intr (struct qlcnic_adapter *adapter, +struct qlcnic_host_sds_ring *sds_ring) +{ +writel (1 , sds_ring->crb_intr_mask); +} +static inline void qlcnic_disable_multi_tx (struct qlcnic_adapter *adapter) {test_and_clear_bit (__QLCNIC_MULTI_TX_UNIQUE, &adapter->state);
@@ -2038,10 +2094,10 @@ static inline void qlcnic_disable_multi_tx(struct qlcnic_adapter *adapter)/* When operating in a muti tx mode, driver needs to write 0x1 * to src register, instead of 0x0 to disable receiving interrupt. */ -static inline void qlcnic_disable_int (struct qlcnic_host_sds_ring *sds_ring) +static inline void +qlcnic_82xx_disable_sds_intr (struct qlcnic_adapter *adapter, +struct qlcnic_host_sds_ring *sds_ring) { -struct qlcnic_adapter *adapter = sds_ring->adapter; -if (qlcnic_check_multi_tx (adapter) && !adapter->ahw->diag_test && (adapter->flags &QLCNIC_MSIX_ENABLED ))
@@ -2050,13 +2106,42 @@ static inline void qlcnic_disable_int(struct qlcnic_host_sds_ring *sds_ring)writel (0 , sds_ring->crb_intr_mask); } +static inline void qlcnic_enable_sds_intr (struct qlcnic_adapter *adapter, +struct qlcnic_host_sds_ring *sds_ring) +{ +if (adapter->ahw->hw_ops->enable_sds_intr) + adapter->ahw->hw_ops->enable_sds_intr (adapter, sds_ring); +} + +static inline void +qlcnic_disable_sds_intr (struct qlcnic_adapter *adapter, +struct qlcnic_host_sds_ring *sds_ring) +{ +if (adapter->ahw->hw_ops->disable_sds_intr) + adapter->ahw->hw_ops->disable_sds_intr (adapter, sds_ring); +} + +static inline void qlcnic_enable_tx_intr (struct qlcnic_adapter *adapter, +struct qlcnic_host_tx_ring *tx_ring) +{ +if (adapter->ahw->hw_ops->enable_tx_intr) + adapter->ahw->hw_ops->enable_tx_intr (adapter, tx_ring); +} + +static inline void qlcnic_disable_tx_intr (struct qlcnic_adapter *adapter, +struct qlcnic_host_tx_ring *tx_ring) +{ +if (adapter->ahw->hw_ops->disable_tx_intr) + adapter->ahw->hw_ops->disable_tx_intr (adapter, tx_ring); +} +/* When operating in a muti tx mode, driver needs to write 0x0 * to src register, instead of 0x1 to enable receiving interrupts. */ -static inline void qlcnic_enable_int (struct qlcnic_host_sds_ring *sds_ring) +static inline void +qlcnic_82xx_enable_sds_intr (struct qlcnic_adapter *adapter, +struct qlcnic_host_sds_ring *sds_ring) { -struct qlcnic_adapter *adapter = sds_ring->adapter; -if (qlcnic_check_multi_tx (adapter) && !adapter->ahw->diag_test && (adapter->flags &QLCNIC_MSIX_ENABLED ))
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +8 -17
@@ -199,6 +199,11 @@ static struct qlcnic_hardware_ops qlcnic_83xx_hw_ops = { .io_slot_reset = qlcnic_83xx_io_slot_reset, .io_resume = qlcnic_83xx_io_resume, .get_beacon_state = qlcnic_83xx_get_beacon_state, + .enable_sds_intr = qlcnic_83xx_enable_sds_intr, + .disable_sds_intr = qlcnic_83xx_disable_sds_intr, + .enable_tx_intr = qlcnic_83xx_enable_tx_intr, + .disable_tx_intr = qlcnic_83xx_disable_tx_intr, + };static struct qlcnic_nic_template qlcnic_83xx_ops = {
@@ -345,20 +350,6 @@ static inline void qlcnic_83xx_set_legacy_intr_mask(struct qlcnic_adapter *adaptwritel (1 , adapter->tgt_mask_reg); } -/* Enable MSI-x and INT-x interrupts */ -void qlcnic_83xx_enable_intr (struct qlcnic_adapter *adapter, -struct qlcnic_host_sds_ring *sds_ring) -{ -writel (0 , sds_ring->crb_intr_mask); -} - -/* Disable MSI-x and INT-x interrupts */ -void qlcnic_83xx_disable_intr (struct qlcnic_adapter *adapter, -struct qlcnic_host_sds_ring *sds_ring) -{ -writel (1 , sds_ring->crb_intr_mask); -} -static inline void qlcnic_83xx_enable_legacy_msix_mbx_intr (struct qlcnic_adapter *adapter) {
@@ -496,7 +487,7 @@ irqreturn_t qlcnic_83xx_tmp_intr(int irq, void *data) done: adapter->ahw->diag_cnt++; -qlcnic_83xx_enable_intr (adapter, sds_ring); +qlcnic_enable_sds_intr (adapter, sds_ring);return IRQ_HANDLED ; }
@@ -1360,7 +1351,7 @@ static int qlcnic_83xx_diag_alloc_res(struct net_device *netdev, int test,if (adapter->ahw->diag_test ==QLCNIC_INTERRUPT_TEST ) {for (ring =0 ; ring < adapter->drv_sds_rings; ring++) { sds_ring = &adapter->recv_ctx->sds_rings[ring]; -qlcnic_83xx_enable_intr (adapter, sds_ring); +qlcnic_enable_sds_intr (adapter, sds_ring); } }
@@ -1385,7 +1376,7 @@ static void qlcnic_83xx_diag_free_res(struct net_device *netdev,for (ring =0 ; ring < adapter->drv_sds_rings; ring++) { sds_ring = &adapter->recv_ctx->sds_rings[ring];if (adapter->flags &QLCNIC_MSIX_ENABLED ) -qlcnic_83xx_disable_intr (adapter, sds_ring); +qlcnic_disable_sds_intr (adapter, sds_ring); } }
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h +0 -4
@@ -584,10 +584,6 @@ void qlcnic_83xx_disable_mbx_intr(struct qlcnic_adapter *);irqreturn_t qlcnic_83xx_clear_legacy_intr (struct qlcnic_adapter *);irqreturn_t qlcnic_83xx_intr (int ,void *);irqreturn_t qlcnic_83xx_tmp_intr (int ,void *); -void qlcnic_83xx_enable_intr (struct qlcnic_adapter *, -struct qlcnic_host_sds_ring *); -void qlcnic_83xx_disable_intr (struct qlcnic_adapter *, -struct qlcnic_host_sds_ring *);void qlcnic_83xx_check_vf (struct qlcnic_adapter *,const struct pci_device_id *);int qlcnic_83xx_config_default_opmode (struct qlcnic_adapter *);
drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c +13 -42
139 lines not on this page · raw message
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +7 -3
@@ -557,6 +557,10 @@ static struct qlcnic_hardware_ops qlcnic_hw_ops = { .io_slot_reset = qlcnic_82xx_io_slot_reset, .io_resume = qlcnic_82xx_io_resume, .get_beacon_state = qlcnic_82xx_get_beacon_state, + .enable_sds_intr = qlcnic_82xx_enable_sds_intr, + .disable_sds_intr = qlcnic_82xx_disable_sds_intr, + .enable_tx_intr = qlcnic_82xx_enable_tx_intr, + .disable_tx_intr = qlcnic_82xx_disable_tx_intr, };static int qlcnic_check_multi_tx_capability (struct qlcnic_adapter *adapter)
@@ -1874,7 +1878,7 @@ void qlcnic_diag_free_res(struct net_device *netdev, int drv_sds_rings)if (adapter->ahw->diag_test ==QLCNIC_INTERRUPT_TEST ) {for (ring =0 ; ring < adapter->drv_sds_rings; ring++) { sds_ring = &adapter->recv_ctx->sds_rings[ring]; -qlcnic_disable_int (sds_ring); +qlcnic_disable_sds_intr (adapter, sds_ring); } }
@@ -1975,7 +1979,7 @@ int qlcnic_diag_alloc_res(struct net_device *netdev, int test)if (adapter->ahw->diag_test ==QLCNIC_INTERRUPT_TEST ) {for (ring =0 ; ring < adapter->drv_sds_rings; ring++) { sds_ring = &adapter->recv_ctx->sds_rings[ring]; -qlcnic_enable_int (sds_ring); +qlcnic_enable_sds_intr (adapter, sds_ring); } }
@@ -2873,7 +2877,7 @@ static irqreturn_t qlcnic_tmp_intr(int irq, void *data) done: adapter->ahw->diag_cnt++; -qlcnic_enable_int (sds_ring); +qlcnic_enable_sds_intr (adapter, sds_ring);return IRQ_HANDLED ; }
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c +2 -0
@@ -71,6 +71,8 @@ static struct qlcnic_hardware_ops qlcnic_sriov_vf_hw_ops = { .change_l2_filter = qlcnic_83xx_change_l2_filter, .get_board_info = qlcnic_83xx_get_port_info, .free_mac_list = qlcnic_sriov_vf_free_mac_list, + .enable_sds_intr = qlcnic_83xx_enable_sds_intr, + .disable_sds_intr = qlcnic_83xx_disable_sds_intr, };static struct qlcnic_nic_template qlcnic_sriov_vf_ops = {
Signature · 1 line
1.8.1.4
PATCH 4/7 qlcnic: Update poll controller code path
In reply to Himanshu MadhaniFrom: Manish chopra <[email protected]>
Add support for MSI/MSI-X mode in poll controller routine.
--- drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 34 +++++++++++++++++++----- 1 file changed, 28 insertions(+), 6 deletions(-)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +28 -6
@@ -2925,17 +2925,39 @@ static irqreturn_t qlcnic_msix_tx_intr(int irq, void *data)#ifdef CONFIG_NET_POLL_CONTROLLER static void qlcnic_poll_controller (struct net_device *netdev) { -int ring; -struct qlcnic_host_sds_ring *sds_ring;struct qlcnic_adapter *adapter =netdev_priv (netdev); -struct qlcnic_recv_context *recv_ctx = adapter->recv_ctx; +struct qlcnic_host_sds_ring *sds_ring; +struct qlcnic_recv_context *recv_ctx; +struct qlcnic_host_tx_ring *tx_ring; +int ring; + +if (!test_bit (__QLCNIC_DEV_UP, &adapter->state)) +return ; + + recv_ctx = adapter->recv_ctx; -disable_irq (adapter->irq);for (ring =0 ; ring < adapter->drv_sds_rings; ring++) { sds_ring = &recv_ctx->sds_rings[ring]; -qlcnic_intr (adapter->irq, sds_ring); +qlcnic_disable_sds_intr (adapter, sds_ring); +napi_schedule (&sds_ring->napi); + } + +if (adapter->flags &QLCNIC_MSIX_ENABLED ) { +/* Only Multi-Tx queue capable devices need to +* schedule NAPI for TX rings +*/ +if ((qlcnic_83xx_check (adapter) && + (adapter->flags &QLCNIC_TX_INTR_SHARED )) || + (qlcnic_82xx_check (adapter) && + !qlcnic_check_multi_tx (adapter))) +return ; + +for (ring =0 ; ring < adapter->drv_tx_rings; ring++) { + tx_ring = &adapter->tx_ring[ring]; +qlcnic_disable_tx_intr (adapter, tx_ring); +napi_schedule (&tx_ring->napi); + } } -enable_irq (adapter->irq); }#endif
Signature · 1 line
1.8.1.4
PATCH 5/7 qlcnic: Refactor interrupt coalescing code for all adapters.
In reply to Himanshu MadhaniFrom: Himanshu Madhani <[email protected]>
o Refactor configuration of interrupt coalescing parameters for all supported adapters.
--- drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 9 +- .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 133 +++++++++++++++++---- .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h | 5 +- .../net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 99 ++++----------- drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c | 27 ++++- drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h | 4 +- drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 40 +++++-- 7 files changed, 200 insertions(+), 117 deletions(-)
drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +6 -3
@@ -369,6 +369,7 @@ struct qlcnic_rx_buffer {*/ #define QLCNIC_INTR_COAL_TYPE_RX 1#define QLCNIC_INTR_COAL_TYPE_TX 2 +#define QLCNIC_INTR_COAL_TYPE_RX_TX 3#define QLCNIC_DEF_INTR_COALESCE_RX_TIME_US 3#define QLCNIC_DEF_INTR_COALESCE_RX_PACKETS 256
@@ -1740,7 +1741,8 @@ struct qlcnic_hardware_ops {int (*change_macvlan) (struct qlcnic_adapter *,u8 *,u16 ,u8 );void (*napi_enable) (struct qlcnic_adapter *);void (*napi_disable) (struct qlcnic_adapter *); -void (*config_intr_coal) (struct qlcnic_adapter *); +int (*config_intr_coal) (struct qlcnic_adapter *, +struct ethtool_coalesce *);int (*config_rss) (struct qlcnic_adapter *,int );int (*config_hw_lro) (struct qlcnic_adapter *,int );int (*config_loopback) (struct qlcnic_adapter *,u8 );
@@ -1936,9 +1938,10 @@ static inline void qlcnic_napi_disable(struct qlcnic_adapter *adapter) adapter->ahw->hw_ops->napi_disable (adapter); } -static inline void qlcnic_config_intr_coalesce (struct qlcnic_adapter *adapter) +static inline int qlcnic_config_intr_coalesce (struct qlcnic_adapter *adapter, +struct ethtool_coalesce *ethcoal) { - adapter->ahw->hw_ops->config_intr_coal (adapter); +return adapter->ahw->hw_ops->config_intr_coal (adapter, ethcoal); }static inline int qlcnic_config_rss (struct qlcnic_adapter *adapter,int enable)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +113 -20
150 lines not on this page · raw message
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h +3 -2
@@ -547,7 +547,6 @@ int qlcnic_83xx_wrt_reg_indirect(struct qlcnic_adapter *, ulong, u32);int qlcnic_83xx_nic_set_promisc (struct qlcnic_adapter *,u32 );int qlcnic_83xx_config_hw_lro (struct qlcnic_adapter *,int );int qlcnic_83xx_config_rss (struct qlcnic_adapter *,int ); -int qlcnic_83xx_config_intr_coalesce (struct qlcnic_adapter *);void qlcnic_83xx_change_l2_filter (struct qlcnic_adapter *,u64 *,u16 );int qlcnic_83xx_get_pci_info (struct qlcnic_adapter *,struct qlcnic_pci_info *);int qlcnic_83xx_set_nic_info (struct qlcnic_adapter *,struct qlcnic_info *);
@@ -577,7 +576,9 @@ int qlcnic_83xx_alloc_mbx_args(struct qlcnic_cmd_args *,void qlcnic_free_mbx_args (struct qlcnic_cmd_args *);void qlcnic_set_npar_data (struct qlcnic_adapter *,const struct qlcnic_info *,struct qlcnic_info *); -void qlcnic_83xx_config_intr_coal (struct qlcnic_adapter *); +int qlcnic_83xx_config_intr_coal (struct qlcnic_adapter *, +struct ethtool_coalesce *); +int qlcnic_83xx_set_rx_tx_intr_coal (struct qlcnic_adapter *);int qlcnic_83xx_get_port_info (struct qlcnic_adapter *);void qlcnic_83xx_enable_mbx_interrupt (struct qlcnic_adapter *);void qlcnic_83xx_disable_mbx_intr (struct qlcnic_adapter *);
drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c +23 -76
114 lines not on this page · raw message
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c +23 -4
@@ -755,10 +755,7 @@ int qlcnic_82xx_read_phys_port_id(struct qlcnic_adapter *adapter)return 0 ; } -/* -* Send the interrupt coalescing parameter set by ethtool to the card. -*/ -void qlcnic_82xx_config_intr_coalesce (struct qlcnic_adapter *adapter) +int qlcnic_82xx_set_rx_coalesce (struct qlcnic_adapter *adapter) {struct qlcnic_nic_req req;int rv;
@@ -780,6 +777,28 @@ void qlcnic_82xx_config_intr_coalesce(struct qlcnic_adapter *adapter)if (rv !=0 )dev_err (&adapter->netdev->dev,"Could not send interrupt coalescing parameters\n" ); + +return rv; +} + +/* Send the interrupt coalescing parameter set by ethtool to the card. */ +int qlcnic_82xx_config_intr_coalesce (struct qlcnic_adapter *adapter, +struct ethtool_coalesce *ethcoal) +{ +struct qlcnic_nic_intr_coalesce *coal = &adapter->ahw->coal; +int rv; + + coal->flag =QLCNIC_INTR_DEFAULT ; + coal->rx_time_us = ethcoal->rx_coalesce_usecs; + coal->rx_packets = ethcoal->rx_max_coalesced_frames; + + rv =qlcnic_82xx_set_rx_coalesce (adapter); + +if (rv) +netdev_err (adapter->netdev, +"Failed to set Rx coalescing parametrs\n" ); + +return rv; }#define QLCNIC_ENABLE_IPV4_LRO BIT_0
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h +3 -1
@@ -171,7 +171,9 @@ int qlcnic_82xx_napi_add(struct qlcnic_adapter *adapter,void qlcnic_82xx_get_beacon_state (struct qlcnic_adapter *);void qlcnic_82xx_change_filter (struct qlcnic_adapter *adapter,u64 *uaddr,u16 vlan_id); -void qlcnic_82xx_config_intr_coalesce (struct qlcnic_adapter *adapter); +int qlcnic_82xx_config_intr_coalesce (struct qlcnic_adapter *, +struct ethtool_coalesce *); +int qlcnic_82xx_set_rx_coalesce (struct qlcnic_adapter *);int qlcnic_82xx_config_rss (struct qlcnic_adapter *adapter,int );void qlcnic_82xx_config_ipaddr (struct qlcnic_adapter *adapter,__be32 ,int );
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +29 -11
@@ -1701,6 +1701,33 @@ static void qlcnic_get_lro_mss_capability(struct qlcnic_adapter *adapter) } } +static int qlcnic_config_def_intr_coalesce (struct qlcnic_adapter *adapter) +{ +struct qlcnic_hardware_context *ahw = adapter->ahw; +int err; + +/* Initialize interrupt coalesce parameters */ + ahw->coal.flag =QLCNIC_INTR_DEFAULT ; + +if (qlcnic_83xx_check (adapter)) { + ahw->coal.type =QLCNIC_INTR_COAL_TYPE_RX_TX ; + ahw->coal.tx_time_us =QLCNIC_DEF_INTR_COALESCE_TX_TIME_US ; + ahw->coal.tx_packets =QLCNIC_DEF_INTR_COALESCE_TX_PACKETS ; + ahw->coal.rx_time_us =QLCNIC_DEF_INTR_COALESCE_RX_TIME_US ; + ahw->coal.rx_packets =QLCNIC_DEF_INTR_COALESCE_RX_PACKETS ; + + err =qlcnic_83xx_set_rx_tx_intr_coal (adapter); + }else { + ahw->coal.type =QLCNIC_INTR_COAL_TYPE_RX ; + ahw->coal.rx_time_us =QLCNIC_DEF_INTR_COALESCE_RX_TIME_US ; + ahw->coal.rx_packets =QLCNIC_DEF_INTR_COALESCE_RX_PACKETS ; + + err =qlcnic_82xx_set_rx_coalesce (adapter); + } + +return err; +} +int __qlcnic_up (struct qlcnic_adapter *adapter,struct net_device *netdev) {int ring;
@@ -1733,7 +1760,7 @@ int __qlcnic_up(struct qlcnic_adapter *adapter, struct net_device *netdev)if (adapter->drv_sds_rings >1 )qlcnic_config_rss (adapter,1 ); -qlcnic_config_intr_coalesce (adapter); +qlcnic_config_def_intr_coalesce (adapter);if (netdev->features &NETIF_F_LRO )qlcnic_config_hw_lro (adapter,QLCNIC_LRO_ENABLED );
@@ -1901,7 +1928,6 @@ out:static int qlcnic_alloc_adapter_resources (struct qlcnic_adapter *adapter) { -struct qlcnic_hardware_context *ahw = adapter->ahw;int err =0 ; adapter->recv_ctx = kzalloc(sizeof(struct qlcnic_recv_context),
@@ -1910,15 +1936,7 @@ static int qlcnic_alloc_adapter_resources(struct qlcnic_adapter *adapter) err = -ENOMEM ; goto err_out; } -/* Initialize interrupt coalesce parameters */ - ahw->coal.flag =QLCNIC_INTR_DEFAULT ; - ahw->coal.type =QLCNIC_INTR_COAL_TYPE_RX ; - ahw->coal.rx_time_us =QLCNIC_DEF_INTR_COALESCE_RX_TIME_US ; - ahw->coal.rx_packets =QLCNIC_DEF_INTR_COALESCE_RX_PACKETS ; -if (qlcnic_83xx_check (adapter)) { - ahw->coal.tx_time_us =QLCNIC_DEF_INTR_COALESCE_TX_TIME_US ; - ahw->coal.tx_packets =QLCNIC_DEF_INTR_COALESCE_TX_PACKETS ; - } +/* clear stats */ memset (&adapter->stats,0 ,sizeof (adapter->stats)); err_out:
Signature · 1 line
1.8.1.4
PATCH 6/7 qlcnic: Enhance logic to calculate msix vectors.
In reply to Himanshu MadhaniFrom: Himanshu Madhani <[email protected]>
o Refactored MSI-x vector calculation for All adapters. Decoupled logic in the code which was using same call to request MSI-x vectors in default driver load, as well as during set_channel() operation for TSS/RSS. This refactoring simplifies code for TSS/RSS code path as well as probe path of the driver load for all adapters.
--- drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 17 +- .../net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c | 75 +++++--- .../net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 7 +- drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 190 ++++++++++++++------- 4 files changed, 192 insertions(+), 97 deletions(-)
drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +10 -7
@@ -105,6 +105,8 @@#define QLCNIC_DEF_TX_RINGS 4#define QLCNIC_MAX_VNIC_TX_RINGS 4#define QLCNIC_MAX_VNIC_SDS_RINGS 4 +#define QLCNIC_83XX_MINIMUM_VECTOR 3 +#define QLCNIC_82XX_MINIMUM_VECTOR 2enum qlcnic_queue_type {QLCNIC_TX_QUEUE =1 ,
@@ -962,6 +964,7 @@ struct qlcnic_ipaddr {#define QLCNIC_TX_INTR_SHARED 0x10000#define QLCNIC_APP_CHANGED_FLAGS 0x20000#define QLCNIC_HAS_PHYS_PORT_ID 0x40000 +#define QLCNIC_TSS_RSS 0x80000#define QLCNIC_IS_MSI_FAMILY (adapter) \ ((adapter)->flags & (QLCNIC_MSI_ENABLED | QLCNIC_MSIX_ENABLED))
@@ -1058,6 +1061,9 @@ struct qlcnic_adapter {u8 drv_tx_rings;/* max tx rings supported by driver */ u8 drv_sds_rings;/* max sds rings supported by driver */ +u8 drv_tss_rings;/* tss ring input */ +u8 drv_rss_rings;/* rss ring input */ +u8 rx_csum;u8 portnum;
@@ -1574,7 +1580,7 @@ int qlcnic_diag_alloc_res(struct net_device *netdev, int);netdev_tx_t qlcnic_xmit_frame (struct sk_buff *,struct net_device *);void qlcnic_set_tx_ring_count (struct qlcnic_adapter *,u8 );void qlcnic_set_sds_ring_count (struct qlcnic_adapter *,u8 ); -int qlcnic_setup_rings (struct qlcnic_adapter *,u8 ,u8 ); +int qlcnic_setup_rings (struct qlcnic_adapter *);int qlcnic_validate_rings (struct qlcnic_adapter *,__u32 ,int );void qlcnic_alloc_lb_filters_mem (struct qlcnic_adapter *adapter);int qlcnic_enable_msix (struct qlcnic_adapter *,u32 );
@@ -1614,7 +1620,7 @@ void qlcnic_set_vlan_config(struct qlcnic_adapter *, struct qlcnic_esw_func_cfg *);void qlcnic_set_eswitch_port_features (struct qlcnic_adapter *,struct qlcnic_esw_func_cfg *); - +int qlcnic_setup_tss_rss_intr (struct qlcnic_adapter *);void qlcnic_down (struct qlcnic_adapter *,struct net_device *);int qlcnic_up (struct qlcnic_adapter *,struct net_device *);void __qlcnic_down (struct qlcnic_adapter *,struct net_device *);
@@ -1671,11 +1677,8 @@ static inline int qlcnic_set_real_num_queues(struct qlcnic_adapter *adapter, err =netif_set_real_num_tx_queues (netdev, adapter->drv_tx_rings);if (err) -dev_err (&adapter->pdev->dev,"failed to set %d Tx queues\n" , - adapter->drv_tx_rings); -else -dev_info (&adapter->pdev->dev,"Set %d Tx queues\n" , - adapter->drv_tx_rings); +netdev_err (netdev,"failed to set %d Tx queues\n" , + adapter->drv_tx_rings);return err; }
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +51 -24
114 lines not on this page · raw message
drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c +5 -2
@@ -736,6 +736,7 @@ static int qlcnic_set_channels(struct net_device *dev, channel->rx_count);return err; } + adapter->drv_rss_rings = channel->rx_count; }if (channel->tx_count) {
@@ -746,10 +747,12 @@ static int qlcnic_set_channels(struct net_device *dev, channel->tx_count);return err; } + adapter->drv_tss_rings = channel->tx_count; } - err =qlcnic_setup_rings (adapter, channel->rx_count, - channel->tx_count); + adapter->flags |=QLCNIC_TSS_RSS ; + + err =qlcnic_setup_rings (adapter);netdev_info (dev,"Allocated %d SDS rings and %d Tx rings\n" , adapter->drv_sds_rings, adapter->drv_tx_rings);
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +126 -64
267 lines not on this page · raw message
Signature · 1 line
1.8.1.4
PATCH 7/7 qlcnic: update version to 5.3.55
In reply to Himanshu MadhaniFrom: Himanshu Madhani <[email protected]>
--- drivers/net/ethernet/qlogic/qlcnic/qlcnic.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +2 -2
@@ -38,8 +38,8 @@#define _QLCNIC_LINUX_MAJOR 5#define _QLCNIC_LINUX_MINOR 3 -#define _QLCNIC_LINUX_SUBVERSION 54 -#define QLCNIC_LINUX_VERSIONID "5.3.54" +#define _QLCNIC_LINUX_SUBVERSION 55 +#define QLCNIC_LINUX_VERSIONID "5.3.55"#define QLCNIC_DRV_IDC_VER 0x01#define QLCNIC_DRIVER_VERSION ((_QLCNIC_LINUX_MAJOR << 16) |\ (_QLCNIC_LINUX_MINOR << 8) | (_QLCNIC_LINUX_SUBVERSION))
Signature · 1 line
1.8.1.4
David Miller
maintainerFrom: Himanshu Madhani <[email protected]>
Date: Thu, 23 Jan 2014 17:18:27 -0500
Quoted 11 lines
This patch series contains following patches.
o Enhanced debug data collection when we are in Tx-timeout situation.
o Enhanced MSI-x vector calculation for defualt load path as well as for TSS/RSS ring change path.
o Refactored interrupt coalescing code for all adapters.
o Refactored interrupt handling as well as cleanup of poll controller code patch for all adapters.
o changedrx_mac_learntype to boolean.Please apply to net-next.
Series applied, thanks.
Quoted 13 lines · David Miller
From: Himanshu Madhani <[email protected]>
Date: Thu, 23 Jan 2014 17:18:27 -0500Quoted 10 lines
This patch series contains following patches.
o Enhanced debug data collection when we are in Tx-timeout situation.
o Enhanced MSI-x vector calculation for defualt load path as well as for TSS/RSS ring change path.
o Refactored interrupt coalescing code for all adapters.
o Refactored interrupt handling as well as cleanup of poll controller code patch for all adapters.
o changedrx_mac_learntype to boolean.
Quoted 3 lines
Quoted 1 line
Please apply to net-next.
Series applied, thanks.
Not that I reject fame, but the commit message contains my name as sign-off, while I've never seen a bit of that code :)
Zoli
David Miller
maintainerFrom: Zoltan Kiss <[email protected]>
Date: Mon, 27 Jan 2014 22:04:17 +0000
Quoted 14 lines · David Miller
Quoted 13 lines
From: Himanshu Madhani <[email protected]>
Date: Thu, 23 Jan 2014 17:18:27 -0500Quoted 10 lines
This patch series contains following patches.
o Enhanced debug data collection when we are in Tx-timeout situation.
o Enhanced MSI-x vector calculation for defualt load path as well as for TSS/RSS ring change path.
o Refactored interrupt coalescing code for all adapters.
o Refactored interrupt handling as well as cleanup of poll controller code patch for all adapters.
o changedrx_mac_learntype to boolean.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
Please apply to net-next.
Series applied, thanks.
Not that I reject fame, but the commit message contains my name as sign-off, while I've never seen a bit of that code :)
Sorry about that. What happens is that I build the merge commit messages from a template, and I used a template for a previous serious with your signoff by accident :-/