summaryrefslogtreecommitdiffstats
path: root/src/plugins/memif/memif.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-01-19 20:56:12 +0100
committerDave Barach <openvpp@barachs.net>2018-02-06 18:17:46 +0000
commitceab7882f8016c2407a4383f87277bad069885b1 (patch)
treee90e247184d9dc3086b6f11f25dff8bd6e7ce51e /src/plugins/memif/memif.c
parentdf5a99cef13ff6a22c195091be45152dc65f5d71 (diff)
vlib: epoll on worker threads
This patch teaches worer threads to sleep and to be waken up by kernel if there is activity on file desctiptors assigned to that thread. It also adds counters to epoll file descriptors and new debug cli 'show unix file'. Change-Id: Iaf67869f4aa88ff5b0a08982e1c08474013107c4 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/plugins/memif/memif.c')
-rw-r--r--src/plugins/memif/memif.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/memif/memif.c b/src/plugins/memif/memif.c
index dc92e7e24ad..7267ef2e000 100644
--- a/src/plugins/memif/memif.c
+++ b/src/plugins/memif/memif.c
@@ -221,6 +221,9 @@ memif_connect (memif_if_t * mif)
{
template.file_descriptor = mq->int_fd;
template.private_data = (mif->dev_instance << 16) | (i & 0xFFFF);
+ template.description = format (0, "%U rx %u int",
+ format_memif_device_name,
+ mif->dev_instance, i);
memif_file_add (&mq->int_clib_file_index, &template);
}
vnet_hw_interface_assign_rx_thread (vnm, mif->hw_if_index, i, ~0);
@@ -440,6 +443,9 @@ memif_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vlib_frame_t * f)
t.file_descriptor = sock->fd;
t.private_data = mif->dev_instance;
memif_file_add (&sock->private_data, &t);
+ t.description = format (0, "%U ctl",
+ format_memif_device_name,
+ mif->dev_instance);
hash_set (msf->dev_instance_by_fd, sock->fd, mif->dev_instance);
mif->flags |= MEMIF_IF_FLAG_CONNECTING;
@@ -805,6 +811,7 @@ memif_create_if (vlib_main_t * vm, memif_create_if_args_t * args)
template.read_function = memif_conn_fd_accept_ready;
template.file_descriptor = msf->sock->fd;
template.private_data = mif->socket_file_index;
+ template.description = format (0, "memif listener %s", msf->filename);
memif_file_add (&msf->sock->private_data, &template);
}