From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id 176455F2E for ; Wed, 21 Mar 2018 13:55:29 +0100 (CET) Received: by mail-wm0-f68.google.com with SMTP id f125so9573045wme.4 for ; Wed, 21 Mar 2018 05:55:28 -0700 (PDT) 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=unpCptTZ8z7+gnceamp3Imop2zTj6XN6sOnRxT9GPbQ=; b=rhqxQbmpaNJPfaQnCRjHlKhTC2U2Q428Av98Cpe5X7thMybx3MIgOmwVUK7O3xG9Gm PEQ0IbiQdtCbR8Q1xozJYzIaX9gOYf5i+2941145Y4P85ooYt+qXEZbSLJ042EYfmPFX 6+IH7+hFVPUfc7qeZvFR71rlDj3kNXf2H2tE4YSjaHiZz8J68lEU7WXMUU5FHnY8B2DK Pt0l/72WwzYi7Imq1jeON3uT6assaa6i2EEpXzuJYIfudY4BRybeTVFmUby91t5df93Q ssEQNWQeL1ymGBHGzVFz1D5OjRPSx8rTiEL0nNKil1yJ18Uzs/v+UiMBHF1GGhBWsWjz yMXw== 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=unpCptTZ8z7+gnceamp3Imop2zTj6XN6sOnRxT9GPbQ=; b=sHy1jm+UqAhIhmRZbWD02TGOoQm30TZoxPO+LMuHuO75mgjpZuU6MLh7Xy5QZk1pXT FOoqpSK7D3hyZGBU4MnY7yszK/JPse5w5X/hErfhZm73L2A4b73HHHRnGqizGA75MEYv GDckZfwsDwaRlIbk0ruIJyvT/q7RCxyesKLtNpsx3ykHmPgvD9jEM0pvvw3WxWYwOsfK aZAj2OY1rl+U8DJ7O60nCY8r3mpcYaAHx+hdPEtl4TcXdDScWTsJVq5Yqm5s3JpRdr9D ueJp7Pk7dhpaCgwiMJXSGHcAU9Uf0crq5p+DzAs2EGfbgneilTuoOme4vNQRCtkAr/2r US6A== X-Gm-Message-State: AElRT7G+E2li+2etj6BaFe+Pc594nUh2XUw9RfMUtT3pE/R21fXhYFke vvfHoLAJLgL5YqRstbmW9czC X-Google-Smtp-Source: AG47ELtBhpPJmBRFRQEWzxRwJ1rR47YxGnynn+r9xRqqoPhE0asYb5D5tktCyZm0/3dNXFGiGMpauQ== X-Received: by 10.28.51.67 with SMTP id z64mr349418wmz.134.1521636928660; Wed, 21 Mar 2018 05:55:28 -0700 (PDT) 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 z9sm5463437wrz.4.2018.03.21.05.55.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 21 Mar 2018 05:55:28 -0700 (PDT) Date: Wed, 21 Mar 2018 13:54:36 +0100 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: Adrien Mazarguil , Yongseok Koh , Allain Legacy Cc: Dahir Osman , dev@dpdk.org, matt.peters@windriver.com Message-ID: <20180321125436.mfuxtxws4qjmwzd5@laranjeiro-vm.dev.6wind.com> References: <20180319163007.11516-1-allain.legacy@windriver.com> <3635d2d4c01011fa599d599bfbf16d30fba7e722.1521636364.git.nelio.laranjeiro@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3635d2d4c01011fa599d599bfbf16d30fba7e722.1521636364.git.nelio.laranjeiro@6wind.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH v2] net/mlx5: setup RSS regardless of queue count 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: Wed, 21 Mar 2018 12:55:29 -0000 On Wed, Mar 21, 2018 at 01:47:51PM +0100, Nelio Laranjeiro wrote: > From: Dahir Osman > > In some environments it is desirable to have the NIC perform RSS > normally on the packet regardless of the number of queues configured. > The RSS hash result that is stored in the mbuf can then be used by > the application to make decisions about how to distribute workloads > to threads, secondary processes, or even virtual machines if the > application is a virtual switch. This change to the mlx5 driver > aligns with how other drivers in the Intel family work. > > Signed-off-by: Allain Legacy > Signed-off-by: Nelio Laranjeiro > --- > drivers/net/mlx5/mlx5_flow.c | 2 +- > drivers/net/mlx5/mlx5_rss.c | 10 ++++++++++ > drivers/net/mlx5/mlx5_rxq.c | 3 ++- > 3 files changed, 13 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c > index 3eecdc604..49600e174 100644 > --- a/drivers/net/mlx5/mlx5_flow.c > +++ b/drivers/net/mlx5/mlx5_flow.c > @@ -909,7 +909,7 @@ mlx5_flow_convert_finalise(struct mlx5_flow_parse *parser) > unsigned int i; > > /* Remove any other flow not matching the pattern. */ > - if (parser->queues_n == 1) { > + if (parser->queues_n == 1 && !parser->rss_conf.rss_hf) { > for (i = 0; i != hash_rxq_init_n; ++i) { > if (i == HASH_RXQ_ETH) > continue; > diff --git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c > index 5ac650163..c490854e1 100644 > --- a/drivers/net/mlx5/mlx5_rss.c > +++ b/drivers/net/mlx5/mlx5_rss.c > @@ -42,6 +42,8 @@ mlx5_rss_hash_update(struct rte_eth_dev *dev, > struct rte_eth_rss_conf *rss_conf) > { > struct priv *priv = dev->data->dev_private; > + unsigned int i; > + unsigned int idx; > > if (rss_conf->rss_hf & MLX5_RSS_HF_MASK) { > rte_errno = EINVAL; > @@ -59,6 +61,14 @@ mlx5_rss_hash_update(struct rte_eth_dev *dev, > priv->rss_conf.rss_key_len = rss_conf->rss_key_len; > } > priv->rss_conf.rss_hf = rss_conf->rss_hf; > + /* Enable the RSS hash in all Rx queues. */ > + for (i = 0, idx = 0; idx != priv->rxqs_n; ++i) { > + if (!(*priv->rxqs)[i]) > + continue; > + (*priv->rxqs)[i]->rss_hash = !!rss_conf->rss_hf && > + !!(dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS); > + ++idx; > + } > return 0; > } > > diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c > index 56b2d19f2..1b4570586 100644 > --- a/drivers/net/mlx5/mlx5_rxq.c > +++ b/drivers/net/mlx5/mlx5_rxq.c > @@ -1070,7 +1070,8 @@ mlx5_rxq_new(struct rte_eth_dev *dev, uint16_t idx, uint16_t desc, > tmpl->rxq.crc_present ? "disabled" : "enabled", > tmpl->rxq.crc_present << 2); > /* Save port ID. */ > - tmpl->rxq.rss_hash = priv->rxqs_n > 1; > + tmpl->rxq.rss_hash = !!priv->rss_conf.rss_hf && > + (!!(dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS)); > tmpl->rxq.port_id = dev->data->port_id; > tmpl->priv = priv; > tmpl->rxq.mp = mp; > -- > 2.11.0 I forgot to say that this patch applies on top of [1] and [2]. Regards, [1] https://dpdk.org/browse/next/dpdk-next-net-mlx [2] https://dpdk.org/dev/patchwork/patch/36066/ -- Nélio Laranjeiro 6WIND