Motr  M0
LNet Transport Core Kernel Private Interface
Collaboration diagram for LNet Transport Core Kernel Private Interface:

Data Structures

struct  nlx_kcore_interceptable_subs
 
struct  nlx_kcore_domain
 
struct  nlx_kcore_transfer_mc
 
struct  nlx_kcore_buffer
 
struct  nlx_kcore_buffer_event
 
struct  nlx_kcore_ops
 

Macros

#define NLX_kcore_LNetMDAttach(ktm, lcbuf, kb, umd)   (*nlx_kcore_iv._nlx_kcore_LNetMDAttach)(ktm, lcbuf, kb, umd)
 
#define NLX_kcore_LNetPut(ktm, lcbuf, kb, umd)   (*nlx_kcore_iv._nlx_kcore_LNetPut)(ktm, lcbuf, kb, umd)
 
#define NLX_kcore_LNetGet(ktm, lcbuf, kb, umd)   (*nlx_kcore_iv._nlx_kcore_LNetGet)(ktm, lcbuf, kb, umd)
 
#define LNetHandleIsEqual(h1, h2)   ((h1).cookie == (h2).cookie)
 
#define LNetHandleIsInvalid(h)   ((h).cookie == LNET_WIRE_HANDLE_COOKIE_NONE)
 
#define NLX_PAGE_OFFSET(addr)   ((addr) & ~PAGE_MASK)
 

Typedefs

typedef int(* nlx_kcore_queue_op_t) (struct nlx_kcore_transfer_mc *ktm, struct nlx_core_buffer *cb, struct nlx_kcore_buffer *kb)
 

Enumerations

enum  { M0_NET_LNET_MAX_PORTALS = 64, M0_NET_LNET_EQ_SIZE = 0, M0_NET_LNET_PORTAL_MASK = M0_NET_LNET_BUFFER_ID_MAX }
 

Functions

 M0_TL_DESCR_DEFINE (tms, "nlx tms", static, struct nlx_kcore_transfer_mc, ktm_tm_linkage, ktm_magic, M0_NET_LNET_KCORE_TM_MAGIC, M0_NET_LNET_KCORE_TMS_MAGIC)
 
 M0_TL_DEFINE (tms, static, struct nlx_kcore_transfer_mc)
 
 M0_TL_DESCR_DEFINE (drv_tms, "drv tms", static, struct nlx_kcore_transfer_mc, ktm_drv_linkage, ktm_magic, M0_NET_LNET_KCORE_TM_MAGIC, M0_NET_LNET_DEV_TMS_MAGIC)
 
 M0_TL_DEFINE (drv_tms, static, struct nlx_kcore_transfer_mc)
 
 M0_TL_DESCR_DEFINE (drv_bufs, "drv bufs", static, struct nlx_kcore_buffer, kb_drv_linkage, kb_magic, M0_NET_LNET_KCORE_BUF_MAGIC, M0_NET_LNET_DEV_BUFS_MAGIC)
 
 M0_TL_DEFINE (drv_bufs, static, struct nlx_kcore_buffer)
 
 M0_TL_DESCR_DEFINE (drv_bevs, "drv bevs", static, struct nlx_kcore_buffer_event, kbe_drv_linkage, kbe_magic, M0_NET_LNET_KCORE_BEV_MAGIC, M0_NET_LNET_DEV_BEVS_MAGIC)
 
 M0_TL_DEFINE (drv_bevs, static, struct nlx_kcore_buffer_event)
 
 M0_BASSERT (sizeof(__u64)==sizeof(uint64_t))
 
static bool nlx_kcore_domain_invariant (const struct nlx_kcore_domain *kd)
 
static bool nlx_kcore_buffer_invariant (const struct nlx_kcore_buffer *kcb)
 
static bool nlx_kcore_buffer_event_invariant (const struct nlx_kcore_buffer_event *kbe)
 
static bool nlx_kcore_tm_invariant (const struct nlx_kcore_transfer_mc *kctm)
 
static bool nlx_kcore_addr_in_use (struct nlx_core_ep_addr *cepa)
 
static int nlx_kcore_max_tmid_find (struct nlx_core_ep_addr *cepa)
 
static void nlx_kcore_tms_list_add (struct nlx_kcore_transfer_mc *kctm)
 
static void nlx_kcore_eq_cb (lnet_event_t *event)
 
static void nlx_core_kmem_loc_set (struct nlx_core_kmem_loc *loc, struct page *pg, uint32_t off)
 
M0_INTERNAL void * nlx_core_mem_alloc (size_t size, unsigned shift)
 
M0_INTERNAL void nlx_core_mem_free (void *data, size_t size, unsigned shift)
 
static int nlx_kcore_core_dom_init (struct nlx_kcore_domain *kd, struct nlx_core_domain *cd)
 
M0_INTERNAL int nlx_core_dom_init (struct m0_net_domain *dom, struct nlx_core_domain *cd)
 
static void nlx_kcore_core_dom_fini (struct nlx_kcore_domain *kd, struct nlx_core_domain *cd)
 
M0_INTERNAL void nlx_core_dom_fini (struct nlx_core_domain *cd)
 
M0_INTERNAL m0_bcount_t nlx_core_get_max_buffer_size (struct nlx_core_domain *lcdom)
 
M0_INTERNAL m0_bcount_t nlx_core_get_max_buffer_segment_size (struct nlx_core_domain *lcdom)
 
M0_INTERNAL int32_t nlx_core_get_max_buffer_segments (struct nlx_core_domain *lcdom)
 
static int nlx_kcore_buf_register (struct nlx_kcore_domain *kd, nlx_core_opaque_ptr_t buffer_id, struct nlx_core_buffer *cb, struct nlx_kcore_buffer *kb)
 
static void nlx_kcore_buf_deregister (struct nlx_core_buffer *cb, struct nlx_kcore_buffer *kb)
 
M0_INTERNAL int nlx_core_buf_register (struct nlx_core_domain *cd, nlx_core_opaque_ptr_t buffer_id, const struct m0_bufvec *bvec, struct nlx_core_buffer *cb)
 
M0_INTERNAL void nlx_core_buf_deregister (struct nlx_core_domain *cd, struct nlx_core_buffer *cb)
 
static int nlx_kcore_buf_msg_recv (struct nlx_kcore_transfer_mc *ktm, struct nlx_core_buffer *cb, struct nlx_kcore_buffer *kb)
 
M0_INTERNAL int nlx_core_buf_msg_recv (struct nlx_core_domain *cd, struct nlx_core_transfer_mc *ctm, struct nlx_core_buffer *cb)
 
static int nlx_kcore_buf_msg_send (struct nlx_kcore_transfer_mc *ktm, struct nlx_core_buffer *cb, struct nlx_kcore_buffer *kb)
 
M0_INTERNAL int nlx_core_buf_msg_send (struct nlx_core_domain *cd, struct nlx_core_transfer_mc *ctm, struct nlx_core_buffer *cb)
 
static int nlx_kcore_buf_active_recv (struct nlx_kcore_transfer_mc *ktm, struct nlx_core_buffer *cb, struct nlx_kcore_buffer *kb)
 
M0_INTERNAL int nlx_core_buf_active_recv (struct nlx_core_domain *cd, struct nlx_core_transfer_mc *ctm, struct nlx_core_buffer *cb)
 
static int nlx_kcore_buf_active_send (struct nlx_kcore_transfer_mc *ktm, struct nlx_core_buffer *cb, struct nlx_kcore_buffer *kb)
 
M0_INTERNAL int nlx_core_buf_active_send (struct nlx_core_domain *cd, struct nlx_core_transfer_mc *ctm, struct nlx_core_buffer *cb)
 
static int nlx_kcore_buf_passive_recv (struct nlx_kcore_transfer_mc *ktm, struct nlx_core_buffer *cb, struct nlx_kcore_buffer *kb)
 
M0_INTERNAL int nlx_core_buf_passive_recv (struct nlx_core_domain *cd, struct nlx_core_transfer_mc *ctm, struct nlx_core_buffer *cb)
 
static int nlx_kcore_buf_passive_send (struct nlx_kcore_transfer_mc *ktm, struct nlx_core_buffer *cb, struct nlx_kcore_buffer *kb)
 
M0_INTERNAL int nlx_core_buf_passive_send (struct nlx_core_domain *cd, struct nlx_core_transfer_mc *ctm, struct nlx_core_buffer *cb)
 
