Motr  M0
LNet Transport Core Interfaces
Collaboration diagram for LNet Transport Core Interfaces:

Modules

 LNet Transport Core Kernel Private Interface
 
 LNet Transport Core User Space Private Interface
 

Data Structures

struct  nlx_core_ep_addr
 
struct  nlx_core_kmem_loc
 
struct  nlx_core_bev_link
 
struct  nlx_core_bev_cqueue
 
struct  nlx_core_buffer_event
 
struct  nlx_core_domain
 
struct  nlx_core_transfer_mc
 
struct  nlx_core_buffer
 
struct  nlx_core_buf_desc
 

Macros

#define CBD_EP(f)   cbd->cbd_passive_ep.cepa_ ## f
 
#define TM_EP(f)   lctm->ctm_addr.cepa_ ## f
 
#define B_EP(f)   lcbuf->cb_addr.cepa_ ## f
 
#define NLX_PO2_SHIFT(n)
 
#define NLX_ALLOC_ALIGNED_PTR(ptr)
 
#define NLX_FREE_ALIGNED_PTR(ptr)
 
#define NLX_ALLOC(ptr, len)   ({ ptr = m0_alloc(len); })
 
#define NLX_ALLOC_PTR(ptr)   M0_ALLOC_PTR(ptr)
 
#define NLX_ALLOC_ARR(ptr, nr)   M0_ALLOC_ARR(ptr, nr)
 

Typedefs

typedef uint64_t nlx_core_opaque_ptr_t
 

Enumerations

enum  {
  M0_NET_LNET_TMID_BITS = 12, M0_NET_LNET_TMID_SHIFT = 64 - M0_NET_LNET_TMID_BITS, M0_NET_LNET_TMID_MAX = (1 << M0_NET_LNET_TMID_BITS) - 1, M0_NET_LNET_TMID_INVALID = M0_NET_LNET_TMID_MAX+1,
  M0_NET_LNET_BUFFER_ID_BITS = 64 - M0_NET_LNET_TMID_BITS, M0_NET_LNET_BUFFER_ID_MIN = 1, M0_NET_LNET_BUFFER_ID_MAX = (1ULL << M0_NET_LNET_BUFFER_ID_BITS) - 1, M0_NET_LNET_BUFFER_ID_MASK = M0_NET_LNET_BUFFER_ID_MAX
}
 
enum  { M0_NET_LNET_NIDSTR_SIZE = 32 }
 
enum  { M0_NET_LNET_BEVQ_MIN_SIZE = 2, M0_NET_LNET_BEVQ_NUM_RESERVED = 1 }
 

Functions

static bool nlx_core_tm_invariant (const struct nlx_core_transfer_mc *lctm)
 
static bool nlx_core_tm_is_locked (const struct nlx_core_transfer_mc *lctm)
 
static bool nlx_core_buffer_invariant (const struct nlx_core_buffer *lcb)
 
static uint32_t nlx_core_kmem_loc_checksum (const struct nlx_core_kmem_loc *loc)
 
static void nlx_core_bev_free_cb (struct nlx_core_bev_link *ql)
 
M0_INTERNAL int nlx_core_bevq_provision (struct nlx_core_domain *lcdom, struct nlx_core_transfer_mc *lctm, size_t need)
 
M0_INTERNAL void nlx_core_bevq_release (struct nlx_core_transfer_mc *lctm, size_t release)
 
M0_INTERNAL bool nlx_core_buf_event_get (struct nlx_core_transfer_mc *lctm, struct nlx_core_buffer_event *lcbe)
 
static uint64_t nlx_core_match_bits_encode (uint32_t tmid, uint64_t counter)
 
static void nlx_core_match_bits_decode (uint64_t mb, uint32_t *tmid, uint64_t *counter)
 
static uint64_t nlx_core_buf_desc_checksum (const struct nlx_core_buf_desc *cbd)
 
M0_INTERNAL void nlx_core_buf_desc_encode (struct nlx_core_transfer_mc *lctm, struct nlx_core_buffer *lcbuf, struct nlx_core_buf_desc *cbd)
 
M0_INTERNAL int nlx_core_buf_desc_decode (struct nlx_core_transfer_mc *lctm, struct nlx_core_buffer *lcbuf, struct nlx_core_buf_desc *cbd)
 
int nlx_core_ep_addr_decode (struct nlx_core_domain *lcdom, const char *ep_addr, struct nlx_core_ep_addr *cepa)
 
void nlx_core_ep_addr_encode (struct nlx_core_domain *lcdom, const struct nlx_core_ep_addr *cepa, char buf[M0_NET_LNET_XEP_ADDR_LEN])
 
M0_INTERNAL void nlx_core_dom_set_debug (struct nlx_core_domain *lcdom, unsigned dbg)
 
M0_INTERNAL void nlx_core_tm_set_debug (struct nlx_core_transfer_mc *lctm, unsigned dbg)
 
static int nlx_core_dom_init (struct m0_net_domain *dom, struct nlx_core_domain *lcdom)
 
static void nlx_core_dom_fini (struct nlx_core_domain *lcdom)
 
static m0_bcount_t nlx_core_get_max_buffer_size (struct nlx_core_domain *lcdom)
 
static m0_bcount_t nlx_core_get_max_buffer_segment_size (struct nlx_core_domain *lcdom)
 
static int32_t nlx_core_get_max_buffer_segments (struct nlx_core_domain *lcdom)
 
static 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)
 
static void nlx_core_buf_deregister (struct nlx_core_domain *lcdom, struct nlx_core_buffer *lcbuf)
 
static int nlx_core_buf_msg_recv (struct nlx_core_domain *lcdom, struct nlx_core_transfer_mc *lctm, struct nlx_core_buffer *lcbuf)
 
static int nlx_core_buf_msg_send (struct nlx_core_domain *lcdom, struct nlx_core_transfer_mc *lctm, struct nlx_core_buffer *lcbuf)
 
static int nlx_core_buf_active_recv (struct nlx_core_domain *lcdom, struct nlx_core_transfer_mc *lctm, struct nlx_core_buffer *lcbuf)
 
static int nlx_core_buf_active_send (struct nlx_core_domain *lcdom, struct nlx_core_transfer_mc *lctm, struct nlx_core_buffer *lcbuf)
 
static int nlx_core_buf_passive_recv (struct nlx_core_domain *lcdom, struct nlx_core_transfer_mc *lctm, struct nlx_core_buffer *lcbuf)
 
static int nlx_core_buf_passive_send (struct nlx_core_domain *lcdom, struct nlx_core_transfer_mc *lctm, struct nlx_core_buffer *lcbuf)
 
static int nlx_core_buf_del (struct nlx_core_domain *lcdom, struct nlx_core_transfer_mc *lctm, struct nlx_core_buffer *lcbuf)
 
static int nlx_core_buf_event_wait (struct nlx_core_domain *lcdom, struct nlx_core_transfer_mc *lctm, m0_time_t timeout)
 
static int nlx_core_nidstrs_get (struct nlx_core_domain *lcdom, char ***nidary)
 
static void nlx_core_nidstrs_put (struct nlx_core_domain *lcdom, char ***nidary)
 
static int nlx_core_tm_start (struct nlx_core_domain *lcdom, struct m0_net_transfer_mc *tm, struct nlx_core_transfer_mc *lctm)
 
static void nlx_core_tm_stop (struct nlx_core_domain *lcdom, struct nlx_core_transfer_mc *lctm)
 
static bool nlx_core_ep_eq (const struct nlx_core_ep_addr *cep1, const struct nlx_core_ep_addr *cep2)
 
static int nlx_core_new_blessed_bev (struct nlx_core_domain *lcdom, struct nlx_core_transfer_mc *lctm, struct nlx_core_buffer_event **bevp)
 
static void * nlx_core_mem_alloc (size_t size, unsigned shift)
 
static void nlx_core_mem_free (void *data, size_t size, unsigned shift)
 
 M0_BASSERT (sizeof(nlx_core_opaque_ptr_t) >=sizeof(void *))
 
struct nlx_core_ep_addr __attribute__ ((__packed__))
 
 M0_BASSERT (M0_NET_LNET_TMID_BITS+M0_NET_LNET_BUFFER_ID_BITS<=64)
 
 M0_BASSERT (sizeof(((struct nlx_core_kmem_loc *) NULL) ->kl_page)+sizeof(((struct nlx_core_kmem_loc *) NULL) ->kl_offset)==sizeof(((struct nlx_core_kmem_loc *) NULL) ->kl_data))
 
static bool nlx_core_kmem_loc_invariant (const struct nlx_core_kmem_loc *loc)
 
static bool nlx_core_kmem_loc_is_empty (const struct nlx_core_kmem_loc *loc)
 
static bool nlx_core_kmem_loc_eq (const struct nlx_core_kmem_loc *a, const struct nlx_core_kmem_loc *b)
 
static int nlx_core_nidstr_decode (struct nlx_core_domain *lcdom, const char *nidstr, uint64_t *nid)
 
static int nlx_core_nidstr_encode (struct nlx_core_domain *lcdom, uint64_t nid, char nidstr[M0_NET_LNET_NIDSTR_SIZE])
 

Variables

enum { ... }  __attribute__
 

Detailed Description

The internal, address space agnostic I/O API used by the LNet transport. See LNet Transport Core API for organizational details and LNet Transport DLD for details of the Motr Network transport for LNet.

Macro Definition Documentation

◆ B_EP

#define B_EP (   f)    lcbuf->cb_addr.cepa_ ## f

Definition at line 269 of file lnet_core.c.

◆ CBD_EP

#define CBD_EP (   f)    cbd->cbd_passive_ep.cepa_ ## f

Definition at line 267 of file lnet_core.c.

◆ NLX_ALLOC

#define NLX_ALLOC (   ptr,
  len 
)    ({ ptr = m0_alloc(len); })

Definition at line 637 of file lnet_core.h.

◆ NLX_ALLOC_ALIGNED_PTR

#define NLX_ALLOC_ALIGNED_PTR (   ptr)
Value:
((ptr) = nlx_core_mem_alloc(sizeof ((ptr)[0]), \
NLX_PO2_SHIFT(sizeof ((ptr)[0]))))
static void ptr(struct m0_addb2__context *ctx, const uint64_t *v, char *buf)
Definition: dump.c:440
static void * nlx_core_mem_alloc(size_t size, unsigned shift)
Definition: klnet_core.c:1138

Definition at line 630 of file lnet_core.h.

◆ NLX_ALLOC_ARR

#define NLX_ALLOC_ARR (   ptr,
  nr 
)    M0_ALLOC_ARR(ptr, nr)

Definition at line 639 of file lnet_core.h.

◆ NLX_ALLOC_PTR

#define NLX_ALLOC_PTR (   ptr)    M0_ALLOC_PTR(ptr)

Definition at line 638 of file lnet_core.h.

◆ NLX_FREE_ALIGNED_PTR

#define NLX_FREE_ALIGNED_PTR (   ptr)
Value:
nlx_core_mem_free((ptr), sizeof ((ptr)[0]), \
NLX_PO2_SHIFT(sizeof ((ptr)[0])))
static void ptr(struct m0_addb2__context *ctx, const uint64_t *v, char *buf)
Definition: dump.c:440
#define NLX_PO2_SHIFT(n)
Definition: lnet_core.h:626
static void nlx_core_mem_free(void *data, size_t size, unsigned shift)
Definition: klnet_core.c:1143

Definition at line 633 of file lnet_core.h.

◆ NLX_PO2_SHIFT

