[dpdk-dev] [PATCH] eal: add missing long-options for short option arguments

2016-03-18 Thread David Marchand
On Thu, Mar 3, 2016 at 4:02 PM, Wiles, Keith  wrote:
>>On Thu, Feb 25, 2016 at 11:12 PM, Wiles, Keith  
>>wrote:
On Thu, Feb 25, 2016 at 01:09:16PM -0600, Keith Wiles wrote:
> A number of short options for EAL are missing long options
> and this patch adds those missing options.
>
> The missing long options are for:
> -c add --coremask
> -d add --driver
> -l add --corelist
> -m add --memsize
> -n add --mem-channels
> -r add --mem-ranks
> -v add --version
> Add an alias for --lcores using --lcore-map
[snip]
>>No strong opinion on this.
>>
>>Just, why "memsize" with no -  but "mem-channels" ?
>>And why cut down to mem rather than memory ?
>
> I debated on mem-size, but I noticed in a couple places some used memsize. I 
> can change them to any thing someone wants. If you want memory-channels and 
> memory-ranks I am good with that too.

Ok, since I can see no real argument against, let's go with explicit options :
--memory-size
--memory-channels
--memory-ranks

The best would be then to align all other existing long options (but
keeping compat with existing ones).

Deal ?


-- 
David Marchand


[dpdk-dev] [PATCH] eal: add missing long-options for short option arguments

2016-03-03 Thread Wiles, Keith
>On Thu, Feb 25, 2016 at 11:12 PM, Wiles, Keith  
>wrote:
>>>On Thu, Feb 25, 2016 at 01:09:16PM -0600, Keith Wiles wrote:
 A number of short options for EAL are missing long options
 and this patch adds those missing options.

 The missing long options are for:
 -c add --coremask
 -d add --driver
 -l add --corelist
 -m add --memsize
 -n add --mem-channels
 -r add --mem-ranks
 -v add --version
 Add an alias for --lcores using --lcore-map

 Signed-off-by: Keith Wiles 
>>>
>>>Why do we need long options for all the short options?
>>
>> I think we need the long options to match the short options just because it 
>> makes sense to me to have long options for all short options. Take the case 
>> of -v, just about everyone else has a ?version long-option, but we do not.
>>
>> The real reason is to allow for DPDK configuration via a configuration file 
>> and I wanted to use the same strings for the config file variables as the 
>> command line options. I figured I would add the long options now as they do 
>> not effect the configuration file patch.
>
>No strong opinion on this.
>
>Just, why "memsize" with no -  but "mem-channels" ?
>And why cut down to mem rather than memory ?

I debated on mem-size, but I noticed in a couple places some used memsize. I 
can change them to any thing someone wants. If you want memory-channels and 
memory-ranks I am good with that too.

>
>
>-- 
>David Marchand
>


Regards,
Keith






[dpdk-dev] [PATCH] eal: add missing long-options for short option arguments

2016-03-03 Thread Wiles, Keith
>>On Thu, Feb 25, 2016 at 01:09:16PM -0600, Keith Wiles wrote:
>>> A number of short options for EAL are missing long options
>>> and this patch adds those missing options.
>>> 
>>> The missing long options are for:
>>> -c add --coremask
>>> -d add --driver
>>> -l add --corelist
>>> -m add --memsize
>>> -n add --mem-channels
>>> -r add --mem-ranks
>>> -v add --version
>>> Add an alias for --lcores using --lcore-map
>>> 
>>> Signed-off-by: Keith Wiles 
>>
>>Why do we need long options for all the short options?
>
>I think we need the long options to match the short options just because it 
>makes sense to me to have long options for all short options. Take the case of 
>-v, just about everyone else has a ?version long-option, but we do not.
>
>The real reason is to allow for DPDK configuration via a configuration file 
>and I wanted to use the same strings for the config file variables as the 
>command line options. I figured I would add the long options now as they do 
>not effect the configuration file patch.

