From: Sugesh Chandran <[email protected]>

Currently devices that do not support configuring flow control via the eth_dev
API (e.g. SRIOV VFs) will fail during configuration setup when the interface
is added even if flow control is not requested. This is due to
rte_eth_dev_flow_ctrl_get() being called regardless of whether a flow
control configuration is required.

Fix this by moving the rte_eth_dev_flow_ctrl_get() call to be part of
the control block that avoids configuring flow control when no change
has occurred.

Fixes: 413c85a24353 ("netdev-dpdk: Fix failure to configure flow control at 
netdev-init.")
Reported-by: [email protected]
Signed-off-by: Sugesh Chandran <[email protected]>
Co-authored-by: Ian Stokes <[email protected]>
Signed-off-by: Ian Stokes <[email protected]>
---
 lib/netdev-dpdk.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 762209dbb..428e6e155 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -1634,16 +1634,15 @@ netdev_dpdk_set_config(struct netdev *netdev, const 
struct smap *args,
     autoneg = smap_get_bool(args, "flow-ctrl-autoneg", false);
 
     fc_mode = fc_mode_set[tx_fc_en][rx_fc_en];
-    /* Get the Flow control configuration for DPDK-ETH */
-    err = rte_eth_dev_flow_ctrl_get(dev->port_id, &dev->fc_conf);
-    if (err) {
-        VLOG_INFO("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;
+        /* Get the Flow control configuration for DPDK-ETH */
+        err = rte_eth_dev_flow_ctrl_get(dev->port_id, &dev->fc_conf);
+        if (err) {
+            VLOG_INFO("cannot get flow control parameters on port "
+                      DPDK_PORT_ID_FMT", err=%d", dev->port_id, err);
+        }
         dpdk_eth_flow_ctrl_setup(dev);
     }
 
-- 
2.13.6

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

Reply via email to