net/mlx5: move Linux-specific functions
[dpdk.git] / drivers / net / ixgbe / ixgbe_ethdev.c
index cf5f1fe..f8a84c5 100644 (file)
@@ -2543,6 +2543,8 @@ ixgbe_flow_ctrl_enable(struct rte_eth_dev *dev, struct ixgbe_hw *hw)
        int err;
        uint32_t mflcn;
 
+       ixgbe_setup_fc(hw);
+
        err = ixgbe_fc_enable(hw);
 
        /* Not negotiated is not an error case */
@@ -4281,9 +4283,13 @@ ixgbe_dev_link_update_share(struct rte_eth_dev *dev,
 
        if (link_up == 0) {
                if (ixgbe_get_media_type(hw) == ixgbe_media_type_fiber) {
-                       intr->flags |= IXGBE_FLAG_NEED_LINK_CONFIG;
                        ixgbe_dev_wait_setup_link_complete(dev, 0);
                        if (rte_atomic32_test_and_set(&ad->link_thread_running)) {
+                               /* To avoid race condition between threads, set
+                                * the IXGBE_FLAG_NEED_LINK_CONFIG flag only
+                                * when there is no link thread running.
+                                */
+                               intr->flags |= IXGBE_FLAG_NEED_LINK_CONFIG;
                                if (rte_ctrl_thread_create(&ad->link_thread_tid,
                                        "ixgbe-link-handler",
                                        NULL,