M0_INTERNAL int nlx_core_buf_del (struct nlx_core_domain *cd, struct nlx_core_transfer_mc *ctm, struct nlx_core_buffer *cb)
 
static int nlx_kcore_buf_event_wait (struct nlx_core_transfer_mc *ctm, struct nlx_kcore_transfer_mc *ktm, m0_time_t timeout)
 
M0_INTERNAL int nlx_core_buf_event_wait (struct nlx_core_domain *cd, struct nlx_core_transfer_mc *ctm, m0_time_t timeout)
 
static int nlx_kcore_nidstr_decode (const char *nidstr, uint64_t *nid)
 
M0_INTERNAL int nlx_core_nidstr_decode (struct nlx_core_domain *lcdom, const char *nidstr, uint64_t *nid)
 
static int nlx_kcore_nidstr_encode (uint64_t nid, char nidstr[M0_NET_LNET_NIDSTR_SIZE])
 
M0_INTERNAL int nlx_core_nidstr_encode (struct nlx_core_domain *lcdom, uint64_t nid, char nidstr[M0_NET_LNET_NIDSTR_SIZE])
 
M0_INTERNAL int nlx_core_nidstrs_get (struct nlx_core_domain *lcdom, char ***nidary)
 
M0_INTERNAL void nlx_core_nidstrs_put (struct nlx_core_domain *lcdom, char ***nidary)
 
M0_INTERNAL int nlx_core_new_blessed_bev (struct nlx_core_domain *cd, struct nlx_core_transfer_mc *ctm, struct nlx_core_buffer_event **bevp)
 
static void nlx_kcore_tm_stop (struct nlx_core_transfer_mc *ctm, struct nlx_kcore_transfer_mc *ktm)
 
M0_INTERNAL void nlx_core_tm_stop (struct nlx_core_domain *cd, struct nlx_core_transfer_mc *ctm)
 
static int nlx_kcore_tm_start (struct nlx_kcore_domain *kd, struct nlx_core_transfer_mc *ctm, struct nlx_kcore_transfer_mc *ktm)
 
M0_INTERNAL int nlx_core_tm_start (struct nlx_core_domain *cd, struct m0_net_transfer_mc *tm, struct nlx_core_transfer_mc *ctm)
 
static void nlx_core_fini (void)
 
static int nlx_core_init (void)
 
static int nlx_kcore_kcore_dom_init (struct nlx_kcore_domain *kd)
 
static void nlx_kcore_kcore_dom_fini (struct nlx_kcore_domain *kd)
 
static int nlx_kcore_buffer_kla_to_kiov (struct nlx_kcore_buffer *kb, const struct m0_bufvec *bvec)
 
static int nlx_kcore_buffer_uva_to_kiov (struct nlx_kcore_buffer *kb, const struct m0_bufvec *bvec)
 
static bool nlx_kcore_kiov_invariant (const lnet_kiov_t *k, size_t len)
 
static uint64_t nlx_kcore_hdr_data_encode_raw (uint32_t tmid, uint32_t portal)
 
static uint64_t nlx_kcore_hdr_data_encode (struct nlx_kcore_transfer_mc *kctm)
 
static void nlx_kcore_hdr_data_decode (uint64_t hdr_data, uint32_t *portal, uint32_t *tmid)
 
static void nlx_kcore_umd_init (struct nlx_kcore_transfer_mc *kctm, struct nlx_core_buffer *lcbuf, struct nlx_kcore_buffer *kcb, int threshold, int max_size, unsigned options, bool isLNetGetOp, lnet_md_t *umd)
 
static void nlx_kcore_kiov_adjust_length (struct nlx_kcore_transfer_mc *ktm, struct nlx_kcore_buffer *kcb, lnet_md_t *umd, m0_bcount_t bytes)
 
static void nlx_kcore_kiov_restore_length (struct nlx_kcore_buffer *kcb)
 
static int nlx_kcore_LNetMDAttach (struct nlx_kcore_transfer_mc *kctm, struct nlx_core_buffer *lcbuf, struct nlx_kcore_buffer *kcb, lnet_md_t *umd)
 
static int nlx_kcore_LNetMDUnlink (struct nlx_kcore_transfer_mc *kctm, struct nlx_kcore_buffer *kcb)
 
static int nlx_kcore_LNetPut (struct nlx_kcore_transfer_mc *kctm, struct nlx_core_buffer *lcbuf, struct nlx_kcore_buffer *kcb, lnet_md_t *umd)
 
static int nlx_kcore_LNetGet (struct nlx_kcore_transfer_mc *kctm, struct nlx_core_buffer *lcbuf, struct nlx_kcore_buffer *kcb, lnet_md_t *umd)
 
static struct nlx_core_domainnlx_kcore_core_domain_map (struct nlx_kcore_domain *kd)
 
static void nlx_kcore_core_domain_unmap (struct nlx_kcore_domain *kd)
 
static struct nlx_core_buffernlx_kcore_core_buffer_map (struct nlx_kcore_buffer *kb)
 
static void nlx_kcore_core_buffer_unmap (struct nlx_kcore_buffer *kb)
 
static struct nlx_core_buffer_eventnlx_kcore_core_bev_map (struct nlx_kcore_buffer_event *kbe)
 
static void nlx_kcore_core_bev_unmap (struct nlx_kcore_buffer_event *kbe)
 
static struct nlx_core_transfer_mcnlx_kcore_core_tm_map (struct nlx_kcore_transfer_mc *ktm)
 
static void nlx_kcore_core_tm_unmap (struct nlx_kcore_transfer_mc *ktm)
 
static struct nlx_core_transfer_mcnlx_kcore_core_tm_map_atomic (struct nlx_kcore_transfer_mc *ktm)
 
static void nlx_kcore_core_tm_unmap_atomic (struct nlx_core_transfer_mc *ctm)
 
static unsigned bufvec_seg_page_count (const struct m0_bufvec *bvec, unsigned n)
 
static unsigned bufvec_seg_kla_to_kiov (const struct m0_bufvec *bvec, unsigned n, lnet_kiov_t *kiov)
 
static int bufvec_seg_uva_to_kiov (struct nlx_kcore_buffer *kb, const struct m0_bufvec *bvec, unsigned n, lnet_kiov_t *kiov)
 
static size_t nlx_kcore_num_kiov_entries_for_bytes (const lnet_kiov_t *kiov, size_t kiov_len, m0_bcount_t bytes, unsigned *last_len)
 

Variables

static struct m0_mutex nlx_kcore_mutex
 
static struct m0_tl nlx_kcore_tms
 
static struct nlx_kcore_interceptable_subs nlx_kcore_iv
 
static struct nlx_kcore_ops nlx_kcore_def_ops
 

Detailed Description

Macro Definition Documentation

◆ LNetHandleIsEqual

#define LNetHandleIsEqual (   h1,
  h2 
)    ((h1).cookie == (h2).cookie)

Definition at line 246 of file klnet_core.h.

◆ LNetHandleIsInvalid

#define LNetHandleIsInvalid (   h)    ((h).cookie == LNET_WIRE_HANDLE_COOKIE_NONE)

Definition at line 247 of file klnet_core.h.

◆ NLX_kcore_LNetGet

#define NLX_kcore_LNetGet (   ktm,
  lcbuf,
  kb,
  umd 
)    (*nlx_kcore_iv._nlx_kcore_LNetGet)(ktm, lcbuf, kb, umd)

Definition at line 887 of file klnet_core.c.

◆ NLX_kcore_LNetMDAttach

#define NLX_kcore_LNetMDAttach (   ktm,
  lcbuf,
  kb,
  umd 
)    (*nlx_kcore_iv._nlx_kcore_LNetMDAttach)(ktm, lcbuf, kb, umd)

Definition at line 883 of file klnet_core.c.

◆ NLX_kcore_LNetPut

#define NLX_kcore_LNetPut (   ktm,
  lcbuf,
  kb,
  umd 
)    (*nlx_kcore_iv._nlx_kcore_LNetPut)(ktm, lcbuf, kb, umd)

Definition at line 885 of file klnet_core.c.

◆ NLX_PAGE_OFFSET

#define NLX_PAGE_OFFSET (   addr)    ((addr) & ~PAGE_MASK)

Definition at line 404 of file klnet_core.h.

