diff mbox

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

Message ID 20160728062853.43672-1-wei1.shen@intel.com
State Changes Requested
Delegated to: Daniele Di Proietto
Headers show

Commit Message

Wei Shen July 28, 2016, 6:28 a.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.

Signed-off-by: Wei Shen <wei1.shen@intel.com>
---
 lib/ovs-numa.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox

Patch

diff --git a/lib/ovs-numa.c b/lib/ovs-numa.c
index c8173e0..98885cf 100644
--- a/lib/ovs-numa.c
+++ b/lib/ovs-numa.c
@@ -551,6 +551,11 @@  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;