net/mlx5: Report enhanced capabilities for IPoIB
authorYishai Hadas <yishaih@mellanox.com>
Thu, 8 Jun 2017 13:15:10 +0000 (16:15 +0300)
committerDoug Ledford <dledford@redhat.com>
Mon, 24 Jul 2017 14:40:46 +0000 (10:40 -0400)
Report 'ipoib_enhanced_offloads' capabilities from
the core layer, it will be used in the next patch from this series.

Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Reviewed-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/net/ethernet/mellanox/mlx5/core/fw.c
include/linux/mlx5/device.h

index fa33d59ab4854de08a674058a76dcdbd60b538a5..2c71557d1cee724c6b12b2033133060661dabbfc 100644 (file)
@@ -120,6 +120,12 @@ int mlx5_query_hca_caps(struct mlx5_core_dev *dev)
                        return err;
        }
 
+       if (MLX5_CAP_GEN(dev, ipoib_enhanced_offloads)) {
+               err = mlx5_core_get_caps(dev, MLX5_CAP_IPOIB_ENHANCED_OFFLOADS);
+               if (err)
+                       return err;
+       }
+
        if (MLX5_CAP_GEN(dev, pg)) {
                err = mlx5_core_get_caps(dev, MLX5_CAP_ODP);
                if (err)
index a47b9ab9f2c947735beb4b3d75760541fe39135f..c13d71deaecac1c9e78183740debd6141a4dc732 100644 (file)
@@ -973,7 +973,7 @@ enum mlx5_cap_type {
        MLX5_CAP_ATOMIC,
        MLX5_CAP_ROCE,
        MLX5_CAP_IPOIB_OFFLOADS,
-       MLX5_CAP_EOIB_OFFLOADS,
+       MLX5_CAP_IPOIB_ENHANCED_OFFLOADS,
        MLX5_CAP_FLOW_TABLE,
        MLX5_CAP_ESWITCH_FLOW_TABLE,
        MLX5_CAP_ESWITCH,
@@ -1016,6 +1016,10 @@ enum mlx5_mcam_feature_groups {
        MLX5_GET(per_protocol_networking_offload_caps,\
                 mdev->caps.hca_max[MLX5_CAP_ETHERNET_OFFLOADS], cap)
 
+#define MLX5_CAP_IPOIB_ENHANCED(mdev, cap) \
+       MLX5_GET(per_protocol_networking_offload_caps,\
+                mdev->caps.hca_cur[MLX5_CAP_IPOIB_ENHANCED_OFFLOADS], cap)
+
 #define MLX5_CAP_ROCE(mdev, cap) \
        MLX5_GET(roce_cap, mdev->caps.hca_cur[MLX5_CAP_ROCE], cap)