#define NLX_PO2_SHIFT (   n)
Value:
(((n) <= 8) ? 3 : ((n) <= 16) ? 4 : ((n) <= 32) ? 5 : \
((n) <= 64) ? 6 : ((n) <= 128) ? 7 : ((n) <= 256) ? 8 : \
((n) <= 512) ? 9 : ((n) / 0))
uint64_t n
Definition: fops.h:107

Round up a number n to the next power of 2, min 1<<3, works for n <= 1<<9. If n is a power of 2, returns n. Requires a constant input, allowing compile-time computation.

Definition at line 626 of file lnet_core.h.

◆ TM_EP

#define TM_EP (   f)    lctm->ctm_addr.cepa_ ## f

Definition at line 268 of file lnet_core.c.

Typedef Documentation

◆ nlx_core_opaque_ptr_t

typedef uint64_t nlx_core_opaque_ptr_t

Opaque type wide enough to represent an address in any address space.

Definition at line 49 of file lnet_core_types.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
M0_NET_LNET_TMID_BITS 

Number of bits used for TM identifier

M0_NET_LNET_TMID_SHIFT 

Shift to the TMID position (52)

M0_NET_LNET_TMID_MAX 

Max TM identifier is 2^12-1 (4095)

M0_NET_LNET_TMID_INVALID 

Invalid value used for dynamic addressing

M0_NET_LNET_BUFFER_ID_BITS 

Number of bits used for buffer identification (52)

M0_NET_LNET_BUFFER_ID_MIN 

Minimum buffer match bit counter value

M0_NET_LNET_BUFFER_ID_MAX 

Maximum buffer match bit counter value: 2^52-1 (0xfffffffffffff)

M0_NET_LNET_BUFFER_ID_MASK 

Buffer match bit mask

Definition at line 64 of file lnet_core_types.h.

◆ anonymous enum

anonymous enum
Enumerator
M0_NET_LNET_NIDSTR_SIZE 

Maximum size of an LNET NID string, same as LNET_NIDSTR_SIZE

Definition at line 104 of file lnet_core_types.h.

◆ anonymous enum

anonymous enum
Enumerator
M0_NET_LNET_BEVQ_MIN_SIZE 

Minimum number of buffer event entries in the queue.

M0_NET_LNET_BEVQ_NUM_RESERVED 

Number of reserved buffer event entries in the queue. The entry pointed to by the consumer is owned by the consumer and thus cannot be used by the producer. It will eventually be used when the pointers advance.

Definition at line 166 of file lnet_core_types.h.

Function Documentation

◆ __attribute__()

struct nlx_core_ep_addr __attribute__ ( (__packed__)  )

◆ M0_BASSERT() [1/3]

M0_BASSERT ( sizeof(nlx_core_opaque_ptr_t) >=sizeof(void *)  )

◆ M0_BASSERT() [2/3]

◆ M0_BASSERT() [3/3]

