]> git.droids-corp.org - dpdk.git/commitdiff
net/cxgbe: increase completion wait time for flow operations
authorRahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Fri, 9 Nov 2018 07:56:26 +0000 (13:26 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 13 Nov 2018 23:35:53 +0000 (00:35 +0100)
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 <rahul.lakkireddy@chelsio.com>
drivers/net/cxgbe/cxgbe_flow.c
drivers/net/cxgbe/cxgbe_flow.h
drivers/net/cxgbe/cxgbe_main.c

index a8f076e6c500f93a14ce54fc2a97d2e54120c0d6..4deaff8f2f0fb830931b1187399ed627f55ddd45 100644 (file)
@@ -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) {
index 718bf3d057ecb5ce738d2d8d301bb14620bbd773..ec8e47aebee2e14445f0fe9240ab26ffa96529be 100644 (file)
@@ -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 */
index 409c9f821496cd63f84eae64bc9976f0f00176fe..ec080e5d3d3bbd41776cf60ca2f751ff566d1bb1 100644 (file)
@@ -157,18 +157,18 @@ out:
 /**
  * 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;
 }