aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSagi Grimberg <sagig@mellanox.com>2016-02-23 03:25:23 -0500
committerDoug Ledford <dledford@redhat.com>2016-03-21 16:32:35 -0400
commit3f0393a57509c200aeecc5e3984bf1a47bffc578 (patch)
tree10f074cd3204b2f47c19ff57f54e087891c00673
parentb06e7de8a9d8d1d540ec122bbdf2face2a211634 (diff)
net/mlx5_core: Introduce offload arithmetic hardware capabilities
Define the necessary hardware structures for the offload arithmetic capabilities and read/cache them on driver load. Signed-off-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com> Reviewed-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/fw.c6
-rw-r--r--include/linux/mlx5/device.h6
-rw-r--r--include/linux/mlx5/mlx5_ifc.h31
3 files changed, 42 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fw.c b/drivers/net/ethernet/mellanox/mlx5/core/fw.c
index fe6dfd8697f4..75c7ae6a5cc4 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fw.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fw.c
@@ -145,6 +145,12 @@ int mlx5_query_hca_caps(struct mlx5_core_dev *dev)
145 return err; 145 return err;
146 } 146 }
147 147
148 if (MLX5_CAP_GEN(dev, vector_calc)) {
149 err = mlx5_core_get_caps(dev, MLX5_CAP_VECTOR_CALC);
150 if (err)
151 return err;
152 }
153
148 return 0; 154 return 0;
149} 155}
150 156
diff --git a/include/linux/mlx5/device.h b/include/linux/mlx5/device.h
index 9566b3b3b2c5..4b531c44b3c7 100644
--- a/include/linux/mlx5/device.h
+++ b/include/linux/mlx5/device.h
@@ -1219,6 +1219,8 @@ enum mlx5_cap_type {
1219 MLX5_CAP_FLOW_TABLE, 1219 MLX5_CAP_FLOW_TABLE,
1220 MLX5_CAP_ESWITCH_FLOW_TABLE, 1220 MLX5_CAP_ESWITCH_FLOW_TABLE,
1221 MLX5_CAP_ESWITCH, 1221 MLX5_CAP_ESWITCH,
1222 MLX5_CAP_RESERVED,
1223 MLX5_CAP_VECTOR_CALC,
1222 /* NUM OF CAP Types */ 1224 /* NUM OF CAP Types */
1223 MLX5_CAP_NUM 1225 MLX5_CAP_NUM
1224}; 1226};
@@ -1281,6 +1283,10 @@ enum mlx5_cap_type {
1281#define MLX5_CAP_ODP(mdev, cap)\ 1283#define MLX5_CAP_ODP(mdev, cap)\
1282 MLX5_GET(odp_cap, mdev->hca_caps_cur[MLX5_CAP_ODP], cap) 1284 MLX5_GET(odp_cap, mdev->hca_caps_cur[MLX5_CAP_ODP], cap)
1283 1285
1286#define MLX5_CAP_VECTOR_CALC(mdev, cap) \
1287 MLX5_GET(vector_calc_cap, \
1288 mdev->hca_caps_cur[MLX5_CAP_VECTOR_CALC], cap)
1289
1284enum { 1290enum {
1285 MLX5_CMD_STAT_OK = 0x0, 1291 MLX5_CMD_STAT_OK = 0x0,
1286 MLX5_CMD_STAT_INT_ERR = 0x1, 1292 MLX5_CMD_STAT_INT_ERR = 0x1,
diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h
index a3cacab22849..ad0a44b1592c 100644
--- a/include/linux/mlx5/mlx5_ifc.h
+++ b/include/linux/mlx5/mlx5_ifc.h
@@ -616,6 +616,33 @@ struct mlx5_ifc_odp_cap_bits {
616 u8 reserved_at_e0[0x720]; 616 u8 reserved_at_e0[0x720];
617}; 617};
618 618
619struct mlx5_ifc_calc_op {
620 u8 reserved_at_0[0x10];
621 u8 reserved_at_10[0x9];
622 u8 op_swap_endianness[0x1];
623 u8 op_min[0x1];
624 u8 op_xor[0x1];
625 u8 op_or[0x1];
626 u8 op_and[0x1];
627 u8 op_max[0x1];
628 u8 op_add[0x1];
629};
630
631struct mlx5_ifc_vector_calc_cap_bits {
632 u8 calc_matrix[0x1];
633 u8 reserved_at_1[0x1f];
634 u8 reserved_at_20[0x8];
635 u8 max_vec_count[0x8];
636 u8 reserved_at_30[0xd];
637 u8 max_chunk_size[0x3];
638 struct mlx5_ifc_calc_op calc0;
639 struct mlx5_ifc_calc_op calc1;
640 struct mlx5_ifc_calc_op calc2;
641 struct mlx5_ifc_calc_op calc3;
642
643 u8 reserved_at_e0[0x720];
644};
645
619enum { 646enum {
620 MLX5_WQ_TYPE_LINKED_LIST = 0x0, 647 MLX5_WQ_TYPE_LINKED_LIST = 0x0,
621 MLX5_WQ_TYPE_CYCLIC = 0x1, 648 MLX5_WQ_TYPE_CYCLIC = 0x1,
@@ -770,7 +797,8 @@ struct mlx5_ifc_cmd_hca_cap_bits {
770 u8 cd[0x1]; 797 u8 cd[0x1];
771 u8 reserved_at_22c[0x1]; 798 u8 reserved_at_22c[0x1];
772 u8 apm[0x1]; 799 u8 apm[0x1];
773 u8 reserved_at_22e[0x2]; 800 u8 vector_calc[0x1];
801 u8 reserved_at_22f[0x1];
774 u8 imaicl[0x1]; 802 u8 imaicl[0x1];
775 u8 reserved_at_231[0x4]; 803 u8 reserved_at_231[0x4];
776 u8 qkv[0x1]; 804 u8 qkv[0x1];
@@ -1940,6 +1968,7 @@ union mlx5_ifc_hca_cap_union_bits {
1940 struct mlx5_ifc_flow_table_nic_cap_bits flow_table_nic_cap; 1968 struct mlx5_ifc_flow_table_nic_cap_bits flow_table_nic_cap;
1941 struct mlx5_ifc_flow_table_eswitch_cap_bits flow_table_eswitch_cap; 1969 struct mlx5_ifc_flow_table_eswitch_cap_bits flow_table_eswitch_cap;
1942 struct mlx5_ifc_e_switch_cap_bits e_switch_cap; 1970 struct mlx5_ifc_e_switch_cap_bits e_switch_cap;
1971 struct mlx5_ifc_vector_calc_cap_bits vector_calc_cap;
1943 u8 reserved_at_0[0x8000]; 1972 u8 reserved_at_0[0x8000];
1944}; 1973};
1945 1974