M0_BASSERT ( sizeof(((struct nlx_core_kmem_loc *) NULL) ->kl_page)+sizeof(((struct nlx_core_kmem_loc *) NULL) ->kl_offset = =sizeof(((struct nlx_core_kmem_loc *) NULL) ->kl_data))

◆ nlx_core_bev_free_cb()

static void nlx_core_bev_free_cb ( struct nlx_core_bev_link ql)
static

Definition at line 165 of file lnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_bevq_provision()

static int nlx_core_bevq_provision ( struct nlx_core_domain lcdom,
struct nlx_core_transfer_mc lctm,
size_t  need 
)

Subroutine to provision additional buffer event entries on the buffer event queue if needed. It increments the struct nlx_core_transfer_mc::ctm_bev_needed counter by the number of LNet events that can be delivered, as indicated by the need parameter.

The subroutine is to be used in the consumer address space only, and uses a kernel or user space specific allocator subroutine to obtain an appropriately blessed entry in the producer space.

The invoker must lock the transfer machine prior to this call.

Parameters
lcdomLNet core domain pointer.
lctmPointer to LNet core TM data structure.
needNumber of additional buffer entries required.
See also
nlx_core_new_blessed_bev(), nlx_core_bevq_release()

Definition at line 175 of file lnet_core.c.

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

◆ nlx_core_bevq_release()

static void nlx_core_bevq_release ( struct nlx_core_transfer_mc lctm,
size_t  release 
)

Subroutine to reduce the needed capacity of the buffer event queue. Note: Entries are never actually released from the circular queue until termination.

The subroutine is to be used in the consumer address space only. The invoker must lock the transfer machine prior to this call.

Parameters
lctmPointer to LNet core TM data structure.
releaseNumber of buffer entries released.
See also
nlx_core_bevq_provision()

Definition at line 204 of file lnet_core.c.

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

◆ nlx_core_buf_active_recv()

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

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 call graph for this function:
Here is the caller graph for this function:

◆ nlx_core_buf_active_send()

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

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 call graph for this function:
Here is the caller graph for this function:

◆ nlx_core_buf_del()

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

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 call graph for this function:
Here is the caller graph for this function:

◆ nlx_core_buf_deregister()

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

Deregisters the buffer.

Parameters
lcdomThe domain private data.
lcbufThe buffer private data.

Definition at line 1330 of file klnet_core.c.

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

◆ nlx_core_buf_desc_checksum()

static uint64_t nlx_core_buf_desc_checksum ( const struct nlx_core_buf_desc cbd)
inlinestatic

Compute the checksum of the network buffer descriptor payload. The computation relies on the fact that the cbd_data part of the union in the network buffer descriptor covers the payload.

Return values
checksumIn little-endian order.

Definition at line 277 of file lnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_buf_desc_decode()

static int nlx_core_buf_desc_decode ( struct nlx_core_transfer_mc lctm,
struct nlx_core_buffer lcbuf,
struct nlx_core_buf_desc cbd 
)

This subroutine decodes the buffer descriptor and copies the values into the given core buffer private data. It is the inverse operation of the nlx_core_buf_desc_encode().

It does the following:

  • The descriptor is validated.
  • The cb_addr field and cb_match_bits fields are set from the descriptor, providing the address of the passive buffer.
  • The operation being performed (SEND or RECV) is validated against the descriptor.
  • The active buffer length is validated against the passive buffer.
  • The size of the active transfer is set in the cb_length field.
Parameters
lctmTransfer machine private data.
lcbufThe buffer private data with cb_length set to the buffer size.
cbdDescriptor structure to be filled in.
Return values
-EINVALInvalid descriptor
-EPERMInvalid operation
-EFBIGBuffer too small
Precondition
The buffer is queued on the specified transfer machine on one of the active bulk queues.
See also
nlx_core_buf_desc_encode()

Definition at line 330 of file lnet_core.c.

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

◆ nlx_core_buf_desc_encode()

static void nlx_core_buf_desc_encode ( struct nlx_core_transfer_mc lctm,
struct nlx_core_buffer lcbuf,
struct nlx_core_buf_desc cbd 
)

This subroutine generates new match bits for the given buffer's cb_match_bits field.

It is intended to be used by the transport prior to invoking passive buffer operations. The reason it is not combined with the passive operation subroutines is that the core API does not guarantee unique match bits. The match bit counter will wrap over time, though, being a very large counter, it would take considerable time before it does wrap.

Parameters
lctmTransfer machine private data.
lcbufThe buffer private data.
cbdDescriptor structure to be filled in.
Precondition
The buffer is queued on the specified transfer machine on one of the passive bulk queues.
See also
nlx_core_buf_desc_decode()

Definition at line 292 of file lnet_core.c.

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

◆ nlx_core_buf_event_get()

static bool nlx_core_buf_event_get ( struct nlx_core_transfer_mc lctm,
struct nlx_core_buffer_event lcbe 
)

Fetches the next event from the circular buffer event queue.

The invoker should ensure that the subroutine is not invoked concurrently with any of the buffer operation initiation subroutines, or another invocation of itself.

Parameters
lctmTransfer machine private data.
lcbeThe next buffer event is returned here.
Return values
trueEvent returned.
falseNo events on the queue.
See also
nlx_core_bevq_provision()

Definition at line 215 of file lnet_core.c.

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

◆ nlx_core_buf_event_wait()

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

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 call graph for this function:
Here is the caller graph for this function:

◆ nlx_core_buf_msg_recv()

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

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 call graph for this function:
Here is the caller graph for this function:

◆ nlx_core_buf_msg_send()

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

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 call graph for this function:
Here is the caller graph for this function:

◆ nlx_core_buf_passive_recv()

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

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 call graph for this function:
Here is the caller graph for this function:

◆ nlx_core_buf_passive_send()

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

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 call graph for this function:
Here is the caller graph for this function:

◆ nlx_core_buf_register()

static 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 
)
static

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 call graph for this function:
Here is the caller graph for this function:

