[v3,2/9] eal: don't allow legacy mode with in-memory mode

Message ID a69d5d7aa970fba06038fd27d439b85647b1b2da.1536073997.git.anatoly.burakov@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series Improve running DPDK without hugetlbfs mounpoint |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Anatoly Burakov Sept. 4, 2018, 3:15 p.m. UTC
  In-memory mode was never meant to support legacy mode, because we
cannot sort anonymous pages anyway.

Fixes: 72b49ff623c4 ("mem: support --in-memory mode")
Cc: stable@dpdk.org

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
 lib/librte_eal/common/eal_common_options.c | 6 ++++++
 1 file changed, 6 insertions(+)
  

Comments

Maxime Coquelin Sept. 13, 2018, 1:06 p.m. UTC | #1
On 09/04/2018 05:15 PM, Anatoly Burakov wrote:
> In-memory mode was never meant to support legacy mode, because we
> cannot sort anonymous pages anyway.
> 
> Fixes: 72b49ff623c4 ("mem: support --in-memory mode")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
>   lib/librte_eal/common/eal_common_options.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
> index dd5f97402..873099acc 100644
> --- a/lib/librte_eal/common/eal_common_options.c
> +++ b/lib/librte_eal/common/eal_common_options.c
> @@ -1390,6 +1390,12 @@ eal_check_common_options(struct internal_config *internal_cfg)
>   			"--"OPT_HUGE_UNLINK"\n");
>   		return -1;
>   	}
> +	if (internal_cfg->legacy_mem &&
> +			internal_cfg->in_memory) {
> +		RTE_LOG(ERR, EAL, "Option --"OPT_LEGACY_MEM" is not compatible "
> +				"with --"OPT_IN_MEMORY"\n");

This is a general comment, as it is consistent with the style of the
file. I generally prefer not splitting error strings into multiple lines
even if it is longer than 80 chars, because it makes grepping for the 
error string more difficult.

> +		return -1;
> +	}
>   
>   	return 0;
>   }
> 

Other than that:
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime
  
Anatoly Burakov Sept. 17, 2018, 9:49 a.m. UTC | #2
On 13-Sep-18 2:06 PM, Maxime Coquelin wrote:
> 
> 
> On 09/04/2018 05:15 PM, Anatoly Burakov wrote:
>> In-memory mode was never meant to support legacy mode, because we
>> cannot sort anonymous pages anyway.
>>
>> Fixes: 72b49ff623c4 ("mem: support --in-memory mode")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
>> ---
>>   lib/librte_eal/common/eal_common_options.c | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/lib/librte_eal/common/eal_common_options.c 
>> b/lib/librte_eal/common/eal_common_options.c
>> index dd5f97402..873099acc 100644
>> --- a/lib/librte_eal/common/eal_common_options.c
>> +++ b/lib/librte_eal/common/eal_common_options.c
>> @@ -1390,6 +1390,12 @@ eal_check_common_options(struct internal_config 
>> *internal_cfg)
>>               "--"OPT_HUGE_UNLINK"\n");
>>           return -1;
>>       }
>> +    if (internal_cfg->legacy_mem &&
>> +            internal_cfg->in_memory) {
>> +        RTE_LOG(ERR, EAL, "Option --"OPT_LEGACY_MEM" is not compatible "
>> +                "with --"OPT_IN_MEMORY"\n");
> 
> This is a general comment, as it is consistent with the style of the
> file. I generally prefer not splitting error strings into multiple lines
> even if it is longer than 80 chars, because it makes grepping for the 
> error string more difficult.

I agree in general, however in this particular case the string is 
ungreppable (it is a word now!) anyway because it's split into a few pieces.

> 
>> +        return -1;
>> +    }
>>       return 0;
>>   }
>>
> 
> Other than that:
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> 
> Thanks,
> Maxime
>
  

Patch

diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index dd5f97402..873099acc 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -1390,6 +1390,12 @@  eal_check_common_options(struct internal_config *internal_cfg)
 			"--"OPT_HUGE_UNLINK"\n");
 		return -1;
 	}
+	if (internal_cfg->legacy_mem &&
+			internal_cfg->in_memory) {
+		RTE_LOG(ERR, EAL, "Option --"OPT_LEGACY_MEM" is not compatible "
+				"with --"OPT_IN_MEMORY"\n");
+		return -1;
+	}
 
 	return 0;
 }