Typedef Documentation

◆ nlx_kcore_queue_op_t

typedef int(* nlx_kcore_queue_op_t) (struct nlx_kcore_transfer_mc *ktm, struct nlx_core_buffer *cb, struct nlx_kcore_buffer *kb)

Performs a kernel core tranfer machine buffer queue send or receive operation (message, active, or passive).

Parameters
ktmThe kernel transfer machine private data.
cbThe buffer private data.
kbThe kernel buffer private data.

Definition at line 257 of file klnet_core.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
M0_NET_LNET_MAX_PORTALS 

Number of portals supported.

M0_NET_LNET_EQ_SIZE 

Size of LNet event queue.

Behavior of LNetEQAlloc() was changed since Lustre 2.2.54, so eq_size parameter should zero after this version, see commit 2.2.54-55-ga096d85 "LU-56 lnet: allow to create EQ with zero eq_size" in Lustre git repository for explanation

M0_NET_LNET_PORTAL_MASK 

Portal mask when encoded in hdr_data

Definition at line 64 of file klnet_core.h.

Function Documentation

◆ bufvec_seg_kla_to_kiov()

static unsigned bufvec_seg_kla_to_kiov ( const struct m0_bufvec bvec,
unsigned  n,
lnet_kiov_t *  kiov 
)
static

Fill in a kiov array with pages from a segment of a m0_bufvec containing kernel logical addresses.

The page reference count is not incremented.

Parameters
bvecMotr buffer vector pointer
nSegment number in the vector
kiovPointer to array of lnet_kiov_t structures.
Returns
Number of lnet_kiov_t elements added.

Definition at line 93 of file klnet_vec.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bufvec_seg_page_count()

static unsigned bufvec_seg_page_count ( const struct m0_bufvec bvec,
unsigned  n 
)
static

Count the number of pages in a segment of a m0_bufvec.

Parameters
bvecMotr buffer vector pointer
nSegment number in the vector
Returns
Number of pages in the segment.

Definition at line 65 of file klnet_vec.c.

Here is the caller graph for this function:

◆ bufvec_seg_uva_to_kiov()

static int bufvec_seg_uva_to_kiov ( struct nlx_kcore_buffer kb,
const struct m0_bufvec bvec,
unsigned  n,
lnet_kiov_t *  kiov 
)
static

Fill in a kiov array with pages from a segment of a m0_bufvec containing user space addresses.

The pages are pinned (but not mapped).

Parameters
kbKcore buffer private pointer.
bvecMotr buffer vector pointer.
nSegment number in the vector.
kiovPointer to array of lnet_kiov_t structures.
Returns
Number of lnet_kiov_t elements added, or -errno on failure.

Definition at line 185 of file klnet_vec.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ M0_BASSERT()

M0_BASSERT ( sizeof(__u64)  = =sizeof(uint64_t))

◆ M0_TL_DEFINE() [1/4]

M0_TL_DEFINE ( tms  ,
static  ,
struct nlx_kcore_transfer_mc   
)

◆ M0_TL_DEFINE() [2/4]

M0_TL_DEFINE ( drv_tms  ,
static  ,
struct nlx_kcore_transfer_mc   
)

◆ M0_TL_DEFINE() [3/4]

M0_TL_DEFINE ( drv_bufs  ,
static  ,
struct nlx_kcore_buffer   
)

◆ M0_TL_DEFINE() [4/4]

M0_TL_DEFINE ( drv_bevs  ,
static  ,
struct nlx_kcore_buffer_event   
)

◆ M0_TL_DESCR_DEFINE() [1/4]

M0_TL_DESCR_DEFINE ( tms  ,
"nlx tms"  ,
static  ,
struct nlx_kcore_transfer_mc  ,
ktm_tm_linkage  ,
ktm_magic  ,
M0_NET_LNET_KCORE_TM_MAGIC  ,
M0_NET_LNET_KCORE_TMS_MAGIC   
)

◆ M0_TL_DESCR_DEFINE() [2/4]

M0_TL_DESCR_DEFINE ( drv_tms  ,
"drv tms"  ,
static  ,
struct nlx_kcore_transfer_mc  ,
ktm_drv_linkage  ,
ktm_magic  ,
M0_NET_LNET_KCORE_TM_MAGIC  ,
M0_NET_LNET_DEV_TMS_MAGIC   
)

◆ M0_TL_DESCR_DEFINE() [3/4]

M0_TL_DESCR_DEFINE ( drv_bufs  ,
"drv bufs"  ,
static  ,
struct nlx_kcore_buffer  ,
kb_drv_linkage  ,
kb_magic  ,
M0_NET_LNET_KCORE_BUF_MAGIC  ,
M0_NET_LNET_DEV_BUFS_MAGIC   
)

◆ M0_TL_DESCR_DEFINE() [4/4]

M0_TL_DESCR_DEFINE ( drv_bevs  ,
"drv bevs"  ,
static  ,
struct nlx_kcore_buffer_event  ,
kbe_drv_linkage  ,
kbe_magic  ,
M0_NET_LNET_KCORE_BEV_MAGIC  ,
M0_NET_LNET_DEV_BEVS_MAGIC   
)

◆ nlx_core_buf_active_recv()

M0_INTERNAL int nlx_core_buf_active_recv ( struct nlx_core_domain lcdom,
struct nlx_core_transfer_mc lctm,
struct nlx_core_buffer lcbuf 
)

Enqueues a buffer for active bulk receive. The cb_match_bits field should be set to the value of the match bits of the remote passive buffer. The cb_addr field should be set with the end point address of the transfer machine with the passive buffer.

The invoker should ensure that the subroutine is not invoked concurrently with any of the other buffer operation initiation subroutines or the nlx_core_buf_event_get() subroutine.

The invoker should provision sufficient buffer event structures prior to the call, using the nlx_core_bevq_provision() subroutine.

Parameters
lcdomThe domain private data.
lctmTransfer machine private data.
lcbufBuffer private data.
Precondition
The buffer is queued on the specified transfer machine.
lcbuf->cb_length is valid
lcbuf->cb_match_bits != 0
lcbuf->cb_addr is valid
lcbuf->cb_max_operations == 1
See also
nlx_core_bevq_provision()

Definition at line 1467 of file klnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_buf_active_send()

M0_INTERNAL int nlx_core_buf_active_send ( struct nlx_core_domain lcdom,
struct nlx_core_transfer_mc lctm,
struct nlx_core_buffer lcbuf 
)

Enqueues a buffer for active bulk send. See nlx_core_buf_active_recv() for how the buffer is to be initialized.

The invoker should ensure that the subroutine is not invoked concurrently with any of the other buffer operation initiation subroutines or the nlx_core_buf_event_get() subroutine.

The invoker should provision sufficient buffer event structures prior to the call, using the nlx_core_bevq_provision() subroutine.

Parameters
lcdomThe domain private data.
lctmTransfer machine private data.
lcbufBuffer private data.
Precondition
The buffer is queued on the specified transfer machine.
lcbuf->cb_length is valid
lcbuf->cb_match_bits != 0
lcbuf->cb_addr is valid
lcbuf->cb_max_operations == 1
See also
nlx_core_bevq_provision()

Definition at line 1517 of file klnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_buf_del()

M0_INTERNAL int nlx_core_buf_del ( struct nlx_core_domain lcdom,
struct nlx_core_transfer_mc lctm,
struct nlx_core_buffer lcbuf 
)

Cancels a buffer operation if possible.

Parameters
lcdomThe domain private data.
lctmTransfer machine private data.
lcbufBuffer private data.
Precondition
The buffer is queued on the specified transfer machine.

Definition at line 1631 of file klnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_buf_deregister()

M0_INTERNAL void nlx_core_buf_deregister ( struct nlx_core_domain lcdom,
struct nlx_core_buffer lcbuf 
)

Deregisters the buffer.

Parameters
lcdomThe domain private data.
lcbufThe buffer private data.

Definition at line 1330 of file klnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_buf_event_wait()

M0_INTERNAL int nlx_core_buf_event_wait ( struct nlx_core_domain lcdom,
struct nlx_core_transfer_mc lctm,
m0_time_t  timeout 
)

Waits for buffer events, or the timeout.

Parameters
lcdomDomain pointer.
lctmTransfer machine private data.
timeoutAbsolute time at which to stop waiting. A value of 0 indicates that the subroutine should not wait.
Return values
0Events present.
-ETIMEDOUTTimed out before events arrived.

