From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <nelio.laranjeiro@6wind.com>
Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46])
 by dpdk.org (Postfix) with ESMTP id 81137AACE
 for <dev@dpdk.org>; Thu, 22 Mar 2018 09:55:33 +0100 (CET)
Received: by mail-wm0-f46.google.com with SMTP id f125so14477393wme.4
 for <dev@dpdk.org>; Thu, 22 Mar 2018 01:55:33 -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=LRUUjCVuQEsx9T618zZQQ4d4BjAJzq9LsfZIFhHRrUA=;
 b=YOm2yW1510D0/7EM4WNDRmGS5YvyBk5Xz4zMxyvXi0+cTtozbM6zf6eciT8m2S29df
 iM+OXVzTEWxTxFkIYDA3NLHjFxZorT863W1s822UAWgcKiX04SJSId6I8RT0orPyhPWv
 MRo6bOUfQL8NheBi2xzcXE2xLUffT9KS68M+d+jsSOa+KD+Afv3pPIAa8cxZDho3oX1D
 fYuPu3svK9HUaEkbpaQ5Yn9e0wgDkKZJiIBJ9RVeICE5LqUBvg7RQBdf/BaSvBpRzCcP
 /FypRpTVw8TrxYuQLMf89SxeKPtunw6mARddAPCfXtvcGQw+LMtT+LzWFftmi01TpznQ
 UrcQ==
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=LRUUjCVuQEsx9T618zZQQ4d4BjAJzq9LsfZIFhHRrUA=;
 b=Lrh91JaacXr6T4wHBymntQszX/D/UHBpeWundqmMAZ+G09qoW/PT52Loiijzs4wPPG
 Ft04qRhoGJC6aZ+X0RWbcnHjxy7E0sz16D4e+/fPVfJe7lY/B8Fws0DkfZGNPd3nx3GA
 iDbXHT/p+8tFwONOHFuMjQMQIj7HSMDTaXA8+9HfKgFsfChvrBPlZPfZoxzK1qgQSbqb
 ni8Mj7a+FVZWCI1OyKR/D8ZRoeF3B5Hwo86Ro/PMgbiGhxKlEEyrPDS6ErFS01bfmy1d
 b/aukG9AFtLWmN0KMsrzNKV9h5Afltqfg3Ogd7jCZDajQ3VLizBRfWvxRNZZxHEUhb0X
 sHZA==
X-Gm-Message-State: AElRT7GUuU3yJCCYFQJKp58S6hFtenZrcLpOchm5lQc2NoYjDOs5Xu1E
 okGl6LXPMz8T6z/1TdylwoZ5
X-Google-Smtp-Source: AG47ELuF2HF8Q4uSTRf7yz/59rPHXvNdncj4VMwNRHbHZg4YUpcUgcXa/PlEd8Pwy7HMgX1xWYRbGQ==
X-Received: by 10.28.172.135 with SMTP id v129mr4534849wme.144.1521708932100; 
 Thu, 22 Mar 2018 01:55:32 -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 104sm5829424wrl.26.2018.03.22.01.55.31
 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
 Thu, 22 Mar 2018 01:55:31 -0700 (PDT)
Date: Thu, 22 Mar 2018 09:54:41 +0100
From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro <nelio.laranjeiro@6wind.com>
To: "Hanoch Haim (hhaim)" <hhaim@cisco.com>
Cc: Yongseok Koh <yskoh@mellanox.com>, "dev@dpdk.org" <dev@dpdk.org>
Message-ID: <20180322085441.a3o2eyvols7jkzxo@laranjeiro-vm.dev.6wind.com>
References: <1b6a9384a5604f15948162766cde90a9@XCH-RTP-017.cisco.com>
 <20180321214749.GA53128@yongseok-MBP.local>
 <f89092e04c594feea76ed66b21c426c1@XCH-RTP-017.cisco.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <f89092e04c594feea76ed66b21c426c1@XCH-RTP-017.cisco.com>
User-Agent: NeoMutt/20170113 (1.7.2)
Subject: Re: [dpdk-dev] mlx5 reta size is dynamic
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Thu, 22 Mar 2018 08:55:33 -0000

On Thu, Mar 22, 2018 at 06:52:53AM +0000, Hanoch Haim (hhaim) wrote:
> Hi Yongseok, 
> 
> 
> RSS has a DPDK API,application can ask for the reta table size and
> configure it. In your case you are assuming specific use case and
> change the size dynamically which solve 90% of the use-cases but break
> the 10% use-case. 
> Instead, you could provide the application a consistent API and with
> that 100% of the applications can work with no issue. This is what
> happen with Intel (ixgbe/i40e)
> Another minor issue the rss_key_size return as zero but internally it
> is 40 bytes

Hi Hanoch,

Legacy DPDK API has always considered there is only a single indirection
table aka. RETA whereas this is not true [1][2] on this device.

On MLX5 there is an indirection table per Hash Rx queue according to the
list of queues making part of it.
The Hash Rx queue is configured to make the hash with configured
information:
 - Algorithm,
 - key
 - hash field (Verbs hash field)
 - Indirection table
An Hash Rx queue cannot handle multiple RSS configuration, we have an
Hash Rx queue per protocol and thus a full configuration per protocol.

In such situation, changing the RETA means stopping the traffic,
destroying every single flow, hash Rx queue, indirection table to remake
everything with the new configuration.
Until then, we always recommended to any application to restart the port
on this device after a RETA update to apply this new configuration.

Since the flow API is the new way to configure flows, application should
move to this new one instead of using old API for such behavior.
We should also remove such devop from the PMD to avoid any confusion.

Regards,

> Thanks,
> Hanoh
> 
> -----Original Message-----
> From: Yongseok Koh [mailto:yskoh@mellanox.com] 
> Sent: Wednesday, March 21, 2018 11:48 PM
> To: Hanoch Haim (hhaim)
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] mlx5 reta size is dynamic
> 
> On Wed, Mar 21, 2018 at 06:56:33PM +0000, Hanoch Haim (hhaim) wrote:
> > Hi mlx5 driver expert,
> > 
> > DPDK: 17.11
> > Any reason mlx5 driver change the rate table size dynamically based on 
> > the rx- queues# ?
> 
> The device only supports 2^n-sized indirection table. For example, if the number of Rx queues is 6, device can't have 1-1 mapping but the size of ind tbl could be 8, 16, 32 and so on. If we configure it as 8 for example, 2 out of 6 queues will have 1/4 of traffic while the rest 4 queues receives 1/8. We thought it was too much disparity and preferred setting the max size in order to mitigate the imbalance.
> 
> > There is a hidden assumption that the user wants to distribute the 
> > packets evenly which is not always correct.
> 
> But it is mostly correct because RSS is used for uniform distribution. The decision wasn't made based on our speculation but by many request from multiple customers.
> 
> > /* If the requested number of RX queues is not a power of two, use the
> >           * maximum indirection table size for better balancing.
> >           * The result is always rounded to the next power of two. */
> >           reta_idx_n = (1 << log2above((rxqs_n & (rxqs_n - 1)) ?
> >                                            priv->ind_table_max_size :
> >                                            rxqs_n));
> 
> Thanks,
> Yongseok

[1] https://dpdk.org/ml/archives/dev/2015-October/024668.html
[2] https://dpdk.org/ml/archives/dev/2015-October/024669.html

-- 
Nélio Laranjeiro
6WIND