[dpdk-dev,v2,2/4] eal: rename function returning hugepage data path

Message ID be2dcc9a773d11b679374f746f0fc82f4ca86c1b.1525090086.git.anatoly.burakov@intel.com (mailing list archive)
State Changes Requested, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Anatoly Burakov April 30, 2018, 12:08 p.m. UTC
  The original name for this path was not too descriptive and
confusing. Rename it to a more appropriate and descriptive name:
it stores data about hugepages, so name it eal_hugepage_data_path().

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_eal/common/eal_filesystem.h   |  2 +-
 lib/librte_eal/linuxapp/eal/eal_memory.c | 10 ++++++----
 2 files changed, 7 insertions(+), 5 deletions(-)
  

Comments

Pattan, Reshma May 10, 2018, 1:14 p.m. UTC | #1
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Anatoly Burakov
> Sent: Monday, April 30, 2018 1:09 PM
> To: dev@dpdk.org
> Cc: Richardson, Bruce <bruce.richardson@intel.com>; thomas@monjalon.net
> Subject: [dpdk-dev] [PATCH v2 2/4] eal: rename function returning hugepage
> data path
> 
> The original name for this path was not too descriptive and confusing.
> Rename it to a more appropriate and descriptive name:
> it stores data about hugepages, so name it eal_hugepage_data_path().
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>

data_path sounds like packet processing data path.  eal_hugepage_data_file?. 
I am ok anyway :-).
Reviewed-by: Reshma Pattan <reshma.pattan@intel.com>
  

Patch

diff --git a/lib/librte_eal/common/eal_filesystem.h b/lib/librte_eal/common/eal_filesystem.h
index 078e2eb..060ac2b 100644
--- a/lib/librte_eal/common/eal_filesystem.h
+++ b/lib/librte_eal/common/eal_filesystem.h
@@ -89,7 +89,7 @@  eal_hugepage_info_path(void)
 #define HUGEPAGE_FILE_FMT "%s/.%s_hugepage_file"
 
 static inline const char *
-eal_hugepage_file_path(void)
+eal_hugepage_data_path(void)
 {
 	static char buffer[PATH_MAX]; /* static so auto-zeroed */
 	const char *directory = default_config_dir;
diff --git a/lib/librte_eal/linuxapp/eal/eal_memory.c b/lib/librte_eal/linuxapp/eal/eal_memory.c
index e0baabb..c917de1 100644
--- a/lib/librte_eal/linuxapp/eal/eal_memory.c
+++ b/lib/librte_eal/linuxapp/eal/eal_memory.c
@@ -1499,7 +1499,7 @@  eal_legacy_hugepage_init(void)
 	}
 
 	/* create shared memory */
-	hugepage = create_shared_memory(eal_hugepage_file_path(),
+	hugepage = create_shared_memory(eal_hugepage_data_path(),
 			nr_hugefiles * sizeof(struct hugepage_file));
 
 	if (hugepage == NULL) {
@@ -1727,16 +1727,18 @@  eal_legacy_hugepage_attach(void)
 
 	test_phys_addrs_available();
 
-	fd_hugepage = open(eal_hugepage_file_path(), O_RDONLY);
+	fd_hugepage = open(eal_hugepage_data_path(), O_RDONLY);
 	if (fd_hugepage < 0) {
-		RTE_LOG(ERR, EAL, "Could not open %s\n", eal_hugepage_file_path());
+		RTE_LOG(ERR, EAL, "Could not open %s\n",
+				eal_hugepage_data_path());
 		goto error;
 	}
 
 	size = getFileSize(fd_hugepage);
 	hp = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd_hugepage, 0);
 	if (hp == MAP_FAILED) {
-		RTE_LOG(ERR, EAL, "Could not mmap %s\n", eal_hugepage_file_path());
+		RTE_LOG(ERR, EAL, "Could not mmap %s\n",
+				eal_hugepage_data_path());
 		goto error;
 	}