Definition at line 1685 of file klnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_buf_msg_recv()

M0_INTERNAL int nlx_core_buf_msg_recv ( struct nlx_core_domain lcdom,
struct nlx_core_transfer_mc lctm,
struct nlx_core_buffer lcbuf 
)

Enqueues a buffer for message reception. Multiple messages may be received into the buffer, space permitting, up to the configured maximum.

The invoker should ensure that the subroutine is not invoked concurrently with any of the other buffer operation initiation subroutines or the nlx_core_buf_event_get() subroutine.

The invoker should provision sufficient buffer event structures prior to the call, using the nlx_core_bevq_provision() subroutine.

Parameters
lcdomThe domain private data.
lctmTransfer machine private data.
lcbufBuffer private data.
Precondition
lcbuf->cb_length is valid
lcbuf->cb_min_receive_size is valid
lcbuf->cb_max_operations > 0
See also
nlx_core_bevq_provision()

Definition at line 1373 of file klnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_buf_msg_send()

M0_INTERNAL int nlx_core_buf_msg_send ( struct nlx_core_domain lcdom,
struct nlx_core_transfer_mc lctm,
struct nlx_core_buffer lcbuf 
)

Enqueues a buffer for message transmission.

The invoker should ensure that the subroutine is not invoked concurrently with any of the other buffer operation initiation subroutines or the nlx_core_buf_event_get() subroutine.

The invoker should provision sufficient buffer event structures prior to the call, using the nlx_core_bevq_provision() subroutine.

Parameters
lcdomThe domain private data.
lctmTransfer machine private data.
lcbufBuffer private data.
Precondition
lcbuf->cb_length is valid
lcbuf->cb_addr is valid
lcbuf->cb_max_operations == 1
See also
nlx_core_bevq_provision()

Definition at line 1417 of file klnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_buf_passive_recv()

M0_INTERNAL int nlx_core_buf_passive_recv ( struct nlx_core_domain lcdom,
struct nlx_core_transfer_mc lctm,
struct nlx_core_buffer lcbuf 
)

Enqueues a buffer for passive bulk receive. The match bits for the passive buffer should be set in the buffer with the nlx_core_buf_desc_encode() subroutine before this call. It is guaranteed that the buffer can be remotely accessed when the subroutine returns.

The invoker should ensure that the subroutine is not invoked concurrently with any of the other buffer operation initiation subroutines or the nlx_core_buf_event_get() subroutine.

The invoker should provision sufficient buffer event structures prior to the call, using the nlx_core_bevq_provision() subroutine.

Parameters
lcdomThe domain private data.
lctmTransfer machine private data.
lcbufBuffer private data.
Precondition
The buffer is queued on the specified transfer machine.
lcbuf->cb_length is valid
lcbuf->cb_match_bits != 0
lcbuf->cb_max_operations == 1
See also
nlx_core_bevq_provision()

Definition at line 1566 of file klnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_buf_passive_send()

M0_INTERNAL int nlx_core_buf_passive_send ( struct nlx_core_domain lcdom,
struct nlx_core_transfer_mc lctm,
struct nlx_core_buffer lcbuf 
)

Enqueues a buffer for passive bulk send. See nlx_core_buf_passive_recv() for how the buffer is to be initialized. It is guaranteed that the buffer can be remotely accessed when the subroutine returns.

The invoker should ensure that the subroutine is not invoked concurrently with any of the other buffer operation initiation subroutines or the nlx_core_buf_event_get() subroutine.

The invoker should provision sufficient buffer event structures prior to the call, using the nlx_core_bevq_provision() subroutine.

Parameters
lcdomThe private data pointer for the domain.
lctmTransfer machine private data.
lcbufBuffer private data.
Precondition
The buffer is queued on the specified transfer machine.
lcbuf->cb_length is valid
lcbuf->cb_match_bits != 0
lcbuf->cb_max_operations == 1
See also
nlx_core_bevq_provision()

Definition at line 1617 of file klnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_buf_register()

M0_INTERNAL int nlx_core_buf_register ( struct nlx_core_domain lcdom,
nlx_core_opaque_ptr_t  buffer_id,
const struct m0_bufvec bvec,
struct nlx_core_buffer lcbuf 
)

Registers a network buffer. In user space this results in the buffer memory getting pinned. The subroutine allocates private data to associate with the network buffer.

Parameters
lcdomThe domain private data to be initialized.
buffer_idValue to set in the cb_buffer_id field.
bvecBuffer vector with core address space pointers.
lcbufThe core private data pointer for the buffer.

Definition at line 1295 of file klnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_dom_fini()

M0_INTERNAL void nlx_core_dom_fini ( struct nlx_core_domain lcdom)

Releases LNet transport resources related to the domain.

Definition at line 1207 of file klnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_dom_init()

M0_INTERNAL int nlx_core_dom_init ( struct m0_net_domain dom,
struct nlx_core_domain lcdom 
)

Allocates and initializes the network domain's private field for use by LNet.

Parameters
domThe network domain pointer.
lcdomThe private data pointer for the domain to be initialized.

Definition at line 1167 of file klnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_fini()

static void nlx_core_fini ( void  )
static

Definition at line 1991 of file klnet_core.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_core_get_max_buffer_segment_size()

M0_INTERNAL m0_bcount_t nlx_core_get_max_buffer_segment_size ( struct nlx_core_domain lcdom)

Gets the maximum size of a buffer segment.

Definition at line 1226 of file klnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_get_max_buffer_segments()

M0_INTERNAL int32_t nlx_core_get_max_buffer_segments ( struct nlx_core_domain lcdom)

Gets the maximum number of buffer segments.

Definition at line 1237 of file klnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_get_max_buffer_size()

M0_INTERNAL m0_bcount_t nlx_core_get_max_buffer_size ( struct nlx_core_domain lcdom)

Gets the maximum buffer size (counting all segments).

Definition at line 1220 of file klnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_init()

static int nlx_core_init ( void  )
static

Definition at line 2002 of file klnet_core.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_core_kmem_loc_set()

static void nlx_core_kmem_loc_set ( struct nlx_core_kmem_loc loc,
struct page *  pg,
uint32_t  off 
)
static

Set a memory location reference, including checksum.

Precondition
off < PAGE_SIZE && ergo(pg == NULL, off == 0)
Parameters
locLocation to set.
pgPointer to page object.
offOffset within the page.

Definition at line 1127 of file klnet_core.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_core_mem_alloc()

M0_INTERNAL void* nlx_core_mem_alloc ( size_t  size,
unsigned  shift 
)

Allocate zero-filled memory, like m0_alloc(). In user space, this memory is allocated such that it will not cross page boundaries using m0_alloc_aligned().

Parameters
sizeMemory size.
shiftAlignment, ignored in kernel space.
Precondition
size <= PAGE_SIZE

Definition at line 1138 of file klnet_core.c.

◆ nlx_core_mem_free()

M0_INTERNAL void nlx_core_mem_free ( void *  data,
size_t  size,
unsigned  shift 
)

Frees memory allocated by nlx_core_mem_alloc().

Definition at line 1143 of file klnet_core.c.

◆ nlx_core_new_blessed_bev()

M0_INTERNAL int nlx_core_new_blessed_bev ( struct nlx_core_domain lcdom,
struct nlx_core_transfer_mc lctm,
struct nlx_core_buffer_event **  bevp 
)

Subroutine to allocate a new buffer event structure initialized with the producer space self pointer set. This subroutine is defined separately for the kernel and user space.

Parameters
lcdomLNet core domain pointer.
lctmLNet core transfer machine pointer. In the user space transport this must be initialized at least with the core device driver file descriptor. In kernel space this is not used.
bevpBuffer event return pointer. The memory must be allocated with the NLX_ALLOC_PTR() macro or variant. It will be freed with the NLX_FREE_PTR() macro from the nlx_core_bev_free_cb() subroutine.
Postcondition
bev_cqueue_bless(&bevp->cbe_tm_link) has been invoked.
See also
bev_cqueue_bless()

Definition at line 1785 of file klnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_nidstr_decode()

M0_INTERNAL int nlx_core_nidstr_decode ( struct nlx_core_domain lcdom,
const char *  nidstr,
uint64_t *  nid 
)

Decodes a NID string into a NID.

