diff mbox

[ovs-dev] ovs-numa: fixed cmask parse with 0x prefix

Message ID 1469570208-24192-1-git-send-email-wei1.shen@intel.com
State Changes Requested
Delegated to: Daniele Di Proietto
Headers show

Commit Message

Wei Shen July 26, 2016, 9:56 p.m. UTC
Fixed a minor bug that would print out a confusing warning about core mask,
"ovs_numa|WARN|Invalid cpu mask: x", when dpdl-lcore-mask has 0x prefix, e.g.
0x123, which is the convention used in INSTALL.DPDK.md.
---
 lib/ovs-numa.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Daniele Di Proietto July 27, 2016, 9:28 p.m. UTC | #1
Thanks for the patch.

We never accepted the 0x prefix for pmd-cpu-mask, but I guess there's no
harm in doing it and it might make user's life easier.

We always use braces, even for single statement, please read CodingStyle.md

https://github.com/openvswitch/ovs/blob/master/CodingStyle.md#statements

I cannot merge this unless you provide a signoff, the details and the
meaning is explained here:

https://github.com/openvswitch/ovs/blob/master/CONTRIBUTING.md#developers-certificate-of-origin

Thanks,

Daniele

2016-07-26 14:56 GMT-07:00 Wei Shen <wei1.shen@intel.com>:

> Fixed a minor bug that would print out a confusing warning about core mask,
> "ovs_numa|WARN|Invalid cpu mask: x", when dpdl-lcore-mask has 0x prefix,
> e.g.
> 0x123, which is the convention used in INSTALL.DPDK.md.
> ---
>  lib/ovs-numa.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/lib/ovs-numa.c b/lib/ovs-numa.c
> index c8173e0..c1938eb 100644
> --- a/lib/ovs-numa.c
> +++ b/lib/ovs-numa.c
> @@ -551,6 +551,10 @@ ovs_numa_set_cpu_mask(const char *cmask)
>          return;
>      }
>
> +    /* Skip 0x if supplied in the cmask */
> +    if (!strncmp(cmask, "0x", 2))
> +        cmask += 2;
> +
>      for (i = strlen(cmask) - 1; i >= 0; i--) {
>          char hex = toupper((unsigned char)cmask[i]);
>          int bin, j;
> --
> 2.5.5
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
>
diff mbox

Patch

diff --git a/lib/ovs-numa.c b/lib/ovs-numa.c
index c8173e0..c1938eb 100644
--- a/lib/ovs-numa.c
+++ b/lib/ovs-numa.c
@@ -551,6 +551,10 @@  ovs_numa_set_cpu_mask(const char *cmask)
         return;
     }
 
+    /* Skip 0x if supplied in the cmask */
+    if (!strncmp(cmask, "0x", 2))
+        cmask += 2;
+
     for (i = strlen(cmask) - 1; i >= 0; i--) {
         char hex = toupper((unsigned char)cmask[i]);
         int bin, j;