DPDK patches and discussions
 help / color / mirror / Atom feed
From: Michal Krawczyk <mk@semihalf.com>
To: ferruh.yigit@intel.com
Cc: shaibran@amazon.com, upstream@semihalf.com, mw@semihalf.com,
	dev@dpdk.org, Michal Krawczyk <mk@semihalf.com>,
	Dawid Gorecki <dgr@semihalf.com>,
	Amit Bernstein <amitbern@amazon.com>
Subject: [PATCH 3/4] net/ena: add an option to disable LLQ
Date: Tue,  7 Jun 2022 18:43:40 +0200	[thread overview]
Message-ID: <20220607164341.19088-4-mk@semihalf.com> (raw)
In-Reply-To: <20220607164341.19088-1-mk@semihalf.com>

The PMD attempts to enable the LLQ (Low Latency Queue) whenever it's
possible. The LLQ requires the user to enable the Write Combining for
the supported igb_uio/vfio-pci modules.

The vfio-pci module officially doesn't support the WC. Moreover, in some
Linux distributions, it can be built into the kernel, so any
modifications to the vfio-pci module require a full rebuild of the
kernel. This can make the configuration process much harder and for some
users, that are not interested in the great network performance for
their setups, it may be redundant. These users requested to be able to
turn off LLQ to avoid the hassle of such a setup.

It's generally not recommended to disable the LLQ, as it won't result in
the performance improvement and on the 6th generation AWS instances the
lack of LLQ can have a huge negative impact on hardware performance.

The device argument which controls the LLQ is called 'enable_llq` and by
default, it's set to 1 (which means that the LLQ is enabled). Setting
it to 0 disables the LLQ.

