Hello Everyone, I have a small set of the fixes for VPP, but unfortunatelly right now, I have no time for pushing the code with git review. I hope that these fixes are very useful for the project and I would be very happy if someone could do it instead of me. In any case I hope that these fixes will be useful for someone )
All of these fixes should be actual for v20.01-rc0-1017-g1c6486f7b Thanks all in advance, and please take a look at the code in attachments. Any suggestion would be helpful. 1) vppinfra: need to close clib file (close-clib-file.patch) 2) unix: too many warnings on deleted epool file (epool-file-delete.patch) 3) vpp_papi: correct unformat ip address for ip_address_dump, ip_route_dump, etc (unformat-api-prefix.patch) 4) dpdk: fix crash on device detach (detach-support.patch) 5) statseg: fix create socket error (statseg_create_socket.patch) Best wishes! --- Aleksander
diff --git a/src/vppinfra/elog.h b/src/vppinfra/elog.h index 3cd067ce7070ad88b8424b6c43e8b6c152bde821..7bed87d672225123f8cf8bab8eaa909c693bca27 100644 --- a/src/vppinfra/elog.h +++ b/src/vppinfra/elog.h @@ -540,6 +540,8 @@ elog_write_file (elog_main_t * em, char *clib_file, int flush_ring) error = serialize (&m, serialize_elog_main, em, flush_ring); if (!error) serialize_close (&m); + + serialize_close_clib_file (&m); return error; } @@ -555,6 +557,8 @@ elog_read_file (elog_main_t * em, char *clib_file) error = unserialize (&m, unserialize_elog_main, em); if (!error) unserialize_close (&m); + + serialize_close_clib_file (&m); return error; } diff --git a/src/vppinfra/serialize.c b/src/vppinfra/serialize.c index 93e44f94e078ae6cb607ac9aac1e6e96ccd91ed7..fc2a1065999381514268e1d4ebd4f1c82c5afbdf 100644 --- a/src/vppinfra/serialize.c +++ b/src/vppinfra/serialize.c @@ -1244,6 +1244,14 @@ unserialize_open_clib_file (serialize_main_t * m, char *file) return serialize_open_clib_file_helper (m, file, /* is_read */ 1); } +void +serialize_close_clib_file (serialize_main_t * m) +{ + if (m->stream.data_function_opaque > 0) + close(m->stream.data_function_opaque); + m->stream.data_function_opaque = 0; +} + #endif /* CLIB_UNIX */ /* diff --git a/src/vppinfra/serialize.h b/src/vppinfra/serialize.h index 90d615f60a484bb530e8533271b6dac754335d02..953dacf623a455882d29cbfcd5b7d0f327ddfc10 100644 --- a/src/vppinfra/serialize.h +++ b/src/vppinfra/serialize.h @@ -418,6 +418,7 @@ void unserialize_open_vector (serialize_main_t * m, u8 * vector); #ifdef CLIB_UNIX clib_error_t *serialize_open_clib_file (serialize_main_t * m, char *file); clib_error_t *unserialize_open_clib_file (serialize_main_t * m, char *file); +void serialize_close_clib_file (serialize_main_t * m); void serialize_open_clib_file_descriptor (serialize_main_t * m, int fd); void unserialize_open_clib_file_descriptor (serialize_main_t * m, int fd);
--- a/src/vlib/unix/input.c 2019-10-30 11:50:40.616813871 +0300 +++ b/src/vlib/unix/input.c 2019-11-14 11:45:03.133999426 +0300 @@ -117,6 +117,8 @@ if (epoll_ctl (em->epoll_fd, op, f->file_descriptor, &e) < 0) { + if (update_type == UNIX_FILE_UPDATE_DELETE) + f->file_descriptor = ~0; clib_unix_warning ("epoll_ctl"); return; }
--- a/src/vpp-api/python/vpp_papi/vpp_format.py 2019-10-30 11:50:40.676813774 +0300 +++ b/src/vpp-api/python/vpp_papi/vpp_format.py 2019-12-26 16:10:54.014344478 +0300 @@ -182,17 +182,11 @@ def unformat_api_prefix_t(o): if o.address.af == 1: - return ipaddress.IPv6Network((o.address.un.ip6, o.len), False) + return {'address': ipaddress.IPv6Address(o.address.un.ip6), 'len': o.len} if o.address.af == 0: - return ipaddress.IPv4Network((o.address.un.ip4, o.len), False) + return {'address': ipaddress.IPv4Address(o.address.un.ip4), 'len': o.len} raise ValueError('Unknown address family {}'.format(o)) - if isinstance(o.address, ipaddress.IPv4Address): - return ipaddress.IPv4Network((o.address, o.len), False) - if isinstance(o.address, ipaddress.IPv6Address): - return ipaddress.IPv6Network((o.address, o.len), False) - raise ValueError('Unknown instance {}', format(o)) - def unformat_api_address_with_prefix_t(o): if o.address.af == 1: return ipaddress.IPv6Interface((o.address.un.ip6, o.len))
diff --git a/src/plugins/dpdk/api/dpdk_api.c b/src/plugins/dpdk/api/dpdk_api.c index 5ff8d5f..09b8c52 100755 --- a/src/plugins/dpdk/api/dpdk_api.c +++ b/src/plugins/dpdk/api/dpdk_api.c @@ -320,7 +320,8 @@ dpdk_api_init (vlib_main_t * vm) VLIB_INIT_FUNCTION (dpdk_api_init) = { .runs_after = VLIB_INITS ("dpdk_init"), -/* *INDENT-OFF* */ +}; +/* *INDENT-ON* */ /* * fd.io coding-style-patch-verification: ON diff --git a/src/plugins/dpdk/device/format.c b/src/plugins/dpdk/device/format.c index 942def6..20fcadd 100644 --- a/src/plugins/dpdk/device/format.c +++ b/src/plugins/dpdk/device/format.c @@ -142,7 +142,7 @@ format_dpdk_device_name (u8 * s, va_list * args) u32 i = va_arg (*args, u32); dpdk_device_t *xd = vec_elt_at_index (dm->devices, i); struct rte_eth_dev_info dev_info; - struct rte_pci_device *pci_dev; + struct rte_pci_device *pci_dev = NULL; u8 *ret; if (xd->name) @@ -224,7 +224,10 @@ format_dpdk_device_name (u8 * s, va_list * args) break; } + memset(&dev_info, 0, sizeof(dev_info)); rte_eth_dev_info_get (xd->port_id, &dev_info); + if (!dev_info.device) return format (s, "Detached"); + pci_dev = dpdk_get_pci_device (&dev_info); if (pci_dev && xd->port_type != VNET_DPDK_PORT_TYPE_FAILSAFE)
diff --git a/src/vlib/unix/main.c b/src/vlib/unix/main.c index 3ec4c342cf13e6676812047df46ab1eab62ece03..62e87ae4aa02ff46f531627a19b6df8ae0cd7e55 100755 --- a/src/vlib/unix/main.c +++ b/src/vlib/unix/main.c @@ -500,6 +500,10 @@ unix_config (vlib_main_t * vm, unformat_input_t * input) vlib_default_runtime_dir, 0); } + error = vlib_unix_recursive_mkdir ((char *) um->runtime_dir); + if (error) + return error; + error = setup_signal_handlers (um); if (error) return error;
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#15136): https://lists.fd.io/g/vpp-dev/message/15136 Mute This Topic: https://lists.fd.io/mt/69665543/21656 Mute #vpp: https://lists.fd.io/mk?hashtag=vpp&subid=1480452 Group Owner: vpp-dev+ow...@lists.fd.io Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-