X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fmlx5%2Fmlx5.h;h=2004479e016c0c08ddaa476bb72c78fdb6c461c1;hb=f3faf9ea1185;hp=1850cf94abc0365c03a8351893f3fb5dc92d4493;hpb=9dbaf7eef6e17113f5c681c3c4fcee6bcda4b5f0;p=dpdk.git diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 1850cf94ab..2004479e01 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -36,43 +36,22 @@ #include #include #include +#include +#include #include "mlx5_defs.h" #include "mlx5_utils.h" -#include "mlx5_mr.h" #include "mlx5_autoconf.h" -/* Request types for IPC. */ -enum mlx5_mp_req_type { - MLX5_MP_REQ_VERBS_CMD_FD = 1, - MLX5_MP_REQ_CREATE_MR, - MLX5_MP_REQ_START_RXTX, - MLX5_MP_REQ_STOP_RXTX, - MLX5_MP_REQ_QUEUE_STATE_MODIFY, -}; - -struct mlx5_mp_arg_queue_state_modify { - uint8_t is_wq; /* Set if WQ. */ - uint16_t queue_id; /* DPDK queue ID. */ - enum ibv_wq_state state; /* WQ requested state. */ -}; -/* Pameters for IPC. */ -struct mlx5_mp_param { - enum mlx5_mp_req_type type; - int port_id; - int result; - RTE_STD_C11 - union { - uintptr_t addr; /* MLX5_MP_REQ_CREATE_MR */ - struct mlx5_mp_arg_queue_state_modify state_modify; - /* MLX5_MP_REQ_QUEUE_STATE_MODIFY */ - } args; +enum mlx5_ipool_index { + MLX5_IPOOL_DECAP_ENCAP = 0, /* Pool for encap/decap resource. */ + MLX5_IPOOL_PUSH_VLAN, /* Pool for push vlan resource. */ + MLX5_IPOOL_TAG, /* Pool for tag resource. */ + MLX5_IPOOL_PORT_ID, /* Pool for port id resource. */ + MLX5_IPOOL_MAX, }; -/** Request timeout for IPC. */ -#define MLX5_MP_REQ_TIMEOUT_SEC 5 - /** Key string for IPC. */ #define MLX5_MP_NAME "net_mlx5_mp" @@ -229,8 +208,6 @@ struct mlx5_verbs_alloc_ctx { const void *obj; /* Pointer to the DPDK object. */ }; -LIST_HEAD(mlx5_mr_list, mlx5_mr); - /* Flow drop context necessary due to Verbs API. */ struct mlx5_drop { struct mlx5_hrxq *hrxq; /* Hash Rx queue queue. */ @@ -441,13 +418,7 @@ struct mlx5_ibv_shared { struct ibv_device_attr_ex device_attr; /* Device properties. */ LIST_ENTRY(mlx5_ibv_shared) mem_event_cb; /**< Called by memory event callback. */ - struct { - uint32_t dev_gen; /* Generation number to flush local caches. */ - rte_rwlock_t rwlock; /* MR Lock. */ - struct mlx5_mr_btree cache; /* Global MR cache table. */ - struct mlx5_mr_list mr_list; /* Registered MR list. */ - struct mlx5_mr_list mr_free_list; /* Freed MR list. */ - } mr; + struct mlx5_mr_share_cache share_cache; /* Shared DV/DR flow data section. */ pthread_mutex_t dv_mutex; /* DV context mutex. */ uint32_t dv_meta_mask; /* flow META metadata supported mask. */ @@ -461,14 +432,14 @@ struct mlx5_ibv_shared { /* Direct Rules tables for FDB, NIC TX+RX */ void *esw_drop_action; /* Pointer to DR E-Switch drop action. */ void *pop_vlan_action; /* Pointer to DR pop VLAN action. */ - LIST_HEAD(encap_decap, mlx5_flow_dv_encap_decap_resource) encaps_decaps; + uint32_t encaps_decaps; /* Encap/decap action indexed memory list. */ LIST_HEAD(modify_cmd, mlx5_flow_dv_modify_hdr_resource) modify_cmds; struct mlx5_hlist *tag_table; - LIST_HEAD(port_id_action_list, mlx5_flow_dv_port_id_action_resource) - port_id_action_list; /* List of port ID actions. */ - LIST_HEAD(push_vlan_action_list, mlx5_flow_dv_push_vlan_action_resource) - push_vlan_action_list; /* List of push VLAN actions. */ + uint32_t port_id_action_list; /* List of port ID actions. */ + uint32_t push_vlan_action_list; /* List of push VLAN actions. */ struct mlx5_flow_counter_mng cmng; /* Counters management structure. */ + struct mlx5_indexed_pool *ipool[MLX5_IPOOL_MAX]; + /* Memory Pool for mlx5 flow resources. */ /* Shared interrupt handler section. */ pthread_mutex_t intr_mutex; /* Interrupt config mutex. */ uint32_t intr_cnt; /* Interrupt handler reference counter. */ @@ -577,6 +548,7 @@ struct mlx5_priv { #endif uint8_t skip_default_rss_reta; /* Skip configuration of default reta. */ uint8_t fdb_def_rule; /* Whether fdb jump to table 1 is configured. */ + struct mlx5_mp_id mp_id; /* ID of a multi-process process */ }; #define PORT_ID(priv) ((priv)->dev_data->port_id) @@ -777,16 +749,10 @@ int mlx5_flow_dev_dump(struct rte_eth_dev *dev, FILE *file, struct rte_flow_error *error); /* mlx5_mp.c */ +int mlx5_mp_primary_handle(const struct rte_mp_msg *mp_msg, const void *peer); +int mlx5_mp_secondary_handle(const struct rte_mp_msg *mp_msg, const void *peer); void mlx5_mp_req_start_rxtx(struct rte_eth_dev *dev); void mlx5_mp_req_stop_rxtx(struct rte_eth_dev *dev); -int mlx5_mp_req_mr_create(struct rte_eth_dev *dev, uintptr_t addr); -int mlx5_mp_req_verbs_cmd_fd(struct rte_eth_dev *dev); -int mlx5_mp_req_queue_state_modify(struct rte_eth_dev *dev, - struct mlx5_mp_arg_queue_state_modify *sm); -int mlx5_mp_init_primary(void); -void mlx5_mp_uninit_primary(void); -int mlx5_mp_init_secondary(void); -void mlx5_mp_uninit_secondary(void); /* mlx5_socket.c */