X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fnet%2Fmlx5%2Fmlx5_glue.h;h=6442f1eba8c075e9fc46f10ea36f4a0e1ad23488;hb=c916517f74b1dc3ccc866527598f8d624c3d2cc9;hp=32487eae2b51ea93b75b81991b97dab4f0ab2ae6;hpb=cbb66daa3c859a14d4e5f993fc71bf7026f2ec8a;p=dpdk.git diff --git a/drivers/net/mlx5/mlx5_glue.h b/drivers/net/mlx5/mlx5_glue.h index 32487eae2b..6442f1eba8 100644 --- a/drivers/net/mlx5/mlx5_glue.h +++ b/drivers/net/mlx5/mlx5_glue.h @@ -9,6 +9,8 @@ #include #include +#include "rte_byteorder.h" + /* Verbs headers do not support -pedantic. */ #ifdef PEDANTIC #pragma GCC diagnostic ignored "-Wpedantic" @@ -50,6 +52,7 @@ struct mlx5dv_flow_matcher; struct mlx5dv_flow_matcher_attr; struct mlx5dv_flow_action_attr; struct mlx5dv_flow_match_parameters; +struct mlx5dv_dr_flow_meter_attr; struct ibv_flow_action; enum mlx5dv_flow_action_packet_reformat_type { packet_reformat_type = 0, }; enum mlx5dv_flow_table_type { flow_table_type = 0, }; @@ -61,6 +64,25 @@ enum mlx5dv_flow_table_type { flow_table_type = 0, }; #ifndef HAVE_IBV_DEVX_OBJ struct mlx5dv_devx_obj; +struct mlx5dv_devx_umem { uint32_t umem_id; }; +#endif + +#ifndef HAVE_IBV_DEVX_ASYNC +struct mlx5dv_devx_cmd_comp; +struct mlx5dv_devx_async_cmd_hdr; +#endif + +#ifndef HAVE_MLX5DV_DR +enum mlx5dv_dr_domain_type { unused, }; +struct mlx5dv_dr_domain; +#endif + +#ifndef HAVE_MLX5DV_DR_DEVX_PORT +struct mlx5dv_devx_port; +#endif + +#ifndef HAVE_MLX5_DR_CREATE_ACTION_FLOW_METER +struct mlx5dv_dr_flow_meter_attr; #endif /* LIB_GLUE_VERSION must be updated every time this structure is modified. */ @@ -78,6 +100,8 @@ struct mlx5_glue { int (*query_device_ex)(struct ibv_context *context, const struct ibv_query_device_ex_input *input, struct ibv_device_attr_ex *attr); + int (*query_rt_values_ex)(struct ibv_context *context, + struct ibv_values_ex *values); int (*query_port)(struct ibv_context *context, uint8_t port_num, struct ibv_port_attr *port_attr); struct ibv_comp_channel *(*create_comp_channel) @@ -140,6 +164,19 @@ struct mlx5_glue { struct ibv_async_event *event); const char *(*port_state_str)(enum ibv_port_state port_state); struct ibv_cq *(*cq_ex_to_cq)(struct ibv_cq_ex *cq); + void *(*dr_create_flow_action_dest_flow_tbl)(void *tbl); + void *(*dr_create_flow_action_dest_port)(void *domain, + uint32_t port); + void *(*dr_create_flow_action_drop)(); + void *(*dr_create_flow_action_push_vlan) + (struct mlx5dv_dr_domain *domain, + rte_be32_t vlan_tag); + void *(*dr_create_flow_action_pop_vlan)(); + void *(*dr_create_flow_tbl)(void *domain, uint32_t level); + int (*dr_destroy_flow_tbl)(void *tbl); + void *(*dr_create_domain)(struct ibv_context *ctx, + enum mlx5dv_dr_domain_type domain); + int (*dr_destroy_domain)(void *domain); struct ibv_cq_ex *(*dv_create_cq) (struct ibv_context *context, struct ibv_cq_init_attr_ex *cq_attr, @@ -158,23 +195,32 @@ struct mlx5_glue { (struct ibv_context *context, struct ibv_qp_init_attr_ex *qp_init_attr_ex, struct mlx5dv_qp_init_attr *dv_qp_init_attr); - struct mlx5dv_flow_matcher *(*dv_create_flow_matcher) + void *(*dv_create_flow_matcher) (struct ibv_context *context, - struct mlx5dv_flow_matcher_attr *matcher_attr); - int (*dv_destroy_flow_matcher)(struct mlx5dv_flow_matcher *matcher); - struct ibv_flow *(*dv_create_flow)(struct mlx5dv_flow_matcher *matcher, - struct mlx5dv_flow_match_parameters *match_value, + struct mlx5dv_flow_matcher_attr *matcher_attr, + void *tbl); + void *(*dv_create_flow)(void *matcher, void *match_value, size_t num_actions, void *actions[]); void *(*dv_create_flow_action_counter)(void *obj, uint32_t offset); void *(*dv_create_flow_action_dest_ibv_qp)(void *qp); + void *(*dv_create_flow_action_dest_devx_tir)(void *tir); void *(*dv_create_flow_action_modify_header) - (struct ibv_context *ctx, size_t actions_sz, uint64_t actions[], - enum mlx5dv_flow_table_type ft_type); + (struct ibv_context *ctx, enum mlx5dv_flow_table_type ft_type, + void *domain, uint64_t flags, size_t actions_sz, + uint64_t actions[]); void *(*dv_create_flow_action_packet_reformat) - (struct ibv_context *ctx, size_t data_sz, void *data, + (struct ibv_context *ctx, enum mlx5dv_flow_action_packet_reformat_type reformat_type, - enum mlx5dv_flow_table_type ft_type); + enum mlx5dv_flow_table_type ft_type, + struct mlx5dv_dr_domain *domain, + uint32_t flags, size_t data_sz, void *data); void *(*dv_create_flow_action_tag)(uint32_t tag); + void *(*dv_create_flow_action_meter) + (struct mlx5dv_dr_flow_meter_attr *attr); + int (*dv_modify_flow_action_meter)(void *action, + struct mlx5dv_dr_flow_meter_attr *attr, uint64_t modify_bits); + int (*dv_destroy_flow)(void *flow); + int (*dv_destroy_flow_matcher)(void *matcher); struct ibv_context *(*dv_open_device)(struct ibv_device *device); struct mlx5dv_devx_obj *(*devx_obj_create) (struct ibv_context *ctx, @@ -190,6 +236,26 @@ struct mlx5_glue { int (*devx_general_cmd)(struct ibv_context *context, const void *in, size_t inlen, void *out, size_t outlen); + struct mlx5dv_devx_cmd_comp *(*devx_create_cmd_comp) + (struct ibv_context *context); + void (*devx_destroy_cmd_comp)(struct mlx5dv_devx_cmd_comp *cmd_comp); + int (*devx_obj_query_async)(struct mlx5dv_devx_obj *obj, + const void *in, size_t inlen, + size_t outlen, uint64_t wr_id, + struct mlx5dv_devx_cmd_comp *cmd_comp); + int (*devx_get_async_cmd_comp)(struct mlx5dv_devx_cmd_comp *cmd_comp, + struct mlx5dv_devx_async_cmd_hdr *resp, + size_t cmd_resp_len); + struct mlx5dv_devx_umem *(*devx_umem_reg)(struct ibv_context *context, + void *addr, size_t size, + uint32_t access); + int (*devx_umem_dereg)(struct mlx5dv_devx_umem *dv_devx_umem); + int (*devx_qp_query)(struct ibv_qp *qp, + const void *in, size_t inlen, + void *out, size_t outlen); + int (*devx_port_query)(struct ibv_context *ctx, + uint32_t port_num, + struct mlx5dv_devx_port *mlx5_devx_port); }; const struct mlx5_glue *mlx5_glue;