Motr  M0
m0_net_xprt_ops Struct Reference

#include <net.h>

Collaboration diagram for m0_net_xprt_ops:
Collaboration graph

Data Fields

int(* xo_dom_init )(const struct m0_net_xprt *xprt, struct m0_net_domain *dom)
 
void(* xo_dom_fini )(struct m0_net_domain *dom)
 
int(* xo_tm_init )(struct m0_net_transfer_mc *tm)
 
int(* xo_tm_confine )(struct m0_net_transfer_mc *tm, const struct m0_bitmap *processors)
 
int(* xo_tm_start )(struct m0_net_transfer_mc *tm, const char *addr)
 
int(* xo_tm_stop )(struct m0_net_transfer_mc *tm, bool cancel)
 
void(* xo_tm_fini )(struct m0_net_transfer_mc *tm)
 
int(* xo_end_point_create )(struct m0_net_end_point **epp, struct m0_net_transfer_mc *tm, const char *addr)
 
int(* xo_buf_register )(struct m0_net_buffer *nb)
 
void(* xo_buf_deregister )(struct m0_net_buffer *nb)
 
int(* xo_buf_add )(struct m0_net_buffer *nb)
 
void(* xo_buf_del )(struct m0_net_buffer *nb)
 
int(* xo_bev_deliver_sync )(struct m0_net_transfer_mc *tm)
 
void(* xo_bev_deliver_all )(struct m0_net_transfer_mc *tm)
 
bool(* xo_bev_pending )(struct m0_net_transfer_mc *tm)
 
void(* xo_bev_notify )(struct m0_net_transfer_mc *tm, struct m0_chan *chan)
 
m0_bcount_t(* xo_get_max_buffer_size )(const struct m0_net_domain *dom)
 
m0_bcount_t(* xo_get_max_buffer_segment_size )(const struct m0_net_domain *dom)
 
int32_t(* xo_get_max_buffer_segments )(const struct m0_net_domain *dom)
 
m0_bcount_t(* xo_get_max_buffer_desc_size )(const struct m0_net_domain *dom)
 
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)
 
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)
 

Detailed Description

Network transport operations. The network domain mutex must be held to invoke these methods, unless explicitly stated otherwise.

Definition at line 133 of file net.h.

Field Documentation

◆ xo_bev_deliver_all

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.

Definition at line 314 of file net.h.

◆ xo_bev_deliver_sync

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.

See also
m0_net_buffer_event_deliver_synchronously()

Definition at line 301 of file net.h.

◆ xo_bev_notify

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.

Definition at line 331 of file net.h.

◆ xo_bev_pending

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.

Definition at line 322 of file net.h.

◆ xo_buf_add

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.

Precondition
nb->nb_tm != NULL
See also
m0_net_buffer_add(), struct m0_net_buffer

Definition at line 274 of file net.h.

◆ xo_buf_del

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.

Precondition
nb->nb_tm != NULL
m0_net__qtype_is_valid(nb->nb_qtype)
See also
m0_net_buffer_del()

Definition at line 290 of file net.h.

◆ xo_buf_deregister

void(* xo_buf_deregister) (struct m0_net_buffer *nb)

Deregisters the buffer from the transfer machine.

See also
m0_net_buffer_deregister()

Definition at line 245 of file net.h.

◆ xo_buf_register

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.

See also
m0_net_buffer_register()

Definition at line 239 of file net.h.

◆ xo_dom_fini

void(* xo_dom_fini) (struct m0_net_domain *dom)

Finalises transport resources in a domain. Only the m0_net_mutex is held across this call.

Definition at line 145 of file net.h.

◆ xo_dom_init

int(* xo_dom_init) (const struct m0_net_xprt *xprt, struct m0_net_domain *dom)

Initialises transport specific part of a domain (e.g., start threads, initialise portals). Only the m0_net_mutex is held across this call.

Definition at line 139 of file net.h.

◆ xo_end_point_create

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.

Parameters
eppReturned end point data structure.
addrAddress string. Could be NULL to indicate dynamic addressing. Do not reference the string after return.
See also
m0_net_end_point_create()

Definition at line 230 of file net.h.

◆ xo_get_max_buffer_desc_size

m0_bcount_t(* xo_get_max_buffer_desc_size) (const struct m0_net_domain *dom)

Retrieves the buffer descriptor size.

Definition at line 359 of file net.h.

◆ xo_get_max_buffer_segment_size

m0_bcount_t(* xo_get_max_buffer_segment_size) (const struct m0_net_domain *dom)

Retrieves the maximum buffer segment size.

Return values
sizeReturns the maximum segment size.
See also
m0_net_domain_get_max_buffer_segment_size()

Definition at line 346 of file net.h.

◆ xo_get_max_buffer_segments

int32_t(* xo_get_max_buffer_segments) (const struct m0_net_domain *dom)

Retrieves the maximum number of buffer segments.

Return values
num_segsReturns the maximum number of buffer segments.
See also
m0_net_domain_get_max_buffer_segments()

Definition at line 354 of file net.h.

◆ xo_get_max_buffer_size

m0_bcount_t(* xo_get_max_buffer_size) (const struct m0_net_domain *dom)

Retrieves the maximum buffer size (includes all segments).

Return values
sizeReturns the maximum buffer size.
See also
m0_net_domain_get_max_buffer_size()

Definition at line 339 of file net.h.

◆ xo_rpc_max_msg_size

m0_bcount_t(* xo_rpc_max_msg_size) (struct m0_net_domain *ndom, m0_bcount_t rpc_size)

Definition at line 366 of file net.h.

◆ xo_rpc_max_recv_msgs

uint32_t(* xo_rpc_max_recv_msgs) (struct m0_net_domain *ndom, m0_bcount_t rpc_size)

Definition at line 369 of file net.h.

◆ xo_rpc_max_seg_size

m0_bcount_t(* xo_rpc_max_seg_size) (struct m0_net_domain *ndom)

Definition at line 362 of file net.h.

◆ xo_rpc_max_segs_nr

uint32_t(* xo_rpc_max_segs_nr) (struct m0_net_domain *ndom)

Definition at line 364 of file net.h.

◆ xo_tm_confine

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.

Parameters
processorsProcessor bitmap.
Return values
-ENOSYSNo affinity support available. Implied by a missing method.

Definition at line 170 of file net.h.

◆ xo_tm_fini

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.
See also
m0_net_tm_fini()

Definition at line 219 of file net.h.

◆ xo_tm_init

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.
Return values
0(success)
-errno(failure)
See also
m0_net_tm_init()

Definition at line 160 of file net.h.

◆ xo_tm_start

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:

  • ntm_dom
  • ntm_xprt_private
Parameters
addrAddress (network end-point string representation) of the transfer machine. The method should not reference this string after it returns.
See also
m0_net_tm_start()

Definition at line 189 of file net.h.

◆ xo_tm_stop

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.

Parameters
tmTransfer machine pointer.
cancelPending outbound operations should be cancelled immediately.
Return values
0(success)
-errno(failure)
See also
m0_net_tm_stop()

Definition at line 206 of file net.h.


The documentation for this struct was generated from the following file: