summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/af_packet
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/vnet/devices/af_packet
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/vnet/devices/af_packet')
-rw-r--r--src/vnet/devices/af_packet/af_packet.c2
-rw-r--r--src/vnet/devices/af_packet/af_packet.h2
-rw-r--r--src/vnet/devices/af_packet/device.c2
3 files changed, 5 insertions, 1 deletions
diff --git a/src/vnet/devices/af_packet/af_packet.c b/src/vnet/devices/af_packet/af_packet.c
index c51fded00c9..2a135105721 100644
--- a/src/vnet/devices/af_packet/af_packet.c
+++ b/src/vnet/devices/af_packet/af_packet.c
@@ -288,6 +288,8 @@ af_packet_create_if (vlib_main_t * vm, u8 * host_if_name, u8 * hw_addr_set,
template.file_descriptor = fd;
template.private_data = if_index;
template.flags = UNIX_FILE_EVENT_EDGE_TRIGGERED;
+ template.description = format (0, "%U", format_af_packet_device_name,
+ if_index);
apif->clib_file_index = clib_file_add (&file_main, &template);
}
diff --git a/src/vnet/devices/af_packet/af_packet.h b/src/vnet/devices/af_packet/af_packet.h
index b095e7ffcd1..18822f838db 100644
--- a/src/vnet/devices/af_packet/af_packet.h
+++ b/src/vnet/devices/af_packet/af_packet.h
@@ -66,6 +66,8 @@ int af_packet_delete_if (vlib_main_t * vm, u8 * host_if_name);
int af_packet_set_l4_cksum_offload (vlib_main_t * vm, u32 sw_if_index,
u8 set);
+format_function_t format_af_packet_device_name;
+
/*
* fd.io coding-style-patch-verification: ON
*
diff --git a/src/vnet/devices/af_packet/device.c b/src/vnet/devices/af_packet/device.c
index b9492b36a69..2c2489b55ab 100644
--- a/src/vnet/devices/af_packet/device.c
+++ b/src/vnet/devices/af_packet/device.c
@@ -51,7 +51,7 @@ static char *af_packet_tx_func_error_strings[] = {
};
-static u8 *
+u8 *
format_af_packet_device_name (u8 * s, va_list * args)
{
u32 i = va_arg (*args, u32);