[v3] eal: fix prompt info when remap_segment failed
Checks
Commit Message
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 <changfengnan@bytedance.com>
---
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(-)
Comments
On 7/4/2023 1:17 PM, Fengnan Chang wrote:
> 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 <changfengnan@bytedance.com>
> ---
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
This is bugfix, suggest add Cc.
With above add, Acked-by: Chengwen Feng <fengchengwen@huawei.com>
On 2023/7/4 20:17, Fengnan Chang wrote:
> 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 <changfengnan@bytedance.com>
> ---
> 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(-)
>
...
05/07/2023 03:33, fengchengwen:
> This is bugfix, suggest add Cc.
>
> With above add, Acked-by: Chengwen Feng <fengchengwen@huawei.com>
>
> On 2023/7/4 20:17, Fengnan Chang wrote:
> > 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 <changfengnan@bytedance.com>
Applied with
Fixes: dd61b34d580b ("mem: error if requesting more segments than MAX_MEMSEG")
Fixes: 66cc45e293ed ("mem: replace memseg with memseg lists")
Cc: stable@dpdk.org
@@ -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++];
@@ -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;
}
@@ -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;
}