This commit also adds the explicit initialization of the devarg for the
'use_large_llq_hdr'. The PMD_REGISTER_PARAM_STRING() call for the ENA
was updated with all the available devargs (including
ENA_DEVARG_MISS_TXC_TO, which wasn't added previously).

Signed-off-by: Michal Krawczyk <mk@semihalf.com>
Reviewed-by: Dawid Gorecki <dgr@semihalf.com>
Reviewed-by: Shai Brandes <shaibran@amazon.com>
Reviewed-by: Amit Bernstein <amitbern@amazon.com>
---
 doc/guides/nics/ena.rst                |  9 ++++++++
 doc/guides/rel_notes/release_22_07.rst |  2 ++
 drivers/net/ena/ena_ethdev.c           | 29 +++++++++++++++++++++++++-
 drivers/net/ena/ena_ethdev.h           |  1 +
 4 files changed, 40 insertions(+), 1 deletion(-)

diff --git a/doc/guides/nics/ena.rst b/doc/guides/nics/ena.rst
index 3d780acac9..df5343e4ae 100644
--- a/doc/guides/nics/ena.rst
+++ b/doc/guides/nics/ena.rst
@@ -96,6 +96,15 @@ Configuration information
      timer service. Setting this parameter to 0 disables this feature. Maximum
      allowed value is 60 seconds.
 
+   * **enable_llq** (default 1)
+
+     Determines whenever the driver should use the LLQ (if it's available) or
+     not.
+
+     **NOTE: On the 6th generation AWS instances disabling LLQ may lead to a
+     huge performance degradation. In general disabling LLQ is highly not
+     recommended!**
+
 **ENA Configuration Parameters**
 
    * **Number of Queues**
diff --git a/doc/guides/rel_notes/release_22_07.rst b/doc/guides/rel_notes/release_22_07.rst
index 73f566e5fc..45d0012f2d 100644
--- a/doc/guides/rel_notes/release_22_07.rst
+++ b/doc/guides/rel_notes/release_22_07.rst
@@ -93,6 +93,8 @@ New Features
   The new driver version (v2.7.0) includes:
 
   * Added fast mbuf free feature support.
+  * Added ``enable_llq`` device argument for controlling the PMD LLQ
+    (Low Latency Queue) mode.
 
 * **Updated Intel iavf driver.**
 
diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index efd6dea4c2..d748b33e51 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -72,6 +72,12 @@ struct ena_stats {
  * considered as a missing.
  */
 #define ENA_DEVARG_MISS_TXC_TO "miss_txc_to"
+/*
+ * Controls whether LLQ should be used (if available). Enabled by default.
+ * NOTE: It's highly not recommended to disable the LLQ, as it may lead to a
+ * huge performance degradation on 6th generation AWS instances.
+ */
+#define ENA_DEVARG_ENABLE_LLQ "enable_llq"
 
 /*
  * Each rte_memzone should have unique name.
@@ -1932,6 +1938,14 @@ ena_set_queues_placement_policy(struct ena_adapter *adapter,
 	int rc;
 	u32 llq_feature_mask;
 
+	if (!adapter->enable_llq) {
+		PMD_DRV_LOG(WARNING,
+			"NOTE: LLQ has been disabled as per user's request. "
+			"This may lead to a huge performance degradation!\n");
+		ena_dev->tx_mem_queue_type = ENA_ADMIN_PLACEMENT_POLICY_HOST;
+		return 0;
+	}
+
 	llq_feature_mask = 1 << ENA_ADMIN_LLQ;
 	if (!(ena_dev->supported_features & llq_feature_mask)) {
 		PMD_DRV_LOG(INFO,
@@ -2127,7 +2141,10 @@ static int eth_ena_dev_init(struct rte_eth_dev *eth_dev)
 	snprintf(adapter->name, ENA_NAME_MAX_LEN, "ena_%d",
 		 adapter->id_number);
 
+	/* Assign default devargs values */
 	adapter->missing_tx_completion_to = ENA_TX_TIMEOUT;
+	adapter->enable_llq = true;
+	adapter->use_large_llq_hdr = false;
 
 	rc = ena_parse_devargs(adapter, pci_dev->device.devargs);
 	if (rc != 0) {
@@ -3478,6 +3495,8 @@ static int ena_process_bool_devarg(const char *key,
 	/* Now, assign it to the proper adapter field. */
 	if (strcmp(key, ENA_DEVARG_LARGE_LLQ_HDR) == 0)
 		adapter->use_large_llq_hdr = bool_value;
+	else if (strcmp(key, ENA_DEVARG_ENABLE_LLQ) == 0)
+		adapter->enable_llq = bool_value;
 
 	return 0;
 }
@@ -3488,6 +3507,7 @@ static int ena_parse_devargs(struct ena_adapter *adapter,
 	static const char * const allowed_args[] = {
 		ENA_DEVARG_LARGE_LLQ_HDR,
 		ENA_DEVARG_MISS_TXC_TO,
+		ENA_DEVARG_ENABLE_LLQ,
 		NULL,
 	};
 	struct rte_kvargs *kvlist;
@@ -3509,6 +3529,10 @@ static int ena_parse_devargs(struct ena_adapter *adapter,
 		goto exit;
 	rc = rte_kvargs_process(kvlist, ENA_DEVARG_MISS_TXC_TO,
 		ena_process_uint_devarg, adapter);
+	if (rc != 0)
+		goto exit;
+	rc = rte_kvargs_process(kvlist, ENA_DEVARG_ENABLE_LLQ,
+		ena_process_bool_devarg, adapter);
 
 exit:
 	rte_kvargs_free(kvlist);
@@ -3727,7 +3751,10 @@ static struct rte_pci_driver rte_ena_pmd = {
 RTE_PMD_REGISTER_PCI(net_ena, rte_ena_pmd);
 RTE_PMD_REGISTER_PCI_TABLE(net_ena, pci_id_ena_map);
 RTE_PMD_REGISTER_KMOD_DEP(net_ena, "* igb_uio | uio_pci_generic | vfio-pci");
-RTE_PMD_REGISTER_PARAM_STRING(net_ena, ENA_DEVARG_LARGE_LLQ_HDR "=<0|1>");
+RTE_PMD_REGISTER_PARAM_STRING(net_ena,
+	ENA_DEVARG_LARGE_LLQ_HDR "=<0|1> "
+	ENA_DEVARG_ENABLE_LLQ "=<0|1> "
+	ENA_DEVARG_MISS_TXC_TO "=<uint>");
 RTE_LOG_REGISTER_SUFFIX(ena_logtype_init, init, NOTICE);
 RTE_LOG_REGISTER_SUFFIX(ena_logtype_driver, driver, NOTICE);
 #ifdef RTE_ETHDEV_DEBUG_RX
diff --git a/drivers/net/ena/ena_ethdev.h b/drivers/net/ena/ena_ethdev.h
index c0094b03ee..0db0918b43 100644
--- a/drivers/net/ena/ena_ethdev.h
+++ b/drivers/net/ena/ena_ethdev.h
@@ -303,6 +303,7 @@ struct ena_adapter {
 
 	bool trigger_reset;
 
+	bool enable_llq;
 	bool use_large_llq_hdr;
 
 	uint32_t last_tx_comp_qid;
-- 
2.25.1


  parent reply	other threads:[~2022-06-07 16:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-07 16:43 [PATCH 0/4] net/ena: v2.7.0 driver release Michal Krawczyk
2022-06-07 16:43 ` [PATCH 1/4] net/ena: add fast mbuf free support Michal Krawczyk
2022-06-07 16:43 ` [PATCH 2/4] net/ena: skip MTU verification Michal Krawczyk
2022-06-07 16:43 ` Michal Krawczyk [this message]
2022-06-07 16:43 ` [PATCH 4/4] net/ena: update version to 2.7.0 Michal Krawczyk
2022-06-07 19:02 ` [PATCH 0/4] net/ena: v2.7.0 driver release Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220607164341.19088-4-mk@semihalf.com \
    --to=mk@semihalf.com \
    --cc=amitbern@amazon.com \
    --cc=dev@dpdk.org \
    --cc=dgr@semihalf.com \
    --cc=ferruh.yigit@intel.com \
    --cc=mw@semihalf.com \
    --cc=shaibran@amazon.com \
    --cc=upstream@semihalf.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).