DPDK patches and discussions
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: dev@dpdk.org
Cc: dsosnowski@nvidia.com, mkashani@nvidia.com, rasland@nvidia.com,
	orika@nvidia.com, Kevin Traynor <ktraynor@redhat.com>,
	stable@dpdk.org
Subject: [PATCH] net/mlx5: fix flow null ops seg fault
Date: Fri, 14 Feb 2025 10:05:45 +0000	[thread overview]
Message-ID: <20250214100545.413991-1-ktraynor@redhat.com> (raw)

flow null driver ops may get selected and try to call .list_create
causing a seg fault.

Full details and back traces in bugzilla.

Add a null ops implementation for .list_create.

Bugzilla ID: 1661
Fixes: e38776c36c8a ("net/mlx5: introduce HWS for non-template flow API")
Cc: stable@dpdk.org

Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
---
 drivers/net/mlx5/mlx5_flow.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index a2ee237841..3fbe89a9d4 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -4032,4 +4032,18 @@ mlx5_flow_validate_item_nsh(struct rte_eth_dev *dev,
 }
 
+static uintptr_t
+flow_null_list_create(struct rte_eth_dev *dev __rte_unused,
+		      enum mlx5_flow_type type __rte_unused,
+		      const struct rte_flow_attr *attr __rte_unused,
+		      const struct rte_flow_item items[] __rte_unused,
+		      const struct rte_flow_action actions[] __rte_unused,
+		      bool external __rte_unused,
+		      struct rte_flow_error *error)
+{
+	rte_flow_error_set(error, ENOTSUP,
+			   RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, NULL);
+	return 0;
+}
+
 static int
 flow_null_validate(struct rte_eth_dev *dev __rte_unused,
@@ -4151,4 +4165,5 @@ flow_null_counter_query(struct rte_eth_dev *dev,
 /* Void driver to protect from null pointer reference. */
 const struct mlx5_flow_driver_ops mlx5_flow_null_drv_ops = {
+	.list_create = flow_null_list_create,
 	.validate = flow_null_validate,
 	.prepare = flow_null_prepare,
-- 
2.48.1


             reply	other threads:[~2025-02-14 10:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-14 10:05 Kevin Traynor [this message]
2025-02-18 11:04 ` Dariusz Sosnowski

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=20250214100545.413991-1-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=dev@dpdk.org \
    --cc=dsosnowski@nvidia.com \
    --cc=mkashani@nvidia.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=stable@dpdk.org \
    /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).