Commit fdb4a083 authored by Igor Russkikh's avatar Igor Russkikh Committed by David S. Miller

net: aquantia: Improve link state and statistics check interval callback

Reduce timeout from 2 secs to 1 sec. If link is down,
reduce it to 500msec. This speeds up link detection.
Signed-off-by: default avatarIgor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 45cc1c7a
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
#define AQ_CFG_PCI_FUNC_MSIX_IRQS 9U #define AQ_CFG_PCI_FUNC_MSIX_IRQS 9U
#define AQ_CFG_PCI_FUNC_PORTS 2U #define AQ_CFG_PCI_FUNC_PORTS 2U
#define AQ_CFG_SERVICE_TIMER_INTERVAL (2 * HZ) #define AQ_CFG_SERVICE_TIMER_INTERVAL (1 * HZ)
#define AQ_CFG_POLLING_TIMER_INTERVAL ((unsigned int)(2 * HZ)) #define AQ_CFG_POLLING_TIMER_INTERVAL ((unsigned int)(2 * HZ))
#define AQ_CFG_SKB_FRAGS_MAX 32U #define AQ_CFG_SKB_FRAGS_MAX 32U
......
...@@ -168,6 +168,7 @@ static int aq_nic_update_link_status(struct aq_nic_s *self) ...@@ -168,6 +168,7 @@ static int aq_nic_update_link_status(struct aq_nic_s *self)
static void aq_nic_service_timer_cb(struct timer_list *t) static void aq_nic_service_timer_cb(struct timer_list *t)
{ {
struct aq_nic_s *self = from_timer(self, t, service_timer); struct aq_nic_s *self = from_timer(self, t, service_timer);
int ctimer = AQ_CFG_SERVICE_TIMER_INTERVAL;
int err = 0; int err = 0;
if (aq_utils_obj_test(&self->header.flags, AQ_NIC_FLAGS_IS_NOT_READY)) if (aq_utils_obj_test(&self->header.flags, AQ_NIC_FLAGS_IS_NOT_READY))
...@@ -182,10 +183,12 @@ static void aq_nic_service_timer_cb(struct timer_list *t) ...@@ -182,10 +183,12 @@ static void aq_nic_service_timer_cb(struct timer_list *t)
aq_nic_update_ndev_stats(self); aq_nic_update_ndev_stats(self);
/* If no link - use faster timer rate to detect link up asap */
if (!netif_carrier_ok(self->ndev))
ctimer = max(ctimer / 2, 1);
err_exit: err_exit:
mod_timer(&self->service_timer, mod_timer(&self->service_timer, jiffies + ctimer);
jiffies + AQ_CFG_SERVICE_TIMER_INTERVAL);
} }
static void aq_nic_polling_timer_cb(struct timer_list *t) static void aq_nic_polling_timer_cb(struct timer_list *t)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment