All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] eal: add error check for core options
@ 2018-02-01 15:39 Marko Kovacevic
  2018-02-01 16:38 ` Burakov, Anatoly
  2018-02-01 17:07 ` [PATCH v2] " Marko Kovacevic
  0 siblings, 2 replies; 8+ messages in thread
From: Marko Kovacevic @ 2018-02-01 15:39 UTC (permalink / raw)
  To: dev
  Cc: anatoly.burakov, vipin.varghese, bruce.richardson, stable,
	Marko Kovacevic

Error information on the current core
usage list,mask and map were incomplete.
Added states to differentiate core usage
and to inform user.

Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
---
 doc/guides/testpmd_app_ug/run_app.rst      |  4 ++++
 lib/librte_eal/common/eal_common_options.c | 33 +++++++++++++++++++++++++++---
 2 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
index 46da1df..26500bf 100644
--- a/doc/guides/testpmd_app_ug/run_app.rst
+++ b/doc/guides/testpmd_app_ug/run_app.rst
@@ -62,6 +62,10 @@ See the DPDK Getting Started Guides for more information on these options.
     The grouping ``()`` can be omitted for single element group.
     The ``@`` can be omitted if cpus and lcores have the same value.
 
+.. Note::
+   When ``--lcores`` is in use, the options ``-l`` and ``-c`` cannot be used.
+
+
 *   ``--master-lcore ID``
 
     Core ID that is used as master.
diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index b6d2762..6604c64 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -57,6 +57,9 @@
 #include "eal_filesystem.h"
 
 #define BITS_PER_HEX 4
+#define LCORE_OPT_LST 1
+#define LCORE_OPT_MSK 2
+#define LCORE_OPT_MAP 3
 
 const char
 eal_short_options[] =
@@ -1028,7 +1031,15 @@ eal_parse_common_option(int opt, const char *optarg,
 			RTE_LOG(ERR, EAL, "invalid coremask\n");
 			return -1;
 		}
-		core_parsed = 1;
+
+		if (core_parsed) {
+			RTE_LOG(ERR, EAL, "Core Mask Option is ignored, because core (%s) is set!\n",
+				(core_parsed == LCORE_OPT_LST)?"LIST" :
+				(core_parsed == LCORE_OPT_MAP)?"MAP" : "Unknown");
+			return -1;
+		}
+
+		core_parsed = LCORE_OPT_MSK;
 		break;
 	/* corelist */
 	case 'l':
@@ -1036,7 +1047,15 @@ eal_parse_common_option(int opt, const char *optarg,
 			RTE_LOG(ERR, EAL, "invalid core list\n");
 			return -1;
 		}
-		core_parsed = 1;
+
+		if (core_parsed) {
+			RTE_LOG(ERR, EAL, "Core List Option is ignored, because core (%s) is set!\n",
+				(core_parsed == LCORE_OPT_MSK)?"LIST" :
+				(core_parsed == LCORE_OPT_MAP)?"MAP" : "Unknown");
+			return -1;
+		}
+
+		core_parsed = LCORE_OPT_LST;
 		break;
 	/* service coremask */
 	case 's':
@@ -1156,7 +1175,15 @@ eal_parse_common_option(int opt, const char *optarg,
 				OPT_LCORES "\n");
 			return -1;
 		}
-		core_parsed = 1;
+
+		if (core_parsed) {
+			RTE_LOG(ERR, EAL, "Core Map Option is ignored, because core (%s) is set!\n",
+				(core_parsed == LCORE_OPT_LST)?"LIST" :
+				(core_parsed == LCORE_OPT_MSK)?"MASK" : "Unknown");
+			return -1;
+		}
+
+		core_parsed = LCORE_OPT_MAP;
 		break;
 
 	/* don't know what to do, leave this to caller */
-- 
2.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v1] eal: add error check for core options
  2018-02-01 15:39 [PATCH v1] eal: add error check for core options Marko Kovacevic
@ 2018-02-01 16:38 ` Burakov, Anatoly
  2018-02-01 17:07 ` [PATCH v2] " Marko Kovacevic
  1 sibling, 0 replies; 8+ messages in thread
From: Burakov, Anatoly @ 2018-02-01 16:38 UTC (permalink / raw)
  To: Marko Kovacevic, dev; +Cc: vipin.varghese, bruce.richardson, stable

On 01-Feb-18 3:39 PM, Marko Kovacevic wrote:
> Error information on the current core
> usage list,mask and map were incomplete.
> Added states to differentiate core usage
> and to inform user.

Nitpicking, but line width on commit message is a little on the short 
side...

> 
> Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
> ---
>   doc/guides/testpmd_app_ug/run_app.rst      |  4 ++++
>   lib/librte_eal/common/eal_common_options.c | 33 +++++++++++++++++++++++++++---
>   2 files changed, 34 insertions(+), 3 deletions(-)
> 
> diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
> index 46da1df..26500bf 100644
> --- a/doc/guides/testpmd_app_ug/run_app.rst
> +++ b/doc/guides/testpmd_app_ug/run_app.rst
> @@ -62,6 +62,10 @@ See the DPDK Getting Started Guides for more information on these options.
>       The grouping ``()`` can be omitted for single element group.
>       The ``@`` can be omitted if cpus and lcores have the same value.
>   
> +.. Note::
> +   When ``--lcores`` is in use, the options ``-l`` and ``-c`` cannot be used.
> +
> +
>   *   ``--master-lcore ID``
>   
>       Core ID that is used as master.
> diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
> index b6d2762..6604c64 100644
> --- a/lib/librte_eal/common/eal_common_options.c
> +++ b/lib/librte_eal/common/eal_common_options.c
> @@ -57,6 +57,9 @@
>   #include "eal_filesystem.h"
>   
>   #define BITS_PER_HEX 4
> +#define LCORE_OPT_LST 1
> +#define LCORE_OPT_MSK 2
> +#define LCORE_OPT_MAP 3
>   
>   const char
>   eal_short_options[] =
> @@ -1028,7 +1031,15 @@ eal_parse_common_option(int opt, const char *optarg,
>   			RTE_LOG(ERR, EAL, "invalid coremask\n");
>   			return -1;
>   		}
> -		core_parsed = 1;
> +
> +		if (core_parsed) {
> +			RTE_LOG(ERR, EAL, "Core Mask Option is ignored, because core (%s) is set!\n",
> +				(core_parsed == LCORE_OPT_LST)?"LIST" :
> +				(core_parsed == LCORE_OPT_MAP)?"MAP" : "Unknown");

i think "LIST" and "MAP" are terribly undescriptive. It would be better 
to put the respective cmdline arguments ("-l" or "-c") there instead. 
Same applies to other cases.

Otherwise,

Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>

> +			return -1;
> +		}
> +
> +		core_parsed = LCORE_OPT_MSK;
>   		break;
>   	/* corelist */
>   	case 'l':
> @@ -1036,7 +1047,15 @@ eal_parse_common_option(int opt, const char *optarg,
>   			RTE_LOG(ERR, EAL, "invalid core list\n");
>   			return -1;
>   		}
> -		core_parsed = 1;
> +
> +		if (core_parsed) {
> +			RTE_LOG(ERR, EAL, "Core List Option is ignored, because core (%s) is set!\n",
> +				(core_parsed == LCORE_OPT_MSK)?"LIST" :
> +				(core_parsed == LCORE_OPT_MAP)?"MAP" : "Unknown");
> +			return -1;
> +		}
> +
> +		core_parsed = LCORE_OPT_LST;
>   		break;
>   	/* service coremask */
>   	case 's':
> @@ -1156,7 +1175,15 @@ eal_parse_common_option(int opt, const char *optarg,
>   				OPT_LCORES "\n");
>   			return -1;
>   		}
> -		core_parsed = 1;
> +
> +		if (core_parsed) {
> +			RTE_LOG(ERR, EAL, "Core Map Option is ignored, because core (%s) is set!\n",
> +				(core_parsed == LCORE_OPT_LST)?"LIST" :
> +				(core_parsed == LCORE_OPT_MSK)?"MASK" : "Unknown");
> +			return -1;
> +		}
> +
> +		core_parsed = LCORE_OPT_MAP;
>   		break;
>   
>   	/* don't know what to do, leave this to caller */
> 


-- 
Thanks,
Anatoly

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2] eal: add error check for core options
  2018-02-01 15:39 [PATCH v1] eal: add error check for core options Marko Kovacevic
  2018-02-01 16:38 ` Burakov, Anatoly
@ 2018-02-01 17:07 ` Marko Kovacevic
  2018-02-01 17:13   ` Burakov, Anatoly
  2018-02-02 14:51   ` [PATCH v3] " Marko Kovacevic
  1 sibling, 2 replies; 8+ messages in thread
From: Marko Kovacevic @ 2018-02-01 17:07 UTC (permalink / raw)
  To: dev
  Cc: john.mcnamara, vipin.varghese, anatoly.burakov, bruce.richardson,
	Marko Kovacevic

Error information on the current core
usage list,mask and map were incomplete.
Added states to differentiate core usage
and to inform user.

Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>

---
V2:
 - Cleaned up the logging for error cases - Anatoly
---
 doc/guides/testpmd_app_ug/run_app.rst      |  4 ++++
 lib/librte_eal/common/eal_common_options.c | 33 +++++++++++++++++++++++++++---
 2 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
index 46da1df..26500bf 100644
--- a/doc/guides/testpmd_app_ug/run_app.rst
+++ b/doc/guides/testpmd_app_ug/run_app.rst
@@ -62,6 +62,10 @@ See the DPDK Getting Started Guides for more information on these options.
     The grouping ``()`` can be omitted for single element group.
     The ``@`` can be omitted if cpus and lcores have the same value.
 
+.. Note::
+   When ``--lcores`` is in use, the options ``-l`` and ``-c`` cannot be used.
+
+
 *   ``--master-lcore ID``
 
     Core ID that is used as master.
diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index b6d2762..459b093 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -57,6 +57,9 @@
 #include "eal_filesystem.h"
 
 #define BITS_PER_HEX 4
+#define LCORE_OPT_LST 1
+#define LCORE_OPT_MSK 2
+#define LCORE_OPT_MAP 3
 
 const char
 eal_short_options[] =
@@ -1028,7 +1031,15 @@ eal_parse_common_option(int opt, const char *optarg,
 			RTE_LOG(ERR, EAL, "invalid coremask\n");
 			return -1;
 		}
-		core_parsed = 1;
+
+		if (core_parsed) {
+			RTE_LOG(ERR, EAL, "Option -c is ignored, because (%s) is set!\n",
+				(core_parsed == LCORE_OPT_LST)?"-l" :
+				(core_parsed == LCORE_OPT_MAP)?"--lcore" : "Unknown");
+			return -1;
+		}
+
+		core_parsed = LCORE_OPT_MSK;
 		break;
 	/* corelist */
 	case 'l':
@@ -1036,7 +1047,15 @@ eal_parse_common_option(int opt, const char *optarg,
 			RTE_LOG(ERR, EAL, "invalid core list\n");
 			return -1;
 		}
-		core_parsed = 1;
+
+		if (core_parsed) {
+			RTE_LOG(ERR, EAL, "Option -l is ignored, because (%s) is set!\n",
+				(core_parsed == LCORE_OPT_MSK)?"-c" :
+				(core_parsed == LCORE_OPT_MAP)?"--lcore" : "Unknown");
+			return -1;
+		}
+
+		core_parsed = LCORE_OPT_LST;
 		break;
 	/* service coremask */
 	case 's':
@@ -1156,7 +1175,15 @@ eal_parse_common_option(int opt, const char *optarg,
 				OPT_LCORES "\n");
 			return -1;
 		}
-		core_parsed = 1;
+
+		if (core_parsed) {
+			RTE_LOG(ERR, EAL, "Option --lcore is ignored, because (%s) is set!\n",
+				(core_parsed == LCORE_OPT_LST)?"-l" :
+				(core_parsed == LCORE_OPT_MSK)?"-c" : "Unknown");
+			return -1;
+		}
+
+		core_parsed = LCORE_OPT_MAP;
 		break;
 
 	/* don't know what to do, leave this to caller */
-- 
2.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] eal: add error check for core options
  2018-02-01 17:07 ` [PATCH v2] " Marko Kovacevic
@ 2018-02-01 17:13   ` Burakov, Anatoly
  2018-02-02 14:51   ` [PATCH v3] " Marko Kovacevic
  1 sibling, 0 replies; 8+ messages in thread
From: Burakov, Anatoly @ 2018-02-01 17:13 UTC (permalink / raw)
  To: Marko Kovacevic, dev; +Cc: john.mcnamara, vipin.varghese, bruce.richardson

On 01-Feb-18 5:07 PM, Marko Kovacevic wrote:
> Error information on the current core
> usage list,mask and map were incomplete.
> Added states to differentiate core usage
> and to inform user.
> 
> Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
> 
> ---

Should've kept my Reviewed-by tag, but no harm done.

Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>

-- 
Thanks,
Anatoly

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v3] eal: add error check for core options
  2018-02-01 17:07 ` [PATCH v2] " Marko Kovacevic
  2018-02-01 17:13   ` Burakov, Anatoly
@ 2018-02-02 14:51   ` Marko Kovacevic
  2018-02-02 15:33     ` Bruce Richardson
  1 sibling, 1 reply; 8+ messages in thread
From: Marko Kovacevic @ 2018-02-02 14:51 UTC (permalink / raw)
  To: dev
  Cc: anatoly.burakov, vipin.varghese, bruce.richardson, stable,
	Marko Kovacevic

Error information on current core usage list, mask or map
were incomplete. Added states to differentiate core usage
and to inform user.

Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>

---

V3:
 - Changed to reflect the coding guidelines - Bruce
 - update the documentation for better clarity - Bruce
 - Added back the reviewer information - Anatoly

V2:
 - Cleaned up the logging for error cases - Anatoly
---
 doc/guides/testpmd_app_ug/run_app.rst      |  4 ++++
 lib/librte_eal/common/eal_common_options.c | 36 +++++++++++++++++++++++++++---
 2 files changed, 37 insertions(+), 3 deletions(-)

diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
index 46da1df..85e725f 100644
--- a/doc/guides/testpmd_app_ug/run_app.rst
+++ b/doc/guides/testpmd_app_ug/run_app.rst
@@ -62,6 +62,10 @@ See the DPDK Getting Started Guides for more information on these options.
     The grouping ``()`` can be omitted for single element group.
     The ``@`` can be omitted if cpus and lcores have the same value.
 
+.. Note::
+    At a given instance only one core option ``--lcores``, ``-l`` or ``-c`` can be used.
+
+
 *   ``--master-lcore ID``
 
     Core ID that is used as master.
diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index b6d2762..66f0868 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -57,6 +57,9 @@
 #include "eal_filesystem.h"
 
 #define BITS_PER_HEX 4
+#define LCORE_OPT_LST 1
+#define LCORE_OPT_MSK 2
+#define LCORE_OPT_MAP 3
 
 const char
 eal_short_options[] =
@@ -1028,7 +1031,16 @@ eal_parse_common_option(int opt, const char *optarg,
 			RTE_LOG(ERR, EAL, "invalid coremask\n");
 			return -1;
 		}
-		core_parsed = 1;
+
+		if (core_parsed) {
+			RTE_LOG(ERR, EAL, "Option -c is ignored, because (%s) is set!\n",
+				(core_parsed == LCORE_OPT_LST) ? "-l" :
+				(core_parsed == LCORE_OPT_MAP) ? "--lcore" :
+				"-c");
+			return -1;
+		}
+
+		core_parsed = LCORE_OPT_MSK;
 		break;
 	/* corelist */
 	case 'l':
@@ -1036,7 +1048,16 @@ eal_parse_common_option(int opt, const char *optarg,
 			RTE_LOG(ERR, EAL, "invalid core list\n");
 			return -1;
 		}
-		core_parsed = 1;
+
+		if (core_parsed) {
+			RTE_LOG(ERR, EAL, "Option -l is ignored, because (%s) is set!\n",
+				(core_parsed == LCORE_OPT_MSK) ? "-c" :
+				(core_parsed == LCORE_OPT_MAP) ? "--lcore" :
+				"-l");
+			return -1;
+		}
+
+		core_parsed = LCORE_OPT_LST;
 		break;
 	/* service coremask */
 	case 's':
@@ -1156,7 +1177,16 @@ eal_parse_common_option(int opt, const char *optarg,
 				OPT_LCORES "\n");
 			return -1;
 		}
-		core_parsed = 1;
+
+		if (core_parsed) {
+			RTE_LOG(ERR, EAL, "Option --lcore is ignored, because (%s) is set!\n",
+				(core_parsed == LCORE_OPT_LST) ? "-l" :
+				(core_parsed == LCORE_OPT_MSK) ? "-c" :
+				"--lcore");
+			return -1;
+		}
+
+		core_parsed = LCORE_OPT_MAP;
 		break;
 
 	/* don't know what to do, leave this to caller */
-- 
2.9.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v3] eal: add error check for core options
  2018-02-02 14:51   ` [PATCH v3] " Marko Kovacevic
@ 2018-02-02 15:33     ` Bruce Richardson
  2018-02-05 23:11       ` [dpdk-stable] " Thomas Monjalon
  2018-02-22 10:10       ` O Mahony, Billy
  0 siblings, 2 replies; 8+ messages in thread
From: Bruce Richardson @ 2018-02-02 15:33 UTC (permalink / raw)
  To: Marko Kovacevic; +Cc: dev, anatoly.burakov, vipin.varghese, stable

On Fri, Feb 02, 2018 at 02:51:28PM +0000, Marko Kovacevic wrote:
> Error information on current core usage list, mask or map
> were incomplete. Added states to differentiate core usage
> and to inform user.
> 
> Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
> Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

This is fine as-is - one comment below for future consideration.
> 
> ---
> 
> V3:
>  - Changed to reflect the coding guidelines - Bruce
>  - update the documentation for better clarity - Bruce
>  - Added back the reviewer information - Anatoly
> 
> V2:
>  - Cleaned up the logging for error cases - Anatoly
> ---
>  doc/guides/testpmd_app_ug/run_app.rst      |  4 ++++
>  lib/librte_eal/common/eal_common_options.c | 36 +++++++++++++++++++++++++++---
>  2 files changed, 37 insertions(+), 3 deletions(-)
> 
> diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
> index 46da1df..85e725f 100644
> --- a/doc/guides/testpmd_app_ug/run_app.rst
> +++ b/doc/guides/testpmd_app_ug/run_app.rst
> @@ -62,6 +62,10 @@ See the DPDK Getting Started Guides for more information on these options.
>      The grouping ``()`` can be omitted for single element group.
>      The ``@`` can be omitted if cpus and lcores have the same value.
>  
> +.. Note::
> +    At a given instance only one core option ``--lcores``, ``-l`` or ``-c`` can be used.
> +
> +
>  *   ``--master-lcore ID``
>  
>      Core ID that is used as master.
> diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
> index b6d2762..66f0868 100644
> --- a/lib/librte_eal/common/eal_common_options.c
> +++ b/lib/librte_eal/common/eal_common_options.c
> @@ -57,6 +57,9 @@
>  #include "eal_filesystem.h"
>  
>  #define BITS_PER_HEX 4
> +#define LCORE_OPT_LST 1
> +#define LCORE_OPT_MSK 2
> +#define LCORE_OPT_MAP 3
>  
>  const char
>  eal_short_options[] =
> @@ -1028,7 +1031,16 @@ eal_parse_common_option(int opt, const char *optarg,
>  			RTE_LOG(ERR, EAL, "invalid coremask\n");
>  			return -1;
>  		}
> -		core_parsed = 1;
> +
> +		if (core_parsed) {
> +			RTE_LOG(ERR, EAL, "Option -c is ignored, because (%s) is set!\n",
> +				(core_parsed == LCORE_OPT_LST) ? "-l" :
> +				(core_parsed == LCORE_OPT_MAP) ? "--lcore" :
> +				"-c");

This block is repeated in slightly different forms 3 times. It should
probably be replaced using a function or macro to return the appropriate
string based on core_parsed value.

Thanks,
/Bruce

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-stable] [PATCH v3] eal: add error check for core options
  2018-02-02 15:33     ` Bruce Richardson
@ 2018-02-05 23:11       ` Thomas Monjalon
  2018-02-22 10:10       ` O Mahony, Billy
  1 sibling, 0 replies; 8+ messages in thread
From: Thomas Monjalon @ 2018-02-05 23:11 UTC (permalink / raw)
  To: Marko Kovacevic; +Cc: Bruce Richardson, dev, anatoly.burakov, vipin.varghese

02/02/2018 16:33, Bruce Richardson:
> On Fri, Feb 02, 2018 at 02:51:28PM +0000, Marko Kovacevic wrote:
> > Error information on current core usage list, mask or map
> > were incomplete. Added states to differentiate core usage
> > and to inform user.
> > 
> > Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
> > Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v3] eal: add error check for core options
  2018-02-02 15:33     ` Bruce Richardson
  2018-02-05 23:11       ` [dpdk-stable] " Thomas Monjalon
