Before supporting the DPDK initialization status in DB 'dpdk-init' was
just a boolean and 'smap_get_bool', which is case-insensitive, was used
to get the value.

Current code uses simple 'strcmp' that fails to recognize values like
"True". As a result this breaks different OVS configuration tools.
For example, kolla-ansible uses 'other_config:dpdk-init=True' but OVS
is not able to recognize it leading to broken installations.

'strcasecmp' should be used instead to fix the issue.

CC: Aaron Conole <[email protected]>
Fixes: 3e52fa5644cd ("dpdk: reflect status and version in the database")
Signed-off-by: Ilya Maximets <[email protected]>
---
 lib/dpdk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/dpdk.c b/lib/dpdk.c
index 53b74fba4..d7901e175 100644
--- a/lib/dpdk.c
+++ b/lib/dpdk.c
@@ -441,8 +441,8 @@ dpdk_init(const struct smap *ovs_other_config)
     const char *dpdk_init_val = smap_get_def(ovs_other_config, "dpdk-init",
                                              "false");
 
-    bool try_only = !strcmp(dpdk_init_val, "try");
-    if (!strcmp(dpdk_init_val, "true") || try_only) {
+    bool try_only = !strcasecmp(dpdk_init_val, "try");
+    if (!strcasecmp(dpdk_init_val, "true") || try_only) {
         static struct ovsthread_once once_enable = OVSTHREAD_ONCE_INITIALIZER;
 
         if (ovsthread_once_start(&once_enable)) {
-- 
2.17.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to