net/mlx4: Warn users of depracated QoS Firmware
authorIdo Shamay <idos@mellanox.com>
Thu, 2 Apr 2015 13:31:17 +0000 (16:31 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 2 Apr 2015 20:25:03 +0000 (16:25 -0400)
A new capability bit was introduced in the past to to differ devices
using the QoS ETS feature. The old was deprecated since then.
If driver sees device which set only the old capabilty, it will print
warning to user suggesting to upgrade the FW.

Signed-off-by: Ido Shamay <idos@mellanox.com>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/en_netdev.c
drivers/net/ethernet/mellanox/mlx4/fw.c
drivers/net/ethernet/mellanox/mlx4/main.c
include/linux/mlx4/device.h

index 2a5df0a..be9e07a 100644 (file)
@@ -2814,7 +2814,7 @@ 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)) {
-               if (mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_SET_ETH_SCHED) {
+               if (mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_ETS_CFG) {
                        dev->dcbnl_ops = &mlx4_en_dcbnl_ops;
                } else {
                        en_info(priv, "enabling only PFC DCB ops\n");
index 94e857e..16bbd6c 100644 (file)
@@ -149,6 +149,7 @@ static void dump_dev_cap_flags2(struct mlx4_dev *dev, u64 flags)
                [23] = "QP rate limiting support",
                [24] = "Ethernet Flow control statistics support",
                [25] = "Granular QoS per VF support",
+               [26] = "Port ETS Scheduler support",
        };
        int i;
 
@@ -900,6 +901,8 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
        MLX4_GET(field, outbox, QUERY_DEV_CAP_VXLAN);
        if (field & 1<<3)
                dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS;
+       if (field & (1 << 5))
+               dev_cap->flags2 |= MLX4_DEV_CAP_FLAG2_ETS_CFG;
        MLX4_GET(dev_cap->max_icm_sz, outbox,
                 QUERY_DEV_CAP_MAX_ICM_SZ_OFFSET);
        if (dev_cap->flags & MLX4_DEV_CAP_FLAG_COUNTERS)
@@ -1157,9 +1160,9 @@ int mlx4_QUERY_DEV_CAP_wrapper(struct mlx4_dev *dev, int slave,
        field &= 0x7f;
        MLX4_PUT(outbox->buf, field, QUERY_DEV_CAP_CQ_TS_SUPPORT_OFFSET);
 
-       /* For guests, disable vxlan tunneling */
+       /* For guests, disable vxlan tunneling and QoS support */
        MLX4_GET(field, outbox->buf, QUERY_DEV_CAP_VXLAN);
-       field &= 0xf7;
+       field &= 0xd7;
        MLX4_PUT(outbox->buf, field, QUERY_DEV_CAP_VXLAN);
 
        /* For guests, report Blueflame disabled */
index ee0a670..3becad3 100644 (file)
@@ -528,6 +528,14 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
                dev->caps.alloc_res_qp_mask =
                        (dev->caps.bf_reg_size ? MLX4_RESERVE_ETH_BF_QP : 0) |
                        MLX4_RESERVE_A0_QP;
+
+               if (!(dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_ETS_CFG) &&
+                   dev->caps.flags & MLX4_DEV_CAP_FLAG_SET_ETH_SCHED) {
+                       mlx4_warn(dev, "Old device ETS support detected\n");
+                       mlx4_warn(dev, "Consider upgrading device FW.\n");
+                       dev->caps.flags2 |= MLX4_DEV_CAP_FLAG2_ETS_CFG;
+               }
+
        } else {
                dev->caps.alloc_res_qp_mask = 0;
        }
index c37208f..15f4676 100644 (file)
@@ -207,6 +207,7 @@ enum {
        MLX4_DEV_CAP_FLAG2_QP_RATE_LIMIT        = 1LL <<  23,
        MLX4_DEV_CAP_FLAG2_FLOWSTATS_EN         = 1LL <<  24,
        MLX4_DEV_CAP_FLAG2_QOS_VPP              = 1LL <<  25,
+       MLX4_DEV_CAP_FLAG2_ETS_CFG              = 1LL <<  26,
 };
 
 enum {