The patch queries MLX5 port hardware if it is capable to offload IPv4 IHL field.
Signed-off-by: Gregory Etelson <getel...@nvidia.com> Acked-by: Viacheslav Ovsiienko <viachesl...@nvidia.com> --- drivers/common/mlx5/mlx5_devx_cmds.c | 6 ++++++ drivers/common/mlx5/mlx5_devx_cmds.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/drivers/common/mlx5/mlx5_devx_cmds.c b/drivers/common/mlx5/mlx5_devx_cmds.c index f5914bce32..9070691332 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.c +++ b/drivers/common/mlx5/mlx5_devx_cmds.c @@ -948,6 +948,12 @@ mlx5_devx_cmd_query_hca_attr(void *ctx, (flow_table_nic_cap, hcattr, flow_table_properties_nic_receive.log_max_ft_sampler_num); attr->pkt_integrity_match = mlx5_devx_query_pkt_integrity_match(hcattr); + attr->inner_ipv4_ihl = MLX5_GET + (flow_table_nic_cap, hcattr, + ft_field_support_2_nic_receive.inner_ipv4_ihl); + attr->outer_ipv4_ihl = MLX5_GET + (flow_table_nic_cap, hcattr, + ft_field_support_2_nic_receive.outer_ipv4_ihl); /* Query HCA offloads for Ethernet protocol. */ memset(in, 0, sizeof(in)); memset(out, 0, sizeof(out)); diff --git a/drivers/common/mlx5/mlx5_devx_cmds.h b/drivers/common/mlx5/mlx5_devx_cmds.h index f8a17b886b..034c40b49c 100644 --- a/drivers/common/mlx5/mlx5_devx_cmds.h +++ b/drivers/common/mlx5/mlx5_devx_cmds.h @@ -148,6 +148,8 @@ struct mlx5_hca_attr { uint32_t crypto_login:1; /* General obj type CRYPTO_LOGIN supported. */ uint32_t regexp_num_of_engines; uint32_t log_max_ft_sampler_num:8; + uint32_t inner_ipv4_ihl:1; + uint32_t outer_ipv4_ihl:1; uint32_t geneve_tlv_opt; uint32_t cqe_compression:1; uint32_t mini_cqe_resp_flow_tag:1; -- 2.31.1