On 18/05/2022 15:18, [email protected] wrote:
From: Lin Huang <[email protected]>

The ALB parameters should never be negative.
So it's to use smap_get_ulonglong() or smap_get_uint() to get it properly.

Hi Lin, did you send the right version? This looks like an earlier revision resent as v4.

Fixes: 5bf84282482a ("Adding support for PMD auto load balancing")
Signed-off-by: Lin Huang <[email protected]>
---
  lib/dpif-netdev.c | 15 ++++++++-------
  1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index 21277b236..3597d7e40 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -4880,8 +4880,9 @@ dpif_netdev_set_config(struct dpif *dpif, const struct 
smap *other_config)
struct pmd_auto_lb *pmd_alb = &dp->pmd_alb; - rebalance_intvl = smap_get_int(other_config, "pmd-auto-lb-rebal-interval",
-                                   ALB_REBALANCE_INTERVAL);
+    rebalance_intvl = smap_get_ullong(other_config,
+                                      "pmd-auto-lb-rebal-interval",
+                                      ALB_REBALANCE_INTERVAL);
/* Input is in min, convert it to msec. */
      rebalance_intvl =
@@ -4894,9 +4895,9 @@ dpif_netdev_set_config(struct dpif *dpif, const struct 
smap *other_config)
          log_autolb = true;
      }
- rebalance_improve = smap_get_int(other_config,
-                                     "pmd-auto-lb-improvement-threshold",
-                                     ALB_IMPROVEMENT_THRESHOLD);
+    rebalance_improve = smap_get_uint(other_config,
+                                      "pmd-auto-lb-improvement-threshold",
+                                      ALB_IMPROVEMENT_THRESHOLD);
      if (rebalance_improve > 100) {
          rebalance_improve = ALB_IMPROVEMENT_THRESHOLD;
      }
@@ -4907,8 +4908,8 @@ dpif_netdev_set_config(struct dpif *dpif, const struct 
smap *other_config)
          log_autolb = true;
      }
- rebalance_load = smap_get_int(other_config, "pmd-auto-lb-load-threshold",
-                                  ALB_LOAD_THRESHOLD);
+    rebalance_load = smap_get_uint(other_config, "pmd-auto-lb-load-threshold",
+                                   ALB_LOAD_THRESHOLD);
      if (rebalance_load > 100) {
          rebalance_load = ALB_LOAD_THRESHOLD;
      }

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

Reply via email to