Motr
M0
|
![]() |
Data Structures | |
struct | nlx_ucore_domain |
struct | nlx_ucore_transfer_mc |
struct | nlx_ucore_buffer |
Macros | |
#define | NLX_UCORE_BUF_OP(op, loc, ...) |
Variables | |
static const char * | nlx_ucore_dev_name = "/dev/" M0_LNET_DEV |
static unsigned | nlx_ucore_nidstrs_thunk = 128 |
#define NLX_UCORE_BUF_OP | ( | op, | |
loc, | |||
... | |||
) |
Definition at line 820 of file ulnet_core.c.
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.
lcdom | The domain private data. |
lctm | Transfer machine private data. |
lcbuf | Buffer private data. |
Definition at line 870 of file ulnet_core.c.
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.
lcdom | The domain private data. |
lctm | Transfer machine private data. |
lcbuf | Buffer private data. |
Definition at line 890 of file ulnet_core.c.
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.
lcdom | The domain private data. |
lctm | Transfer machine private data. |
lcbuf | Buffer private data. |
Definition at line 950 of file ulnet_core.c.
M0_INTERNAL void nlx_core_buf_deregister | ( | struct nlx_core_domain * | lcdom, |
struct nlx_core_buffer * | lcbuf | ||
) |
Deregisters the buffer.
lcdom | The domain private data. |
lcbuf | The buffer private data. |
Definition at line 792 of file ulnet_core.c.
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.
lcdom | Domain pointer. |
lctm | Transfer machine private data. |
timeout | Absolute time at which to stop waiting. A value of 0 indicates that the subroutine should not wait. |
0 | Events present. |
-ETIMEDOUT | Timed out before events arrived. |
Definition at line 960 of file ulnet_core.c.
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.
lcdom | The domain private data. |
lctm | Transfer machine private data. |
lcbuf | Buffer private data. |
Definition at line 845 of file ulnet_core.c.
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.
lcdom | The domain private data. |
lctm | Transfer machine private data. |
lcbuf | Buffer private data. |
Definition at line 858 of file ulnet_core.c.
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.
lcdom | The domain private data. |
lctm | Transfer machine private data. |
lcbuf | Buffer private data. |
Definition at line 910 of file ulnet_core.c.
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.
lcdom | The private data pointer for the domain. |
lctm | Transfer machine private data. |
lcbuf | Buffer private data. |
Definition at line 930 of file ulnet_core.c.
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.
lcdom | The domain private data to be initialized. |
buffer_id | Value to set in the cb_buffer_id field. |
bvec | Buffer vector with core address space pointers. |
lcbuf | The core private data pointer for the buffer. |
Definition at line 749 of file ulnet_core.c.
M0_INTERNAL void nlx_core_dom_fini | ( | struct nlx_core_domain * | lcdom | ) |
Releases LNet transport resources related to the domain.
Definition at line 703 of file ulnet_core.c.
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.
dom | The network domain pointer. |
lcdom | The private data pointer for the domain to be initialized. |
Definition at line 633 of file ulnet_core.c.
|
static |
Definition at line 1211 of file ulnet_core.c.
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 727 of file ulnet_core.c.
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 739 of file ulnet_core.c.
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 717 of file ulnet_core.c.
|
static |
Definition at line 1216 of file ulnet_core.c.
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().
size | Memory size. |
shift | Alignment, ignored in kernel space. |
Definition at line 532 of file ulnet_core.c.
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 537 of file ulnet_core.c.
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.
lcdom | LNet core domain pointer. |
lctm | LNet 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. |
bevp | Buffer 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. |
Definition at line 1174 of file ulnet_core.c.
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.
lcdom | The domain private data. |
nidstr | the string to be decoded. |
nid | On success, the resulting NID is returned here. |
-EINVAL | the NID string could not be decoded |
Definition at line 986 of file ulnet_core.c.
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.
lcdom | The domain private data. |
nid | The NID to be converted. |
nidstr | On success, the string form is set here. |
Definition at line 1009 of file ulnet_core.c.
M0_INTERNAL int nlx_core_nidstrs_get | ( | struct nlx_core_domain * | cd, |
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().
lcdom | Domain pointer. |
nidary | A 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().
nidary | A NULL-terminated (like argv) array of NID strings is returned. |
Definition at line 1038 of file ulnet_core.c.
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 1049 of file ulnet_core.c.
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.
lcdom | The domain private data. |
tm | The transfer machine pointer. |
lctm | The 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. |
Definition at line 1082 of file ulnet_core.c.
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.
lcdom | The domain private data. |
lctm | The transfer machine private data. |
Definition at line 1157 of file ulnet_core.c.
|
static |
The nlx_ucore_buffer invariant.
Definition at line 519 of file ulnet_core.c.
|
static |
Invariant for the nlx_ucore_domain structure.
Definition at line 507 of file ulnet_core.c.
|
static |
Wrapper subroutine to invoke the driver ioctl() and map errno on failure to a valid return code.
>=0 | On success. |
<0 | On failure. |
Definition at line 548 of file ulnet_core.c.
|
static |
Routine to fetch the NID strings from the device driver. The subroutine does not modify the domain private structure.
ud | Ucore domain. Only the fd field is required to be set. |
nidary | A NULL-terminated (like argv) array of NID strings is returned. |
Definition at line 579 of file ulnet_core.c.
|
static |
Routine to release the strings allocated by nlx_ucore_nidstrs_get().
Definition at line 625 of file ulnet_core.c.
|
static |
The nlx_ucore_tm invariant.
Definition at line 527 of file ulnet_core.c.
|
static |
Subroutine to stop the TM in the kernel.
Definition at line 1063 of file ulnet_core.c.
|
static |
The name of the core device
Definition at line 502 of file ulnet_core.c.
|
static |
Buffer (linear) increment size when fetching NID strings. Can be intercepted by unit tests.
Definition at line 570 of file ulnet_core.c.