]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: stmmac: set TxQ mode back to DCB after disabling CBS
authorMohammad Athari Bin Ismail <mohammad.athari.ismail@intel.com>
Thu, 4 Feb 2021 14:03:16 +0000 (22:03 +0800)
committerJakub Kicinski <kuba@kernel.org>
Sat, 6 Feb 2021 04:00:19 +0000 (20:00 -0800)
When disable CBS, mode_to_use parameter is not updated even the operation
mode of Tx Queue is changed to Data Centre Bridging (DCB). Therefore,
when tc_setup_cbs() function is called to re-enable CBS, the operation
mode of Tx Queue remains at DCB, which causing CBS fails to work.

This patch updates the value of mode_to_use parameter to MTL_QUEUE_DCB
after operation mode of Tx Queue is changed to DCB in stmmac_dma_qmode()
callback function.

Fixes: 1f705bc61aee ("net: stmmac: Add support for CBS QDISC")
Suggested-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Signed-off-by: Mohammad Athari Bin Ismail <mohammad.athari.ismail@intel.com>
Signed-off-by: Song, Yoong Siang <yoong.siang.song@intel.com>
Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Acked-by: Vinicius Costa Gomes <vinicius.gomes@intel.com>
Link: https://lore.kernel.org/r/1612447396-20351-1-git-send-email-yoong.siang.song@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c

index 8ed3b2c834a09e44cce6f4810a5484c3cd5d7943..56985542e2029701e0977415bfcc83399361f6f4 100644 (file)
@@ -324,7 +324,12 @@ static int tc_setup_cbs(struct stmmac_priv *priv,
 
                priv->plat->tx_queues_cfg[queue].mode_to_use = MTL_QUEUE_AVB;
        } else if (!qopt->enable) {
-               return stmmac_dma_qmode(priv, priv->ioaddr, queue, MTL_QUEUE_DCB);
+               ret = stmmac_dma_qmode(priv, priv->ioaddr, queue,
+                                      MTL_QUEUE_DCB);
+               if (ret)
+                       return ret;
+
+               priv->plat->tx_queues_cfg[queue].mode_to_use = MTL_QUEUE_DCB;
        }
 
        /* Port Transmit Rate and Speed Divider */