eal/linux: log hugepage create errors with filename
authorStephen Hemminger <stephen@networkplumber.org>
Thu, 23 Dec 2021 19:21:58 +0000 (11:21 -0800)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 21 Jan 2022 14:40:58 +0000 (15:40 +0100)
While debugging running DPDK service in a container, it is
useful to see which file creation failed.  Don't hide this
failure with DEBUG.

Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
lib/eal/linux/eal_memalloc.c

index 337f2bc..16b58d8 100644 (file)
@@ -308,8 +308,8 @@ get_seg_fd(char *path, int buflen, struct hugepage_info *hi,
                if (fd < 0) {
                        fd = open(path, O_CREAT | O_RDWR, 0600);
                        if (fd < 0) {
                if (fd < 0) {
                        fd = open(path, O_CREAT | O_RDWR, 0600);
                        if (fd < 0) {
-                               RTE_LOG(ERR, EAL, "%s(): open failed: %s\n",
-                                       __func__, strerror(errno));
+                               RTE_LOG(ERR, EAL, "%s(): open '%s' failed: %s\n",
+                                       __func__, path, strerror(errno));
                                return -1;
                        }
                        /* take out a read lock and keep it indefinitely */
                                return -1;
                        }
                        /* take out a read lock and keep it indefinitely */
@@ -346,8 +346,8 @@ get_seg_fd(char *path, int buflen, struct hugepage_info *hi,
 
                        fd = open(path, O_CREAT | O_RDWR, 0600);
                        if (fd < 0) {
 
                        fd = open(path, O_CREAT | O_RDWR, 0600);
                        if (fd < 0) {
-                               RTE_LOG(DEBUG, EAL, "%s(): open failed: %s\n",
-                                       __func__, strerror(errno));
+                               RTE_LOG(ERR, EAL, "%s(): open '%s' failed: %s\n",
+                                       __func__, path, strerror(errno));
                                return -1;
                        }
                        /* take out a read lock */
                                return -1;
                        }
                        /* take out a read lock */