diff options
author | Igor Russkikh <igor.russkikh@aquantia.com> | 2017-12-14 04:34:45 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-12-15 12:46:42 -0500 |
commit | fdb4a0830e74acfbe84d4d4e6772ea09c96786ad (patch) | |
tree | 9af1206024ef9132bbfa64f54ee369f80e686344 | |
parent | 45cc1c7ad47c4d166d15c7bce449d2de4daef0c5 (diff) |
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: Igor Russkikh <igor.russkikh@aquantia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/aquantia/atlantic/aq_cfg.h | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_cfg.h b/drivers/net/ethernet/aquantia/atlantic/aq_cfg.h index 57e796870595..73b93a7b4800 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_cfg.h +++ b/drivers/net/ethernet/aquantia/atlantic/aq_cfg.h | |||
@@ -50,7 +50,7 @@ | |||
50 | #define AQ_CFG_PCI_FUNC_MSIX_IRQS 9U | 50 | #define AQ_CFG_PCI_FUNC_MSIX_IRQS 9U |
51 | #define AQ_CFG_PCI_FUNC_PORTS 2U | 51 | #define AQ_CFG_PCI_FUNC_PORTS 2U |
52 | 52 | ||
53 | #define AQ_CFG_SERVICE_TIMER_INTERVAL (2 * HZ) | 53 | #define AQ_CFG_SERVICE_TIMER_INTERVAL (1 * HZ) |
54 | #define AQ_CFG_POLLING_TIMER_INTERVAL ((unsigned int)(2 * HZ)) | 54 | #define AQ_CFG_POLLING_TIMER_INTERVAL ((unsigned int)(2 * HZ)) |
55 | 55 | ||
56 | #define AQ_CFG_SKB_FRAGS_MAX 32U | 56 | #define AQ_CFG_SKB_FRAGS_MAX 32U |
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c index b3a5d1fbc713..75a894a9251c 100644 --- a/drivers/net/ethernet/aquantia/atlantic/aq_nic.c +++ b/drivers/net/ethernet/aquantia/atlantic/aq_nic.c | |||
@@ -168,6 +168,7 @@ static int aq_nic_update_link_status(struct aq_nic_s *self) | |||
168 | static void aq_nic_service_timer_cb(struct timer_list *t) | 168 | static void aq_nic_service_timer_cb(struct timer_list *t) |
169 | { | 169 | { |
170 | struct aq_nic_s *self = from_timer(self, t, service_timer); | 170 | struct aq_nic_s *self = from_timer(self, t, service_timer); |
171 | int ctimer = AQ_CFG_SERVICE_TIMER_INTERVAL; | ||
171 | int err = 0; | 172 | int err = 0; |
172 | 173 | ||
173 | if (aq_utils_obj_test(&self->header.flags, AQ_NIC_FLAGS_IS_NOT_READY)) | 174 | 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 | 183 | ||
183 | aq_nic_update_ndev_stats(self); | 184 | aq_nic_update_ndev_stats(self); |
184 | 185 | ||
186 | /* If no link - use faster timer rate to detect link up asap */ | ||
187 | if (!netif_carrier_ok(self->ndev)) | ||
188 | ctimer = max(ctimer / 2, 1); | ||
185 | 189 | ||
186 | err_exit: | 190 | err_exit: |
187 | mod_timer(&self->service_timer, | 191 | mod_timer(&self->service_timer, jiffies + ctimer); |
188 | jiffies + AQ_CFG_SERVICE_TIMER_INTERVAL); | ||
189 | } | 192 | } |
190 | 193 | ||
191 | static void aq_nic_polling_timer_cb(struct timer_list *t) | 194 | static void aq_nic_polling_timer_cb(struct timer_list *t) |