From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 810C71C998 for ; Mon, 14 May 2018 18:27:47 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 May 2018 09:27:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,400,1520924400"; d="scan'208";a="39197844" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga007.fm.intel.com with ESMTP; 14 May 2018 09:27:43 -0700 Received: from sivswdev01.ir.intel.com (sivswdev01.ir.intel.com [10.237.217.45]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id w4EGRgFA009126; Mon, 14 May 2018 17:27:42 +0100 Received: from sivswdev01.ir.intel.com (localhost [127.0.0.1]) by sivswdev01.ir.intel.com with ESMTP id w4EGRg3m030593; Mon, 14 May 2018 17:27:42 +0100 Received: (from aburakov@localhost) by sivswdev01.ir.intel.com with LOCAL id w4EGRg8O030589; Mon, 14 May 2018 17:27:42 +0100 From: Anatoly Burakov To: dev@dpdk.org Cc: thomas@monjalon.net, bruce.richardson@intel.com Date: Mon, 14 May 2018 17:27:40 +0100 Message-Id: <42855b1ca54d0115c8c50a75664084ae8036ad8d.1526315209.git.anatoly.burakov@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v3 2/4] eal: rename function returning hugepage data path X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 May 2018 16:27:47 -0000 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 Reviewed-by: Reshma Pattan --- lib/librte_eal/common/eal_filesystem.h | 2 +- lib/librte_eal/linuxapp/eal/eal_memory.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) 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; } -- 2.7.4