Skip to content

Commit

Permalink
net/mlx5: Geneve, Add flow table capabilities for Geneve decap with T…
Browse files Browse the repository at this point in the history
…LV options

Introduce specification for Geneve decap flow with encapsulation options
and allow creation of rules that are matching on Geneve TLV options.

Reviewed-by: Oz Shlomo <ozsh@mellanox.com>
Signed-off-by: Yevgeny Kliteynik <kliteyn@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
  • Loading branch information
Yevgeny Kliteynik authored and Saeed Mahameed committed Apr 29, 2019
1 parent 75d90e7 commit b169e64
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 7 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/fs_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ struct mlx5_ft_underlay_qp {
u32 qpn;
};

#define MLX5_FTE_MATCH_PARAM_RESERVED reserved_at_800
#define MLX5_FTE_MATCH_PARAM_RESERVED reserved_at_a00
/* Calculate the fte_match_param length and without the reserved length.
* Make sure the reserved field is the last.
*/
Expand Down
4 changes: 3 additions & 1 deletion include/linux/mlx5/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,8 @@ enum {
MLX5_MATCH_OUTER_HEADERS = 1 << 0,
MLX5_MATCH_MISC_PARAMETERS = 1 << 1,
MLX5_MATCH_INNER_HEADERS = 1 << 2,

MLX5_MATCH_MISC_PARAMETERS_2 = 1 << 3,
MLX5_MATCH_MISC_PARAMETERS_3 = 1 << 4,
};

enum {
Expand Down Expand Up @@ -1045,6 +1046,7 @@ enum mlx5_mpls_supported_fields {
};

enum mlx5_flex_parser_protos {
MLX5_FLEX_PROTO_GENEVE = 1 << 3,
MLX5_FLEX_PROTO_CW_MPLS_GRE = 1 << 4,
MLX5_FLEX_PROTO_CW_MPLS_UDP = 1 << 5,
};
Expand Down
50 changes: 45 additions & 5 deletions include/linux/mlx5/mlx5_ifc.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ enum {

enum {
MLX5_GENERAL_OBJ_TYPES_CAP_SW_ICM = (1ULL << MLX5_OBJ_TYPE_SW_ICM),
MLX5_GENERAL_OBJ_TYPES_CAP_GENEVE_TLV_OPT = (1ULL << 11),
};

enum {
MLX5_OBJ_TYPE_GENEVE_TLV_OPT = 0x000b,
};

enum {
Expand Down Expand Up @@ -339,7 +344,8 @@ struct mlx5_ifc_flow_table_fields_supported_bits {
u8 inner_tcp_flags[0x1];
u8 reserved_at_37[0x9];

u8 reserved_at_40[0x5];
u8 geneve_tlv_option_0_data[0x1];
u8 reserved_at_41[0x4];
u8 outer_first_mpls_over_udp[0x4];
u8 outer_first_mpls_over_gre[0x4];
u8 inner_first_mpls[0x4];
Expand Down Expand Up @@ -528,6 +534,12 @@ struct mlx5_ifc_fte_match_set_misc2_bits {
u8 reserved_at_1a0[0x60];
};

struct mlx5_ifc_fte_match_set_misc3_bits {
u8 reserved_at_0[0x120];
u8 geneve_tlv_option_0_data[0x20];
u8 reserved_at_140[0xc0];
};

struct mlx5_ifc_cmd_pas_bits {
u8 pa_h[0x20];

Expand Down Expand Up @@ -1247,9 +1259,13 @@ struct mlx5_ifc_cmd_hca_cap_bits {
u8 num_of_uars_per_page[0x20];

u8 flex_parser_protocols[0x20];
u8 reserved_at_560[0x20];

u8 reserved_at_580[0x3c];
u8 max_geneve_tlv_options[0x8];
u8 reserved_at_568[0x3];
u8 max_geneve_tlv_option_data_len[0x5];
u8 reserved_at_570[0x10];

u8 reserved_at_580[0x1c];
u8 mini_cqe_resp_stride_index[0x1];
u8 cqe_128_always[0x1];
u8 cqe_compression_128[0x1];
Expand Down Expand Up @@ -1283,7 +1299,9 @@ struct mlx5_ifc_cmd_hca_cap_bits {

u8 uctx_cap[0x20];

u8 reserved_at_6c0[0x140];
u8 reserved_at_6c0[0x4];
u8 flex_parser_id_geneve_tlv_option_0[0x4];
u8 reserved_at_6c8[0x138];
};

enum mlx5_flow_destination_type {
Expand Down Expand Up @@ -1341,7 +1359,9 @@ struct mlx5_ifc_fte_match_param_bits {

struct mlx5_ifc_fte_match_set_misc2_bits misc_parameters_2;

u8 reserved_at_800[0x800];
struct mlx5_ifc_fte_match_set_misc3_bits misc_parameters_3;

u8 reserved_at_a00[0x600];
};

enum {
Expand Down Expand Up @@ -4850,6 +4870,7 @@ enum {
MLX5_QUERY_FLOW_GROUP_OUT_MATCH_CRITERIA_ENABLE_MISC_PARAMETERS = 0x1,
MLX5_QUERY_FLOW_GROUP_OUT_MATCH_CRITERIA_ENABLE_INNER_HEADERS = 0x2,
MLX5_QUERY_FLOW_GROUP_IN_MATCH_CRITERIA_ENABLE_MISC_PARAMETERS_2 = 0x3,
MLX5_QUERY_FLOW_GROUP_IN_MATCH_CRITERIA_ENABLE_MISC_PARAMETERS_3 = 0x4,
};

struct mlx5_ifc_query_flow_group_out_bits {
Expand Down Expand Up @@ -9545,6 +9566,20 @@ struct mlx5_ifc_sw_icm_bits {
u8 sw_icm_start_addr[0x40];

u8 reserved_at_c0[0x140];
};

struct mlx5_ifc_geneve_tlv_option_bits {
u8 modify_field_select[0x40];

u8 reserved_at_40[0x18];
u8 geneve_option_fte_index[0x8];

u8 option_class[0x10];
u8 option_type[0x8];
u8 reserved_at_78[0x3];
u8 option_data_length[0x5];

u8 reserved_at_80[0x180];
};

struct mlx5_ifc_create_umem_in_bits {
Expand Down Expand Up @@ -9589,6 +9624,11 @@ struct mlx5_ifc_create_sw_icm_in_bits {
struct mlx5_ifc_sw_icm_bits sw_icm;
};

struct mlx5_ifc_create_geneve_tlv_option_in_bits {
struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr;
struct mlx5_ifc_geneve_tlv_option_bits geneve_tlv_opt;
};

struct mlx5_ifc_mtrc_string_db_param_bits {
u8 string_db_base_address[0x20];

Expand Down

0 comments on commit b169e64

Please sign in to comment.