From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by dpdk.org (Postfix) with ESMTP id C27F823C for ; Mon, 30 Apr 2018 09:06:59 +0200 (CEST) Received: by mail-wr0-f193.google.com with SMTP id v15-v6so7002307wrm.10 for ; Mon, 30 Apr 2018 00:06:59 -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=t3F+LMA/rMFdKwzJCFGeNq42F1mdFBZM8qq2X7Il4Gg=; b=azUaqVoa3IiSL13cpomxvn6GHaxWHaHC03Dp1wwQahuMk8/fTnyap/sZ5U3QYi6LRn WnkyIGSBapZENr7S2qz6xkWzUjhyly3GqxEM9HxwiALp26DdDlm/KEQsc3OERqk9IE5Z ATB/Mm+dpNFMIG/iBhPdZVNp1KA7hhNq4vaXGtQSZxRvnS5i/OYc250vQu5NBQx7+x3K qPOLvgNpxeiOW/VyHqwjt9ZqgDckR8rWQ2th1PdaTEpZpZS9//j/uL9ca5wid7XwUYBH N9tcmj5dtTCRMUbur3kcSbZk7uoJN5O5Ov+8KbQPvNCvw446X8SddMnexVZC5m38eRDm 78cg== 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=t3F+LMA/rMFdKwzJCFGeNq42F1mdFBZM8qq2X7Il4Gg=; b=L9Drxb3TZTJN6AmzimGwCXLYSbA2XnzLc5T+nIpGlp86iPASD4nQuHurZh/G6IMwVN OercndKZENm05Tf/VqbuRRhH/nyYy+yUPFxmI9uSWgjzCqGy7DW/GIOQ5TmEsUAhpBJt xlxcusWa5aH1KGHqW0ZFrluCMK6N8rtJwvP8LkLnfYYCKENYUF5ql28W+r9nq3+55j4n ByTZ5pX/a5aopa5X3nak5+8rCR3wIgmun8tvotvBeuifc1gsNr65jj0JLV1JlQJy2sI1 XBUPug6Lp0LLA4BgvGC08r/oi+ziluhFa4PMWw9MNZgynmU+dHysgHu1MJMz5FIVTK1b wFeg== X-Gm-Message-State: ALQs6tCKF9VVBTK4ELNPUrTwJAOMm357rGoePE1RS9Rsw62b1aN8+6ol Y7Qg494Td6g/6D7ByjS/xXubOgGvYQ== X-Google-Smtp-Source: AB8JxZr6x8SnZF/TQb2d2YO0PWk1rOKKNsPR86y00QNkD8appAqN0kUbQQV9XSKor8AEFwLoAOdiKQ== X-Received: by 2002:adf:9bcd:: with SMTP id e13-v6mr8637130wrc.240.1525072019510; Mon, 30 Apr 2018 00:06:59 -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 c18sm7258955wmd.13.2018.04.30.00.06.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Apr 2018 00:06:58 -0700 (PDT) Date: Mon, 30 Apr 2018 09:07:59 +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: <20180430070759.w5lnkunmcpvaluau@laranjeiro-vm.dev.6wind.com> References: <20180429180308.85361-1-shahafs@mellanox.com> <20180429180308.85361-2-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: <20180429180308.85361-2-shahafs@mellanox.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH 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: Mon, 30 Apr 2018 07:06:59 -0000 On Sun, Apr 29, 2018 at 09:03:08PM +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 > --- > drivers/net/mlx5/mlx5_ethdev.c | 51 ++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 51 insertions(+) > > diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c > index 588d4ba627..78354922b0 100644 > --- a/drivers/net/mlx5/mlx5_ethdev.c > +++ b/drivers/net/mlx5/mlx5_ethdev.c > @@ -417,6 +417,56 @@ 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; > + > + if (priv->link_speed_capa & ETH_LINK_SPEED_100G) { > + if (dev->data->nb_rx_queues <= 2 && > + dev->data->nb_tx_queues <= 2) { > + /* Minimum CPU utilization. */ > + info->default_rxportconf.ring_size = 256; > + info->default_txportconf.ring_size = 256; > + /* Don't care as queue num is set. */ > + info->default_rxportconf.nb_queues = 0; > + info->default_txportconf.nb_queues = 0; > + } else { > + /* Max Throughput. */ > + info->default_rxportconf.ring_size = 2048; > + info->default_txportconf.ring_size = 2048; > + info->default_rxportconf.nb_queues = 16; > + info->default_txportconf.nb_queues = 16; > + } > + } else { > + if (dev->data->nb_rx_queues <= 2 && > + dev->data->nb_tx_queues <= 2) { > + /* Minimum CPU utilization. */ > + info->default_rxportconf.ring_size = 256; > + info->default_txportconf.ring_size = 256; > + /* Don't care as queue num is set. */ > + info->default_rxportconf.nb_queues = 0; > + info->default_txportconf.nb_queues = 0; > + } else { > + /* Max Throughput. */ > + info->default_rxportconf.ring_size = 4096; > + info->default_txportconf.ring_size = 4096; > + info->default_rxportconf.nb_queues = 8; > + info->default_txportconf.nb_queues = 8; > + } > + } > + info->default_rxportconf.burst_size = 64; > + info->default_txportconf.burst_size = 64; This can be fully re-written to simplify and ease the maintenance, default values i.e. "Minimum CPU utilization" are duplicated, this can be used as default values and just tweak in case the amount of queues are different from 2 according to the link speed. > +} > + > +/** > * DPDK callback to get information about the device. > * > * @param dev > @@ -458,6 +508,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