]> git.baikalelectronics.ru Git - kernel.git/commitdiff
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 2a5df0aa2228ad0c7743cc606841994b739bfd8d..be9e07a721937e75ca65dc206980d421574b64ac 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 94e857e390631c77e77d2f9046d5bdee6f7eec07..16bbd6cdff6c45420f2c141230fbaf814f731bda 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 ee0a67069b5727d194ba5bb870b294ce436c461c..3becad37aec873061f28806e1eeaeaf76a01fcef 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 c37208f7869f73929c1a182f95b698d8ed6382a1..15f46767342eb4fba0a48deabd1342f691407271 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 {