[ovs-dev] [PATCH v1] netdev-dpdk: Fix flow control configuration.

Tomasz Konieczny tomaszx.konieczny at intel.com
Mon Sep 9 11:39:50 UTC 2019


Currently OVS is unable to change flow control configuration in DPDK
because new settings are being overwritten by current settings
with rte_eth_dev_flow_ctrl_get(). The fix restores correct order
of operations and at the same time does not trigger error on devices
without flow control support when flow control not requested.

Fixes: d95a8d2b0bd6 ("netdev-dpdk: Fix flow control configuration.")
Signed-off-by: Tomasz Konieczny <tomaszx.konieczny at intel.com>
---
 lib/netdev-dpdk.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index bc20d68..c02dea1 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -1856,17 +1856,19 @@ netdev_dpdk_set_config(struct netdev *netdev, const struct smap *args,
     rx_fc_en = smap_get_bool(args, "rx-flow-ctrl", false);
     tx_fc_en = smap_get_bool(args, "tx-flow-ctrl", false);
     autoneg = smap_get_bool(args, "flow-ctrl-autoneg", false);
-
     fc_mode = fc_mode_set[tx_fc_en][rx_fc_en];
-    if (dev->fc_conf.mode != fc_mode || autoneg != dev->fc_conf.autoneg) {
-        dev->fc_conf.mode = fc_mode;
-        dev->fc_conf.autoneg = autoneg;
+
+    if (fc_mode != RTE_FC_NONE || autoneg != false) {
         /* Get the Flow control configuration for DPDK-ETH */
         err = rte_eth_dev_flow_ctrl_get(dev->port_id, &dev->fc_conf);
         if (err) {
             VLOG_WARN("Cannot get flow control parameters on port "
                 DPDK_PORT_ID_FMT", err=%d", dev->port_id, err);
         }
+    }
+    if (dev->fc_conf.mode != fc_mode || autoneg != dev->fc_conf.autoneg) {
+        dev->fc_conf.mode = fc_mode;
+        dev->fc_conf.autoneg = autoneg;
         dpdk_eth_flow_ctrl_setup(dev);
     }
 
-- 
2.7.4



More information about the dev mailing list