From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 77E1F42DD4; Tue, 4 Jul 2023 14:18:01 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1979F40E03; Tue, 4 Jul 2023 14:18:01 +0200 (CEST) Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by mails.dpdk.org (Postfix) with ESMTP id BCB8240042 for ; Tue, 4 Jul 2023 14:17:59 +0200 (CEST) Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-55b741fd0c5so303579a12.0 for ; Tue, 04 Jul 2023 05:17:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1688473078; x=1691065078; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=jPyc37f8dMe53MhgbqbBz0/RptRXiaK6mDHum6PwkXk=; b=gyJyTsQGvKDv1rKl9679Hsu82mPsOBP1aqJoureOKFcurWrh5G32aPf6ap1I0gimVg HPaz6cRHMrqBLKqfBUZWV5o2nHlDdemquiatjsI6uQ/+i8wv5cp0gbv49DIZjzDUPfdo mnSbtqzT3XbXzQ21Hvjc0fBFSCHpa8Y8v9Q390rviTlN4fT58XizbP0nHk/TGo7IZsIS fd8TLd8RTdlYJRM+vlCx/MXaKcdGsMir+T3LsaF7OFQYICyzBmSGLTl1BNv7PG+NUjLM Bx85oX8dRqCeRGxA96tUPSyrPQ+k7MOrBJfpplpmZBs6AleO8zbMcyl/2npLr+Q1Giwn VgsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688473078; x=1691065078; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jPyc37f8dMe53MhgbqbBz0/RptRXiaK6mDHum6PwkXk=; b=UDQFASziwXPe05v3wiQYOziD6OrUs62ho1274jk9QFf4LSBKDX+SwRdDeJRSDA66Dg IuKCSMnuIAElKWYP4/zjZgO7uKRPxZMTsJvduEn988+TNnKeJIFUe9eDJKC/QwoSrygM 7ycfFJEoTjXlB2gUAnei7/Z1CLA9PwVig0Ii3GtDxBXD+cfq06OSMi3eA20nyMEt+obq 2AeEqdGmkx2k0eGT2RQTa3kDspX7rHR5OvVT98G1SV8xnw0syn5WtCpZA05IflTlfOIe EUToGfLM7bDm+r8Oeyq8dblttSQ1q7l/T1lcx/0JxgIa+h99IAim9uWMFayEQWLnlIN5 l/hA== X-Gm-Message-State: ABy/qLbT+YBfvvD+bQBB8ZmjJBPilsE973PSYZvW5RlCZvDX7lVzJ3Bh uFkFHFcHXUub629fEhpyixw+2Q== X-Google-Smtp-Source: APBJJlE+b94utgTnne4hsr9OWHZj6KHaUFori92vZuDB7TEGuqJJ08Qb6WXQIc59yuthX3yCf1698w== X-Received: by 2002:a17:903:94:b0:1ac:40f7:8b5a with SMTP id o20-20020a170903009400b001ac40f78b5amr13549936pld.3.1688473078488; Tue, 04 Jul 2023 05:17:58 -0700 (PDT) Received: from HTW5T2C6VL.bytedance.net ([203.208.167.147]) by smtp.gmail.com with ESMTPSA id y1-20020a1709027c8100b001b025aba9edsm11748489pll.220.2023.07.04.05.17.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 04 Jul 2023 05:17:58 -0700 (PDT) From: Fengnan Chang To: david.marchand@redhat.com, anatoly.burakov@intel.com Cc: dev@dpdk.org, Fengnan Chang Subject: [PATCH v3] eal: fix prompt info when remap_segment failed Date: Tue, 4 Jul 2023 20:17:51 +0800 Message-Id: <20230704121751.92253-1-changfengnan@bytedance.com> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org When there is not enough space to memsegs, we should prompt which configuration should be modified instead of printing some numbers. Signed-off-by: Fengnan Chang --- lib/eal/common/eal_common_dynmem.c | 6 ++---- lib/eal/freebsd/eal_memory.c | 8 +++----- lib/eal/linux/eal_memory.c | 11 ++++------- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/lib/eal/common/eal_common_dynmem.c b/lib/eal/common/eal_common_dynmem.c index 52e52e5986..bdbbe233a0 100644 --- a/lib/eal/common/eal_common_dynmem.c +++ b/lib/eal/common/eal_common_dynmem.c @@ -120,8 +120,7 @@ eal_dynmem_memseg_lists_init(void) max_seglists_per_type = RTE_MAX_MEMSEG_LISTS / n_memtypes; if (max_seglists_per_type == 0) { - RTE_LOG(ERR, EAL, "Cannot accommodate all memory types, please increase %s\n", - RTE_STR(RTE_MAX_MEMSEG_LISTS)); + RTE_LOG(ERR, EAL, "Cannot accommodate all memory types, please increase RTE_MAX_MEMSEG_LISTS\n"); goto out; } @@ -180,8 +179,7 @@ eal_dynmem_memseg_lists_init(void) for (cur_seglist = 0; cur_seglist < n_seglists; cur_seglist++) { if (msl_idx >= RTE_MAX_MEMSEG_LISTS) { RTE_LOG(ERR, EAL, - "No more space in memseg lists, please increase %s\n", - RTE_STR(RTE_MAX_MEMSEG_LISTS)); + "No more space in memseg lists, please increase RTE_MAX_MEMSEG_LISTS\n"); goto out; } msl = &mcfg->memsegs[msl_idx++]; diff --git a/lib/eal/freebsd/eal_memory.c b/lib/eal/freebsd/eal_memory.c index 17ab10e0ca..5c6165c580 100644 --- a/lib/eal/freebsd/eal_memory.c +++ b/lib/eal/freebsd/eal_memory.c @@ -172,9 +172,8 @@ rte_eal_hugepage_init(void) break; } if (msl_idx == RTE_MAX_MEMSEG_LISTS) { - RTE_LOG(ERR, EAL, "Could not find space for memseg. Please increase %s and/or %s in configuration.\n", - RTE_STR(RTE_MAX_MEMSEG_PER_TYPE), - RTE_STR(RTE_MAX_MEM_MB_PER_TYPE)); + RTE_LOG(ERR, EAL, "Could not find space for memseg. Please increase RTE_MAX_MEMSEG_PER_LIST " + "RTE_MAX_MEMSEG_PER_TYPE and/or RTE_MAX_MEM_MB_PER_TYPE in configuration.\n"); return -1; } arr = &msl->memseg_arr; @@ -404,8 +403,7 @@ memseg_primary_init(void) if (msl_idx >= RTE_MAX_MEMSEG_LISTS) { RTE_LOG(ERR, EAL, - "No more space in memseg lists, please increase %s\n", - RTE_STR(RTE_MAX_MEMSEG_LISTS)); + "No more space in memseg lists, please increase RTE_MAX_MEMSEG_LISTS\n"); return -1; } diff --git a/lib/eal/linux/eal_memory.c b/lib/eal/linux/eal_memory.c index 0876974631..9b6f08fba8 100644 --- a/lib/eal/linux/eal_memory.c +++ b/lib/eal/linux/eal_memory.c @@ -716,9 +716,8 @@ remap_segment(struct hugepage_file *hugepages, int seg_start, int seg_end) break; } if (msl_idx == RTE_MAX_MEMSEG_LISTS) { - RTE_LOG(ERR, EAL, "Could not find space for memseg. Please increase %s and/or %s in configuration.\n", - RTE_STR(RTE_MAX_MEMSEG_PER_TYPE), - RTE_STR(RTE_MAX_MEM_MB_PER_TYPE)); + RTE_LOG(ERR, EAL, "Could not find space for memseg. Please increase RTE_MAX_MEMSEG_PER_LIST " + "RTE_MAX_MEMSEG_PER_TYPE and/or RTE_MAX_MEM_MB_PER_TYPE in configuration.\n"); return -1; } @@ -966,8 +965,7 @@ prealloc_segments(struct hugepage_file *hugepages, int n_pages) break; } if (msl_idx == RTE_MAX_MEMSEG_LISTS) { - RTE_LOG(ERR, EAL, "Not enough space in memseg lists, please increase %s\n", - RTE_STR(RTE_MAX_MEMSEG_LISTS)); + RTE_LOG(ERR, EAL, "Not enough space in memseg lists, please increase RTE_MAX_MEMSEG_LISTS\n"); return -1; } @@ -1833,8 +1831,7 @@ memseg_primary_init_32(void) if (msl_idx >= RTE_MAX_MEMSEG_LISTS) { RTE_LOG(ERR, EAL, - "No more space in memseg lists, please increase %s\n", - RTE_STR(RTE_MAX_MEMSEG_LISTS)); + "No more space in memseg lists, please increase RTE_MAX_MEMSEG_LISTS\n"); return -1; } -- 2.37.1 (Apple Git-137.1)