DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dariusz Sosnowski <dsosnowski@nvidia.com>
To: Matan Azrad <matan@nvidia.com>,
	Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Cc: <dev@dpdk.org>
Subject: [PATCH v3 2/3] net/mlx5: document E-Switch limitations with HWS in mlx5 PMD
Date: Mon, 14 Nov 2022 18:19:55 +0000	[thread overview]
Message-ID: <20221114181956.1052159-3-dsosnowski@nvidia.com> (raw)
In-Reply-To: <20221114181956.1052159-1-dsosnowski@nvidia.com>

This patch adds the following limitations to the mlx5 PMD guide:

- With HW Steering and E-Switch enabled, transfer proxy port must
  be started before any port representor.
- With HW Steering and E-Switch enabled, all representors
  must be stopped before transfer proxy port is stopped.

Documentation of mlx5 PMD's implementations of
rte_eth_dev_start() and rte_eth_dev_stop() is updated accordingly:

- rte_eth_dev_start() returns (-EAGAIN) when transfer proxy port
  cannot be started.
- rte_eth_dev_stop() returns (-EBUSY) when port representor
  cannot be stopped.

Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
---
 doc/guides/nics/mlx5.rst        | 13 +++++++++++++
 drivers/net/mlx5/mlx5_trigger.c | 11 +++++++++++
 2 files changed, 24 insertions(+)

diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst
index 4f0db21dde..1df6ca9711 100644
--- a/doc/guides/nics/mlx5.rst
+++ b/doc/guides/nics/mlx5.rst
@@ -161,6 +161,19 @@ Limitations
   - NIC ConnectX-5 and before are not supported.
   - Partial match with item template is not supported.
   - IPv6 5-tuple matching is not supported.
+  - With E-Switch enabled, ports which share the E-Switch domain
+    should be started and stopped in a specific order:
+
+    - When starting ports, the transfer proxy port should be started first
+      and port representors should follow.
+    - When stopping ports, all of the port representors
+      should be stopped before stopping the transfer proxy port.
+
+    If ports are started/stopped in an incorrect order,
+    ``rte_eth_dev_start()``/``rte_eth_dev_stop()`` will return an appropriate error code:
+
+    - ``-EAGAIN`` for ``rte_eth_dev_start()``.
+    - ``-EBUSY`` for ``rte_eth_dev_stop()``.
 
 - When using Verbs flow engine (``dv_flow_en`` = 0), flow pattern without any
   specific VLAN will match for VLAN packets as well:
diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index fe6359908a..f54443ed1a 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -1138,6 +1138,10 @@ mlx5_hw_representor_port_allowed_start(struct rte_eth_dev *dev)
  *
  * @return
  *   0 on success, a negative errno value otherwise and rte_errno is set.
+ *   The following error values are defined:
+ *
+ *   - -EAGAIN: If port representor cannot be started,
+ *     because transfer proxy port is not started.
  */
 int
 mlx5_dev_start(struct rte_eth_dev *dev)
@@ -1394,6 +1398,13 @@ mlx5_hw_proxy_port_allowed_stop(struct rte_eth_dev *dev)
  *
  * @param dev
  *   Pointer to Ethernet device structure.
+ *
+ * @return
+ *   0 on success, a negative errno value otherwise and rte_errno is set.
+ *   The following error values are defined:
+ *
+ *   - -EBUSY: If transfer proxy port cannot be stopped,
+ *     because other port representors are still running.
  */
 int
 mlx5_dev_stop(struct rte_eth_dev *dev)
-- 
2.25.1


  parent reply	other threads:[~2022-11-14 18:21 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-09 16:31 [PATCH 0/3] ethdev: document special cases of port start and stop Dariusz Sosnowski
2022-11-09 16:31 ` [PATCH 1/3] net/mlx5: fix log level on failed transfer proxy stop Dariusz Sosnowski
2022-11-09 16:31 ` [PATCH 2/3] doc: document E-Switch limitations with HWS in mlx5 PMD Dariusz Sosnowski
2022-11-09 16:31 ` [PATCH 3/3] ethdev: document special cases of port start and stop Dariusz Sosnowski
2022-11-09 19:06 ` [PATCH v2 0/3] " Dariusz Sosnowski
2022-11-09 19:06   ` [PATCH v2 1/3] net/mlx5: fix log level on failed transfer proxy stop Dariusz Sosnowski
2022-11-14 13:17     ` Slava Ovsiienko
2022-11-09 19:06   ` [PATCH v2 2/3] doc: document E-Switch limitations with HWS in mlx5 PMD Dariusz Sosnowski
2022-11-14 13:18     ` Slava Ovsiienko
2022-11-09 19:06   ` [PATCH v2 3/3] ethdev: document special cases of port start and stop Dariusz Sosnowski
2022-11-14 14:07     ` Ferruh Yigit
2022-11-14 16:12       ` Dariusz Sosnowski
2022-11-14 17:10         ` Ferruh Yigit
2022-11-14 18:22           ` Dariusz Sosnowski
2022-11-14 18:19   ` [PATCH v3 0/3] " Dariusz Sosnowski
2022-11-14 18:19     ` [PATCH v3 1/3] net/mlx5: fix log level on failed transfer proxy stop Dariusz Sosnowski
2022-11-14 18:19     ` Dariusz Sosnowski [this message]
2022-11-15  8:49       ` [PATCH v3 2/3] net/mlx5: document E-Switch limitations with HWS in mlx5 PMD Slava Ovsiienko
2022-11-14 18:19     ` [PATCH v3 3/3] ethdev: document special cases of port start and stop Dariusz Sosnowski
2022-11-14 18:32       ` Ferruh Yigit
2022-11-21 22:53     ` [PATCH v3 0/3] " Thomas Monjalon

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=20221114181956.1052159-3-dsosnowski@nvidia.com \
    --to=dsosnowski@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=viacheslavo@nvidia.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).