[v3] eal: warn on legacy memory allocation requirement

Message ID 20190730172153.29008-1-thomas@monjalon.net (mailing list archive)
State Accepted, archived
Headers
Series [v3] eal: warn on legacy memory allocation requirement |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-Compile-Testing success Compile Testing PASS
ci/Intel-compilation success Compilation OK
ci/mellanox-Performance-Testing success Performance Testing PASS

Commit Message

Thomas Monjalon July 30, 2019, 5:21 p.m. UTC
  When using --no-huge mode, dynamic allocation is not supported.
Because of this limitation, the option --legacy-mem is implied
and -m may be needed to specify the amount of memory to allocate.
Otherwise the default amount MEMSIZE_IF_NO_HUGE_PAGE will be allocated.

The option --socket-mem can also be used with --legacy-mem
when hugepages are supported.

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
v3:
	- replace "allocation" with "amount of reserved memory"
	- add --socket-mem
	- more rewording
v2:
	- user-oriented message
	- trigger warning on any legacy mem option
---
 lib/librte_eal/common/eal_common_options.c | 5 +++++
 1 file changed, 5 insertions(+)
  

Comments

Anatoly Burakov July 31, 2019, 9:15 a.m. UTC | #1
On 30-Jul-19 6:21 PM, Thomas Monjalon wrote:
> When using --no-huge mode, dynamic allocation is not supported.
> Because of this limitation, the option --legacy-mem is implied
> and -m may be needed to specify the amount of memory to allocate.
> Otherwise the default amount MEMSIZE_IF_NO_HUGE_PAGE will be allocated.
> 
> The option --socket-mem can also be used with --legacy-mem
> when hugepages are supported.
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
> v3:
> 	- replace "allocation" with "amount of reserved memory"
> 	- add --socket-mem
> 	- more rewording
> v2:
> 	- user-oriented message
> 	- trigger warning on any legacy mem option
> ---

Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
  
Thomas Monjalon Aug. 5, 2019, 9:46 a.m. UTC | #2
31/07/2019 11:15, Burakov, Anatoly:
> On 30-Jul-19 6:21 PM, Thomas Monjalon wrote:
> > When using --no-huge mode, dynamic allocation is not supported.
> > Because of this limitation, the option --legacy-mem is implied
> > and -m may be needed to specify the amount of memory to allocate.
> > Otherwise the default amount MEMSIZE_IF_NO_HUGE_PAGE will be allocated.
> > 
> > The option --socket-mem can also be used with --legacy-mem
> > when hugepages are supported.
> > 
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> 
> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

Applied
  

Patch

diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index 512d5088e..ab0b6082b 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -1589,6 +1589,11 @@  eal_check_common_options(struct internal_config *internal_cfg)
 				"with --"OPT_MATCH_ALLOCATIONS"\n");
 		return -1;
 	}
+	if (internal_cfg->legacy_mem && internal_cfg->memory == 0) {
+		RTE_LOG(NOTICE, EAL, "Static memory layout is selected, "
+			"amount of reserved memory can be adjusted with "
+			"-m or --"OPT_SOCKET_MEM"\n");
+	}
 
 	return 0;
 }