DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix port stop by verify flows are still present
@ 2018-01-30 13:36 Nelio Laranjeiro
  2018-02-01 12:50 ` Shahaf Shuler
  0 siblings, 1 reply; 2+ messages in thread
From: Nelio Laranjeiro @ 2018-01-30 13:36 UTC (permalink / raw)
  To: Adrien Mazarguil; +Cc: dev, Shahaf Shuler, Yongseok Koh

priv_flow_stop() may be called several times, in such situation flows are
already removed from the NIC and thus all associated objects are no present
in the flow object (ibv_flow, indirections tables, ....).

Fixes: 71ee11c83bc4 ("net/mlx5: fix flow stop when flows are already stopped")
Fixes: 8086cf08b2f0 ("net/mlx5: handle RSS hash configuration in RSS flow")

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
 drivers/net/mlx5/mlx5_flow.c | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index bf8eff8a5..1167c741c 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -2208,6 +2208,7 @@ priv_flow_stop(struct priv *priv, struct mlx5_flows *list)
 
 	TAILQ_FOREACH_REVERSE(flow, list, mlx5_flows, next) {
 		unsigned int i;
+		struct mlx5_ind_table_ibv *ind_tbl = NULL;
 
 		if (flow->drop) {
 			if (!flow->frxq[HASH_RXQ_ETH].ibv_flow)
@@ -2215,17 +2216,26 @@ priv_flow_stop(struct priv *priv, struct mlx5_flows *list)
 			claim_zero(ibv_destroy_flow
 				   (flow->frxq[HASH_RXQ_ETH].ibv_flow));
 			flow->frxq[HASH_RXQ_ETH].ibv_flow = NULL;
+			DEBUG("Flow %p removed", (void *)flow);
 			/* Next flow. */
 			continue;
 		}
+		/* Verify the flow has not already been cleaned. */
+		for (i = 0; i != hash_rxq_init_n; ++i) {
+			if (!flow->frxq[i].ibv_flow)
+				continue;
+			/*
+			 * Indirection table may be necessary to remove the
+			 * flags in the Rx queues.
+			 * This helps to speed-up the process by avoiding
+			 * another loop.
+			 */
+			ind_tbl = flow->frxq[i].hrxq->ind_table;
+			break;
+		}
+		if (i == hash_rxq_init_n)
+			return;
 		if (flow->mark) {
-			struct mlx5_ind_table_ibv *ind_tbl = NULL;
-
-			for (i = 0; i != hash_rxq_init_n; ++i) {
-				if (!flow->frxq[i].hrxq)
-					continue;
-				ind_tbl = flow->frxq[i].hrxq->ind_table;
-			}
 			assert(ind_tbl);
 			for (i = 0; i != ind_tbl->queues_n; ++i)
 				(*priv->rxqs)[ind_tbl->queues[i]]->mark = 0;
-- 
2.11.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] net/mlx5: fix port stop by verify flows are still present
  2018-01-30 13:36 [dpdk-dev] [PATCH] net/mlx5: fix port stop by verify flows are still present Nelio Laranjeiro
@ 2018-02-01 12:50 ` Shahaf Shuler
  0 siblings, 0 replies; 2+ messages in thread
From: Shahaf Shuler @ 2018-02-01 12:50 UTC (permalink / raw)
  To: Nélio Laranjeiro, Adrien Mazarguil; +Cc: dev, Yongseok Koh

Tuesday, January 30, 2018 3:37 PM, Nelio Laranjeiro:
> priv_flow_stop() may be called several times, in such situation flows are
> already removed from the NIC and thus all associated objects are no present
> in the flow object (ibv_flow, indirections tables, ....).

s/indirections/ indirection

> 
> Fixes: 71ee11c83bc4 ("net/mlx5: fix flow stop when flows are already
> stopped")

Such commit don't exists. Removed it.

> Fixes: 8086cf08b2f0 ("net/mlx5: handle RSS hash configuration in RSS flow")
> 
> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> ---

With above fixes, applied to next-net-mlx.
Let me know if you disagree.
Thanks. 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-02-01 12:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-30 13:36 [dpdk-dev] [PATCH] net/mlx5: fix port stop by verify flows are still present Nelio Laranjeiro
2018-02-01 12:50 ` Shahaf Shuler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).