Motr  M0
net.h File Reference
#include <stdarg.h>
#include "lib/rwlock.h"
#include "lib/list.h"
#include "lib/tlist.h"
#include "lib/queue.h"
#include "lib/refs.h"
#include "lib/chan.h"
#include "lib/cond.h"
#include "lib/mutex.h"
#include "lib/time.h"
#include "lib/thread.h"
#include "lib/vec.h"
#include "net/ip.h"
#include "net/net_otw_types.h"
#include "net/net_otw_types_xc.h"
#include "sm/sm.h"
Include dependency graph for net.h:

Go to the source code of this file.

Data Structures

struct  m0_net_xprt
 
struct  m0_net_xprt_ops
 
struct  m0_net_domain
 
struct  m0_net_end_point
 
struct  m0_net_tm_event
 
struct  m0_net_tm_callbacks
 
struct  m0_net_qstats
 
struct  m0_net_transfer_mc
 
struct  m0_net_buffer_event
 
struct  m0_net_buffer_callbacks
 
struct  m0_net_buffer
 

Macros

#define __MOTR_NET_NET_H__
 
#define M0_NET_XPRT_PREFIX_DEFAULT   "lnet"
 
#define USE_LIBFAB   0
 
#define ntm_mutex   ntm_group.s_lock
 

Typedefs

typedef void(* m0_net_buffer_cb_proc_t) (const struct m0_net_buffer_event *ev)
 

Enumerations

enum  { M0_NET_TM_RECV_QUEUE_DEF_LEN = 2 }
 
enum  m0_net_queue_type {
  M0_NET_QT_MSG_RECV = 0, M0_NET_QT_MSG_SEND, M0_NET_QT_PASSIVE_BULK_RECV, M0_NET_QT_PASSIVE_BULK_SEND,
  M0_NET_QT_ACTIVE_BULK_RECV, M0_NET_QT_ACTIVE_BULK_SEND, M0_NET_QT_NR
}
 
enum  m0_net_tm_state {
  M0_NET_TM_UNDEFINED = 0, M0_NET_TM_INITIALIZED, M0_NET_TM_STARTING, M0_NET_TM_STARTED,
  M0_NET_TM_STOPPING, M0_NET_TM_STOPPED, M0_NET_TM_FAILED
}
 
enum  m0_net_tm_ev_type { M0_NET_TEV_ERROR = 0, M0_NET_TEV_STATE_CHANGE, M0_NET_TEV_DIAGNOSTIC, M0_NET_TEV_NR }
 
enum  m0_net_buf_flags {
  M0_NET_BUF_REGISTERED = 1 << 0, M0_NET_BUF_QUEUED = 1 << 1, M0_NET_BUF_IN_USE = 1 << 2, M0_NET_BUF_CANCELLED = 1 << 3,
  M0_NET_BUF_TIMED_OUT = 1 << 4, M0_NET_BUF_RETAIN = 1 << 5
}
 

Functions

M0_INTERNAL int m0_net_init (void)
 
M0_INTERNAL void m0_net_fini (void)
 
int m0_net_domain_init (struct m0_net_domain *dom, const struct m0_net_xprt *xprt)
 
void m0_net_domain_fini (struct m0_net_domain *dom)
 
M0_INTERNAL m0_bcount_t m0_net_domain_get_max_buffer_size (struct m0_net_domain *dom)
 
M0_INTERNAL m0_bcount_t m0_net_domain_get_max_buffer_segment_size (struct m0_net_domain *dom)
 
M0_INTERNAL m0_bcount_t m0_net_domain_get_max_buffer_desc_size (struct m0_net_domain *dom)
 
M0_INTERNAL int32_t m0_net_domain_get_max_buffer_segments (struct m0_net_domain *dom)
 
 M0_TL_DESCR_DECLARE (m0_nep, M0_EXTERN)
 
 M0_TL_DECLARE (m0_nep, M0_INTERNAL, struct m0_net_end_point)
 
M0_INTERNAL int m0_net_end_point_create (struct m0_net_end_point **epp, struct m0_net_transfer_mc *tm, const char *addr)
 
M0_INTERNAL void m0_net_end_point_get (struct m0_net_end_point *ep)
 
void m0_net_end_point_put (struct m0_net_end_point *ep)
 
M0_INTERNAL int m0_net_tm_init (struct m0_net_transfer_mc *tm, struct m0_net_domain *dom)
 
M0_INTERNAL void m0_net_tm_fini (struct m0_net_transfer_mc *tm)
 
M0_INTERNAL int m0_net_tm_confine (struct m0_net_transfer_mc *tm, const struct m0_bitmap *processors)
 
M0_INTERNAL int m0_net_tm_start (struct m0_net_transfer_mc *tm, const char *addr)
 
M0_INTERNAL int m0_net_tm_stop (struct m0_net_transfer_mc *tm, bool abort)
 
M0_INTERNAL int m0_net_tm_stats_get (struct m0_net_transfer_mc *tm, enum m0_net_queue_type qtype, struct m0_net_qstats *qs, bool reset)
 
