From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by dpdk.org (Postfix) with ESMTP id 069731B363 for ; Wed, 14 Feb 2018 09:57:55 +0100 (CET) Received: by mail-wr0-f193.google.com with SMTP id s5so21337887wra.0 for ; Wed, 14 Feb 2018 00:57:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:in-reply-to:references:content-transfer-encoding; bh=QvnxaWtBb2iQajfpSczQXHk81KcdnBqvrgoYru5DjAA=; b=gp1Hgb/hkdz17UGyhPA8mVwRkyFRgmDLvS7L+kotEZwmeSeY+XjiSBBZGgpu4Yq/nG uE9evchwJd3JpHSHS3LRgw4cSMEEIPrZ22mOgy0iXLevrrN9QnOYplDh3Ahjd6WHqZc3 1JUOSysNte35Nhd4UAAINjJ8PBGBh5eDxT4jEdc6pHKidQ8jr6uj062QuhweGXjf2XPZ mP0KKNW3tmtppHVNn3rEgSTT3njsNYp2IMsilGGr+TmLs1HJLT7QUTp0IcZd67UftUqq wGNCvHthG7w5TBmZdSxRKNu9OxB5q601AJquGaFbGAXF3w7Y7019/OGL71vbjGF5Xnha OePw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:in-reply-to:references :content-transfer-encoding; bh=QvnxaWtBb2iQajfpSczQXHk81KcdnBqvrgoYru5DjAA=; b=HmK4i4tASeU2+uTbfP0ar45MF2HaO85HAanLbuDKQoqi94L5gS3+KRN0/LiHYTPxWs PJ14ZHTN3L6XKrO3Eurme6sHPloEAzorYU8emCWlQpXapmR6vh/m81ISTBk5A4sviTWd tz/CTj5eGnrOP68IRkMnMLnD855Myuk3izf09adwRuiEi+fQSov2GbRHdfYe39setaII bkgQnH8a88itoihC+eGxRIOnPitAuCm2G4iEXDQxg3stLWR2l+8ljoaQXk5nfKANCCVl YKG1wydCIYrgK7tMowUkeUE6EXlQPiJvQ7tYJguGNlHt2oDfoUCh4PFqWCXaHZ2A+dgB MiFg== X-Gm-Message-State: APf1xPDOi7AEC1p9UhYqNsMY5xmpAszaCyt53il8pzM0n/IKluYaogpe pCf80RC8pF9zgvTX3lBGlhdIoXg+xA== X-Google-Smtp-Source: AH8x2250QvfM1ltw1aVTJ/7Z3/W5ncModfy1g8uWyD/Gf/2h/wSSQzuN1Fg+4mpmEkxXKAzTEN9m+w== X-Received: by 10.223.163.207 with SMTP id m15mr3940927wrb.174.1518598674421; Wed, 14 Feb 2018 00:57:54 -0800 (PST) Received: from laranjeiro-vm.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id 42sm18593706wrw.15.2018.02.14.00.57.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Feb 2018 00:57:53 -0800 (PST) From: Nelio Laranjeiro To: stable@dpdk.org, Yuanhan Liu Cc: =?UTF-8?q?N=C3=A9lio=20Laranjeiro?= , Adrien Mazarguil , Yongseok Koh Date: Wed, 14 Feb 2018 09:58:30 +0100 Message-Id: <60abcdb78605211d43588124988a44a0a6f4921d.1518598604.git.nelio.laranjeiro@6wind.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <9e4118bfe3df2a78d9cf6d5ca74efe4ece730799.1518598604.git.nelio.laranjeiro@6wind.com> References: <9e4118bfe3df2a78d9cf6d5ca74efe4ece730799.1518598604.git.nelio.laranjeiro@6wind.com> MIME-Version: 1.0 In-Reply-To: <20180207093155.GA31542@yliu-mob> References: <20180207093155.GA31542@yliu-mob> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH 2/3] net/mlx5: fix port stop by verify flows are still present X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Feb 2018 08:57:55 -0000 From: NĂ©lio Laranjeiro [ 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 --- 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 68c28edee..c18c77d48 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; -- 2.11.0