From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id BC6201B2CB for ; Mon, 6 Nov 2017 15:31:53 +0100 (CET) Received: by mail-wm0-f65.google.com with SMTP id b189so14107292wmd.4 for ; Mon, 06 Nov 2017 06:31:53 -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=DbNzZrvjlmHu7ozuHoaPpF6BjIBIDsubNulno1jMRcc=; b=u3Iv1rrZ9+TzHhRv5sIhEMhm0gbvGG960h/dvbXP9H3SPE+KuqZwnz+tH1llPRPdWa spCtVJPOJviCKUD0Mz1eh4uFUAnlQrFSoM8C1Ug1D2SoHMeg0VOUg0OGDCGm0xUTyoMt AU5n4WAckeFTOZf9TQFazSMZ3gs0SBeZLpuNtkJj+h65pmV5xjUYYVDzIKiacGHZaG44 gtsPYimuXRRet+03Cvt7Ua7s2v821O0mqmg+CDXU0YRtm24QXdl4XaNlvB0HXXuWWNPx 11pLPqIgudqoYUnrZnN+hVTvILoKobSAVZnPZQS19pFn8VjEbozufVbxo5i658LeD8L8 vRtA== 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=DbNzZrvjlmHu7ozuHoaPpF6BjIBIDsubNulno1jMRcc=; b=uIPEFudKWW0MosRGU3weXzeiXcg3E8X5yeG+fpQl7E9xH/I/Rh4y5pxYtulNASyoeF S4G9Xnw4pYEO33nB1oWGmO8Xw/td6d1vM1AmIVybtHo3R2EMyR20rnhqbNZsjt7Ojrsn iWZxd7GAeK8H+iyyNLa0lOuzhgsd2SgUCOy7IsLT4wzSGTw5aGVpK6Jh5MtgXsYe0UpD bi95FP7nfNm+ZoDy47WPycAusebUj7cH9s2Y8+KFRbZQAOWS6DGE/k9jtcnB2rh0O6bw Ynpxc/LbNLBpt2xYk/gGtW2K6A6Hbw41ZeBFG0P1xMGQIVVjyI+zKfvfp0VCn1utelus MtHA== X-Gm-Message-State: AJaThX4xXVcFkfe62E57I4UyJOl8DRCL5W1S35x3s+2LVlSuAnvj2RYH JCNUctGDOOHkOPYMYu4D64TG X-Google-Smtp-Source: ABhQp+QiCEYgoTBnaQDn1R1i5r0gSeFH3jGUMA/DHENbWuZZtm3t9PnQdXmm1XAnptNHa4M6raks2A== X-Received: by 10.28.87.17 with SMTP id l17mr5402061wmb.158.1509978712358; Mon, 06 Nov 2017 06:31:52 -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 c17sm16195251wrg.26.2017.11.06.06.31.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Nov 2017 06:31:51 -0800 (PST) Date: Mon, 6 Nov 2017 15:32:03 +0100 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: Shahaf Shuler Cc: adrien.mazarguil@6wind.com, yskoh@mellanox.com, dev@dpdk.org Message-ID: <20171106143203.btdvbclzs2wpm472@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: User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH v2] 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 14:31:53 -0000 On Mon, Nov 06, 2017 at 04:00:25PM +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 > --- > On v2: > - Fixing the issue from the hrxq_get and hrxq_new functions. > --- > drivers/net/mlx5/mlx5_flow.c | 4 ++-- > drivers/net/mlx5/mlx5_rxq.c | 8 ++++++-- > 2 files changed, 8 insertions(+), 4 deletions(-) > > diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c > index 5f49bf5ff..bcb06f84a 100644 > --- a/drivers/net/mlx5/mlx5_flow.c > +++ b/drivers/net/mlx5/mlx5_flow.c > @@ -1781,7 +1781,7 @@ priv_flow_create_action_queue_rss(struct priv *priv, > parser->rss_conf.rss_key_len, > hash_fields, > parser->queues, > - hash_fields ? parser->queues_n : 1); > + parser->queues_n); > if (flow->frxq[i].hrxq) > continue; > flow->frxq[i].hrxq = > @@ -1790,7 +1790,7 @@ priv_flow_create_action_queue_rss(struct priv *priv, > parser->rss_conf.rss_key_len, > hash_fields, > parser->queues, > - hash_fields ? parser->queues_n : 1); > + parser->queues_n); > if (!flow->frxq[i].hrxq) { > rte_flow_error_set(error, ENOMEM, > RTE_FLOW_ERROR_TYPE_HANDLE, > diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c > index a1f382b1f..18c13b3c7 100644 > --- a/drivers/net/mlx5/mlx5_rxq.c > +++ b/drivers/net/mlx5/mlx5_rxq.c > @@ -1265,7 +1265,8 @@ mlx5_priv_ind_table_ibv_verify(struct priv *priv) > * @param hash_fields > * Verbs protocol hash field to make the RSS on. > * @param queues > - * Queues entering in hash queue. > + * Queues entering in hash queue. In case of empty hash_fields only the > + * first queue index will be taken for the indirection table. > * @param queues_n > * Number of queues. > * > @@ -1280,6 +1281,7 @@ mlx5_priv_hrxq_new(struct priv *priv, uint8_t *rss_key, uint8_t rss_key_len, > struct mlx5_ind_table_ibv *ind_tbl; > struct ibv_qp *qp; > > + queues_n = hash_fields ? queues_n : 1; > ind_tbl = mlx5_priv_ind_table_ibv_get(priv, queues, queues_n); > if (!ind_tbl) > ind_tbl = mlx5_priv_ind_table_ibv_new(priv, queues, queues_n); > @@ -1332,7 +1334,8 @@ mlx5_priv_hrxq_new(struct priv *priv, uint8_t *rss_key, uint8_t rss_key_len, > * @param rss_conf > * RSS configuration for the Rx hash queue. > * @param queues > - * Queues entering in hash queue. > + * Queues entering in hash queue. In case of empty hash_fields only the > + * first queue index will be taken for the indirection table. > * @param queues_n > * Number of queues. > * > @@ -1345,6 +1348,7 @@ mlx5_priv_hrxq_get(struct priv *priv, uint8_t *rss_key, uint8_t rss_key_len, > { > struct mlx5_hrxq *hrxq; > > + queues_n = hash_fields ? queues_n : 1; > LIST_FOREACH(hrxq, &priv->hrxqs, next) { > struct mlx5_ind_table_ibv *ind_tbl; > > -- > 2.12.0 Acked-by: Nelio Laranjeiro -- Nélio Laranjeiro 6WIND