diff options
author | Paul Vinciguerra <pvinci@vinciconsulting.com> | 2020-01-28 14:47:17 -0500 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2020-12-28 09:45:41 +0000 |
commit | 5481ad4eb7fbbf32ff30450525c935de63ffcf0f (patch) | |
tree | 0d371afdf27b033511f83bad6249e17ec52688c6 /src/vnet | |
parent | f6472e0f7b220226f2c2d4b7e05de4ebe7f36663 (diff) |
vlib: add missing file template descriptions
Add descriptions to clib_file_t template structures so that
sockets can be identified via the 'show unix file' cli command.
Type: fix
Change-Id: Ibf82d55aa6c7b1126bd252b76d0dc8b7076f5046
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'src/vnet')
-rw-r--r-- | src/vnet/devices/virtio/vhost_user.c | 4 | ||||
-rw-r--r-- | src/vnet/ip/punt.c | 2 | ||||
-rw-r--r-- | src/vnet/unix/tuntap.c | 1 |
3 files changed, 6 insertions, 1 deletions
diff --git a/src/vnet/devices/virtio/vhost_user.c b/src/vnet/devices/virtio/vhost_user.c index 5c5d23f2017..573d6579cea 100644 --- a/src/vnet/devices/virtio/vhost_user.c +++ b/src/vnet/devices/virtio/vhost_user.c @@ -746,6 +746,7 @@ vhost_user_socket_read (clib_file_t * uf) template.file_descriptor = fds[0]; template.private_data = ((vui - vhost_user_main.vhost_user_interfaces) << 8) + q; + template.description = format (0, "vhost user"); vui->vrings[q].callfd_idx = clib_file_add (&file_main, &template); } else @@ -1098,6 +1099,7 @@ vhost_user_socksvr_accept_ready (clib_file_t * uf) template.error_function = vhost_user_socket_error; template.file_descriptor = client_fd; template.private_data = vui - vhost_user_main.vhost_user_interfaces; + template.description = format (0, "vhost interface %d", vui->sw_if_index); vui->clib_file_index = clib_file_add (&file_main, &template); vui->num_qid = 2; return 0; @@ -1251,6 +1253,7 @@ vhost_user_process (vlib_main_t * vm, sun.sun_family = AF_UNIX; template.read_function = vhost_user_socket_read; template.error_function = vhost_user_socket_error; + template.description = format (0, "vhost user process"); while (1) { @@ -1577,6 +1580,7 @@ vhost_user_vui_init (vnet_main_t * vnm, template.read_function = vhost_user_socksvr_accept_ready; template.file_descriptor = server_sock_fd; template.private_data = vui - vum->vhost_user_interfaces; //hw index + template.description = format (0, "vhost user %d", sw); vui->unix_server_index = clib_file_add (&file_main, &template); } else diff --git a/src/vnet/ip/punt.c b/src/vnet/ip/punt.c index ffe0b83d7f4..7cdb5fcc084 100644 --- a/src/vnet/ip/punt.c +++ b/src/vnet/ip/punt.c @@ -869,7 +869,7 @@ punt_config (vlib_main_t * vm, unformat_input_t * input) clib_file_t template = { 0 }; template.read_function = punt_socket_read_ready; template.file_descriptor = pm->socket_fd; - template.description = format (0, "%s", socket_path); + template.description = format (0, "punt socket %s", socket_path); pm->clib_file_index = clib_file_add (fm, &template); pm->is_configured = true; diff --git a/src/vnet/unix/tuntap.c b/src/vnet/unix/tuntap.c index 6834ee88c99..50f02df9e82 100644 --- a/src/vnet/unix/tuntap.c +++ b/src/vnet/unix/tuntap.c @@ -665,6 +665,7 @@ tuntap_config (vlib_main_t * vm, unformat_input_t * input) clib_file_t template = { 0 }; template.read_function = tuntap_read_ready; template.file_descriptor = tm->dev_net_tun_fd; + template.description = format (0, "vnet tuntap"); tm->clib_file_index = clib_file_add (&file_main, &template); } |