net: aquantia: Atlantic driver 10/2017 updates
Subsystems (3)
cover net: aquantia: Atlantic driver 10/2017 updates
This patchset fixes various issues in driver, improves parameters for better performance on 10Gbit link
Igor Russkikh (7):
net: aquantia: Reset nic statistics on interface up/down
net: aquantia: Add queue restarts stats counter
net: aquantia: Fixed transient link up/down/up notification
net: aquantia: Limit number of MSIX irqs to the number of cpus
net: aquantia: mmio unmap was not performed on driver removal
net: aquantia: Enable coalescing management via ethtool interface
net: aquantia: Bad udp rate on default interrupt coalescing
drivers/net/ethernet/aquantia/atlantic/aq_cfg.h | 8 +- .../net/ethernet/aquantia/atlantic/aq_ethtool.c | 157 +++++++++++++-------- drivers/net/ethernet/aquantia/atlantic/aq_hw.h | 5 +- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 39 +++-- drivers/net/ethernet/aquantia/atlantic/aq_nic.h | 4 +- .../net/ethernet/aquantia/atlantic/aq_pci_func.c | 14 +- drivers/net/ethernet/aquantia/atlantic/aq_vec.c | 3 + .../ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c | 21 ++- .../ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | 89 ++++++------ .../aquantia/atlantic/hw_atl/hw_atl_b0_internal.h | 3 + .../aquantia/atlantic/hw_atl/hw_atl_utils.c | 69 +++++++-- .../aquantia/atlantic/hw_atl/hw_atl_utils.h | 18 ++- 12 files changed, 284 insertions(+), 146 deletions(-)
Signature · 1 line
2.7.4
PATCH 1/7 net: aquantia: Reset nic statistics on interface up/down
Internal statistics system on chip never gets reset until hardware reboot. This is quite inconvenient in terms of ethtool statistics usage.
This patch implements incremental statistics update inside of service callback.
Upon nic initialization, first request is done to fetch initial stat data, current collected stat data gets cleared. Internal statistics mailbox readout is improved to save space and increase readability
--- drivers/net/ethernet/aquantia/atlantic/aq_hw.h | 2 + drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 3 + .../ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c | 1 + .../ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | 1 + .../aquantia/atlantic/hw_atl/hw_atl_utils.c | 69 +++++++++++++++++----- .../aquantia/atlantic/hw_atl/hw_atl_utils.h | 16 ++++- 6 files changed, 75 insertions(+), 17 deletions(-)
drivers/net/ethernet/aquantia/atlantic/aq_hw.h +2 -0
@@ -163,6 +163,8 @@ struct aq_hw_ops {int (*hw_get_regs)(struct aq_hw_s *self,struct aq_hw_caps_s *aq_hw_caps,u32 *regs_buff); +int (*hw_update_stats)(struct aq_hw_s *self); +int (*hw_get_hw_stats)(struct aq_hw_s *self,u64 *data,unsigned int *p_count);
drivers/net/ethernet/aquantia/atlantic/aq_nic.c +3 -0
@@ -167,6 +167,9 @@ static void aq_nic_service_timer_cb(unsigned long param) self->aq_hw_ops.hw_interrupt_moderation_set (self->aq_hw, self->aq_nic_cfg.is_interrupt_moderation); +if (self->aq_hw_ops.hw_update_stats) + self->aq_hw_ops.hw_update_stats (self->aq_hw); +memset (&stats_rx,0U ,sizeof (struct aq_ring_stats_rx_s ));memset (&stats_tx,0U ,sizeof (struct aq_ring_stats_tx_s ));for (i =AQ_DIMOF (self->aq_vec); i--;) {
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c +1 -0
@@ -885,6 +885,7 @@ static struct aq_hw_ops hw_atl_ops_ = { .hw_rss_set = hw_atl_a0_hw_rss_set, .hw_rss_hash_set = hw_atl_a0_hw_rss_hash_set, .hw_get_regs = hw_atl_utils_hw_get_regs, + .hw_update_stats = hw_atl_utils_update_stats, .hw_get_hw_stats = hw_atl_utils_get_hw_stats, .hw_get_fw_version = hw_atl_utils_get_fw_version, };
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c +1 -0
@@ -939,6 +939,7 @@ static struct aq_hw_ops hw_atl_ops_ = { .hw_rss_set = hw_atl_b0_hw_rss_set, .hw_rss_hash_set = hw_atl_b0_hw_rss_hash_set, .hw_get_regs = hw_atl_utils_hw_get_regs, + .hw_update_stats = hw_atl_utils_update_stats, .hw_get_hw_stats = hw_atl_utils_get_hw_stats, .hw_get_fw_version = hw_atl_utils_get_fw_version, };
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.c +55 -14
103 lines not on this page · raw message
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h +13 -3
@@ -115,16 +115,21 @@ struct __packed hw_aq_atl_utils_fw_rpc { }; }; -struct __packed hw_aq_atl_utils_mbox { +struct __packed hw_aq_atl_utils_mbox_header {u32 version;u32 transaction_id; -int error; +u32 error; +}; + +struct __packed hw_aq_atl_utils_mbox { +struct hw_aq_atl_utils_mbox_header header;struct hw_atl_stats_s stats; };struct __packed hw_atl_s {struct aq_hw_s base; -struct hw_aq_atl_utils_mbox mbox; +struct hw_atl_stats_s last_stats; +struct hw_atl_stats_s curr_stats;u64 speed;u32 itr_tx;u32 itr_rx;
@@ -170,6 +175,9 @@ enum hal_atl_utils_fw_state_e {void hw_atl_utils_hw_chip_features_init (struct aq_hw_s *self,u32 *p); +int hw_atl_utils_mpi_read_mbox (struct aq_hw_s *self, +struct hw_aq_atl_utils_mbox_header *pmbox); +void hw_atl_utils_mpi_read_stats (struct aq_hw_s *self,struct hw_aq_atl_utils_mbox *pmbox);
@@ -199,6 +207,8 @@ int hw_atl_utils_hw_deinit(struct aq_hw_s *self);int hw_atl_utils_get_fw_version (struct aq_hw_s *self,u32 *fw_version); +int hw_atl_utils_update_stats (struct aq_hw_s *self); +int hw_atl_utils_get_hw_stats (struct aq_hw_s *self,u64 *data,unsigned int *p_count);
Signature · 1 line
2.7.4
PATCH 2/7 net: aquantia: Add queue restarts stats counter
In reply to Igor RusskikhQueue stat strings are cleaned up, duplicate stat name strings removed, queue restarts counter added
--- .../net/ethernet/aquantia/atlantic/aq_ethtool.c | 92 ++++++++-------------- drivers/net/ethernet/aquantia/atlantic/aq_vec.c | 3 + 2 files changed, 37 insertions(+), 58 deletions(-)
drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c +34 -58
@@ -56,10 +56,6 @@ aq_ethtool_set_link_ksettings(struct net_device *ndev,return aq_nic_set_link_ksettings (aq_nic, cmd); } -/* there "5U" is number of queue[#] stats lines (InPackets+...+InErrors) */ -static const unsigned int aq_ethtool_stat_queue_lines =5U ; -static const unsigned int aq_ethtool_stat_queue_chars = -5U *ETH_GSTRING_LEN ;static const char aq_ethtool_stat_names[][ETH_GSTRING_LEN ] = {"InPackets" ,"InUCast" ,
@@ -83,56 +79,26 @@ static const char aq_ethtool_stat_names[][ETH_GSTRING_LEN] = {"InOctetsDma" ,"OutOctetsDma" , "InDroppedDma", -"Queue[0] InPackets" , -"Queue[0] OutPackets" , -"Queue[0] InJumboPackets" , -"Queue[0] InLroPackets" , -"Queue[0] InErrors" , -"Queue[1] InPackets" , -"Queue[1] OutPackets" , -"Queue[1] InJumboPackets" , -"Queue[1] InLroPackets" , -"Queue[1] InErrors" , -"Queue[2] InPackets" , -"Queue[2] OutPackets" , -"Queue[2] InJumboPackets" , -"Queue[2] InLroPackets" , -"Queue[2] InErrors" , -"Queue[3] InPackets" , -"Queue[3] OutPackets" , -"Queue[3] InJumboPackets" , -"Queue[3] InLroPackets" , -"Queue[3] InErrors" , -"Queue[4] InPackets" , -"Queue[4] OutPackets" , -"Queue[4] InJumboPackets" , -"Queue[4] InLroPackets" , -"Queue[4] InErrors" , -"Queue[5] InPackets" , -"Queue[5] OutPackets" , -"Queue[5] InJumboPackets" , -"Queue[5] InLroPackets" , -"Queue[5] InErrors" , -"Queue[6] InPackets" , -"Queue[6] OutPackets" , -"Queue[6] InJumboPackets" , -"Queue[6] InLroPackets" , -"Queue[6] InErrors" , -"Queue[7] InPackets" , -"Queue[7] OutPackets" , -"Queue[7] InJumboPackets" , -"Queue[7] InLroPackets" , - "Queue[7] InErrors", +}; + +static const char aq_ethtool_queue_stat_names[][ETH_GSTRING_LEN ] = { +"Queue[%d] InPackets" , +"Queue[%d] OutPackets" , +"Queue[%d] Restarts" , +"Queue[%d] InJumboPackets" , +"Queue[%d] InLroPackets" , +"Queue[%d] InErrors" , };static void aq_ethtool_stats (struct net_device *ndev,struct ethtool_stats *stats,u64 *data) {struct aq_nic_s *aq_nic =netdev_priv (ndev); +struct aq_nic_cfg_s *cfg =aq_nic_get_cfg (aq_nic); -/* ASSERT: Need add lines to aq_ethtool_stat_names if AQ_CFG_VECS_MAX > 8 */ -BUILD_BUG_ON (AQ_CFG_VECS_MAX >8 ); -memset (data,0 ,ARRAY_SIZE (aq_ethtool_stat_names) *sizeof (u64)); +memset (data,0 , (ARRAY_SIZE (aq_ethtool_stat_names) + +ARRAY_SIZE (aq_ethtool_queue_stat_names) * + cfg->vecs) *sizeof (u64));aq_nic_get_stats (aq_nic, data); }
@@ -154,8 +120,8 @@ static void aq_ethtool_get_drvinfo(struct net_device *ndev,strlcpy (drvinfo->bus_info, pdev ?pci_name (pdev) :"" ,sizeof (drvinfo->bus_info)); - drvinfo->n_stats =ARRAY_SIZE (aq_ethtool_stat_names) - - (AQ_CFG_VECS_MAX - cfg->vecs) * aq_ethtool_stat_queue_lines; + drvinfo->n_stats =ARRAY_SIZE (aq_ethtool_stat_names) + + cfg->vecs *ARRAY_SIZE (aq_ethtool_queue_stat_names); drvinfo->testinfo_len =0 ; drvinfo->regdump_len = regs_count; drvinfo->eedump_len =0 ;
@@ -164,14 +130,25 @@ static void aq_ethtool_get_drvinfo(struct net_device *ndev,static void aq_ethtool_get_strings (struct net_device *ndev,u32 stringset,u8 *data) { +int i, si;struct aq_nic_s *aq_nic =netdev_priv (ndev);struct aq_nic_cfg_s *cfg =aq_nic_get_cfg (aq_nic); - -if (stringset ==ETH_SS_STATS ) -memcpy (data, *aq_ethtool_stat_names, -sizeof (aq_ethtool_stat_names) - - (AQ_CFG_VECS_MAX - cfg->vecs) * - aq_ethtool_stat_queue_chars); +u8 *p = data; + +if (stringset ==ETH_SS_STATS ) { +memcpy (p, *aq_ethtool_stat_names, +sizeof (aq_ethtool_stat_names)); + p = p +sizeof (aq_ethtool_stat_names); +for (i =0 ; i < cfg->vecs; i++) { +for (si =0 ; + si <ARRAY_SIZE (aq_ethtool_queue_stat_names); + si++) { +snprintf (p,ETH_GSTRING_LEN , + aq_ethtool_queue_stat_names[si], i); + p +=ETH_GSTRING_LEN ; + } + } + } }static int aq_ethtool_get_sset_count (struct net_device *ndev,int stringset)
@@ -182,9 +159,8 @@ static int aq_ethtool_get_sset_count(struct net_device *ndev, int stringset)switch (stringset) {case ETH_SS_STATS : - ret =ARRAY_SIZE (aq_ethtool_stat_names) - - (AQ_CFG_VECS_MAX - cfg->vecs) * - aq_ethtool_stat_queue_lines; + ret =ARRAY_SIZE (aq_ethtool_stat_names) + + cfg->vecs *ARRAY_SIZE (aq_ethtool_queue_stat_names);break ;default : ret = -EOPNOTSUPP ;
drivers/net/ethernet/aquantia/atlantic/aq_vec.c +3 -0
@@ -373,8 +373,11 @@ int aq_vec_get_sw_stats(struct aq_vec_s *self, u64 *data, unsigned int *p_count)memset (&stats_tx,0U ,sizeof (struct aq_ring_stats_tx_s ));aq_vec_add_stats (self, &stats_rx, &stats_tx); +/* This data should mimic aq_ethtool_queue_stat_names structure +*/ data[count] += stats_rx.packets; data[++count] += stats_tx.packets; + data[++count] += stats_tx.queue_restarts; data[++count] += stats_rx.jumbo_packets; data[++count] += stats_rx.lro_packets; data[++count] += stats_rx.errors;
Signature · 1 line
2.7.4
PATCH 3/7 net: aquantia: Fixed transient link up/down/up notification
In reply to Igor RusskikhWhen doing ifconfig down/up, driver did not reported carrier_off neither in nic_stop nor in nic_start. That caused link to be visible as "up" during couple of seconds immediately after "ifconfig up".
--- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/aquantia/atlantic/aq_nic.c +2 -0
@@ -337,6 +337,7 @@ struct aq_nic_s *aq_nic_alloc_hot(struct net_device *ndev) }if (netif_running (ndev))netif_tx_disable (ndev); +netif_carrier_off (self->ndev);for (self->aq_vecs =0 ; self->aq_vecs < self->aq_nic_cfg.vecs; self->aq_vecs++) {
@@ -902,6 +903,7 @@ int aq_nic_stop(struct aq_nic_s *self)unsigned int i =0U ;netif_tx_disable (self->ndev); +netif_carrier_off (self->ndev);del_timer_sync (&self->service_timer);
Signature · 1 line
2.7.4
PATCH 4/7 net: aquantia: Limit number of MSIX irqs to the number of cpus
In reply to Igor RusskikhThere is no much practical use from having MSIX vectors more that number of cpus, thus cap this first with preconfigured limit, then with number of cpus online.
--- drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c +7 -4
@@ -85,6 +85,7 @@ int aq_pci_func_init(struct aq_pci_func_s *self)int err =0 ;unsigned int bar =0U ;unsigned int port =0U ; +unsigned int numvecs =0U ; err =pci_enable_device (self->pdev);if (err <0 )
@@ -142,10 +143,12 @@ int aq_pci_func_init(struct aq_pci_func_s *self) } } -/*enable interrupts */ + numvecs =min ((u8 )AQ_CFG_VECS_DEF , self->aq_hw_caps.msix_irqs); + numvecs =min (numvecs,num_online_cpus ()); + +/* enable interrupts */ #if !AQ_CFG_FORCE_LEGACY_INT - err =pci_alloc_irq_vectors (self->pdev, self->aq_hw_caps.msix_irqs, - self->aq_hw_caps.msix_irqs,PCI_IRQ_MSIX ); + err =pci_alloc_irq_vectors (self->pdev, numvecs, numvecs,PCI_IRQ_MSIX );if (err <0 ) { err = pci_alloc_irq_vectors(self->pdev, 1, 1,
@@ -153,7 +156,7 @@ int aq_pci_func_init(struct aq_pci_func_s *self)if (err <0 ) goto err_exit; } -#endif +#endif /* AQ_CFG_FORCE_LEGACY_INT */ /* net device init */ for (port =0 ; port < self->ports; ++port) {
Signature · 1 line
2.7.4
PATCH 5/7 net: aquantia: mmio unmap was not performed on driver removal
In reply to Igor RusskikhThat may lead to mmio resource leakage.
--- drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c +3 -0
@@ -268,6 +268,9 @@ void aq_pci_func_free(struct aq_pci_func_s *self)aq_nic_ndev_free (self->port[port]); } +if (self->mmio) +iounmap (self->mmio); +kfree (self); err_exit:;
Signature · 1 line
2.7.4
PATCH 6/7 net: aquantia: Enable coalescing management via ethtool interface
In reply to Igor RusskikhAquantia NIC allows both TX and RX interrupt throttle rate (ITR) management, but this was used in a very limited way via predefined values. This patch allows to setup ITR default values via module command line arguments and via standard ethtool coalescing settings.
--- drivers/net/ethernet/aquantia/atlantic/aq_cfg.h | 8 ++- .../net/ethernet/aquantia/atlantic/aq_ethtool.c | 65 ++++++++++++++++++ drivers/net/ethernet/aquantia/atlantic/aq_hw.h | 3 +- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 36 +++++++--- drivers/net/ethernet/aquantia/atlantic/aq_nic.h | 4 +- .../ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c | 20 +++--- .../ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | 76 ++++++++++++---------- .../aquantia/atlantic/hw_atl/hw_atl_b0_internal.h | 3 + .../aquantia/atlantic/hw_atl/hw_atl_utils.h | 2 - 9 files changed, 155 insertions(+), 62 deletions(-)
drivers/net/ethernet/aquantia/atlantic/aq_cfg.h +6 -2
@@ -22,8 +22,12 @@#define AQ_CFG_FORCE_LEGACY_INT 0U -#define AQ_CFG_IS_INTERRUPT_MODERATION_DEF 1U -#define AQ_CFG_INTERRUPT_MODERATION_RATE_DEF 0xFFFFU +#define AQ_CFG_INTERRUPT_MODERATION_OFF 0 +#define AQ_CFG_INTERRUPT_MODERATION_ON 1 +#define AQ_CFG_INTERRUPT_MODERATION_AUTO 0xFFFFU + +#define AQ_CFG_INTERRUPT_MODERATION_USEC_MAX (0x1FF * 2) +#define AQ_CFG_IRQ_MASK 0x1FFU#define AQ_CFG_VECS_MAX 8U
drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c +65 -0
75 lines not on this page · raw message
drivers/net/ethernet/aquantia/atlantic/aq_hw.h +1 -2
@@ -151,8 +151,7 @@ struct aq_hw_ops { [ETH_ALEN ], u32 count); -int (*hw_interrupt_moderation_set)(struct aq_hw_s *self, -bool itr_enabled); +int (*hw_interrupt_moderation_set)(struct aq_hw_s *self);int (*hw_rss_set)(struct aq_hw_s *self,struct aq_rss_parameters *rss_params);
drivers/net/ethernet/aquantia/atlantic/aq_nic.c +26 -10
@@ -16,6 +16,7 @@#include "aq_pci_func.h" #include "aq_nic_internal.h" +#include <linux/moduleparam.h> #include <linux/netdevice.h> #include <linux/etherdevice.h> #include <linux/timer.h>
@@ -24,6 +25,18 @@#include <linux/tcp.h> #include <net/ip.h> +static unsigned int aq_itr =AQ_CFG_INTERRUPT_MODERATION_AUTO ; +module_param_named (aq_itr, aq_itr, uint,0644 ); +MODULE_PARM_DESC (aq_itr,"Interrupt throttling mode" ); + +static unsigned int aq_itr_tx; +module_param_named (aq_itr_tx, aq_itr_tx, uint,0644 ); +MODULE_PARM_DESC (aq_itr_tx,"TX interrupt throttle rate" ); + +static unsigned int aq_itr_rx; +module_param_named (aq_itr_rx, aq_itr_rx, uint,0644 ); +MODULE_PARM_DESC (aq_itr_rx,"RX interrupt throttle rate" ); +static void aq_nic_rss_init (struct aq_nic_s *self,unsigned int num_rss_queues) {struct aq_nic_cfg_s *cfg = &self->aq_nic_cfg;
@@ -61,9 +74,9 @@ static void aq_nic_cfg_init_defaults(struct aq_nic_s *self) cfg->is_polling =AQ_CFG_IS_POLLING_DEF ; - cfg->is_interrupt_moderation =AQ_CFG_IS_INTERRUPT_MODERATION_DEF ; - cfg->itr = cfg->is_interrupt_moderation ? -AQ_CFG_INTERRUPT_MODERATION_RATE_DEF :0U ; + cfg->itr = aq_itr; + cfg->tx_itr = aq_itr_tx; + cfg->rx_itr = aq_itr_rx; cfg->is_rss =AQ_CFG_IS_RSS_DEF ; cfg->num_rss_queues =AQ_CFG_NUM_RSS_QUEUES_DEF ;
@@ -126,10 +139,12 @@ static int aq_nic_update_link_status(struct aq_nic_s *self)if (err)return err; -if (self->link_status.mbps != self->aq_hw->aq_link_status.mbps) +if (self->link_status.mbps != self->aq_hw->aq_link_status.mbps) {pr_info ("%s: link change old %d new %d\n" ,AQ_CFG_DRV_NAME , self->link_status.mbps, self->aq_hw->aq_link_status.mbps); +aq_nic_update_interrupt_moderation_settings (self); + } self->link_status = self->aq_hw->aq_link_status;if (!netif_carrier_ok (self->ndev) && self->link_status.mbps) {
@@ -164,9 +179,6 @@ static void aq_nic_service_timer_cb(unsigned long param)if (err) goto err_exit; - self->aq_hw_ops.hw_interrupt_moderation_set (self->aq_hw, - self->aq_nic_cfg.is_interrupt_moderation); -if (self->aq_hw_ops.hw_update_stats) self->aq_hw_ops.hw_update_stats (self->aq_hw);
@@ -425,9 +437,8 @@ int aq_nic_start(struct aq_nic_s *self)if (err <0 ) goto err_exit; - err = self->aq_hw_ops.hw_interrupt_moderation_set (self->aq_hw, - self->aq_nic_cfg.is_interrupt_moderation); -if (err <0 ) + err =aq_nic_update_interrupt_moderation_settings (self); +if (err) goto err_exit;setup_timer (&self->service_timer, &aq_nic_service_timer_cb, (unsigned long )self);
@@ -649,6 +660,11 @@ int aq_nic_xmit(struct aq_nic_s *self, struct sk_buff *skb)return err; } +int aq_nic_update_interrupt_moderation_settings (struct aq_nic_s *self) +{ +return self->aq_hw_ops.hw_interrupt_moderation_set (self->aq_hw); +} +int aq_nic_set_packet_filter (struct aq_nic_s *self,unsigned int flags) {int err =0 ;
drivers/net/ethernet/aquantia/atlantic/aq_nic.h +3 -1
@@ -40,6 +40,8 @@ struct aq_nic_cfg_s {u32 vecs;/* vecs==allocated irqs */ u32 irq_type;u32 itr; +u16 rx_itr; +u16 tx_itr;u32 num_rss_queues;u32 mtu;u32 ucp_0x364;
@@ -49,7 +51,6 @@ struct aq_nic_cfg_s {u16 is_mc_list_enabled;u16 mc_list_count;bool is_autoneg; -bool is_interrupt_moderation;bool is_polling;bool is_rss;bool is_lro;
@@ -104,5 +105,6 @@ int aq_nic_set_link_ksettings(struct aq_nic_s *self,struct aq_nic_cfg_s *aq_nic_get_cfg (struct aq_nic_s *self);u32 aq_nic_get_fw_version (struct aq_nic_s *self);int aq_nic_change_pm_state (struct aq_nic_s *self,pm_message_t *pm_msg); +int aq_nic_update_interrupt_moderation_settings (struct aq_nic_s *self);#endif /* AQ_NIC_H */
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0.c +9 -11
@@ -765,24 +765,23 @@ static int hw_atl_a0_hw_multicast_list_set(struct aq_hw_s *self,return err; } -static int hw_atl_a0_hw_interrupt_moderation_set (struct aq_hw_s *self, -bool itr_enabled) +static int hw_atl_a0_hw_interrupt_moderation_set (struct aq_hw_s *self) {unsigned int i =0U ; +u32 itr_rx; -if (itr_enabled && self->aq_nic_cfg->itr) { -if (self->aq_nic_cfg->itr !=0xFFFFU ) { +if (self->aq_nic_cfg->itr) { +if (self->aq_nic_cfg->itr !=AQ_CFG_INTERRUPT_MODERATION_AUTO ) {u32 itr_ = (self->aq_nic_cfg->itr >>1 ); itr_ =min (AQ_CFG_IRQ_MASK , itr_); -PHAL_ATLANTIC_A0 ->itr_rx =0x80000000U | - (itr_ <<0x10 ); + itr_rx =0x80000000U | (itr_ <<0x10 ); }else {u32 n =0xFFFFU &aq_hw_read_reg (self,0x00002A00U );if (n < self->aq_link_status.mbps) { -PHAL_ATLANTIC_A0 ->itr_rx =0U ; + itr_rx =0U ; }else {static unsigned int hw_timers_tbl_[] = { 0x01CU, /* 10Gbit */
@@ -797,8 +796,7 @@ static int hw_atl_a0_hw_interrupt_moderation_set(struct aq_hw_s *self,hw_atl_utils_mbps_2_speed_index ( self->aq_link_status.mbps); -PHAL_ATLANTIC_A0 ->itr_rx = -0x80000000U | + itr_rx =0x80000000U | (hw_timers_tbl_[speed_index] <<0x10U ); }
@@ -806,11 +804,11 @@ static int hw_atl_a0_hw_interrupt_moderation_set(struct aq_hw_s *self,aq_hw_write_reg (self,0x00002A00U ,0x8D000000U ); } }else { -PHAL_ATLANTIC_A0 ->itr_rx =0U ; + itr_rx =0U ; }for (i =HW_ATL_A0_RINGS_MAX ; i--;) -reg_irq_thr_set (self,PHAL_ATLANTIC_A0 ->itr_rx, i); +reg_irq_thr_set (self, itr_rx, i);return aq_hw_err_from_flags (self); }
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c +42 -34
107 lines not on this page · raw message
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.h +3 -0
@@ -139,6 +139,9 @@#define HW_ATL_B0_FW_VER_EXPECTED 0x01050006U +#define HW_ATL_INTR_MODER_MAX 0x1FF +#define HW_ATL_INTR_MODER_MIN 0xFF +/* Hardware tx descriptor */ struct __packed hw_atl_txd_s {u64 buf_addr;
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h +0 -2
@@ -131,8 +131,6 @@ struct __packed hw_atl_s {struct hw_atl_stats_s last_stats;struct hw_atl_stats_s curr_stats;u64 speed; -u32 itr_tx; -u32 itr_rx;unsigned int chip_features;u32 fw_ver_actual;atomic_t dpc;
Signature · 1 line
2.7.4
PATCH 7/7 net: aquantia: Bad udp rate on default interrupt coalescing
In reply to Igor RusskikhDefault Tx rates cause very long ISR delays on Tx.0xff is 510us delay, giving only ~ 2000 interrupts per seconds for Tx rings cleanup. With these settings udp tx rate was never higher than ~800Mbps on a single stream. Changing min delay to 0xF makes it way better with ~6Gbps
TCP stream performance is almost unaffected by this change, since LSO optimizations play important role.
CPU load is affected insignificantly by this change.
--- drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c +6 -6
@@ -821,12 +821,12 @@ static int hw_atl_b0_hw_interrupt_moderation_set(struct aq_hw_s *self) itr_rx |= rx_max_timer <<0x10U ; }else {static unsigned int hw_atl_b0_timers_table_tx_[][2 ] = { - {0xffU ,0xffU },/* 10Gbit */ - {0xffU ,0x1ffU },/* 5Gbit */ - {0xffU ,0x1ffU },/* 5Gbit 5GS */ - {0xffU ,0x1ffU },/* 2.5Gbit */ - {0xffU ,0x1ffU },/* 1Gbit */ - {0xffU ,0x1ffU },/* 100Mbit */ + {0xfU ,0xffU },/* 10Gbit */ + {0xfU ,0x1ffU },/* 5Gbit */ + {0xfU ,0x1ffU },/* 5Gbit 5GS */ + {0xfU ,0x1ffU },/* 2.5Gbit */ + {0xfU ,0x1ffU },/* 1Gbit */ + {0xfU ,0x1ffU },/* 100Mbit */ }; static unsigned int hw_atl_b0_timers_table_rx_[][2] = {
Signature · 1 line
2.7.4
David Miller
maintainerFrom: Igor Russkikh <[email protected]>
Date: Thu, 19 Oct 2017 18:23:52 +0300
Quoted 2 lines
This patchset fixes various issues in driver, improves parameters for better performance on 10Gbit link
Series applied.