summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNĂ©lio Laranjeiro <nelio.laranjeiro@6wind.com>2018-02-14 09:58:30 +0100
committerYuanhan Liu <yliu@fridaylinux.org>2018-02-16 20:22:31 +0800
commitff24f852f040c180253da06af8d61212d739d67e (patch)
tree7622e3c042c2403e3ca9e6a6d83e518220560706
parent29dd3c693214d2a547025bbe90e9c3810ad83ad0 (diff)
downloaddpdk-stable-ff24f852f040c180253da06af8d61212d739d67e.zip
dpdk-stable-ff24f852f040c180253da06af8d61212d739d67e.tar.gz
dpdk-stable-ff24f852f040c180253da06af8d61212d739d67e.tar.xz
net/mlx5: fix port stop by verify flows are still present
[ backported from upstream commit f07f9bcdb4d6aaaef7469ac4b03d8dd8d43a41db ] 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, indirection tables, ....). Fixes: 8086cf08b2f0 ("net/mlx5: handle RSS hash configuration in RSS flow") Cc: stable@dpdk.org Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
-rw-r--r--drivers/net/mlx5/mlx5_flow.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 68c28ed..c18c77d 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -2240,23 +2240,33 @@ 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->drxq.ibv_flow)
continue;
claim_zero(ibv_destroy_flow(flow->drxq.ibv_flow));
flow->drxq.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;