net: fix amd-xgbe flow-control issue
authortangpengpeng <tangpengpeng@higon.com>
Thu, 26 Jul 2018 06:45:16 +0000 (14:45 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 26 Jul 2018 16:29:59 +0000 (09:29 -0700)
If we enable or disable xgbe flow-control by ethtool ,
it does't work.Because the parameter is not properly
assigned,so we need to adjust the assignment order
of the parameters.

Fixes: c1ce2f77366b ("amd-xgbe: Fix flow control setting logic")
Signed-off-by: tangpengpeng <tangpengpeng@higon.com>
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/amd/xgbe/xgbe-mdio.c

index 4b5d625de8f0be4edf28c72c47718ca107d3433d..8a3a60bb26888f0659c72a54d26afbfd9029843f 100644 (file)
@@ -1111,14 +1111,14 @@ static void xgbe_phy_adjust_link(struct xgbe_prv_data *pdata)
 
                if (pdata->tx_pause != pdata->phy.tx_pause) {
                        new_state = 1;
-                       pdata->hw_if.config_tx_flow_control(pdata);
                        pdata->tx_pause = pdata->phy.tx_pause;
+                       pdata->hw_if.config_tx_flow_control(pdata);
                }
 
                if (pdata->rx_pause != pdata->phy.rx_pause) {
                        new_state = 1;
-                       pdata->hw_if.config_rx_flow_control(pdata);
                        pdata->rx_pause = pdata->phy.rx_pause;
+                       pdata->hw_if.config_rx_flow_control(pdata);
                }
 
                /* Speed support */