Ping. I really want to have long options for the short option to allow me to 
use those same options for the config file support I would like to use for 
DPDK. A config file support is much more reasonable for live or production 
systems IMHO. Plus it could be very nice for the examples to have a config file 
on how that example could be configured.

I can create the config file support without the long option names for the 
short ones, but it would be a lot cleaner to have the same names for config 
file and command line.

Thanks
++Keith

>>
>>/Bruce
>>
>>
>
>
>Regards,
>Keith
>
>
>
>
>


Regards,
Keith






[dpdk-dev] [PATCH] eal: add missing long-options for short option arguments

2016-02-25 Thread Wiles, Keith
>On Thu, Feb 25, 2016 at 01:09:16PM -0600, Keith Wiles wrote:
>> A number of short options for EAL are missing long options
>> and this patch adds those missing options.
>> 
>> The missing long options are for:
>> -c add --coremask
>> -d add --driver
>> -l add --corelist
>> -m add --memsize
>> -n add --mem-channels
>> -r add --mem-ranks
>> -v add --version
>> Add an alias for --lcores using --lcore-map
>> 
>> Signed-off-by: Keith Wiles 
>
>Why do we need long options for all the short options?

I think we need the long options to match the short options just because it 
makes sense to me to have long options for all short options. Take the case of 
-v, just about everyone else has a ?version long-option, but we do not.

The real reason is to allow for DPDK configuration via a configuration file and 
I wanted to use the same strings for the config file variables as the command 
line options. I figured I would add the long options now as they do not effect 
the configuration file patch.
>
>/Bruce
>
>


Regards,
Keith






[dpdk-dev] [PATCH] eal: add missing long-options for short option arguments

2016-02-25 Thread Bruce Richardson
On Thu, Feb 25, 2016 at 01:09:16PM -0600, Keith Wiles wrote:
> A number of short options for EAL are missing long options
> and this patch adds those missing options.
> 
> The missing long options are for:
> -c add --coremask
> -d add --driver
> -l add --corelist
> -m add --memsize
> -n add --mem-channels
> -r add --mem-ranks
> -v add --version
> Add an alias for --lcores using --lcore-map
> 
> Signed-off-by: Keith Wiles 

Why do we need long options for all the short options?

/Bruce



[dpdk-dev] [PATCH] eal: add missing long-options for short option arguments

2016-02-25 Thread Keith Wiles
A number of short options for EAL are missing long options
and this patch adds those missing options.

The missing long options are for:
-c add --coremask
-d add --driver
-l add --corelist
-m add --memsize
-n add --mem-channels
-r add --mem-ranks
-v add --version
Add an alias for --lcores using --lcore-map

Signed-off-by: Keith Wiles 
---
 doc/guides/testpmd_app_ug/run_app.rst  | 16 +++
 lib/librte_eal/common/eal_common_options.c | 31 --
 lib/librte_eal/common/eal_options.h| 16 +++
 3 files changed, 45 insertions(+), 18 deletions(-)

diff --git a/doc/guides/testpmd_app_ug/run_app.rst 
b/doc/guides/testpmd_app_ug/run_app.rst
index f605564..753a013 100644
--- a/doc/guides/testpmd_app_ug/run_app.rst
+++ b/doc/guides/testpmd_app_ug/run_app.rst
@@ -38,18 +38,18 @@ The following are the EAL command-line options that can be 
used in conjunction w
 or any other DPDK application.
 See the DPDK Getting Started Guides for more information on these options.

-*   ``-c COREMASK``
+*   ``-c, --coremask COREMASK``

 Set the hexadecimal bitmask of the cores to run on.

-*   ``-l CORELIST``
+*   ``-l, --corelist CORELIST``

 List of cores to run on

 The argument format is ``[-c2][,c3[-c4],...]``
 where ``c1``, ``c2``, etc are core indexes between 0 and 128.

-*   ``--lcores COREMAP``
+*   ``--lcores COREMAP or --lcore-map COREMAP``

 Map lcore set to physical cpu set

