From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from stargate.chelsio.com (stargate.chelsio.com [12.32.117.8]) by dpdk.org (Postfix) with ESMTP id CFF5C4D3A; Fri, 9 Nov 2018 08:57:51 +0100 (CET) Received: from localhost (scalar.blr.asicdesigners.com [10.193.185.94]) by stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id wA97vmYp014829; Thu, 8 Nov 2018 23:57:49 -0800 From: Rahul Lakkireddy To: dev@dpdk.org Cc: indranil@chelsio.com, nirranjan@chelsio.com, stable@dpdk.org Date: Fri, 9 Nov 2018 13:26:26 +0530 Message-Id: <3efccbc043a19eb0b4a0984f617690efa100d988.1541747960.git.rahul.lakkireddy@chelsio.com> X-Mailer: git-send-email 2.5.3 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH 4/6] net/cxgbe: increase completion wait time for flow operations X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Nov 2018 07:57:52 -0000 Under heavy load, flow related operations can take more time to complete. Increase max completion wait time to 10 seconds. Also increase max receive budget to read more replies from firmware in every cycle. Fixes: 9eb2c9a48072 ("net/cxgbe: implement flow create operation") Cc: stable@dpdk.org Signed-off-by: Rahul Lakkireddy --- drivers/net/cxgbe/cxgbe_flow.c | 4 ++-- drivers/net/cxgbe/cxgbe_flow.h | 5 +++-- drivers/net/cxgbe/cxgbe_main.c | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/net/cxgbe/cxgbe_flow.c b/drivers/net/cxgbe/cxgbe_flow.c index a8f076e6c..4deaff8f2 100644 --- a/drivers/net/cxgbe/cxgbe_flow.c +++ b/drivers/net/cxgbe/cxgbe_flow.c @@ -797,7 +797,7 @@ static int __cxgbe_flow_create(struct rte_eth_dev *dev, struct rte_flow *flow) /* Poll the FW for reply */ err = cxgbe_poll_for_completion(&adap->sge.fw_evtq, - CXGBE_FLOW_POLL_US, + CXGBE_FLOW_POLL_MS, CXGBE_FLOW_POLL_CNT, &ctx.completion); if (err) { @@ -883,7 +883,7 @@ static int __cxgbe_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow) /* Poll the FW for reply */ err = cxgbe_poll_for_completion(&adap->sge.fw_evtq, - CXGBE_FLOW_POLL_US, + CXGBE_FLOW_POLL_MS, CXGBE_FLOW_POLL_CNT, &ctx.completion); if (err) { diff --git a/drivers/net/cxgbe/cxgbe_flow.h b/drivers/net/cxgbe/cxgbe_flow.h index 718bf3d05..ec8e47aeb 100644 --- a/drivers/net/cxgbe/cxgbe_flow.h +++ b/drivers/net/cxgbe/cxgbe_flow.h @@ -10,8 +10,9 @@ #include "mps_tcam.h" #include "cxgbe.h" -#define CXGBE_FLOW_POLL_US 10 -#define CXGBE_FLOW_POLL_CNT 10 +/* Max poll time is 100 * 100msec = 10 sec */ +#define CXGBE_FLOW_POLL_MS 100 /* 100 milliseconds */ +#define CXGBE_FLOW_POLL_CNT 100 /* Max number of times to poll */ struct chrte_fparse { int (*fptr)(const void *mask, /* currently supported mask */ diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c index 409c9f821..ec080e5d3 100644 --- a/drivers/net/cxgbe/cxgbe_main.c +++ b/drivers/net/cxgbe/cxgbe_main.c @@ -157,18 +157,18 @@ int setup_sge_ctrl_txq(struct adapter *adapter) /** * cxgbe_poll_for_completion: Poll rxq for completion * @q: rxq to poll - * @us: microseconds to delay + * @ms: milliseconds to delay * @cnt: number of times to poll * @c: completion to check for 'done' status * * Polls the rxq for reples until completion is done or the count * expires. */ -int cxgbe_poll_for_completion(struct sge_rspq *q, unsigned int us, +int cxgbe_poll_for_completion(struct sge_rspq *q, unsigned int ms, unsigned int cnt, struct t4_completion *c) { unsigned int i; - unsigned int work_done, budget = 4; + unsigned int work_done, budget = 32; if (!c) return -EINVAL; @@ -181,7 +181,7 @@ int cxgbe_poll_for_completion(struct sge_rspq *q, unsigned int us, return 0; } t4_os_unlock(&c->lock); - udelay(us); + rte_delay_ms(ms); } return -ETIMEDOUT; } -- 2.18.0