patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Suanming Mou <suanmingm@nvidia.com>
To: Matan Azrad <matan@nvidia.com>,
	Shahaf Shuler <shahafs@nvidia.com>,
	Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Cc: dev@dpdk.org, rasland@nvidia.com, stable@dpdk.org
Subject: [dpdk-stable] [PATCH v5 15/34] net/mlx5: fix redundant Direct Verbs resources allocate
Date: Wed, 28 Oct 2020 16:59:56 +0800	[thread overview]
Message-ID: <1603875616-272798-16-git-send-email-suanmingm@nvidia.com> (raw)
In-Reply-To: <1603875616-272798-1-git-send-email-suanmingm@nvidia.com>

All table, tag, header modify, header reformat are supported only on DV
mode. For the OFED version doesn't support these, create the related
redundant DV resources waste the memory.

Add the code section in the HAVE_IBV_FLOW_DV_SUPPORT macro to avoid the
redundant resources allocation.

Fixes: 2eb4d0107acc ("net/mlx5: refactor PCI probing on Linux")
Cc: stable@dpdk.org
Signed-off-by: Suanming Mou <suanmingm@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/net/mlx5/linux/mlx5_os.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c
index 4db5d33..db32b39 100644
--- a/drivers/net/mlx5/linux/mlx5_os.c
+++ b/drivers/net/mlx5/linux/mlx5_os.c
@@ -225,7 +225,7 @@
 mlx5_alloc_shared_dr(struct mlx5_priv *priv)
 {
 	struct mlx5_dev_ctx_shared *sh = priv->sh;
-	char s[MLX5_HLIST_NAMESIZE];
+	char s[MLX5_HLIST_NAMESIZE] __rte_unused;
 	int err;
 
 	MLX5_ASSERT(sh && sh->refcnt);
@@ -233,7 +233,9 @@
 		return 0;
 	err = mlx5_alloc_table_hash_list(priv);
 	if (err)
-		return err;
+		goto error;
+	/* The resources below are only valid with DV support. */
+#ifdef HAVE_IBV_FLOW_DV_SUPPORT
 	/* Create tags hash list table. */
 	snprintf(s, sizeof(s), "%s_tags", sh->ibdev_name);
 	sh->tag_table = mlx5_hlist_create(s, MLX5_TAGS_HLIST_ARRAY_SIZE, 0,
@@ -260,6 +262,7 @@
 		err = ENOMEM;
 		goto error;
 	}
+#endif
 #ifdef HAVE_MLX5DV_DR
 	void *domain;
 
-- 
1.8.3.1


  parent reply	other threads:[~2020-10-28  9:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1601984948-313027-1-git-send-email-suanmingm@nvidia.com>
2020-10-06 11:48 ` [dpdk-stable] [PATCH 09/25] " Suanming Mou
     [not found] ` <1603437295-119083-1-git-send-email-suanmingm@nvidia.com>
2020-10-23  7:14   ` [dpdk-stable] [PATCH v2 14/25] " Suanming Mou
     [not found] ` <1603801650-442376-1-git-send-email-suanmingm@nvidia.com>
2020-10-27 12:27   ` [dpdk-stable] [PATCH v3 15/34] " Suanming Mou
     [not found] ` <1603842466-19879-1-git-send-email-suanmingm@nvidia.com>
2020-10-27 23:47   ` [dpdk-stable] [PATCH v4 " Suanming Mou
     [not found] ` <1603875616-272798-1-git-send-email-suanmingm@nvidia.com>
2020-10-28  8:59   ` Suanming Mou [this message]
     [not found] ` <1603877633-293405-1-git-send-email-suanmingm@nvidia.com>
2020-10-28  9:33   ` [dpdk-stable] [PATCH v5 " Suanming Mou

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=1603875616-272798-16-git-send-email-suanmingm@nvidia.com \
    --to=suanmingm@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=shahafs@nvidia.com \
    --cc=stable@dpdk.org \
    --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).