Parameters
lcdomThe domain private data.
nidstrthe string to be decoded.
nidOn success, the resulting NID is returned here.
Return values
-EINVALthe NID string could not be decoded

Definition at line 1710 of file klnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_nidstr_encode()

M0_INTERNAL int nlx_core_nidstr_encode ( struct nlx_core_domain lcdom,
uint64_t  nid,
char  nidstr[M0_NET_LNET_NIDSTR_SIZE] 
)

Encode a NID into its string representation.

Parameters
lcdomThe domain private data.
nidThe NID to be converted.
nidstrOn success, the string form is set here.

Definition at line 1732 of file klnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_nidstrs_get()

M0_INTERNAL int nlx_core_nidstrs_get ( struct nlx_core_domain lcdom,
char ***  nidary 
)

Gets a list of strings corresponding to the local LNET network interfaces. The returned array must be released using nlx_core_nidstrs_put().

Parameters
nidaryA NULL-terminated (like argv) array of NID strings is returned.

Definition at line 1744 of file klnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_nidstrs_put()

M0_INTERNAL void nlx_core_nidstrs_put ( struct nlx_core_domain lcdom,
char ***  nidary 
)

Releases the string array returned by nlx_core_nidstrs_get().

Definition at line 1774 of file klnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_tm_start()

M0_INTERNAL int nlx_core_tm_start ( struct nlx_core_domain lcdom,
struct m0_net_transfer_mc tm,
struct nlx_core_transfer_mc lctm 
)

Starts a transfer machine. Internally this results in the creation of the LNet EQ associated with the transfer machine.

Parameters
lcdomThe domain private data.
tmThe transfer machine pointer.
lctmThe transfer machine private data to be initialized. The nlx_core_transfer_mc::ctm_addr must be set by the caller. If the lcpea_tmid field value is M0_NET_LNET_TMID_INVALID then a transfer machine identifier is dynamically assigned to the transfer machine and the nlx_core_transfer_mc::ctm_addr is modified in place.
Note
There is no equivalent of the xo_tm_init() subroutine.
This function does not create a m0_net_end_point for the transfer machine, because there is no equivalent object at the core layer.

Definition at line 1942 of file klnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_tm_stop()

M0_INTERNAL void nlx_core_tm_stop ( struct nlx_core_domain lcdom,
struct nlx_core_transfer_mc lctm 
)

Stops the transfer machine and release associated resources. All operations must be finalized prior to this call.

Parameters
lcdomThe domain private data.
lctmThe transfer machine private data.
Note
There is no equivalent of the xo_tm_fini() subroutine.

Definition at line 1834 of file klnet_core.c.

Here is the caller graph for this function:

◆ nlx_kcore_addr_in_use()

static bool nlx_kcore_addr_in_use ( struct nlx_core_ep_addr cepa)
static

Tests if the specified address is in use by a running TM.

Note
the nlx_kcore_mutex must be locked by the caller

Definition at line 939 of file klnet_core.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_buf_active_recv()

static int nlx_kcore_buf_active_recv ( struct nlx_kcore_transfer_mc ktm,
struct nlx_core_buffer cb,
struct nlx_kcore_buffer kb 
)
static

Performs kernel core tasks relating to adding a buffer to the bulk active receive queue.

Parameters
ktmThe kernel transfer machine private data.
cbThe buffer private data.
kbThe kernel buffer private data.

Definition at line 1438 of file klnet_core.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_buf_active_send()

static int nlx_kcore_buf_active_send ( struct nlx_kcore_transfer_mc ktm,
struct nlx_core_buffer cb,
struct nlx_kcore_buffer kb 
)
static

Performs kernel core tasks relating to adding a buffer to the bulk active send queue.

Parameters
ktmThe kernel transfer machine private data.
cbThe buffer private data.
kbThe kernel buffer private data.

Definition at line 1488 of file klnet_core.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_buf_deregister()

static void nlx_kcore_buf_deregister ( struct nlx_core_buffer cb,
struct nlx_kcore_buffer kb 
)
static

Performs common kernel core tasks related to de-registering a buffer.

Parameters
cbThe core private data pointer for the buffer.
kbKernel core private buffer pointer.

Definition at line 1282 of file klnet_core.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_buf_event_wait()

static int nlx_kcore_buf_event_wait ( struct nlx_core_transfer_mc ctm,
struct nlx_kcore_transfer_mc ktm,
m0_time_t  timeout 
)
static

Performs common kernel core tasks to wait for buffer events.

Parameters
ctmThe transfer machine private data.
ktmThe kernel transfer machine private data.
timeoutAbsolute time at which to stop waiting.

Definition at line 1658 of file klnet_core.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_buf_msg_recv()

static int nlx_kcore_buf_msg_recv ( struct nlx_kcore_transfer_mc ktm,
struct nlx_core_buffer cb,
struct nlx_kcore_buffer kb 
)
static

Performs kernel core tasks relating to adding a buffer to the message receive queue.

Parameters
ktmThe kernel transfer machine private data.
cbThe buffer private data.
kbThe kernel buffer private data.

Definition at line 1348 of file klnet_core.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_buf_msg_send()

static int nlx_kcore_buf_msg_send ( struct nlx_kcore_transfer_mc ktm,
struct nlx_core_buffer cb,
struct nlx_kcore_buffer kb 
)
static

Performs kernel core tasks relating to adding a buffer to the message receive queue.

Parameters
ktmThe kernel transfer machine private data.
cbThe buffer private data.
kbThe kernel buffer private data.

Definition at line 1394 of file klnet_core.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_buf_passive_recv()

static int nlx_kcore_buf_passive_recv ( struct nlx_kcore_transfer_mc ktm,
struct nlx_core_buffer cb,
struct nlx_kcore_buffer kb 
)
static

Performs kernel core tasks relating to adding a buffer to the bulk passive receive queue.

Parameters
ktmThe kernel transfer machine private data.
cbThe buffer private data.
kbThe kernel buffer private data.

Definition at line 1538 of file klnet_core.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_buf_passive_send()

static int nlx_kcore_buf_passive_send ( struct nlx_kcore_transfer_mc ktm,
struct nlx_core_buffer cb,
struct nlx_kcore_buffer kb 
)
static

Performs kernel core tasks relating to adding a buffer to the bulk passive send queue.

Parameters
ktmThe kernel transfer machine private data.
cbThe buffer private data.
kbThe kernel buffer private data.

Definition at line 1587 of file klnet_core.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_buf_register()

static int nlx_kcore_buf_register ( struct nlx_kcore_domain kd,
nlx_core_opaque_ptr_t  buffer_id,
struct nlx_core_buffer cb,
struct nlx_kcore_buffer kb 
)
static

Performs common kernel core tasks related to registering a network buffer. The nlx_kcore_buffer::kb_kiov is not set.

Parameters
kdKernel core private domain pointer.
buffer_idValue to set in the cb_buffer_id field.
cbThe core private data pointer for the buffer.
kbKernel core private buffer pointer.

Definition at line 1251 of file klnet_core.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_buffer_event_invariant()

static bool nlx_kcore_buffer_event_invariant ( const struct nlx_kcore_buffer_event kbe)
static

KCore buffer event invariant.

Definition at line 918 of file klnet_core.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_buffer_invariant()

static bool nlx_kcore_buffer_invariant ( const struct nlx_kcore_buffer kcb)
static

KCore buffer invariant.

Note
Shouldn't require the mutex as it is called from nlx_kcore_eq_cb.

Definition at line 908 of file klnet_core.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_buffer_kla_to_kiov()

M0_INTERNAL int nlx_kcore_buffer_kla_to_kiov ( struct nlx_kcore_buffer kb,
const struct m0_bufvec bvec 
)
static

This subroutine sets up the LNet kernel I/O vector in the kcore buffer from a bufvec containing kernel logical addresses.

The page reference count is not incremented.

Parameters
kbKcore buffer private pointer
bvecVector with kernel logical addresses.
Return values
-EFBIGif the IO vector is too large.

Definition at line 133 of file klnet_vec.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_buffer_uva_to_kiov()

M0_INTERNAL int nlx_kcore_buffer_uva_to_kiov ( struct nlx_kcore_buffer kb,
const struct m0_bufvec bvec 
)
static

This subroutine sets up the LNet kernel I/O vector in the kcore buffer from a bufvec containing userspace virtual addresses.

