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 B149F2583 for ; Wed, 2 May 2018 08:39:40 +0200 (CEST) Received: by mail-wm0-f67.google.com with SMTP id a8so20778356wmg.5 for ; Tue, 01 May 2018 23:39:40 -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=TvqIkuxN6M/SKWfSppDujGWPUuXyrMGjTLd9BVD92Dk=; b=tb8REWbQrVgfq+iuFmQAkslHSujZNR6LOqmDLNzk2Pj09bQAo9gxh/pXTSz90Zp7vX xla3155D6JK36YqaLzUGyB/94R68BYgI2WLz0kiWm1SkT1qZRapJJ+XHN3ZlEzpl+8Hq Udq1Rn5nru2UOcMKF4kQGnfWzB/xJoIveJUE71Ez5KGEeVzL/5OTtrBGkE4+g059WYUK NClLgncw98fA1PtUYS9GInZwzIutBl1eksEmn/ipuRoCUUG73YAndBsAfZKacNaCrDjQ uDqlI6cRL77+W+6n+a+aB3s+Iakkq9Ulc+srazIO1fMJRKx+ugZCFbUcdzpIZGRUQFat dIaQ== 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=TvqIkuxN6M/SKWfSppDujGWPUuXyrMGjTLd9BVD92Dk=; b=gYkhzGPEoFTdMtpXvd72CFZ8ADbQw1CRK09jpZEV+S82e34cb5FWxLFql8fgcTZvN/ XhaFcz3FKNvfBAaumqCQq7jNGjdxMKXfnZNWb/udTbxYrGIELzrqdyXy0q8fr81fzfDx gFZSaM0xsQBCKV7yFwYUDh1RcDVdYCIJ9a+3G1k2SZMe8JVENWZuQhIO+CNUle/yVgPj T6KiiD/Hnr36iZGHzKYb532VnmuFDwA3C2BQydu4LrDUFPBSrGovcG+Hfo9l8VDoIdMg PkIoJTT7w4P0z7nVQhtb9TsT6xTyGi3fESiizS/y0L+bU2hDkSGtb7+uFN+7BymaVcg+ CnTg== X-Gm-Message-State: ALQs6tCxQO4PZ3CODJAolEBUGWsyEFMM1Qh0GwhiVgGTsSF2uo6NR2my YxFo1+urzZZh8ZMuCIGHVcmu X-Google-Smtp-Source: AB8JxZpUcSuQALytsH+KXyMFCmQZJk5F3uIbVE7y3YhcBXJuB57IXQFdimUClE98aa314ROloBb+Gw== X-Received: by 10.28.217.211 with SMTP id q202mr10960581wmg.84.1525243180398; Tue, 01 May 2018 23:39:40 -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 n4sm21299954wmg.29.2018.05.01.23.39.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 01 May 2018 23:39:39 -0700 (PDT) Date: Wed, 2 May 2018 08:40:44 +0200 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: Shahaf Shuler Cc: adrien.mazarguil@6wind.com, yskoh@mellanox.com, dev@dpdk.org, erezsc@mellanox.com, amira@mellanox.com, olgas@mellanox.com Message-ID: <20180502064044.bbsivjt3yldmyexq@laranjeiro-vm.dev.6wind.com> References: <20180429180308.85361-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 2/2] net/mlx5: add Rx and Tx tuning parameters 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, 02 May 2018 06:39:40 -0000 On Tue, May 01, 2018 at 12:58:49PM +0300, Shahaf Shuler wrote: > A new ethdev API was exposed by > commit 3be82f5cc5e3 ("ethdev: support PMD-tuned Tx/Rx parameters") > > Enabling the PMD to provide default parameters in case no strict request > from application in order to improve the out of the box experience. > > While the current API lacks the means for the PMD to provide the best > possible value, providing the best default the PMD can guess. > The values are based on Mellanox performance report and depends on the > underlying NIC capabilities. > > Cc: erezsc@mellanox.com > Cc: amira@mellanox.com > Cc: olgas@mellanox.com > > Signed-off-by: Shahaf Shuler Acked-by: Nelio Laranjeiro > --- > > On v2: > - refactor the code to ease the maintenance. > > --- > drivers/net/mlx5/mlx5_ethdev.c | 40 ++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 40 insertions(+) > > diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c > index 588d4ba627..3fad199a60 100644 > --- a/drivers/net/mlx5/mlx5_ethdev.c > +++ b/drivers/net/mlx5/mlx5_ethdev.c > @@ -417,6 +417,45 @@ mlx5_dev_configure(struct rte_eth_dev *dev) > } > > /** > + * Sets default tuning parameters. > + * > + * @param dev > + * Pointer to Ethernet device. > + * @param[out] info > + * Info structure output buffer. > + */ > +static void > +mlx5_set_default_params(struct rte_eth_dev *dev, struct rte_eth_dev_info *info) > +{ > + struct priv *priv = dev->data->dev_private; > + > + /* Minimum CPU utilization. */ > + info->default_rxportconf.ring_size = 256; > + info->default_txportconf.ring_size = 256; > + info->default_rxportconf.burst_size = 64; > + info->default_txportconf.burst_size = 64; > + if (priv->link_speed_capa & ETH_LINK_SPEED_100G) { > + info->default_rxportconf.nb_queues = 16; > + info->default_txportconf.nb_queues = 16; > + if (dev->data->nb_rx_queues > 2 || > + dev->data->nb_tx_queues > 2) { > + /* Max Throughput. */ > + info->default_rxportconf.ring_size = 2048; > + info->default_txportconf.ring_size = 2048; > + } > + } else { > + info->default_rxportconf.nb_queues = 8; > + info->default_txportconf.nb_queues = 8; > + if (dev->data->nb_rx_queues > 2 || > + dev->data->nb_tx_queues > 2) { > + /* Max Throughput. */ > + info->default_rxportconf.ring_size = 4096; > + info->default_txportconf.ring_size = 4096; > + } > + } > +} > + > +/** > * DPDK callback to get information about the device. > * > * @param dev > @@ -458,6 +497,7 @@ mlx5_dev_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *info) > info->hash_key_size = rss_hash_default_key_len; > info->speed_capa = priv->link_speed_capa; > info->flow_type_rss_offloads = ~MLX5_RSS_HF_MASK; > + mlx5_set_default_params(dev, info); > } > > /** > -- > 2.12.0 > Thanks, -- Nélio Laranjeiro 6WIND