net/mlx4_en: Change default QoS settings
authorMoni Shoua <monis@mellanox.com>
Thu, 28 Dec 2017 14:26:11 +0000 (16:26 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 28 Dec 2017 17:24:05 +0000 (12:24 -0500)
Change the default mapping between TC and TCG as follows:

Prio     |             TC/TCG
         |      from             to
         |    (set by FW)      (set by SW)
---------+-----------------------------------
0        |      0/0              0/7
1        |      1/0              0/6
2        |      2/0              0/5
3        |      3/0              0/4
4        |      4/0              0/3
5        |      5/0              0/2
6        |      6/0              0/1
7        |      7/0              0/0

These new settings cause that a pause frame for any prio stops
traffic for all prios.

Fixes: 564c274c3df0 ("net/mlx4_en: DCB QoS support")
Signed-off-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c
drivers/net/ethernet/mellanox/mlx4/en_netdev.c
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h

index 5f41dc92aa6848aafd3e3a4b7a735ad33da984dd..1a0c3bf86ead3ad66f377eae5ab0abede7f93d43 100644 (file)
@@ -310,6 +310,7 @@ static int mlx4_en_ets_validate(struct mlx4_en_priv *priv, struct ieee_ets *ets)
                }
 
                switch (ets->tc_tsa[i]) {
+               case IEEE_8021QAZ_TSA_VENDOR:
                case IEEE_8021QAZ_TSA_STRICT:
                        break;
                case IEEE_8021QAZ_TSA_ETS:
@@ -347,6 +348,10 @@ static int mlx4_en_config_port_scheduler(struct mlx4_en_priv *priv,
        /* higher TC means higher priority => lower pg */
        for (i = IEEE_8021QAZ_MAX_TCS - 1; i >= 0; i--) {
                switch (ets->tc_tsa[i]) {
+               case IEEE_8021QAZ_TSA_VENDOR:
+                       pg[i] = MLX4_EN_TC_VENDOR;
+                       tc_tx_bw[i] = MLX4_EN_BW_MAX;
+                       break;
                case IEEE_8021QAZ_TSA_STRICT:
                        pg[i] = num_strict++;
                        tc_tx_bw[i] = MLX4_EN_BW_MAX;
index 99051a294fa649f52f2b46bab94ee47d8b980ba3..21bc17fa38546f7a41a09aa6072db393000daef9 100644 (file)
@@ -3336,6 +3336,13 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
        priv->msg_enable = MLX4_EN_MSG_LEVEL;
 #ifdef CONFIG_MLX4_EN_DCB
        if (!mlx4_is_slave(priv->mdev->dev)) {
+               u8 prio;
+
+               for (prio = 0; prio < IEEE_8021QAZ_MAX_TCS; ++prio) {
+                       priv->ets.prio_tc[prio] = prio;
+                       priv->ets.tc_tsa[prio]  = IEEE_8021QAZ_TSA_VENDOR;
+               }
+
                priv->dcbx_cap = DCB_CAP_DCBX_VER_CEE | DCB_CAP_DCBX_HOST |
                        DCB_CAP_DCBX_VER_IEEE;
                priv->flags |= MLX4_EN_DCB_ENABLED;
index 2b72677eccd48f5a45aa6f0e44cc45258cf24762..7db3d0d9bfce72f03f7bca6a2613cfdebb710374 100644 (file)
@@ -479,6 +479,7 @@ struct mlx4_en_frag_info {
 #define MLX4_EN_BW_MIN 1
 #define MLX4_EN_BW_MAX 100 /* Utilize 100% of the line */
 
+#define MLX4_EN_TC_VENDOR 0
 #define MLX4_EN_TC_ETS 7
 
 enum dcb_pfc_type {