@@ -66,7 +66,7 @@ See the DPDK Getting Started Guides for more information on 
these options.

 Core ID that is used as master.

-*   ``-n NUM``
+*   ``-n, --mem-channels NUM``

 Set the number of memory channels to use.

@@ -74,7 +74,7 @@ See the DPDK Getting Started Guides for more information on 
these options.

 Blacklist a PCI devise to prevent EAL from using it. Multiple -b options 
are allowed.

-*   ``-d LIB.so``
+*   ``-d, --driver LIB.so|DIR``

 Load an external driver. Multiple -d options are allowed.

@@ -82,15 +82,15 @@ See the DPDK Getting Started Guides for more information on 
these options.

 Add a PCI device in white list.

-*   ``-m MB``
+*   ``-m, --memsize MB``

 Memory to allocate. See also ``--socket-mem``.

-*   ``-r NUM``
+*   ``-r, --mem-ranks NUM``

 Set the number of memory ranks (auto-detected by default).

-*   ``-v``
+*   ``-v, --version``

 Display the version information on startup.

diff --git a/lib/librte_eal/common/eal_common_options.c 
b/lib/librte_eal/common/eal_common_options.c
index 29942ea..cf9801d 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -95,6 +95,14 @@ eal_long_options[] = {
{OPT_VFIO_INTR, 1, NULL, OPT_VFIO_INTR_NUM},
{OPT_VMWARE_TSC_MAP,0, NULL, OPT_VMWARE_TSC_MAP_NUM   },
{OPT_XEN_DOM0,  0, NULL, OPT_XEN_DOM0_NUM },
+   {OPT_COREMASK,  1, NULL, OPT_COREMASK_NUM },
+   {OPT_DRIVER,1, NULL, OPT_DRIVER_NUM   },
+   {OPT_CORELIST,  1, NULL, OPT_CORELIST_NUM },
+   {OPT_MEM_SIZE,  1, NULL, OPT_MEM_SIZE_NUM },
+   {OPT_MEM_CHANNELS,  1, NULL, OPT_MEM_CHANNELS_NUM },
+   {OPT_MEM_RANKS, 1, NULL, OPT_MEM_RANKS_NUM},
+   {OPT_VERSION,   0, NULL, OPT_VERSION_NUM  },
+   {OPT_LCORE_MAP, 1, NULL, OPT_LCORE_MAP_NUM},
{0, 0, NULL, 0}
 };

@@ -889,6 +897,7 @@ eal_parse_common_option(int opt, const char *optarg,
conf->log_level = log;
break;
}
+   case OPT_LCORE_MAP_NUM:
case OPT_LCORES_NUM:
if (eal_parse_lcores(optarg) < 0) {
RTE_LOG(ERR, EAL, "invalid parameter for --"
@@ -978,11 +987,13 @@ eal_common_usage(void)
 {
printf("[options]\n\n"
   "EAL common options:\n"
-  "  -c COREMASK Hexadecimal bitmask of cores to run on\n"
-  "  -l CORELIST List of cores to run on\n"
+  "  -c, --"OPT_COREMASK"  Hexadecimal bitmask of cores to run 
on\n"
+  "  -l, --"OPT_CORELIST"  List of cores to run on\n"
   "  The argument format is 
[-c2][,c3[-c4],...]\n"
   "  where c1, c2, etc are core indexes 
between 0 and %d\n"
-  "  --"OPT_LCORES" COREMAPMap lcore set to physical cpu set\n"
+  "(ex: 1-3,7,9-10) skipping 4,5,6 and 8 
cores.\n"
+  "  --"OPT_LCORES" COREMAP\n"
+  "  --"OPT_LCORE_MAP" COREMAP Map lcore set to physical cpu set\n"
   "  The argument format is\n"
   "
'[<,lcores[@cpus]>...]'\n"
   "  lcores and cpus list are grouped by '(' 
and ')'\n"
@@ -991,9