DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Cc: Bruce Richardson <bruce.richardson@intel.com>
Subject: [PATCH 2/3] eal: use common basename function
Date: Wed,  6 Aug 2025 13:38:32 +0000	[thread overview]
Message-ID: <20250806133833.3236170-3-bruce.richardson@intel.com> (raw)
In-Reply-To: <20250806133833.3236170-1-bruce.richardson@intel.com>

Use the new "rte_basename" function which has common behaviour on all
supported platforms. As extra benefit, it removes the need for
recreating the socket path twice, since rte_basename guarantees not
to modify its argument.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/eal/common/eal_common_proc.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/lib/eal/common/eal_common_proc.c b/lib/eal/common/eal_common_proc.c
index 0dea787e38..62fd4ba88f 100644
--- a/lib/eal/common/eal_common_proc.c
+++ b/lib/eal/common/eal_common_proc.c
@@ -625,10 +625,7 @@ rte_mp_channel_init(void)
 
 	/* create filter path */
 	create_socket_path("*", path, sizeof(path));
-	strlcpy(mp_filter, basename(path), sizeof(mp_filter));
-
-	/* path may have been modified, so recreate it */
-	create_socket_path("*", path, sizeof(path));
+	rte_basename(path, mp_filter, sizeof(mp_filter));
 	strlcpy(mp_dir_path, dirname(path), sizeof(mp_dir_path));
 
 	/* lock the directory */
-- 
2.48.1


  parent reply	other threads:[~2025-08-06 13:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-06 13:38 [PATCH 0/3] Use cross-platform rte_basename function Bruce Richardson
2025-08-06 13:38 ` [PATCH 1/3] app: use cross-platform basename function Bruce Richardson
2025-08-06 13:38 ` Bruce Richardson [this message]
2025-08-06 13:38 ` [PATCH 3/3] dma/idxd: use DPDK " Bruce Richardson

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=20250806133833.3236170-3-bruce.richardson@intel.com \
    --to=bruce.richardson@intel.com \
    --cc=dev@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).