Detailed functional specification of the internals of the LNet Transport Device.
More...
|
static int | nlx_dev_ioctl_dom_init (struct nlx_kcore_domain *kd, struct m0_lnet_dev_dom_init_params *p) |
|
static int | nlx_dev_ioctl_buf_register (struct nlx_kcore_domain *kd, struct m0_lnet_dev_buf_register_params *p) |
|
static void | nlx_dev_buf_pages_unpin (const struct nlx_kcore_buffer *kb) |
|
static int | nlx_dev_buf_deregister (struct nlx_kcore_domain *kd, struct nlx_kcore_buffer *kb) |
|
static int | nlx_dev_ioctl_buf_deregister (struct nlx_kcore_domain *kd, struct m0_lnet_dev_buf_deregister_params *p) |
|
static int | nlx_dev_ioctl_buf_queue_op (const struct m0_lnet_dev_buf_queue_params *p, nlx_kcore_queue_op_t op) |
|
static int | nlx_dev_ioctl_buf_del (const struct nlx_kcore_domain *kd, const struct m0_lnet_dev_buf_queue_params *p) |
|
static int | nlx_dev_ioctl_buf_event_wait (const struct nlx_kcore_domain *kd, const struct m0_lnet_dev_buf_event_wait_params *p) |
|
static int | nlx_dev_ioctl_nidstr_decode (struct m0_lnet_dev_nid_encdec_params *p) |
|
static int | nlx_dev_ioctl_nidstr_encode (struct m0_lnet_dev_nid_encdec_params *p) |
|
static int | nlx_dev_ioctl_nidstrs_get (struct nlx_kcore_domain *kd, struct m0_lnet_dev_nidstrs_get_params *p) |
|
static int | nlx_dev_ioctl_tm_start (struct nlx_kcore_domain *kd, struct m0_lnet_dev_tm_start_params *p) |
|
static int | nlx_dev_tm_cleanup (struct nlx_kcore_domain *kd, struct nlx_kcore_transfer_mc *ktm) |
|
static int | nlx_dev_ioctl_tm_stop (struct nlx_kcore_domain *kd, struct m0_lnet_dev_tm_stop_params *p) |
|
static int | nlx_dev_ioctl_bev_bless (struct nlx_kcore_domain *kd, struct m0_lnet_dev_bev_bless_params *p) |
|
static long | nlx_dev_ioctl (struct file *file, unsigned int cmd, unsigned long arg) |
|
static int | nlx_dev_open (struct inode *inode, struct file *file) |
|
M0_INTERNAL int | nlx_dev_close (struct inode *inode, struct file *file) |
|
Detailed functional specification of the internals of the LNet Transport Device.
- See also
- LNet Transport Device DLD and Logical Specification
◆ nlx_dev_buf_deregister()
Deregisters a shared memory buffer from the kernel domain.
- Parameters
-
kd | The kernel domain object. |
kb | The kernel buffer object, freed upon return. |
Definition at line 1012 of file klnet_drv.c.
◆ nlx_dev_buf_pages_unpin()
◆ nlx_dev_close()
M0_INTERNAL int nlx_dev_close |
( |
struct inode * |
inode, |
|
|
struct file * |
file |
|
) |
| |
Releases all resources for the given struct file.
This operation is called once when the file is being released. There is a 1:1 correspondence between struct file objects and nlx_kcore_domain objects, so this operation will release all kernel resources for the domain. That can be expensive if the user process failed to release all transfer machines and buffers before closing the file.
- Parameters
-
inode | Device inode object. |
file | File object being released. |
Definition at line 1527 of file klnet_drv.c.
◆ nlx_dev_ioctl()
static long nlx_dev_ioctl |
( |
struct file * |
file, |
|
|
unsigned int |
cmd, |
|
|
unsigned long |
arg |
|
) |
| |
|
static |
Performs an unlocked (BKL is not held) ioctl request on the m0lnet device.
- Precondition
- nlx_kcore_domain_invariant(file->private_data)
- Parameters
-
file | File instance, corresponding to the nlx_kcore_domain. |
cmd | The request or operation to perform. |
arg | Argument to the operation, internally treated as a pointer whose type depends on the cmd. |
Definition at line 1372 of file klnet_drv.c.
◆ nlx_dev_ioctl_bev_bless()
◆ nlx_dev_ioctl_buf_del()
Cancels a buffer operation if possible.
- Parameters
-
kd | The kernel domain object. |
p | Ioctl request parameters. |
Definition at line 1083 of file klnet_drv.c.
◆ nlx_dev_ioctl_buf_deregister()
Deregisters a shared memory buffer from the kernel domain.
- Parameters
-
kd | The kernel domain object. |
p | Ioctl request parameters. |
Definition at line 1036 of file klnet_drv.c.
◆ nlx_dev_ioctl_buf_event_wait()
Waits for buffer events, or the timeout.
- Parameters
-
kd | The kernel domain object. |
p | Ioctl request parameters. |
Definition at line 1103 of file klnet_drv.c.
◆ nlx_dev_ioctl_buf_queue_op()
Enqueues a buffer on the appropriate transfer machine queue.
- Parameters
-
p | Ioctl request parameters. |
op | Buffer queue operation to perform. |
Definition at line 1052 of file klnet_drv.c.
◆ nlx_dev_ioctl_buf_register()
Registers a shared memory buffer with the kernel domain.
- Parameters
-
kd | The kernel domain object. |
p | Ioctl request parameters. |
Definition at line 901 of file klnet_drv.c.
◆ nlx_dev_ioctl_dom_init()
Completes the kernel initialization of the kernel and shared core domain objects. The user domain object is mapped into kernel space and its nlx_core_domain::cd_kpvt field is set.
- Parameters
-
kd | The kernel domain object. |
p | Ioctl request parameters. The buffer size maximum fields are set on success. |
Definition at line 853 of file klnet_drv.c.
◆ nlx_dev_ioctl_nidstr_decode()
Decodes a NID string into a NID.
- Parameters
-
Definition at line 1129 of file klnet_drv.c.
◆ nlx_dev_ioctl_nidstr_encode()
Encodes a NID into a NID string.
- Parameters
-
Definition at line 1139 of file klnet_drv.c.
◆ nlx_dev_ioctl_nidstrs_get()
Gets the NID strings of all the local LNet interfaces. The NID strings are encoded consecutively in user space buffer denoted by the m0_lnet_dev_nidstrs_get_params::dng_buf field as a sequence nul terminated strings, with an final nul (string) terminating the list.
- Parameters
-
kd | The kernel domain object. |
p | Ioctl request parameters. |
- Return values
-
-EFBIG | if the strings do not fit in the provided buffer. |
Definition at line 1153 of file klnet_drv.c.
◆ nlx_dev_ioctl_tm_start()
Completes the kernel portion of the TM start logic. The shared transfer machine object is pinned in kernel space and its nlx_core_transfer_mc::ctm_kpvt field is set.
- Parameters
-
kd | The kernel domain object. |
p | Ioctl request parameters. |
Definition at line 1197 of file klnet_drv.c.
◆ nlx_dev_ioctl_tm_stop()
Complete the kernel portion of the TM stop logic.
- Parameters
-
kd | The kernel domain object. |
p | Ioctl request parameters. |
Definition at line 1291 of file klnet_drv.c.
◆ nlx_dev_open()
static int nlx_dev_open |
( |
struct inode * |
inode, |
|
|
struct file * |
file |
|
) |
| |
|
static |
Open the /dev/m0lnet device.
There is a 1:1 correspondence between struct file objects and nlx_kcore_domain objects. Thus, user processes will open the m0lnet device once for each m0_net_domain.
- Parameters
-
inode | Inode object for the device. |
file | File object for this instance. |
Definition at line 1494 of file klnet_drv.c.
◆ nlx_dev_tm_cleanup()
Helper for nlx_dev_close() and nlx_dev_ioctl_tm_stop() to clean up kernel resources associated with an individual transfer machine.
- Parameters
-
kd | The kernel domain object. |
ktm | The kernel transfer machine object, removed from the kd->kd_drv_tms and freed upon return. |
- Todo:
- XXX list removal is protected by the lock, but iteration over the list isn't? –nikita.
Definition at line 1254 of file klnet_drv.c.
◆ nlx_dev
struct miscdevice nlx_dev |
|
static |
Initial value:= {
.minor = MISC_DYNAMIC_MINOR,
}
static struct file_operations nlx_dev_file_ops
Device description. The device is named /dev/m0lnet when nlx_dev_init() completes. The major number is 10 (misc), and the minor number is assigned dynamically when misc_register() is called.
Definition at line 1626 of file klnet_drv.c.
◆ nlx_dev_file_ops
struct file_operations nlx_dev_file_ops |
|
static |
Initial value:= {
.owner = THIS_MODULE,
}
M0_INTERNAL int nlx_dev_close(struct inode *inode, struct file *file)
static int nlx_dev_open(struct inode *inode, struct file *file)
static long nlx_dev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
File operations for the m0lnet device, UT can override.
Definition at line 1613 of file klnet_drv.c.
◆ nlx_dev_registered
bool nlx_dev_registered = false |
|
static |