From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id 6A2C11B254 for ; Mon, 6 Nov 2017 08:43:31 +0100 (CET) Received: by mail-wm0-f66.google.com with SMTP id z3so12054093wme.5 for ; Sun, 05 Nov 2017 23:43:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=O+csp3W2hpv3bDg3dscwW8SYbPxmH7u9L47KJGj4Y5Y=; b=Hb22yGJZ5A/q9bpQyC9v8i5cT02aC0CJlRcD3EkLGEj2x+gXTPbUHkx7bt9jzG/ld1 oBnUNTFNzfFNNpXJ5KKIR+JYYHibVbLawJIdMd2kkUWjzUmovfgthIHgFh6JckJSuBEq oJOSw5jtyltad6RelOz4dsYMZ1IW4TH7pMMU52NgRrXtM+69uK+DCLR+ODNzrM7LPNjs u/0r4+8AshZpe43PFBMrR+K+ZwSZJZExahV7yC6hQZ+RRW8QXSL2iIuu4G7PbUoP3raX gZufSvnlOcqjLTpeCB08TsZheHpWN1FwGxwM9Rl6D+inpbA+zPYVfv282suX+qh6/g7b uS8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=O+csp3W2hpv3bDg3dscwW8SYbPxmH7u9L47KJGj4Y5Y=; b=DeXRqF1hgJHuuP9lflRbtjupB76vHCnEy7hg/oVaME/ZYSeL++0I5M9GaLVe0EHnSK asAcX+pwKx/ZoCIHRHljpVGB+ymP7KKBQf/dH/KMuKKe7gZQ34HNcK3FmeF+Sh8M7lQu hym8T82mGyz3Z9sJQo5MRU+QMv0II4tzMbu3Zgrr90wyW4U8GE/T2VzRkL4UdxsnTMIb FXAUOGTrAHQcC0CLvjPhLZ1AOOsJ+1KcwKobWfgZvrRBntp7i8lED06JzLK9RmhM6fan Ioc94rBSv/61HuWSK3jN4khCGzGgTtXz98oB8Od5Qiej/anRzn4+Hsw73+BWDybq+K/r S/+w== X-Gm-Message-State: AMCzsaWZa0ULwguoik9sIMAl9Jvgp4S2TSqLmyK9yDvUFMMqn74X+1ID h3O83funpgKqhUTsKTghFMC8 X-Google-Smtp-Source: ABhQp+TRWEwgQbdIStoFBzDp94HAXWyCM+S3PgXUxlPZgogslP02ug2Dqv6xSM9lr0lc3wJSS2c/cg== X-Received: by 10.80.201.131 with SMTP id w3mr19075431edh.56.1509954211077; Sun, 05 Nov 2017 23:43:31 -0800 (PST) Received: from laranjeiro-vm (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id d12sm11282118eda.27.2017.11.05.23.43.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 05 Nov 2017 23:43:30 -0800 (PST) Date: Mon, 6 Nov 2017 08:43:40 +0100 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: Shahaf Shuler Cc: yskoh@mellanox.com, adrien.mazarguil@6wind.com, dev@dpdk.org Message-ID: <20171106074340.hltazlvyshmivoir@laranjeiro-vm> References: <20171105154449.93962-1-shahafs@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20171105154449.93962-1-shahafs@mellanox.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix flow creation on port start 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: Mon, 06 Nov 2017 07:43:31 -0000 Hi Shahaf, On Sun, Nov 05, 2017 at 05:44:49PM +0200, Shahaf Shuler wrote: > While the PMD avoids from creating hash RXQ with no hash fields and > array of queues after the port was allready started, it lacks such > protection when re-creating the flows after the port restarts. > > This may lead to inconsist behaviour for flows depending if they were > created before or after the port start. > > Fixes: 8086cf08b2f0 ("net/mlx5: handle RSS hash configuration in RSS flow") > Cc: nelio.laranjeiro@6wind.com > > Signed-off-by: Shahaf Shuler > --- > drivers/net/mlx5/mlx5_flow.c | 13 +++++++++---- > 1 file changed, 9 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c > index 5f49bf5ff..b0a196a4b 100644 > --- a/drivers/net/mlx5/mlx5_flow.c > +++ b/drivers/net/mlx5/mlx5_flow.c > @@ -2290,22 +2290,27 @@ priv_flow_start(struct priv *priv, struct mlx5_flows *list) > continue; > } > for (i = 0; i != hash_rxq_init_n; ++i) { > + uint64_t hash_fields = hash_rxq_init[i].hash_fields; > if (!flow->frxq[i].ibv_attr) > continue; > flow->frxq[i].hrxq = > mlx5_priv_hrxq_get(priv, flow->rss_conf.rss_key, > flow->rss_conf.rss_key_len, > - hash_rxq_init[i].hash_fields, > + hash_fields, > (*flow->queues), > - flow->queues_n); > + hash_fields ? > + flow->queues_n : > + 1); > if (flow->frxq[i].hrxq) > goto flow_create; > flow->frxq[i].hrxq = > mlx5_priv_hrxq_new(priv, flow->rss_conf.rss_key, > flow->rss_conf.rss_key_len, > - hash_rxq_init[i].hash_fields, > + hash_fields, > (*flow->queues), > - flow->queues_n); > + hash_fields ? > + flow->queues_n : > + 1); > if (!flow->frxq[i].hrxq) { > DEBUG("Flow %p cannot be applied", > (void *)flow); > -- > 2.12.0 I would suggest to modify directly the mlx5_priv_hrxq_get() and mlx5_priv_hrxq_new() to handle this and update the comment of both functions, as the two places where those are called are tricking the queue numbers the same way, it can be directly handled by the function itself. Thanks, -- Nélio Laranjeiro 6WIND