From mboxrd@z Thu Jan 1 00:00:00 1970 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) 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=V4s5nf+ukZeZO5OapAuaj6jvyOq7BzNe4XEespYNGas=; b=QSWW9pWJo3o7Ltdi28zFZt4/sUYkoFW9wl7rraoJmujYENp5e7fyx03COoDF4czADs DSRt5y6mIbZTXNPogXWJsWB73+FFwY+Hn0LM6Bru3fk4lvMINsEOFwSDZ9Lc341M2VIe nB87+fA2hW4y/1XAG0MjXFVPlpA1nJ+KWJnOlbb6m65GSimeBGHhRxXSfVkLkvneUlJp 5WqnuKR7sdnwY/6AcKJR4fNLsLmj1PV+J6BkC/AYjNfUnTjuLqh+V0JmvDILOi2WmplG WLUMSDkbGvn7tA0nODdaikj347xeS6HHZG6diKnbSIbVu3r84xfNiMNtsDuXyXaHxg73 QNXw== 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=V4s5nf+ukZeZO5OapAuaj6jvyOq7BzNe4XEespYNGas=; b=IOQnDjP22sSR77BbZ/W18iPp0z5bPT/UVBEyqozZuLrW2hKkMwo3yFiGYoaZhfqKzR 3TzdAxxi7GujLHqpZUSrgdy5g8cQ/9aKoGrJ3PV1NyoTzLLMwceAzEy2QN+kgqs9u6kV bXEOi54njdhxR0SykB4EmDco1cFqIBsfJrS1WLTEf5O5SCpoEx5+ms1w2o59uXn4ns+r tpk0MBP3g7JzEuatLg1d/C6E5B1/w1qhqFT6UEm0D+eA6lM45+TahMtAoe1ykAi5a/KX j6xqenaDBwe5TtSwyra1cz0Ma866hIOiEFlGuF+q7OD+INguuOM7hJuo9JjMpx0dlw9d c0rQ== X-Gm-Message-State: ALQs6tCn+ATw1twVxNh0QMkhJSYzxHflQbOi37ZDErbmGgC6ntr9TsXP cvZkDrcsYo6ff0lAq8Hpf+Zu X-Google-Smtp-Source: AIpwx4/YIOzMGRCxhG7MjgC73+sP/kq3I/YDGWh7HZzHiPE8grl4Z261nkzavvuXuYsoSpWc1q71Bw== X-Received: by 10.28.107.5 with SMTP id g5mr2705684wmc.133.1523450221759; Wed, 11 Apr 2018 05:37:01 -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 l34sm1143958wre.14.2018.04.11.05.37.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Apr 2018 05:37:01 -0700 (PDT) Date: Wed, 11 Apr 2018 14:37:21 +0200 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: Xueming Li Cc: Shahaf Shuler , dev@dpdk.org 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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180410133415.189905-14-xuemingl@mellanox.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH v2 13/15] net/mlx5: setup RSS flow 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, 11 Apr 2018 12:37:02 -0000 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