M0_INTERNAL void m0_net_tm_event_post (const struct m0_net_tm_event *ev)
 
M0_INTERNAL void m0_net_tm_colour_set (struct m0_net_transfer_mc *tm, uint32_t colour)
 
M0_INTERNAL uint32_t m0_net_tm_colour_get (struct m0_net_transfer_mc *tm)
 
M0_INTERNAL int m0_net_tm_pool_attach (struct m0_net_transfer_mc *tm, struct m0_net_buffer_pool *bufpool, const struct m0_net_buffer_callbacks *callbacks, m0_bcount_t min_recv_size, uint32_t max_recv_msgs, uint32_t min_recv_queue_len)
 
M0_INTERNAL void m0_net_tm_pool_length_set (struct m0_net_transfer_mc *tm, uint32_t len)
 
M0_INTERNAL void m0_net_domain_buffer_pool_not_empty (struct m0_net_buffer_pool *pool)
 
M0_INTERNAL int m0_net_buffer_register (struct m0_net_buffer *buf, struct m0_net_domain *dom)
 
M0_INTERNAL void m0_net_buffer_deregister (struct m0_net_buffer *buf, struct m0_net_domain *dom)
 
M0_INTERNAL int m0_net_buffer_add (struct m0_net_buffer *buf, struct m0_net_transfer_mc *tm)
 
M0_INTERNAL bool m0_net_buffer_del (struct m0_net_buffer *buf, struct m0_net_transfer_mc *tm)
 
M0_INTERNAL void m0_net_buffer_event_post (const struct m0_net_buffer_event *ev)
 
M0_INTERNAL void m0_net_buffer_event_deliver_all (struct m0_net_transfer_mc *tm)
 
M0_INTERNAL int m0_net_buffer_event_deliver_synchronously (struct m0_net_transfer_mc *tm)
 
M0_INTERNAL bool m0_net_buffer_event_pending (struct m0_net_transfer_mc *tm)
 
M0_INTERNAL void m0_net_buffer_event_notify (struct m0_net_transfer_mc *tm, struct m0_chan *chan)
 
M0_INTERNAL int m0_net_desc_copy (const struct m0_net_buf_desc *from_desc, struct m0_net_buf_desc *to_desc)
 
M0_INTERNAL void m0_net_desc_free (struct m0_net_buf_desc *desc)
 
 M0_TL_DESCR_DECLARE (m0_net_pool, M0_EXTERN)
 
 M0_TL_DESCR_DECLARE (m0_net_tm, M0_EXTERN)
 
 M0_TL_DECLARE (m0_net_pool, M0_INTERNAL, struct m0_net_buffer)
 
 M0_TL_DECLARE (m0_net_tm, M0_INTERNAL, struct m0_net_buffer)
 
M0_INTERNAL bool m0_net_endpoint_is_valid (const char *endpoint)
 
M0_INTERNAL void m0_net_xprt_default_set (const struct m0_net_xprt *xprt)
 
M0_INTERNAL void m0_net_xprt_register (const struct m0_net_xprt *xprt)
 
M0_INTERNAL void m0_net_xprt_deregister (const struct m0_net_xprt *xprt)
 
struct m0_net_xprtm0_net_xprt_default_get (void)
 
struct m0_net_xprt ** m0_net_all_xprt_get (void)
 
int m0_net_xprt_nr (void)
 
M0_INTERNAL void m0_net_print_xprt (void)
 
M0_INTERNAL bool m0_net_check_xprt (const struct m0_net_xprt *xprt)
 
M0_INTERNAL m0_bcount_t default_xo_rpc_max_seg_size (struct m0_net_domain *ndom)
 
M0_INTERNAL uint32_t default_xo_rpc_max_segs_nr (struct m0_net_domain *ndom)
 
M0_INTERNAL m0_bcount_t default_xo_rpc_max_msg_size (struct m0_net_domain *ndom, m0_bcount_t rpc_size)
 
M0_INTERNAL uint32_t default_xo_rpc_max_recv_msgs (struct m0_net_domain *ndom, m0_bcount_t rpc_size)
 

Macro Definition Documentation

◆ __MOTR_NET_NET_H__

#define __MOTR_NET_NET_H__

Definition at line 26 of file net.h.

◆ ntm_mutex

#define ntm_mutex   ntm_group.s_lock

Mutex associated with the transfer machine. The mutex is used when the transfer machine state is in the bounds: M0_NET_TM_INITIALIZED < state < M0_NET_TM_STOPPED.

Most transfer machine operations are protected by this mutex. The presence of this mutex in the transfer machine provides a tighter locus of memory accesses to the data structures associated with the operation of a single transfer machine, than would occur were the domain mutex used. It also reduces the memory access overlaps between individual transfer machines. Transports could use this memory access pattern to provide processor-affinity support for buffer operation on a per-transfer-machine-per-processor basis, by invoking the buffer operation callbacks on the same processor used to submit the buffer operation.

Definition at line 840 of file net.h.