📄 c2_wr.h
字号:
u32 remote_stag; u32 length;} __attribute__((packed));union c2wr_rdma_read { struct c2wr_rdma_read_req req; struct c2wr_ce rep;} __attribute__((packed));struct c2wr_mw_bind_req { struct c2_sq_hdr sq_hdr; u64 va; u8 stag_key; u8 pad[3]; u32 mw_stag_index; u32 mr_stag_index; u32 length; u32 flags;} __attribute__((packed));union c2wr_mw_bind { struct c2wr_mw_bind_req req; struct c2wr_ce rep;} __attribute__((packed));struct c2wr_nsmr_fastreg_req { struct c2_sq_hdr sq_hdr; u64 va; u8 stag_key; u8 pad[3]; u32 stag_index; u32 pbe_size; u32 fbo; u32 length; u32 addrs_length; /* array of paddrs (must be aligned on a 64bit boundary) */ u64 paddrs[0];} __attribute__((packed));union c2wr_nsmr_fastreg { struct c2wr_nsmr_fastreg_req req; struct c2wr_ce rep;} __attribute__((packed));struct c2wr_stag_invalidate_req { struct c2_sq_hdr sq_hdr; u8 stag_key; u8 pad[3]; u32 stag_index;} __attribute__((packed));union c2wr_stag_invalidate { struct c2wr_stag_invalidate_req req; struct c2wr_ce rep;} __attribute__((packed));union c2wr_sqwr { struct c2_sq_hdr sq_hdr; struct c2wr_send_req send; struct c2wr_send_req send_se; struct c2wr_send_req send_inv; struct c2wr_send_req send_se_inv; struct c2wr_rdma_write_req rdma_write; struct c2wr_rdma_read_req rdma_read; struct c2wr_mw_bind_req mw_bind; struct c2wr_nsmr_fastreg_req nsmr_fastreg; struct c2wr_stag_invalidate_req stag_inv;} __attribute__((packed));/* * RQ WRs */struct c2wr_rqwr { struct c2_rq_hdr rq_hdr; u8 data[0]; /* array of SGEs */} __attribute__((packed));union c2wr_recv { struct c2wr_rqwr req; struct c2wr_ce rep;} __attribute__((packed));/* * All AEs start with this header. Most AEs only need to convey the * information in the header. Some, like LLP connection events, need * more info. The union typdef c2wr_ae_t has all the possible AEs. * * hdr.context is the user_context from the rnic_open WR. NULL If this * is not affiliated with an rnic * * hdr.id is the AE identifier (eg; CCAE_REMOTE_SHUTDOWN, * CCAE_LLP_CLOSE_COMPLETE) * * resource_type is one of: C2_RES_IND_QP, C2_RES_IND_CQ, C2_RES_IND_SRQ * * user_context is the context passed down when the host created the resource. */struct c2wr_ae_hdr { struct c2wr_hdr hdr; u64 user_context; /* user context for this res. */ u32 resource_type; /* see enum c2_resource_indicator */ u32 resource; /* handle for resource */ u32 qp_state; /* current QP State */} __attribute__((packed));/* * After submitting the CCAE_ACTIVE_CONNECT_RESULTS message on the AEQ, * the adapter moves the QP into RTS state */struct c2wr_ae_active_connect_results { struct c2wr_ae_hdr ae_hdr; u32 laddr; u32 raddr; u16 lport; u16 rport; u32 private_data_length; u8 private_data[0]; /* data is in-line in the msg. */} __attribute__((packed));/* * When connections are established by the stack (and the private data * MPA frame is received), the adapter will generate an event to the host. * The details of the connection, any private data, and the new connection * request handle is passed up via the CCAE_CONNECTION_REQUEST msg on the * AE queue: */struct c2wr_ae_connection_request { struct c2wr_ae_hdr ae_hdr; u32 cr_handle; /* connreq handle (sock ptr) */ u32 laddr; u32 raddr; u16 lport; u16 rport; u32 private_data_length; u8 private_data[0]; /* data is in-line in the msg. */} __attribute__((packed));union c2wr_ae { struct c2wr_ae_hdr ae_generic; struct c2wr_ae_active_connect_results ae_active_connect_results; struct c2wr_ae_connection_request ae_connection_request;} __attribute__((packed));struct c2wr_init_req { struct c2wr_hdr hdr; u64 hint_count; u64 q0_host_shared; u64 q1_host_shared; u64 q1_host_msg_pool; u64 q2_host_shared; u64 q2_host_msg_pool;} __attribute__((packed));struct c2wr_init_rep { struct c2wr_hdr hdr;} __attribute__((packed));union c2wr_init { struct c2wr_init_req req; struct c2wr_init_rep rep;} __attribute__((packed));/* * For upgrading flash. */struct c2wr_flash_init_req { struct c2wr_hdr hdr; u32 rnic_handle;} __attribute__((packed));struct c2wr_flash_init_rep { struct c2wr_hdr hdr; u32 adapter_flash_buf_offset; u32 adapter_flash_len;} __attribute__((packed));union c2wr_flash_init { struct c2wr_flash_init_req req; struct c2wr_flash_init_rep rep;} __attribute__((packed));struct c2wr_flash_req { struct c2wr_hdr hdr; u32 rnic_handle; u32 len;} __attribute__((packed));struct c2wr_flash_rep { struct c2wr_hdr hdr; u32 status;} __attribute__((packed));union c2wr_flash { struct c2wr_flash_req req; struct c2wr_flash_rep rep;} __attribute__((packed));struct c2wr_buf_alloc_req { struct c2wr_hdr hdr; u32 rnic_handle; u32 size;} __attribute__((packed));struct c2wr_buf_alloc_rep { struct c2wr_hdr hdr; u32 offset; /* 0 if mem not available */ u32 size; /* 0 if mem not available */} __attribute__((packed));union c2wr_buf_alloc { struct c2wr_buf_alloc_req req; struct c2wr_buf_alloc_rep rep;} __attribute__((packed));struct c2wr_buf_free_req { struct c2wr_hdr hdr; u32 rnic_handle; u32 offset; /* Must match value from alloc */ u32 size; /* Must match value from alloc */} __attribute__((packed));struct c2wr_buf_free_rep { struct c2wr_hdr hdr;} __attribute__((packed));union c2wr_buf_free { struct c2wr_buf_free_req req; struct c2wr_ce rep;} __attribute__((packed));struct c2wr_flash_write_req { struct c2wr_hdr hdr; u32 rnic_handle; u32 offset; u32 size; u32 type; u32 flags;} __attribute__((packed));struct c2wr_flash_write_rep { struct c2wr_hdr hdr; u32 status;} __attribute__((packed));union c2wr_flash_write { struct c2wr_flash_write_req req; struct c2wr_flash_write_rep rep;} __attribute__((packed));/* * Messages for LLP connection setup. *//* * Listen Request. This allocates a listening endpoint to allow passive * connection setup. Newly established LLP connections are passed up * via an AE. See c2wr_ae_connection_request_t */struct c2wr_ep_listen_create_req { struct c2wr_hdr hdr; u64 user_context; /* returned in AEs. */ u32 rnic_handle; u32 local_addr; /* local addr, or 0 */ u16 local_port; /* 0 means "pick one" */ u16 pad; u32 backlog; /* tradional tcp listen bl */} __attribute__((packed));struct c2wr_ep_listen_create_rep { struct c2wr_hdr hdr; u32 ep_handle; /* handle to new listening ep */ u16 local_port; /* resulting port... */ u16 pad;} __attribute__((packed));union c2wr_ep_listen_create { struct c2wr_ep_listen_create_req req; struct c2wr_ep_listen_create_rep rep;} __attribute__((packed));struct c2wr_ep_listen_destroy_req { struct c2wr_hdr hdr; u32 rnic_handle; u32 ep_handle;} __attribute__((packed));struct c2wr_ep_listen_destroy_rep { struct c2wr_hdr hdr;} __attribute__((packed));union c2wr_ep_listen_destroy { struct c2wr_ep_listen_destroy_req req; struct c2wr_ep_listen_destroy_rep rep;} __attribute__((packed));struct c2wr_ep_query_req { struct c2wr_hdr hdr; u32 rnic_handle; u32 ep_handle;} __attribute__((packed));struct c2wr_ep_query_rep { struct c2wr_hdr hdr; u32 rnic_handle; u32 local_addr; u32 remote_addr; u16 local_port; u16 remote_port;} __attribute__((packed));union c2wr_ep_query { struct c2wr_ep_query_req req; struct c2wr_ep_query_rep rep;} __attribute__((packed));/* * The host passes this down to indicate acceptance of a pending iWARP * connection. The cr_handle was obtained from the CONNECTION_REQUEST * AE passed up by the adapter. See c2wr_ae_connection_request_t. */struct c2wr_cr_accept_req { struct c2wr_hdr hdr; u32 rnic_handle; u32 qp_handle; /* QP to bind to this LLP conn */ u32 ep_handle; /* LLP handle to accept */ u32 private_data_length; u8 private_data[0]; /* data in-line in msg. */} __attribute__((packed));/* * adapter sends reply when private data is successfully submitted to * the LLP. */struct c2wr_cr_accept_rep { struct c2wr_hdr hdr;} __attribute__((packed));union c2wr_cr_accept { struct c2wr_cr_accept_req req; struct c2wr_cr_accept_rep rep;} __attribute__((packed));/* * The host sends this down if a given iWARP connection request was * rejected by the consumer. The cr_handle was obtained from a * previous c2wr_ae_connection_request_t AE sent by the adapter. */struct c2wr_cr_reject_req { struct c2wr_hdr hdr; u32 rnic_handle; u32 ep_handle; /* LLP handle to reject */} __attribute__((packed));/* * Dunno if this is needed, but we'll add it for now. The adapter will * send the reject_reply after the LLP endpoint has been destroyed. */struct c2wr_cr_reject_rep { struct c2wr_hdr hdr;} __attribute__((packed));union c2wr_cr_reject { struct c2wr_cr_reject_req req; struct c2wr_cr_reject_rep rep;} __attribute__((packed));/* * console command. Used to implement a debug console over the verbs * request and reply queues. *//* * Console request message. It contains: * - message hdr with id = CCWR_CONSOLE * - the physaddr/len of host memory to be used for the reply. * - the command string. eg: "netstat -s" or "zoneinfo" */struct c2wr_console_req { struct c2wr_hdr hdr; /* id = CCWR_CONSOLE */ u64 reply_buf; /* pinned host buf for reply */ u32 reply_buf_len; /* length of reply buffer */ u8 command[0]; /* NUL terminated ascii string */ /* containing the command req */} __attribute__((packed));/* * flags used in the console reply. */enum c2_console_flags { CONS_REPLY_TRUNCATED = 0x00000001 /* reply was truncated */} __attribute__((packed));/* * Console reply message. * hdr.result contains the c2_status_t error if the reply was _not_ generated, * or C2_OK if the reply was generated. */struct c2wr_console_rep { struct c2wr_hdr hdr; /* id = CCWR_CONSOLE */ u32 flags;} __attribute__((packed));union c2wr_console { struct c2wr_console_req req; struct c2wr_console_rep rep;} __attribute__((packed));/* * Giant union with all WRs. Makes life easier... */union c2wr { struct c2wr_hdr hdr; struct c2wr_user_hdr user_hdr; union c2wr_rnic_open rnic_open; union c2wr_rnic_query rnic_query; union c2wr_rnic_getconfig rnic_getconfig; union c2wr_rnic_setconfig rnic_setconfig; union c2wr_rnic_close rnic_close; union c2wr_cq_create cq_create; union c2wr_cq_modify cq_modify; union c2wr_cq_destroy cq_destroy; union c2wr_pd_alloc pd_alloc; union c2wr_pd_dealloc pd_dealloc; union c2wr_srq_create srq_create; union c2wr_srq_destroy srq_destroy; union c2wr_qp_create qp_create; union c2wr_qp_query qp_query; union c2wr_qp_modify qp_modify; union c2wr_qp_destroy qp_destroy; struct c2wr_qp_connect qp_connect; union c2wr_nsmr_stag_alloc nsmr_stag_alloc; union c2wr_nsmr_register nsmr_register; union c2wr_nsmr_pbl nsmr_pbl; union c2wr_mr_query mr_query; union c2wr_mw_query mw_query; union c2wr_stag_dealloc stag_dealloc; union c2wr_sqwr sqwr; struct c2wr_rqwr rqwr; struct c2wr_ce ce; union c2wr_ae ae; union c2wr_init init; union c2wr_ep_listen_create ep_listen_create; union c2wr_ep_listen_destroy ep_listen_destroy; union c2wr_cr_accept cr_accept; union c2wr_cr_reject cr_reject; union c2wr_console console; union c2wr_flash_init flash_init; union c2wr_flash flash; union c2wr_buf_alloc buf_alloc; union c2wr_buf_free buf_free; union c2wr_flash_write flash_write;} __attribute__((packed));/* * Accessors for the wr fields that are packed together tightly to * reduce the wr message size. The wr arguments are void* so that * either a struct c2wr*, a struct c2wr_hdr*, or a pointer to any of the types * in the struct c2wr union can be passed in. */static __inline__ u8 c2_wr_get_id(void *wr){ return ((struct c2wr_hdr *) wr)->id;}static __inline__ void c2_wr_set_id(void *wr, u8 id){ ((struct c2wr_hdr *) wr)->id = id;}static __inline__ u8 c2_wr_get_result(void *wr){ return ((struct c2wr_hdr *) wr)->result;}static __inline__ void c2_wr_set_result(void *wr, u8 result){ ((struct c2wr_hdr *) wr)->result = result;}static __inline__ u8 c2_wr_get_flags(void *wr){ return ((struct c2wr_hdr *) wr)->flags;}static __inline__ void c2_wr_set_flags(void *wr, u8 flags){ ((struct c2wr_hdr *) wr)->flags = flags;}static __inline__ u8 c2_wr_get_sge_count(void *wr){ return ((struct c2wr_hdr *) wr)->sge_count;}static __inline__ void c2_wr_set_sge_count(void *wr, u8 sge_count){ ((struct c2wr_hdr *) wr)->sge_count = sge_count;}static __inline__ u32 c2_wr_get_wqe_count(void *wr){ return ((struct c2wr_hdr *) wr)->wqe_count;}static __inline__ void c2_wr_set_wqe_count(void *wr, u32 wqe_count){ ((struct c2wr_hdr *) wr)->wqe_count = wqe_count;}#endif /* _C2_WR_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -