public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Dariusz Sosnowski <dsosnowski@nvidia.com>
To: Viacheslav Ovsiienko <viacheslavo@nvidia.com>,
	Bing Zhao <bingz@nvidia.com>, Ori Kam <orika@nvidia.com>,
	Suanming Mou <suanmingm@nvidia.com>,
	Matan Azrad <matan@nvidia.com>,
	Gregory Etelson <getelson@nvidia.com>
Cc: <dev@dpdk.org>, <stable@dpdk.org>
Subject: [PATCH] net/mlx5: fix flex item capability check
Date: Mon, 23 Mar 2026 11:20:59 +0100	[thread overview]
Message-ID: <20260323102059.791194-1-dsosnowski@nvidia.com> (raw)

Whenever installed BlueField FW was too old and it did not support
flex parser, mlx5 PMD reported an unrelated error
on flex item creation.
For example it reported that:

    unsupported header length field mode (FIXED)

This was caused by lack of check for flex parser support.

This patch adds missing capability check and
adds proper error reporting.
Limitations of flex item described in PMD docs are also adjusted.

Fixes: 71adf25dbfb3 ("net/mlx5: fix flex item availability")
Cc: getelson@nvidia.com
Cc: stable@dpdk.org

Signed-off-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 doc/guides/nics/mlx5.rst     | 39 +++++++++++++++++++++++++++++++++---
 drivers/net/mlx5/mlx5_flow.c |  6 ++++++
 2 files changed, 42 insertions(+), 3 deletions(-)

diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst
index 9dcc93cc23..64d3c96332 100644
--- a/doc/guides/nics/mlx5.rst
+++ b/doc/guides/nics/mlx5.rst
@@ -3100,15 +3100,48 @@ See :ref:`mlx5_firmware_config` for more details about the flex parser profile.
 Limitations
 ^^^^^^^^^^^
 
+#. Minimum FW version ``XX.31.1002``.
+
 #. Flex item is supported on PF only.
 
 #. The header length mask width can go up to 6 bits.
 
-#. The Firmware supports 8 global sample fields.
+#. Following number of global sample fields is available based on FW version.
    Each flex item allocates non-shared sample fields from that pool.
 
-#. The flex item can have 1 input link - ``eth`` or ``udp``
-   and up to 3 output links - ``ipv4`` or ``ipv6``.
+   +---------------+------------+
+   | Sample fields | FW version |
+   +===============+============+
+   | 3             | XX.31.1002 |
+   +---------------+------------+
+   | 8             | XX.33.1048 |
+   +---------------+------------+
+
+#. The flex item can have 1 input link and up to 3 output links.
+
+#. Following types of input links are supported:
+
+   +------+------------+
+   | Type | FW version |
+   +======+============+
+   | ETH  | XX.31.1002 |
+   +------+------------+
+   | UDP  | XX.31.1002 |
+   +------+------------+
+
+#. Following types of output links are supported:
+
+   +------+------------+
+   | Type | FW version |
+   +======+============+
+   | IPV4 | XX.31.1002 |
+   +------+------------+
+   | IPV6 | XX.31.1002 |
+   +------+------------+
+   | TCP  | XX.36.1010 |
+   +------+------------+
+   | UDP  | XX.36.1010 |
+   +------+------------+
 
 #. In flex item configuration, ``next_header.field_base`` value
    must be byte aligned (multiple of 8).
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 7df64d634d..915ea29a5a 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -11904,6 +11904,12 @@ mlx5_flow_flex_item_create(struct rte_eth_dev *dev,
 				   "flex item available on BlueField ports only");
 		return NULL;
 	}
+	if (!priv->sh->cdev->config.hca_attr.parse_graph_flex_node) {
+		rte_flow_error_set(error, ENOTSUP,
+				   RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL,
+				   "flex item not supported on current FW");
+		return NULL;
+	}
 	if (!fops->item_create) {
 		DRV_LOG(ERR, "port %u %s.", dev->data->port_id, err_msg);
 		rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_ACTION,
-- 
2.47.3


             reply	other threads:[~2026-03-23 10:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-23 10:20 Dariusz Sosnowski [this message]
2026-03-24 13:03 ` [PATCH] net/mlx5: fix flex item capability check Raslan Darawsheh

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=20260323102059.791194-1-dsosnowski@nvidia.com \
    --to=dsosnowski@nvidia.com \
    --cc=bingz@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=getelson@nvidia.com \
    --cc=matan@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=stable@dpdk.org \
    --cc=suanmingm@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