The pages referenced by the bvec->ov_buf are pinned in kernel memory.

Parameters
kbKcore buffer private pointer.
bvecVector with userspace virtual addresses.
Return values
-EFBIGif the IO vector is too large.

Definition at line 236 of file klnet_vec.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_core_bev_map()

static struct nlx_core_buffer_event* nlx_kcore_core_bev_map ( struct nlx_kcore_buffer_event kbe)
static

Maps a page that should point to a nlx_core_buffer_event. Uses kmap() because this subroutine can be used on contexts that will block.

Precondition
nlx_kcore_buffer_event_invariant(kbe)
Postcondition
ret != NULL
Parameters
kbePointer to kcore buffer event private data.
Returns
core object, never NULL

Definition at line 651 of file klnet_utils.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_core_bev_unmap()

static void nlx_kcore_core_bev_unmap ( struct nlx_kcore_buffer_event kbe)
static

Unmaps the page that contains a nlx_core_buffer_event using kunmap().

Precondition
nlx_core_kmem_loc_invariant(&kbe->kbe_bev_loc)
Parameters
kbePointer to kcore buffer event private data.

Definition at line 671 of file klnet_utils.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_core_buffer_map()

static struct nlx_core_buffer* nlx_kcore_core_buffer_map ( struct nlx_kcore_buffer kb)
static

Maps a page that should point to a nlx_core_buffer. Uses kmap() because this subroutine can be used on contexts that will block.

Precondition
nlx_kcore_buffer_invariant(kb)
Postcondition
ret != NULL
Parameters
kbPointer to kcore buffer private data.
Returns
core object, never NULL

Definition at line 617 of file klnet_utils.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_core_buffer_unmap()

static void nlx_kcore_core_buffer_unmap ( struct nlx_kcore_buffer kb)
static

Unmaps the page that contains a nlx_core_buffer using kunmap().

Precondition
nlx_core_kmem_loc_invariant(&kcb->kb_cb_loc)
Parameters
kbPointer to kcore buffer private data.

Definition at line 637 of file klnet_utils.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_core_dom_fini()

static void nlx_kcore_core_dom_fini ( struct nlx_kcore_domain kd,
struct nlx_core_domain cd 
)
static

Finilizes the core private data associated with a kernel core private data object.

Parameters
kdKernel core private data pointer.
cdCore private data pointer.

Definition at line 1200 of file klnet_core.c.

Here is the caller graph for this function:

◆ nlx_kcore_core_dom_init()

static int nlx_kcore_core_dom_init ( struct nlx_kcore_domain kd,
struct nlx_core_domain cd 
)
static

Initializes the core private data given a previously initialized kernel core private data object.

See also
nlx_kcore_kcore_dom_init()
Precondition
nlx_kcore_domain_invariant(kd) && !nlx_core_kmem_loc_is_empty(&kd->kd_cd_loc)
Parameters
kdKernel core private data pointer.
cdCore private data pointer.

Definition at line 1157 of file klnet_core.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_core_domain_map()

static struct nlx_core_domain* nlx_kcore_core_domain_map ( struct nlx_kcore_domain kd)
static

Maps a page that should point to a nlx_core_domain. Uses kmap() because this subroutine can be used on contexts that will block.

Precondition
nlx_kcore_domain_invariant(kd) && !nlx_core_kmem_loc_is_empty(&kd->kd_cd_loc)
Parameters
kdkernel private object containing location reference to be mapped
Returns
core object, never NULL

Definition at line 582 of file klnet_utils.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_core_domain_unmap()

static void nlx_kcore_core_domain_unmap ( struct nlx_kcore_domain kd)
static

Unmaps the page that contains a nlx_core_domain using kunmap().

Precondition
nlx_kcore_domain_invariant(kd)
Parameters
kdPointer to kcore domain private data.

Definition at line 603 of file klnet_utils.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_core_tm_map()

static struct nlx_core_transfer_mc* nlx_kcore_core_tm_map ( struct nlx_kcore_transfer_mc ktm)
static

Maps a page that should point to a nlx_core_transfer_mc. Uses kmap() because this subroutine can be used on contexts that will block.

Precondition
nlx_kcore_tm_invariant(ktm)
Postcondition
ret != NULL
Parameters
ktmPointer to kcore transfer machine private data.
Returns
core object, never NULL

Definition at line 685 of file klnet_utils.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_core_tm_map_atomic()

static struct nlx_core_transfer_mc* nlx_kcore_core_tm_map_atomic ( struct nlx_kcore_transfer_mc ktm)
static

Maps a page that should point to a nlx_core_transfer_mc. Uses kmap_atomic(), thus it is user responsibility to serialize this routine CPU-wise (each CPU has its own set of slots).

Precondition
nlx_kcore_tm_invariant(ktm)
Postcondition
ret != NULL
Parameters
ktmPointer to kcore transfer machine private data.
Returns
core object, never NULL

Definition at line 722 of file klnet_utils.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_core_tm_unmap()

static void nlx_kcore_core_tm_unmap ( struct nlx_kcore_transfer_mc ktm)
static

Unmaps the page that contains a nlx_core_transfer_mc using kunmap().

Precondition
nlx_core_kmem_loc_invariant(&kctm->ktm_ctm_loc)
Parameters
ktmPointer to kcore transfer machine private data.

Definition at line 705 of file klnet_utils.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_core_tm_unmap_atomic()

static void nlx_kcore_core_tm_unmap_atomic ( struct nlx_core_transfer_mc ctm)
static

Unmaps the page that contains a nlx_core_transfer_mc. Uses kunmap_atomic().

Note
this signature differs from nlx_kcore_core_tm_unmap() due to the differing requirements of kunmap() vs kunmap_atomic(); the former requires a struct page while the latter requires a mapped address.
Precondition
nlx_core_tm_invariant(ctm)
Parameters
ctmPointer to corresponding core TM private data.

Definition at line 749 of file klnet_utils.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_domain_invariant()

static bool nlx_kcore_domain_invariant ( const struct nlx_kcore_domain kd)
static

KCore domain invariant.

Note
Unlike other kernel core object invariants, the reference to the nlx_core_domain is allowed to be NULL, because initialization of the nlx_kcore_domain in the driver is split between the open and M0_LNET_DOM_INIT ioctl request.

Definition at line 897 of file klnet_core.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_eq_cb()

static void nlx_kcore_eq_cb ( lnet_event_t *  event)
static

Callback for the LNet Event Queue. It must be re-entrant, and not make any calls to the LNet API. It must not perform non-atomic operations, such as locking a mutex. An atomic spin lock is used to synchronize access to the nlx_core_transfer_mc::nlx_core_bev_cqueue.

Definition at line 1004 of file klnet_core.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_hdr_data_decode()

static void nlx_kcore_hdr_data_decode ( uint64_t  hdr_data,
uint32_t *  portal,
uint32_t *  tmid 
)
inlinestatic

Helper subroutine to decode header data from an LNetPut event.

Parameters
hdr_data
portalPointer to portal.
tmidPointer to transfer machine identifier.
See also
nlx_kcore_hdr_data_encode()

Definition at line 229 of file klnet_utils.c.

Here is the caller graph for this function:

◆ nlx_kcore_hdr_data_encode()

static uint64_t nlx_kcore_hdr_data_encode ( struct nlx_kcore_transfer_mc kctm)
static

Helper subroutine to encode header data for LNetPut operations.

Parameters
kctmPointer to kcore TM private data.
See also
nlx_kcore_hdr_data_decode(), nlx_kcore_hdr_data_encode_raw()

Definition at line 212 of file klnet_utils.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_hdr_data_encode_raw()

static uint64_t nlx_kcore_hdr_data_encode_raw ( uint32_t  tmid,
uint32_t  portal 
)
inlinestatic

Helper subroutine to encode header data for LNetPut operations.

Parameters
tmidTransfer machine id
portalPortal number
See also
nlx_kcore_hdr_data_encode(), nlx_kcore_hdr_data_decode()

Definition at line 200 of file klnet_utils.c.

Here is the caller graph for this function:

◆ nlx_kcore_kcore_dom_fini()

static void nlx_kcore_kcore_dom_fini ( struct nlx_kcore_domain kd)
static

Finalizes the kernel core domain private data object.

Parameters
kdkernel core private data pointer for the domain to be finalized.

