Motr
M0
|
#include <net.h>
Network transport operations. The network domain mutex must be held to invoke these methods, unless explicitly stated otherwise.
void(* xo_bev_deliver_all) (struct m0_net_transfer_mc *tm) |
Invokes m0_net_buffer_event_post() for all pending events.
Invoked by the m0_net_buffer_event_deliver_all() subroutine. Optional if the synchronous buffer event delivery feature is not supported.
As buffer event delivery takes place without holding the transfer machine mutex, the transport should protect the invocation of this subroutine from synchronous termination of the transfer machine.
int(* xo_bev_deliver_sync) (struct m0_net_transfer_mc *tm) |
Invoked by the m0_net_buffer_event_deliver_synchronously() subroutine to request the transport to disable automatic delivery of buffer events. The method is optional and need not be specified if this support is not available. If supported, then the xo_bev_deliver_all() and the xo_bev_pending() operations must be provided.
void(* xo_bev_notify) (struct m0_net_transfer_mc *tm, struct m0_chan *chan) |
Arranges for the given channel to be signalled when new event arrives.
Invoked by the m0_net_buffer_event_notify() subroutine. Optional if the synchronous buffer event delivery feature is not supported.
bool(* xo_bev_pending) (struct m0_net_transfer_mc *tm) |
Returns true, iff there are pending events.
Invoked by the m0_net_buffer_event_pending() subroutine. Optional if the synchronous buffer event delivery feature is not supported.
int(* xo_buf_add) (struct m0_net_buffer *nb) |
Initiates an operation on a buffer on the transfer machine's queues.
In the case of buffers added to the M0_NET_QT_ACTIVE_BULK_RECV or M0_NET_QT_ACTIVE_BULK_SEND queues, the method should validate that the buffer size or data length meet the size requirements encoded within the network buffer descriptor m0_net_buffer::nb_desc.
In the case of the buffers added to the M0_NET_QT_PASSIVE_BULK_RECV or M0_NET_QT_PASSIVE_BULK_SEND queues, the method should set the network buffer descriptor in the specified buffer (m0_net_buffer::nb_desc).
The M0_NET_BUF_IN_USE flag will be cleared before invoking the method. This allows the transport to use this flag to defer operations until later, which is useful if buffers are added during transfer machine state transitions.
The M0_NET_BUF_QUEUED flag and the nb_add_time field will be set prior to calling the method.
Serialized using the transfer machine mutex.
void(* xo_buf_del) (struct m0_net_buffer *nb) |
Cancels an operation involving a buffer. The method should cancel the operation involving use of the buffer, as described by the value of the m0_net_buffer.nb_qtype field. The M0_NET_BUF_CANCELLED flag should be set in buffers whose operations get cancelled, so m0_net_buffer_event_post() can enforce the right error status. Serialized using the transfer machine mutex.
void(* xo_buf_deregister) (struct m0_net_buffer *nb) |
Deregisters the buffer from the transfer machine.
int(* xo_buf_register) (struct m0_net_buffer *nb) |
Registers the buffer for use with a transfer machine in the manner indicated by the m0_net_buffer.nb_qtype value.
void(* xo_dom_fini) (struct m0_net_domain *dom) |
int(* xo_dom_init) (const struct m0_net_xprt *xprt, struct m0_net_domain *dom) |
int(* xo_end_point_create) (struct m0_net_end_point **epp, struct m0_net_transfer_mc *tm, const char *addr) |
Creates an end point with a specific address.
epp | Returned end point data structure. |
addr | Address string. Could be NULL to indicate dynamic addressing. Do not reference the string after return. |
m0_bcount_t(* xo_get_max_buffer_desc_size) (const struct m0_net_domain *dom) |
m0_bcount_t(* xo_get_max_buffer_segment_size) (const struct m0_net_domain *dom) |
Retrieves the maximum buffer segment size.
size | Returns the maximum segment size. |
int32_t(* xo_get_max_buffer_segments) (const struct m0_net_domain *dom) |
Retrieves the maximum number of buffer segments.
num_segs | Returns the maximum number of buffer segments. |
m0_bcount_t(* xo_get_max_buffer_size) (const struct m0_net_domain *dom) |
Retrieves the maximum buffer size (includes all segments).
size | Returns the maximum buffer size. |
m0_bcount_t(* xo_rpc_max_msg_size) (struct m0_net_domain *ndom, m0_bcount_t rpc_size) |
uint32_t(* xo_rpc_max_recv_msgs) (struct m0_net_domain *ndom, m0_bcount_t rpc_size) |
m0_bcount_t(* xo_rpc_max_seg_size) (struct m0_net_domain *ndom) |
uint32_t(* xo_rpc_max_segs_nr) (struct m0_net_domain *ndom) |
int(* xo_tm_confine) (struct m0_net_transfer_mc *tm, const struct m0_bitmap *processors) |
Optional method to set the processor affinity for the threads of a transfer machine. The transfer machine must be initialized but not yet started.
processors | Processor bitmap. |
-ENOSYS | No affinity support available. Implied by a missing method. |
void(* xo_tm_fini) (struct m0_net_transfer_mc *tm) |
Releases resources associated with a transfer machine. The transfer machine will be in the stopped state.
The following fields are of special interest to this method:
- ntm_dom - ntm_xprt_private - The method should free any allocated memory tracked by this pointer.
int(* xo_tm_init) (struct m0_net_transfer_mc *tm) |
Performs transport level initialization of the transfer machine.
All fields will be initialized at this time, specifically:
- ntm_dom - ntm_xprt_private - Initialized to NULL. The method can set its own value in the structure.
0 | (success) |
-errno | (failure) |
int(* xo_tm_start) (struct m0_net_transfer_mc *tm, const char *addr) |
Initiates the startup of the (initialized) transfer machine. A completion event should be posted when started, using a different thread. Serialized using the transfer machine mutex.
The following fields are of special interest to this method:
addr | Address (network end-point string representation) of the transfer machine. The method should not reference this string after it returns. |
int(* xo_tm_stop) (struct m0_net_transfer_mc *tm, bool cancel) |
Initiates the shutdown of a transfer machine, cancelling any pending startup. No incoming messages should be accepted. Pending operations should drain or be cancelled if requested. A completion event should be posted when stopped, using a different thread. Serialized using the transfer machine mutex.
tm | Transfer machine pointer. |
cancel | Pending outbound operations should be cancelled immediately. |
0 | (success) |
-errno | (failure) |