From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro Subject: Re: [PATCH v2 13/15] net/mlx5: setup RSS flow regardless of queue count Date: Wed, 11 Apr 2018 14:37:21 +0200 Message-ID: <20180411123721.dylf3ilszlg64sdc@laranjeiro-vm.dev.6wind.com> References: <20180410133415.189905-1-xuemingl@mellanox.com> <20180410133415.189905-14-xuemingl@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Cc: Shahaf Shuler , dev@dpdk.org To: Xueming Li Return-path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id 0E31112001 for ; Wed, 11 Apr 2018 14:37:02 +0200 (CEST) Received: by mail-wm0-f67.google.com with SMTP id x4so3475222wmh.5 for ; Wed, 11 Apr 2018 05:37:02 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20180410133415.189905-14-xuemingl@mellanox.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Apr 10, 2018 at 09:34:13PM +0800, Xueming Li wrote: > 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. > > Signed-off-by: Xueming Li > --- > drivers/net/mlx5/mlx5_flow.c | 71 +++++++++++++++++++------------------------- > 1 file changed, 30 insertions(+), 41 deletions(-) > > diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c > index 5784f2ee0..9efe00086 100644 > --- a/drivers/net/mlx5/mlx5_flow.c > +++ b/drivers/net/mlx5/mlx5_flow.c > @@ -1252,48 +1252,37 @@ mlx5_flow_convert_rss(struct rte_eth_dev *dev, struct mlx5_flow_parse *parser) > parser->queue[i].ibv_attr = NULL; > } > } > - if (parser->rss_conf.types) { > - /* Remove impossible flow according to the RSS configuration. */ > - for (i = hmin; i != (hmax + 1); ++i) { > - if (!parser->queue[i].ibv_attr) > - continue; > - if (parser->rss_conf.types & > - hash_rxq_init[i].dpdk_rss_hf) { > - parser->queue[i].hash_fields = > - hash_rxq_init[i].hash_fields; > - found = 1; > - continue; > - } > - /* L4 flow could be used for L3 RSS. */ > - if (i == parser->layer && i < ip && > - (hash_rxq_init[ip].dpdk_rss_hf & > - parser->rss_conf.types)) { > - parser->queue[i].hash_fields = > - hash_rxq_init[ip].hash_fields; > - found = 1; > - continue; > - } > - /* L3 flow and L4 hash: non-rss L3 flow. */ > - if (i == parser->layer && i == ip && found) > - /* IP pattern and L4 HF. */ > - continue; > - rte_free(parser->queue[i].ibv_attr); > - parser->queue[i].ibv_attr = NULL; > + /* Remove impossible flow according to the RSS configuration. */ > + for (i = hmin; i != (hmax + 1); ++i) { > + if (!parser->queue[i].ibv_attr) > + continue; > + if (parser->rss_conf.types & > + hash_rxq_init[i].dpdk_rss_hf) { > + parser->queue[i].hash_fields = > + hash_rxq_init[i].hash_fields; > + found = 1; > + continue; > } > - if (!found) > - DRV_LOG(WARNING, > - "port %u rss hash function doesn't match " > - "pattern", dev->data->port_id); > - } else { > - /* Remove any other flow. */ > - for (i = hmin; i != (hmax + 1); ++i) { > - if (i == parser->layer || !parser->queue[i].ibv_attr) > - continue; > - rte_free(parser->queue[i].ibv_attr); > - parser->queue[i].ibv_attr = NULL; > + /* L4 flow could be used for L3 RSS. */ > + if (i == parser->layer && i < ip && > + (hash_rxq_init[ip].dpdk_rss_hf & > + parser->rss_conf.types)) { > + parser->queue[i].hash_fields = > + hash_rxq_init[ip].hash_fields; > + found = 1; > + continue; > } > - parser->rss_conf.queue_num = 1; > + /* L3 flow and L4 hash: non-rss L3 flow. */ > + if (i == parser->layer && i == ip && found) > + /* IP pattern and L4 HF. */ > + continue; > + rte_free(parser->queue[i].ibv_attr); > + parser->queue[i].ibv_attr = NULL; > } > + if (!found) > + DRV_LOG(WARNING, > + "port %u rss hash function doesn't match " > + "pattern", dev->data->port_id); > return 0; > } > > @@ -2326,8 +2315,8 @@ mlx5_flow_dump(struct rte_eth_dev *dev __rte_unused, > (void *)flow->frxq[i].hrxq->ind_table, > flow->frxq[i].hash_fields | > (flow->tunnel && > - flow->rss_conf.rss_level ? (uint32_t)IBV_RX_HASH_INNER : 0), > - flow->queues_n, > + flow->rss_conf.level ? (uint32_t)IBV_RX_HASH_INNER : 0), > + flow->rss_conf.queue_num, > flow->frxq[i].ibv_attr->num_of_specs, > flow->frxq[i].ibv_attr->size, > flow->frxq[i].ibv_attr->priority, > -- > 2.13.3 Seems, this code should make part of "[PATCH v2 07/15] net/mlx5: support tunnel RSS level", as it re-works the code added there, in addition this feature is already present in tree for non tunnel packets. Any reason why it is not merged in the previous commit? Thanks, -- Nélio Laranjeiro 6WIND