From: Qi Zhang Date: Thu, 29 Aug 2019 02:36:50 +0000 (+0800) Subject: net/ice/base: delay less X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=fc882012b3fac233f8d9340ad3979f2cd5880a2a;p=dpdk.git net/ice/base: delay less Shorten the delay for SQ responses, but increase the number of loops. Max delay time is unchanged, but some operations complete much more quickly. In the process, add a new define to make the delay count and delay time more explicit, and simplify the code so it's the same for both switch and NIC mode. Add comments to make things more explicit. Signed-off-by: Mitch Williams Signed-off-by: Paul M Stillwell Jr Signed-off-by: Qi Zhang Acked-by: Xiaolong Ye --- diff --git a/drivers/net/ice/base/ice_controlq.c b/drivers/net/ice/base/ice_controlq.c index 501f986b9d..1ea8f3a240 100644 --- a/drivers/net/ice/base/ice_controlq.c +++ b/drivers/net/ice/base/ice_controlq.c @@ -982,7 +982,7 @@ ice_sq_send_cmd_nolock(struct ice_hw *hw, struct ice_ctl_q_info *cq, if (ice_sq_done(hw, cq)) break; - ice_msec_delay(1, false); + ice_usec_delay(ICE_CTL_Q_SQ_CMD_USEC, false); total_delay++; } while (total_delay < cq->sq_cmd_timeout); diff --git a/drivers/net/ice/base/ice_controlq.h b/drivers/net/ice/base/ice_controlq.h index acb4ab49ec..b1214f6705 100644 --- a/drivers/net/ice/base/ice_controlq.h +++ b/drivers/net/ice/base/ice_controlq.h @@ -33,8 +33,9 @@ enum ice_ctl_q { ICE_CTL_Q_MAILBOX, }; -/* Control Queue default settings */ -#define ICE_CTL_Q_SQ_CMD_TIMEOUT 250 /* msecs */ +/* Control Queue timeout settings - max delay 250ms */ +#define ICE_CTL_Q_SQ_CMD_TIMEOUT 2500 /* Count 2500 times */ +#define ICE_CTL_Q_SQ_CMD_USEC 100 /* Check every 100usec */ struct ice_ctl_q_ring { void *dma_head; /* Virtual address to DMA head */ diff --git a/drivers/net/ice/base/ice_osdep.h b/drivers/net/ice/base/ice_osdep.h index 35a17b941e..27c1830c5e 100644 --- a/drivers/net/ice/base/ice_osdep.h +++ b/drivers/net/ice/base/ice_osdep.h @@ -292,7 +292,7 @@ ice_hweight32(u32 num) #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) #define DELAY(x) rte_delay_us(x) -#define ice_usec_delay(x) rte_delay_us(x) +#define ice_usec_delay(x, y) rte_delay_us(x) #define ice_msec_delay(x, y) rte_delay_us(1000 * (x)) #define udelay(x) DELAY(x) #define msleep(x) DELAY(1000 * (x))