RDMA_CM API

4.1.Event Channel Operations

4.1.1.rdma_create_event_channel

        Template:
        struct rdma_event_channel * rdma_create_event_channel (void)
        Input Parameters:
        void
                no arguments
        Output Parameters:
        none
        Return Value:
        A pointer to the created event channel, or NULL if the request fails. On  failure, errno will be set to indicate the failure reason.
Description:
        Opens an event channel used to report communication events. Asynchronous events are reported  to users through event channels.
        Notes:
        Event channels are used to direct all events on an rdma_cm_id. For many clients, a single event  channel may be sufficient, however, when managing a large number of connections or cm_ids, users may find it useful to direct events for different cm_ids to different channels for processing.
        All created event channels must be destroyed by calling rdma_destroy_event_channel. Users  should call rdma_get_cm_event to retrieve events on an event channel.
        Each event channel is mapped to a file descriptor. The associated file descriptor can be used and  manipulated like any other fd to change its behavior. Users may make the fd non-blocking, poll  or select the fd, etc.
        
        See Also:
        rdma_cm, rdma_get_cm_event, rdma_destroy_event_channel

 4.1.2.rdma_destroy_event_channel     

        Template:
        void rdma_destroy_event_channel (struct rdma_event_channel *channel)
        Input Parameters:
        channel
                The communication channel to destroy.
        Output Parameters:
        none
        Return Value:
        none
Description:
        Close an event communication channel. Release all resources associated with an event channel  and closes the associated file descriptor.
Notes:
        All rdma_cm_id's associated with the event channel must be destroyed, and all returned events  must be acked before calling this function.
See Also:
        rdma_create_event_channel, rdma_get_cm_event, rdma_ack_cm_event

4.2.Connection Manager (CM) ID Operations

 4.2.1.rdma_create_id        

        Template:
        int rdma_create_id (struct rdma_event_channel *channel, struct rdma_cm_id **id, void *context, enum rdma_port_space ps)
        Input Parameters:
        channel
                The communication channel that events associated with the allocated rdma_cm_id will be reported on.
        id
                A reference where the allocated communication identifier will be returned.
        context
                User specified context associated with the rdma_cm_id.
        ps
                RDMA port space.
        Output Parameters:
        None
        
        Return Value:
        0 on success, -1 on error. If the call fails, errno will be set to indicate the reason for the failure.
        Description:
        Creates an identifier that is used to track communication information.
Notes:
        rdma_cm_ids are conceptually equivalent to a socket for RDMA communication. The difference is that RDMA communication requires explicitly binding to a specified RDMA device before communication can occur, and most operations are asynchronous in nature. Communication events on an rdma_cm_id are reported through the associated event channel. Users must release the rdma_cm_id by calling rdma_destroy_id.
        PORT SPACES Details of the services provided by the different port spaces are outlined below.
        RDMA_PS_TCP
                Provides reliable, connection-oriented QP communication.
                Unlike TCP, the RDMA port space provides message, not stream, based
communication.
        RDMA_PS_UDP
                Provides unreliable, connection less QP communication.
                Supports both datagram and multicast communication.
See Also:
        rdma_cm, rdma_create_event_channel, rdma_destroy_id, rdma_get_devices, rdma_bind_addr, rdma_resolve_addr, rdma_connect, rdma_listen, rdma_set_option

4.2.2.rdma_destroy_id

        Template:
        int rdma_destroy_id (struct rdma_cm_id *id)
        Input Parameters:
        id
                The communication identifier to destroy.
        Output Parameters:
        None
        Return Value:
        0 on success, -1 on error. If the call fails, errno will be set to indicate the reason for the failure.
Description:
        Destroys the specified rdma_cm_id and cancels any outstanding asynchronous operation.
Notes:
        Users must free any associated QP with the rdma_cm_id before calling this routine and ack an related events.
See Also:
        rdma_create_id, rdma_destroy_qp, rdma_ack_cm_event

4.2.3.rdma_migrate_id

        Template:
        int rdma_migrate_id (struct rdma_cm_id *id, struct rdma_event_channel *channel)
        Input Parameters:
        id
                An existing RDMA communication identifier to migrate channel The new event channel for rdma_cm_id events
        Output Parameters:
        None
        Return Value:
        0 on success, -1 on error. If the call fails, errno will be set to indicate the reason for the failure.
Description:
        rdma_migrate_id migrates a communication identifier to a different event channel and moves any pending events associated with the rdma_cm_id to the new channel.
No polling for events on the rdma_cm_id's current channel nor running of any routines on the rdma_cm_id should be done while migrating between channels. rdma_migrate_id will block while there are any unacknowledged events on the current event channel.
        If the channel parameter is NULL, then the specified rdma_cm_id will be placed into synchronous operation mode. All calls on the id will block until the operation completes.

4.2.4.rdma_set_option

        Template:

        int rdma_set_option(struct rdma_cm_id *id, int level, int optname, void *optval, size_t optlen)

        Input Parameters:
        id
                RDMA communication identifier
        level
                Protocol level of the option to set
        optname
                Name of the option to set
        optval
                Reference to the option data
        optlen
                The size of the option data (optval) buffer
        Output Parameters:
        None
        Return Value:
        0 on success, -1 on error. If the call fails, errno will be set to indicate the reason for the failure.
Description:
        rdma_set_option sets communication options for an rdma_cm_id. Option levels and details may be found in the enums in the relevant header files.

 

猜你喜欢

转载自blog.csdn.net/x13262608581/article/details/125155345
API