masters-thesis/scripts/ib_verbs.py

121 lines
12 KiB
Python
Executable File

#!/usr/bin/env python3
import dict_to_table as dtt
from sys import argv
caption = "\\gls{ib} verbs"
ibverbs = {'ibv_fork_init':['int ibv_fork_init(void)','Initializes the data structure to handle \\texttt{fork()} safely.'],
'ibv_get_device_list':['struct ibv_device ** ibv_get_device_list(int *num_devices)','Returns a list, including name and other properties, of devices in the system that support the IB verbs.'],
'ibv_free_device_list':['void ibv_free_device_list(struct ibv_device **list)','Frees the list that was previously returned by \\texttt{ibv\_get\_device\_list().}'],
'ibv_get_device_name':['const char * ibv_get_device_name(struct ibv_device *device)','Returns a pointer to the name of a device returned by \\texttt{ibv\_get\_device\_list()}.'],
'ibv_get_device_guid':['uint64_t ibv_get_device_guid(struct ibv_device *device)','Returns the 64-bit \\gls{guid} of a device returned by \\texttt{ibv\_get\_device\_list()}.'],
'ibv_open_device':['struct ibv_context * ibv_open_device(struct ibv_device *device)','Opens a device returned by \\texttt{ibv\_get\_device\_list()} and returns a context that can be used with all verbs that directly modify the device.'],
'ibv_close_device':['int ibv_close_device(struct ibv_context *context)','Closes the context that was opened by \\texttt{ibv\_open\_device()}.'],
'ibv_node_type_str':['const char * ibv_node_type_str (enum ibv_node_type node_type)','Returns the type of the device: \\gls{hca}, switch, router, \\gls{rdma} enabled \\gls{nic}, or unknown.'],
'ibv_port_state_str':['const char * ibv_port_state_str (enum ibv_port_state port_state)','Returns a string that describes the enumeration \\texttt{port\_state}.'],
'ibv_query_device':['int ibv_query_device(struct ibv_context *context, struct ibv_device_attr *device_attr)','Retrieves an extensive list of attributes of a device, e.g., maximum \\gls{mr} size, maximum number of \\glspl{qp}, maximum number of \\glspl{cq}, vendor ID, node and system image \\gls{guid}, and hardware version.'],
'ibv_query_port':['int ibv_query_port(struct ibv_context *context, uint8_t port_num, struct ibv_port_attr *port_attr)','Retrieves and extensive list of attributes of a port, e.g., maximum \\gls{mtu} and message size.'],
'ibv_query_gid':['int ibv_query_gid(struct ibv_context *context, uint8_t port_num, int index, union ibv_gid *gid)','Retrieves an entry from the port\'s \\gls{gid} table.'],
'ibv_query_pkey':['int ibv_query_pkey(struct ibv_context *context, uint8_t port_num, int index, uint16_t *pkey)','Retrieves an entry from the port\'s partition key table.'],
'ibv_alloc_pd':['struct ibv_pd * ibv_alloc_pd(struct ibv_context *context)','Allocates a \\acrfull{pd} for the given context.'],
'ibv_dealloc_pd':['int ibv_dealloc_pd(struct ibv_pd *pd)','Deallocates a \\acrfull{pd}. Fails if objects are still associated with the given \\gls{pd}.'],
'ibv_create_cq':['struct ibv_cq * ibv_create_cq(struct ibv_context *context, int cqe, void *cq_context, struct ibv_comp_channel *channel, int comp_vector)', 'Creates a \\acrfull{cq}. The variable \\texttt{cq\_context} is user defined and is returned as parameter in \\texttt{ibv\_get\_cq\_event()} if a \\acrfull{cc} is used.'],
'ibv_resize_cq':['int ibv_resize_cq(struct ibv_cq *cq, int cqe)', 'Resizes the \\acrfull{cq}. The new size must be bigger than the number of \\glspl{cqe} present in the \\gls{cq}.'],
'ibv_destroy_cq':['int ibv_destroy_cq(struct ibv_cq *cq)', 'Destroys an \\acrfull{cq}. This will only succeed if no more \\gls{qp} is associated with the \\gls{cq}.'],
'ibv_create_comp_channel':['struct ibv_comp_channel *ibv_create_comp_channel(struct ibv_context *context)', 'Creates a new, unbound \\acrfull{cc}.'],
'ibv_destroy_comp_channel':['int ibv_destroy_comp_channel(struct ibv_comp_channel *channel)', 'Destroys an \\acrfull{cc}. This will only succeed if no more \\gls{cq} is associated with the \\gls{cc}.'],
'ibv_reg_mr':['struct ibv_mr * ibv_reg_mr(struct ibv_pd *pd, void *addr, size_t length, enum ibv_access_flags access)', 'Registers a \\acrfull{mr} associated with a \\gls{pd}. The returned struct \\texttt{ibv\_mr} contains the local and remote key.'],
'ibv_dereg_mr':['int ibv_dereg_mr(struct ibv_mr *mr)', 'Destroys a \\acrfull{mr}. This will only succeed if no more \\glspl{mw} are associated to the \\gls{mr}.'],
'ibv_create_qp':['struct ibv_qp * ibv_create_qp(struct ibv_pd *pd, struct ibv_qp_init_attr *qp_init_attr)', 'Creates a \\acrfull{qp} in the \\textit{reset} state. All desired initial attributes must be placed in \\texttt{*qp\_init\_attr}.'],
'ibv_destroy_qp':['int ibv_destroy_qp(struct ibv_qp *qp)', 'Destroys a \\acrfull{qp}.'],
'ibv_create_srq':['struct ibv_srq * ibv_create_srq(struct ibv_pd *pd, struct ibv_srq_init_attr *srq_init_attr)', 'Creates a \\acrfull{srq}. All desired initial attributes must be placed in \\texttt{*srq\_init\_attr}. An \\acrshort{srq} serves as \\gls{rq} for several \\glspl{qp} and must be passed to \\texttt{ibv\_create\_qp()} with \\texttt{*qp\_init\_attr}. It is used in order to save resources.'],
'ibv_modify_srq':['int ibv_modify_srq (struct ibv_srq *srq, struct ibv_srq_attr *srq_attr, int srq_attr_mask)', 'Modifies the attributes which are specified in the bitmask \\texttt{srq\_attr\_mask} with the values in \\texttt{*srq\_attr}.'],
'ibv_destroy_srq':['int ibv_destroy_srq(struct ibv_srq *srq)', 'Destroys a \\acrfull{srq}. This will only succeed if no more \\gls{qp} is associated with this \\acrfull{srq}.'],
'ibv_open_xrc_domain':['struct ibv_xrc_domain * ibv_open_xrc_domain(struct ibv_context *context, int fd, int oflag)', 'Opens and \\acrfull{xrc} domain for the device.'],
'ibv_create_xrc_srq':['struct ibv_srq * ibv_create_xrc_srq(struct ibv_pd *pd, struct ibv_xrc_domain *xrc_domain, struct ibv_cq *xrc_cq, struct ibv_srq_init_attr *srq_init_attr)', 'Creates an \\acrfull{xrc} \\acrfull{srq}.'],
'ibv_close_xrc_domain':['int ibv_close_xrc_domain(struct ibv_xrc_domain *d)', 'Closes an \\acrfull{xrc} domain. This will only succeed if no more \\gls{qp} or \\acrshort{srq} is associated with the \\acrshort{xrc}.'],
'ibv_create_xrc_rcv_qp':['int ibv_create_xrc_rcv_qp(struct ibv_qp_init_attr *init_attr, uint32_t *xrc_rcv_qpn)', 'Creates an \\acrfull{xrc} \\acrfull{qp}.'],
'ibv_modify_xrc_rcv_qp':['int ibv_modify_xrc_rcv_qp(struct ibv_xrc_domain *xrc_domain, uint32_t xrc_qp_num, struct ibv_qp_attr *attr, int attr_mask)', 'Modifies the attributes which are specified in the bitmask \\texttt{attr\_mask} with the values in \\texttt{*attr}. The \\gls{qp} is then transitioned through \\textit{reset}$\\,\\to\\,$\\textit{init}$\\,\\to\\,$\\textit{started}.'],
'ibv_reg_xrc_rcv_qp':['int ibv_reg_xrc_rcv_qp(struct ibv_xrc_domain *xrc_domain, uint32_t xrc_qp_num)', 'Registers a user process with the defined \\acrfull{xrc} receive \\acrfull{qp}.'],
'ibv_unreg_xrc_rcv_qp':['int ibv_unreg_xrc_rcv_qp(struct ibv_xrc_domain *xrc_domain, uint32_t xrc_qp_num)', 'Unregisters a user process from the defined \\acrfull{xrc} receive \\acrfull{qp}.'],
'ibv_create_ah':['struct ibv_ah *ibv_create_ah(struct ibv_pd *pd, struct ibv_ah_attr *attr)', 'Creates an \\acrfull{ah} out of \\gls{ah} attributes. These can be manually created or acquired via \\texttt{rdma\_get\_cm\_event()}.'],
'ibv_destroy_ah':['int ibv_destroy_ah(struct ibv_ah *ah)', 'Destroys an \\acrfull{ah}.'],
'ibv_modify_qp':['int ibv_modify_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr, enum ibv_qp_attr_mask attr_mask)', 'Modifies the attributes and the state of a \\acrfull{qp}. Attribute changes and transitions are subject to strict rules that can be found in~\\cite{mellanox2015RDMA} and~\\cite{infinibandvol1}.'],
'ibv_query_qp':['int ibv_query_qp(struct ibv_qp *qp, struct ibv_qp_attr *attr, enum ibv_qp_attr_mask attr_mask, struct ibv_qp_init_attr *init_attr)', 'Retrieves the attributes which are specified in the bitmask \\texttt{attr\_mask} from the \\acrfull{qp}.'],
'ibv_query_srq':['int ibv_query_srq(struct ibv_srq *srq, struct ibv_srq_attr *srq_attr)', 'Similar to \\texttt{ibv\_query\_qp()}, but for a \\acrfull{srq}.'],
'ibv_query_xrc_rcv_qp':['int ibv_query_xrc_rcv_qp(struct ibv_xrc_domain *xrc_domain, uint32_t xrc_qp_num, struct ibv_qp_attr *attr, int attr_mask, struct ibv_qp_init_attr *init_attr)', 'Similar to \\texttt{ibv\_query\_qp()}, but for an \\acrfull{xrc}.'],
'ibv_post_recv':['int ibv_post_recv(struct ibv_qp *qp, struct ibv_recv_wr *wr, struct ibv_recv_wr **bad_wr)', 'Submits a linked list of \\acrfullpl{wr} to the \\acrfull{rq}. Processing will stop on the first error and the erroneous \\gls{wr} will be returned via \\texttt{**bad\_wr}. At least one \\gls{wr} must be placed in the \\gls{rq} to transition to the state \\textit{ready to receive}.'],
'ibv_post_send':['int ibv_post_send(struct ibv_qp *qp, struct ibv_send_wr *wr, struct ibv_send_wr **bad_wr)', 'Submits a linked list of \\acrfullpl{wr} to the \\acrfull{sq}. All communication is initialized through this function. Processing will stop on the first error and the erroneous \\gls{wr} will be returned via \\texttt{**bad\_wr}.'],
'ibv_post_srq_recv':['int ibv_post_srq_recv(struct ibv_srq *srq, struct ibv_recv_wr *recv_wr, struct ibv_recv_wr **bad_recv_wr)', 'Submits a linked list of \\acrfullpl{wr} to a given \\acrfull{srq}. This function is similar to \\texttt{ibv\_post\_recv()}.'],
'ibv_req_notify_cq':['int ibv_req_notify_cq(struct ibv_cq *cq, int solicited_only)', 'Informs the \\acrfull{cq} about the fact that it must send completion events to a \\acrfull{cc}. This works only for \\acrfullpl{cqe} that were not yet present in the \\gls{cq} when this function was called.'],
'ibv_get_cq_event':['int ibv_get_cq_event(struct ibv_comp_channel *channel, struct ibv_cq **cq, void **cq_context)', 'Retrieves notifications from a \\acrfull{cc} that is bound to one or more \\glspl{cq}. This function is a blocking function.'],
'ibv_ack_cq_events':['void ibv_ack_cq_events(struct ibv_cq *cq, unsigned int nevents)', 'Acknowledges events from \\texttt{ibv\_get\_cq\_event()}. Events must be acknowledged before associated objects can be destroyed. This is done in order to avoid races. Calling this function is relatively expensive and it is possible to ackknowledge multiple events in one call.'],
'ibv_poll_cq':['int ibv_poll_cq(struct ibv_cq *cq, int num_entries, struct ibv_wc *wc)', 'Retrieves \\acrfullpl{cqe} from the \\acrfull{cq}.'],
'ibv_init_ah_from_wc':['int ibv_init_ah_from_wc(struct ibv_context *context, uint8_t port_num, struct ibv_wc *wc, struct ibv_grh *grh, struct ibv_ah_attr *ah_attr)', 'Initializes an \\acrfull{ah} in \\texttt{*ah\_attr}, based on a \\gls{cqe} of a received message.'],
'ibv_create_ah_from_wc':['struct ibv_ah * ibv_create_ah_from_wc(struct ibv_pd *pd, struct ibv_wc *wc, struct ibv_grh *grh, uint8_t port_num)', 'Combines \\texttt{ibv\_init\_ah\_from\_wc()} and \\texttt{ibv\_create\_ah()}.'],
'ibv_attach_mcast':['int ibv_attach_mcast(struct ibv_qp *qp, const union ibv_gid *gid, uint16_t lid)', 'Attaches a \\gls{ud} \\gls{qp} to a multicast group with a given \\gls{gid} and \\gls{lid}.'],
'ibv_detach_mcast':['int ibv_detach_mcast(struct ibv_qp *qp, const union ibv_gid *gid, uint16_t lid)', 'Detaches a \\gls{ud} \\gls{qp} from the multicast group with a given \\gls{gid} and \\gls{lid}.'],
'ibv_get_async_event':['int ibv_get_async_event(struct ibv_context *context, struct ibv_async_event *event)', 'Retrieves asynchronous events from the devices. This function is a blocking function.'],
'ibv_ack_async_event':['void ibv_ack_async_event(struct ibv_async_event *event)', 'Acknowledges events from \\texttt{ibv\_get\_async\_event()}. Events must be acknowledged before associated objects can be destroyed. This is done in order to avoid races.'],
'ibv_event_type_str':['const char * ibv_event_type_str(enum ibv_event_type event_type)', 'Translates an enumeration that is included in an event returned by \\texttt{ibv\_get\_async\_event()} into a string.']
}
dtt.print_file(ibverbs, argv[0], caption, 1000)