◆ nlx_core_buffer_invariant()

static bool nlx_core_buffer_invariant ( const struct nlx_core_buffer lcb)
static

Core buffer invariant.

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

Definition at line 149 of file lnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_dom_fini()

static void nlx_core_dom_fini ( struct nlx_core_domain lcdom)
static

Releases LNet transport resources related to the domain.

Definition at line 1207 of file klnet_core.c.

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

◆ nlx_core_dom_init()

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

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 call graph for this function:
Here is the caller graph for this function:

◆ nlx_core_dom_set_debug()

static void nlx_core_dom_set_debug ( struct nlx_core_domain lcdom,
unsigned  dbg 
)

Definition at line 447 of file lnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_ep_addr_decode()

static int nlx_core_ep_addr_decode ( struct nlx_core_domain lcdom,
const char *  ep_addr,
struct nlx_core_ep_addr cepa 
)

Parses an end point address string and convert to internal form. A "*" value for the transfer machine identifier results in a value of M0_NET_LNET_TMID_INVALID being set.

Parameters
lcdomDomain pointer.
ep_addrThe LNet end point address to decode.
cepaOn success, the parsed values are stored here.

Definition at line 386 of file lnet_core.c.

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

◆ nlx_core_ep_addr_encode()

static void nlx_core_ep_addr_encode ( struct nlx_core_domain lcdom,
const struct nlx_core_ep_addr cepa,
char  buf[M0_NET_LNET_XEP_ADDR_LEN] 
)

Constructs the external address string from its internal form. A value of M0_NET_LNET_TMID_INVALID for the cepa_tmid field results in a "*" being set for that field.

Parameters
lcdomDomain pointer.
cepaThe end point address parameters to encode.
bufThe string address is stored in this buffer.

Definition at line 427 of file lnet_core.c.

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

◆ nlx_core_ep_eq()

static bool nlx_core_ep_eq ( const struct nlx_core_ep_addr cep1,
const struct nlx_core_ep_addr cep2 
)
inlinestatic

Compare two struct nlx_core_ep_addr objects.

Definition at line 537 of file lnet_core.h.

Here is the caller graph for this function:

◆ nlx_core_get_max_buffer_segment_size()

static m0_bcount_t nlx_core_get_max_buffer_segment_size ( struct nlx_core_domain lcdom)
static

Gets the maximum size of a buffer segment.

Definition at line 1226 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_segments()

static int32_t nlx_core_get_max_buffer_segments ( struct nlx_core_domain lcdom)
static

Gets the maximum number of buffer segments.

Definition at line 1237 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_size()

static m0_bcount_t nlx_core_get_max_buffer_size ( struct nlx_core_domain lcdom)
static

Gets the maximum buffer size (counting all segments).

Definition at line 1220 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_checksum()

static uint32_t nlx_core_kmem_loc_checksum ( const struct nlx_core_kmem_loc loc)
static

Definition at line 155 of file lnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_kmem_loc_eq()

static bool nlx_core_kmem_loc_eq ( const struct nlx_core_kmem_loc a,
const struct nlx_core_kmem_loc b 
)
inlinestatic

Compare memory location objects for equality. These objects cannot be compared atomically. The caller must ensure that appropriate synchronization is used if the objects can change.

Definition at line 104 of file lnet_pvt.h.

Here is the caller graph for this function:

◆ nlx_core_kmem_loc_invariant()

static bool nlx_core_kmem_loc_invariant ( const struct nlx_core_kmem_loc loc)
inlinestatic

Test if a memory location reference is valid.

Definition at line 81 of file lnet_pvt.h.

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

◆ nlx_core_kmem_loc_is_empty()

static bool nlx_core_kmem_loc_is_empty ( const struct nlx_core_kmem_loc loc)
inlinestatic

Test if a memory location object is empty (not set).

Definition at line 91 of file lnet_pvt.h.

Here is the caller graph for this function:

◆ nlx_core_match_bits_decode()

static void nlx_core_match_bits_decode ( uint64_t  mb,
uint32_t *  tmid,
uint64_t *  counter 
)
inlinestatic

Helper subroutine to decode the match bits into its components.

Parameters
mbMatch bit field.
tmidPointer to returned Transfer Machine id.
counterPointer to returned buffer counter value.
See also
nlx_core_match_bits_encode()

Definition at line 258 of file lnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_match_bits_encode()

static uint64_t nlx_core_match_bits_encode ( uint32_t  tmid,
uint64_t  counter 
)
static

Helper subroutine to construct the match bit value from its components.

Parameters
tmidTransfer machine identifier.
counterBuffer counter value. The value of 0 is reserved for the TM receive message queue.
See also
nlx_core_match_bits_decode()

Definition at line 243 of file lnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_mem_alloc()

static void* nlx_core_mem_alloc ( size_t  size,
unsigned  shift 
)
static

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.

Here is the call graph for this function:

◆ nlx_core_mem_free()

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

Frees memory allocated by nlx_core_mem_alloc().

Definition at line 1143 of file klnet_core.c.

Here is the call graph for this function:

◆ nlx_core_new_blessed_bev()

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

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 call graph for this function:
Here is the caller graph for this function:

◆ nlx_core_nidstr_decode()

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

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 call graph for this function:
Here is the caller graph for this function:

◆ nlx_core_nidstr_encode()

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

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 call graph for this function:
Here is the caller graph for this function:

◆ nlx_core_nidstrs_get()

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

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

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

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 call graph for this function:
Here is the caller graph for this function:

◆ nlx_core_nidstrs_put()

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

Releases the string array returned by nlx_core_nidstrs_get().

Definition at line 1774 of file klnet_core.c.

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

◆ nlx_core_tm_invariant()

static bool nlx_core_tm_invariant ( const struct nlx_core_transfer_mc lctm)
static

Core TM invariant.

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

Definition at line 120 of file lnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_tm_is_locked()

static bool nlx_core_tm_is_locked ( const struct nlx_core_transfer_mc lctm)
static

Test that the network TM is locked. Consumer address space only. The subroutine takes advantage of the fact that the core data structure is known to be embedded in the xo data structure, which keeps a pointer to the network TM structure.

Parameters
lctmLNet core TM pointer.

Definition at line 134 of file lnet_core.c.

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

◆ nlx_core_tm_set_debug()

static void nlx_core_tm_set_debug ( struct nlx_core_transfer_mc lctm,
unsigned  dbg 
)

Definition at line 453 of file lnet_core.c.

Here is the caller graph for this function:

◆ nlx_core_tm_start()

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

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 call graph for this function:
Here is the caller graph for this function:

◆ nlx_core_tm_stop()

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

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 call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ __attribute__

enum { ... } __attribute__