@ 2018-02-22 10:10       ` O Mahony, Billy
  1 sibling, 0 replies; 8+ messages in thread
From: O Mahony, Billy @ 2018-02-22 10:10 UTC (permalink / raw)
  To: Richardson, Bruce, Kovacevic, Marko
  Cc: dev, Burakov, Anatoly, Varghese, Vipin, stable

> > +.. Note::
> > +    At a given instance only one core option ``--lcores``, ``-l`` or ``-c`` can be
> used.
> > +
> > +

Hi Marko,

I always found the n different way to specify cores perplexing. I always suspected they were mutually exclusive but that was far from clear from the docs and it never was important enough to me to try out the various options. Taking the time to add clear documentation makes everyone's work more efficient and less frustrating. 

So thank you and keep up the good work :)

Billy. 

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
> Sent: Friday, February 2, 2018 3:33 PM
> To: Kovacevic, Marko <marko.kovacevic@intel.com>
> Cc: dev@dpdk.org; Burakov, Anatoly <anatoly.burakov@intel.com>; Varghese,
> Vipin <vipin.varghese@intel.com>; stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v3] eal: add error check for core options
> 
> On Fri, Feb 02, 2018 at 02:51:28PM +0000, Marko Kovacevic wrote:
> > Error information on current core usage list, mask or map were
> > incomplete. Added states to differentiate core usage and to inform
> > user.
> >
> > Signed-off-by: Marko Kovacevic <marko.kovacevic@intel.com>
> > Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> 
> This is fine as-is - one comment below for future consideration.
> >
> > ---
> >
> > V3:
> >  - Changed to reflect the coding guidelines - Bruce
> >  - update the documentation for better clarity - Bruce
> >  - Added back the reviewer information - Anatoly
> >
> > V2:
> >  - Cleaned up the logging for error cases - Anatoly
> > ---
> >  doc/guides/testpmd_app_ug/run_app.rst      |  4 ++++
> >  lib/librte_eal/common/eal_common_options.c | 36
> > +++++++++++++++++++++++++++---
> >  2 files changed, 37 insertions(+), 3 deletions(-)
> >
> > diff --git a/doc/guides/testpmd_app_ug/run_app.rst
> > b/doc/guides/testpmd_app_ug/run_app.rst
> > index 46da1df..85e725f 100644
> > --- a/doc/guides/testpmd_app_ug/run_app.rst
> > +++ b/doc/guides/testpmd_app_ug/run_app.rst
> > @@ -62,6 +62,10 @@ See the DPDK Getting Started Guides for more
> information on these options.
> >      The grouping ``()`` can be omitted for single element group.
> >      The ``@`` can be omitted if cpus and lcores have the same value.
> >
> > +.. Note::
> > +    At a given instance only one core option ``--lcores``, ``-l`` or ``-c`` can be
> used.
> > +
> > +
> >  *   ``--master-lcore ID``
> >
> >      Core ID that is used as master.
> > diff --git a/lib/librte_eal/common/eal_common_options.c
> > b/lib/librte_eal/common/eal_common_options.c
> > index b6d2762..66f0868 100644
> > --- a/lib/librte_eal/common/eal_common_options.c
> > +++ b/lib/librte_eal/common/eal_common_options.c
> > @@ -57,6 +57,9 @@
> >  #include "eal_filesystem.h"
> >
> >  #define BITS_PER_HEX 4
> > +#define LCORE_OPT_LST 1
> > +#define LCORE_OPT_MSK 2
> > +#define LCORE_OPT_MAP 3
> >
> >  const char
> >  eal_short_options[] =
> > @@ -1028,7 +1031,16 @@ eal_parse_common_option(int opt, const char
> *optarg,
> >  			RTE_LOG(ERR, EAL, "invalid coremask\n");
> >  			return -1;
> >  		}
> > -		core_parsed = 1;
> > +
> > +		if (core_parsed) {
> > +			RTE_LOG(ERR, EAL, "Option -c is ignored, because (%s)
> is set!\n",
> > +				(core_parsed == LCORE_OPT_LST) ? "-l" :
> > +				(core_parsed == LCORE_OPT_MAP) ? "--lcore" :
> > +				"-c");
> 
> This block is repeated in slightly different forms 3 times. It should probably be
> replaced using a function or macro to return the appropriate string based on
> core_parsed value.
> 
> Thanks,
> /Bruce

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-02-22 10:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-01 15:39 [PATCH v1] eal: add error check for core options Marko Kovacevic
2018-02-01 16:38 ` Burakov, Anatoly
2018-02-01 17:07 ` [PATCH v2] " Marko Kovacevic
2018-02-01 17:13   ` Burakov, Anatoly
2018-02-02 14:51   ` [PATCH v3] " Marko Kovacevic
2018-02-02 15:33     ` Bruce Richardson
2018-02-05 23:11       ` [dpdk-stable] " Thomas Monjalon
2018-02-22 10:10       ` O Mahony, Billy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.