Definition at line 2078 of file klnet_core.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_kcore_dom_init()

static int nlx_kcore_kcore_dom_init ( struct nlx_kcore_domain kd)
static

Initializes the kernel core domain private data object. The nlx_kcore_domain::kd_cd_loc is empty on return, denoting the initial state of the domain. The caller must set this field before calling nlx_kcore_core_dom_init().

See also
nlx_kcore_core_dom_init()
Postcondition
nlx_kcore_domain_invariant(kd)
Parameters
kdkernel core private data pointer for the domain to be initialized.

Definition at line 2061 of file klnet_core.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_kiov_adjust_length()

static void nlx_kcore_kiov_adjust_length ( struct nlx_kcore_transfer_mc ktm,
struct nlx_kcore_buffer kcb,
lnet_md_t *  umd,
m0_bcount_t  bytes 
)
static

Helper subroutine to adjust the length of the kiov vector in a UMD to match a specified byte length. This is needed for SEND and active buffer operations. Restore the kiov with nlx_kcore_kiov_restore_length().

Parameters
ktmPointer to kcore TM private data.
kcbPointer to kcore buffer private data with match bits set.
umdPointer to the UMD.
bytesThe byte count desired.
See also
nlx_kcore_kiov_restore_length()
Postcondition
kcb->kb_kiov_adj_idx >= 0
kcb->kb_kiov_adj_idx < kcb->kb_kiov_len
nlx_kcore_kiov_invariant(umd->start, umd->length)

Definition at line 314 of file klnet_utils.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_kiov_invariant()

static bool nlx_kcore_kiov_invariant ( const lnet_kiov_t *  k,
size_t  len 
)
static
Here is the caller graph for this function:

◆ nlx_kcore_kiov_restore_length()

static void nlx_kcore_kiov_restore_length ( struct nlx_kcore_buffer kcb)
static

Helper subroutine to restore the original length of the buffer's kiov.

Parameters
kcbPointer to kcore buffer private data with match bits set.
See also
nlx_kcore_kiov_adjust_length()
Precondition
kcb->kb_kiov_adj_idx >= 0
kcb->kb_kiov_adj_idx < kcb->kb_kiov_len
Postcondition
nlx_kcore_kiov_invariant(kcb->kb_kiov, kcb->kb_kiov_len)

Definition at line 352 of file klnet_utils.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_LNetGet()

static int nlx_kcore_LNetGet ( struct nlx_kcore_transfer_mc kctm,
struct nlx_core_buffer lcbuf,
struct nlx_kcore_buffer kcb,
lnet_md_t *  umd 
)
static

Helper subroutine to fetch a buffer from a remote destination using LNetGet().

  • The MD is set up to automatically unlink.
  • The MD handle is set in the struct nlx_kcore_buffer::kb_mdh field.
  • The TM's portal and TMID are encoded in the header data.
  • Sets the kb_ktm field in the KCore buffer private data.
    Parameters
    kctmPointer to kcore TM private data.
    lcbufPointer to kcore buffer private data with match bits set, and the address of the remote destination in struct nlx_core_buffer::cb_addr.
    kcbPointer to kcore buffer private data.
    umdPointer to lnet_md_t structure for the buffer, with appropriate values set for the desired operation.
    Precondition
    umd->threshold == 2
    See also
    nlx_kcore_hdr_data_encode(), nlx_kcore_hdr_data_decode()
    Note
    LNet event could potentially be delivered before this sub returns.

Definition at line 523 of file klnet_utils.c.

Here is the call graph for this function:

◆ nlx_kcore_LNetMDAttach()

static int nlx_kcore_LNetMDAttach ( struct nlx_kcore_transfer_mc kctm,
struct nlx_core_buffer lcbuf,
struct nlx_kcore_buffer kcb,
lnet_md_t *  umd 
)
static

Helper subroutine to attach a network buffer to the match list associated with the transfer machine's portal.

  • The ME entry created is put at the end of the match list.
  • The ME and MD are set up to automatically unlink.
  • The MD handle is set in the struct nlx_kcore_buffer::kb_mdh field.
  • Sets the kb_ktm field in the KCore buffer private data.
    Parameters
    kctmPointer to kcore TM private data.
    lcbufPointer to core buffer private data with match bits set in the cb_match_bits field, and the network address in cb_addr.
    kcbPointer to kcore buffer private data.
    umdPointer to lnet_md_t structure for the buffer, with appropriate values set for the desired operation.
    Note
    LNet event could potentially be delivered before this sub returns.

Definition at line 377 of file klnet_utils.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_LNetMDUnlink()

static int nlx_kcore_LNetMDUnlink ( struct nlx_kcore_transfer_mc kctm,
struct nlx_kcore_buffer kcb 
)
static

Helper subroutine to unlink an MD.

Parameters
kctmPointer to kcore TM private data.
kcbPointer to kcore buffer private data with kb_mdh set.
Note
LNet event could potentially be delivered before this sub returns. There is always an inherent race condition between the invocation of this subroutine and ongoing activity. No assumptions can be made about the value of ephemeral fields in related buffer data structures.

Definition at line 433 of file klnet_utils.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_LNetPut()

static int nlx_kcore_LNetPut ( struct nlx_kcore_transfer_mc kctm,
struct nlx_core_buffer lcbuf,
struct nlx_kcore_buffer kcb,
lnet_md_t *  umd 
)
static

Helper subroutine to send a buffer to a remote destination using LNetPut().

  • The MD is set up to automatically unlink.
  • The MD handle is set in the struct nlx_kcore_buffer::kb_mdh field.
  • The TM's portal and TMID are encoded in the header data.
  • Sets the kb_ktm field in the KCore buffer private data.
    Parameters
    kctmPointer to kcore TM private data.
    lcbufPointer to core buffer private data with match bits set, and the address of the remote destination in struct nlx_core_buffer::cb_addr.
    kcbPointer to kcore buffer private data.
    umdPointer to lnet_md_t structure for the buffer, with appropriate values set for the desired operation.
    See also
    nlx_kcore_hdr_data_encode(), nlx_kcore_hdr_data_decode()
    Note
    LNet event could potentially be delivered before this sub returns.

Definition at line 461 of file klnet_utils.c.

Here is the call graph for this function:

◆ nlx_kcore_max_tmid_find()

static int nlx_kcore_max_tmid_find ( struct nlx_core_ep_addr cepa)
static

Find an unused tmid.

Note
The nlx_kcore_mutex must be locked by the caller
Parameters
cepaThe NID, PID and Portal are used to filter the nlx_kcore_tms.
Returns
The largest available tmid, or -EADDRNOTAVAIL if none exists.

Definition at line 953 of file klnet_core.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_nidstr_decode()

static int nlx_kcore_nidstr_decode ( const char *  nidstr,
uint64_t *  nid 
)
static

Decodes a NID string into a NID.

Parameters
nidstrthe string to be decoded.
nidOn success, the resulting NID is returned here.
Return values
-EINVALthe NID string could not be decoded.

Definition at line 1702 of file klnet_core.c.

Here is the caller graph for this function:

◆ nlx_kcore_nidstr_encode()

static int nlx_kcore_nidstr_encode ( uint64_t  nid,
char  nidstr[M0_NET_LNET_NIDSTR_SIZE] 
)
static

Encode a NID into its string representation.

Parameters
nidThe NID to be converted.
nidstrOn success, the string form is set here.

Definition at line 1721 of file klnet_core.c.

Here is the caller graph for this function:

◆ nlx_kcore_num_kiov_entries_for_bytes()

static size_t nlx_kcore_num_kiov_entries_for_bytes ( const lnet_kiov_t *  kiov,
size_t  kiov_len,
m0_bcount_t  bytes,
unsigned *  last_len 
)
static

Helper subroutine to determine the number of kiov vector elements are required to match a specified byte length.

Parameters
kiovPointer to the KIOV vector.
kiov_lenLength of the KIOV vector.
bytesThe byte count desired.
last_lenReturns the number of bytes used in the last kiov element.
Returns
The number of KIOV entries required.
Postcondition
return value <= kiov_len

Definition at line 302 of file klnet_vec.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_tm_invariant()

static bool nlx_kcore_tm_invariant ( const struct nlx_kcore_transfer_mc kctm)
static

KCore tm invariant.

Note
Shouldn't require the mutex as it is called from nlx_kcore_eq_cb.

Definition at line 929 of file klnet_core.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_tm_start()

static int nlx_kcore_tm_start ( struct nlx_kcore_domain kd,
struct nlx_core_transfer_mc ctm,
struct nlx_kcore_transfer_mc ktm 
)
static

Performs kernel core tasks related to starting a transfer machine. Internally this results in the creation of the LNet EQ associated with the transfer machine.

Parameters
kdThe kernel domain for this transfer machine.
ctmThe transfer machine private data to be initialized. The nlx_core_transfer_mc::ctm_addr must be set by the caller. If the lcpea_tmid field value is M0_NET_LNET_TMID_INVALID then a transfer machine identifier is dynamically assigned to the transfer machine and the nlx_core_transfer_mc::ctm_addr is modified in place.
ktmThe kernel transfer machine private data to be initialized.

Definition at line 1858 of file klnet_core.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_tm_stop()

static void nlx_kcore_tm_stop ( struct nlx_core_transfer_mc ctm,
struct nlx_kcore_transfer_mc ktm 
)
static

Performs kernel core tasks relating to stopping a transfer machine. Kernel resources are released.

Parameters
ctmThe transfer machine private data.
ktmThe kernel transfer machine private data.

Definition at line 1811 of file klnet_core.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_tms_list_add()

static void nlx_kcore_tms_list_add ( struct nlx_kcore_transfer_mc kctm)
static

Add the transfer machine to the nlx_kcore_tms. The list is kept in descending order sorted by nlx_core_ep_addr::cepa_tmid.

Note
the nlx_kcore_mutex must be locked by the caller

Definition at line 980 of file klnet_core.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nlx_kcore_umd_init()

static void nlx_kcore_umd_init ( struct nlx_kcore_transfer_mc kctm,
struct nlx_core_buffer lcbuf,
struct nlx_kcore_buffer kcb,
int  threshold,
int  max_size,
unsigned  options,
bool  isLNetGetOp,
lnet_md_t *  umd 
)
static

Helper subroutine to fill in the common fields of the lnet_md_t associated with a network buffer and the common fields of the kcore buffer private data.

Parameters
kctmPointer to kcore TM private data.
lcbufPointer to core buffer private data with match bits set.
kcbPointer to kcore buffer private data with match bits set.
thresholdValue for threshold field. Should be at least 1.
max_sizeMax size value, if not zero. If provided the LNET_MD_MAX_SIZE flag is set.
optionsOptional flags to be set. If not 0, only LNET_MD_OP_PUT or LNET_MD_OP_GET are accepted.
isLNetGetOpSet to true if the lnet_md_t is to be used to create an MD that will be used in an LNetGet operation. The threshold field is forced to 2, and the out-of-order fields of the nlx_kcore_buffer are reset.
umdPointer to return structure to be filled in. The ktm_eqh handle is used by default. Adjust if necessary.
Postcondition
ergo(isLNetGetOp, umd->threshold == 2 && !kcb->kb_ooo_reply)

Definition at line 255 of file klnet_utils.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ nlx_kcore_def_ops

struct nlx_kcore_ops nlx_kcore_def_ops
static
Initial value:
= {
.ko_dom_init = nlx_kcore_core_dom_init,
.ko_dom_fini = nlx_kcore_core_dom_fini,
.ko_buf_register = nlx_kcore_buf_register,
.ko_buf_deregister = nlx_kcore_buf_deregister,
.ko_tm_start = nlx_kcore_tm_start,
.ko_tm_stop = nlx_kcore_tm_stop,
.ko_buf_msg_recv = nlx_kcore_buf_msg_recv,
.ko_buf_msg_send = nlx_kcore_buf_msg_send,
.ko_buf_active_recv = nlx_kcore_buf_active_recv,
.ko_buf_active_send = nlx_kcore_buf_active_send,
.ko_buf_passive_recv = nlx_kcore_buf_passive_recv,
.ko_buf_passive_send = nlx_kcore_buf_passive_send,
.ko_buf_del = nlx_kcore_LNetMDUnlink,
.ko_buf_event_wait = nlx_kcore_buf_event_wait,
}
static int nlx_kcore_buf_passive_send(struct nlx_kcore_transfer_mc *ktm, struct nlx_core_buffer *cb, struct nlx_kcore_buffer *kb)
Definition: klnet_core.c:1587
static int nlx_kcore_core_dom_init(struct nlx_kcore_domain *kd, struct nlx_core_domain *cd)
Definition: klnet_core.c:1157
static void nlx_kcore_core_dom_fini(struct nlx_kcore_domain *kd, struct nlx_core_domain *cd)
Definition: klnet_core.c:1200
static void nlx_kcore_tm_stop(struct nlx_core_transfer_mc *ctm, struct nlx_kcore_transfer_mc *ktm)
Definition: klnet_core.c:1811
static void nlx_kcore_buf_deregister(struct nlx_core_buffer *cb, struct nlx_kcore_buffer *kb)
Definition: klnet_core.c:1282
static int nlx_kcore_buf_passive_recv(struct nlx_kcore_transfer_mc *ktm, struct nlx_core_buffer *cb, struct nlx_kcore_buffer *kb)
Definition: klnet_core.c:1538
static int nlx_kcore_buf_msg_recv(struct nlx_kcore_transfer_mc *ktm, struct nlx_core_buffer *cb, struct nlx_kcore_buffer *kb)
Definition: klnet_core.c:1348
static int nlx_kcore_tm_start(struct nlx_kcore_domain *kd, struct nlx_core_transfer_mc *ctm, struct nlx_kcore_transfer_mc *ktm)
Definition: klnet_core.c:1858
static int nlx_kcore_buf_register(struct nlx_kcore_domain *kd, nlx_core_opaque_ptr_t buffer_id, struct nlx_core_buffer *cb, struct nlx_kcore_buffer *kb)
Definition: klnet_core.c:1251
static int nlx_kcore_buf_event_wait(struct nlx_core_transfer_mc *ctm, struct nlx_kcore_transfer_mc *ktm, m0_time_t timeout)
Definition: klnet_core.c:1658
static int nlx_kcore_buf_active_send(struct nlx_kcore_transfer_mc *ktm, struct nlx_core_buffer *cb, struct nlx_kcore_buffer *kb)
Definition: klnet_core.c:1488
static int nlx_kcore_buf_msg_send(struct nlx_kcore_transfer_mc *ktm, struct nlx_core_buffer *cb, struct nlx_kcore_buffer *kb)
Definition: klnet_core.c:1394
static int nlx_kcore_buf_active_recv(struct nlx_kcore_transfer_mc *ktm, struct nlx_core_buffer *cb, struct nlx_kcore_buffer *kb)
Definition: klnet_core.c:1438
static int nlx_kcore_LNetMDUnlink(struct nlx_kcore_transfer_mc *kctm, struct nlx_kcore_buffer *kcb)
Definition: klnet_utils.c:433

Definition at line 2035 of file klnet_core.c.

◆ nlx_kcore_iv

struct nlx_kcore_interceptable_subs nlx_kcore_iv
static
Initial value:
= {
#define _NLXIS(s)
}
static int nlx_kcore_LNetMDAttach(struct nlx_kcore_transfer_mc *kctm, struct nlx_core_buffer *lcbuf, struct nlx_kcore_buffer *kcb, lnet_md_t *umd)
Definition: klnet_utils.c:377
static int nlx_kcore_LNetGet(struct nlx_kcore_transfer_mc *kctm, struct nlx_core_buffer *lcbuf, struct nlx_kcore_buffer *kcb, lnet_md_t *umd)
Definition: klnet_utils.c:523
static int nlx_kcore_LNetPut(struct nlx_kcore_transfer_mc *kctm, struct nlx_core_buffer *lcbuf, struct nlx_kcore_buffer *kcb, lnet_md_t *umd)
Definition: klnet_utils.c:461
#define _NLXIS(s)

Definition at line 873 of file klnet_core.c.

◆ nlx_kcore_mutex

struct m0_mutex nlx_kcore_mutex
static

Kernel core lock. Provides serialization across the nlx_kcore_tms list.

Definition at line 822 of file klnet_core.c.

◆ nlx_kcore_tms

struct m0_tl nlx_kcore_tms
static

List of all transfer machines. Protected by nlx_kcore_mutex.

Definition at line 825 of file klnet_core.c.