Re: [vpp-dev] Set of the small bug-fixes for #vpp

2020-01-13 Thread Ole Troan
Aleksander,

> Sorry, you are absolutely right. It's no issues here. In my VPP v19.08-stable 
> I have no commit 75761b93.

Thanks, that was good to hear!

Best regards,
Ole

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#15144): https://lists.fd.io/g/vpp-dev/message/15144
Mute This Topic: https://lists.fd.io/mt/69665543/21656
Mute #vpp: https://lists.fd.io/mk?hashtag=vpp=1480452
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] Set of the small bug-fixes for #vpp

2020-01-13 Thread Aleksander Djuric
Sorry, you are absolutely right. It's no issues here. In my VPP v19.08-stable I 
have no commit 75761b93.
Thanks!
Aleksander
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#15143): https://lists.fd.io/g/vpp-dev/message/15143
Mute This Topic: https://lists.fd.io/mt/69665543/21656
Mute #vpp: https://lists.fd.io/mk?hashtag=vpp=1480452
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] Set of the small bug-fixes for #vpp

2020-01-13 Thread Ole Troan
Hi Aleksander,


> Yes. This fix still needed. Please take a look at the test below:
> 
> > import ipaddress
> > ipaddress.IPv4Network((u'192.168.0.222', 24), False)
> IPv4Network(u'192.168.0.0/24')
> 
> The IPv4Network method should not be used here, because in functions like an 
> ip_address_dump or ip_route_dump we expect to receive the host address with 
> network prefix, instead of it's network address.


Right, those should be separated by the following commit: 75761b93

E.g. ip_address_details uses vl_api_address_with_prefix_t , which maps in 
Python to the IPv6Interface class.
ip_route_details is a 'pure' prefix, with the anything after prefix length 
zero'ed out. Or at least it should be.

Do you have the above patch?
Otherwise I will not discount that there are issues here. ;-)

Cheers,
Ole-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#15142): https://lists.fd.io/g/vpp-dev/message/15142
Mute This Topic: https://lists.fd.io/mt/69665543/21656
Mute #vpp: https://lists.fd.io/mk?hashtag=vpp=1480452
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] Set of the small bug-fixes for #vpp

2020-01-13 Thread Aleksander Djuric
Yes. This fix still needed. Please take a look at the test below:

> import ipaddress
> ipaddress.IPv4Network(( u'192.168.0.222' , 24 ), False )
IPv4Network(u'192.168.0.0/24')

The IPv4Network method should not be used here, because in functions like an 
ip_address_dump or ip_route_dump we expect to receive the host address with 
network prefix, instead of it's network address.

>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#15141): https://lists.fd.io/g/vpp-dev/message/15141
Mute This Topic: https://lists.fd.io/mt/69665543/21656
Mute #vpp: https://lists.fd.io/mk?hashtag=vpp=1480452
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] Set of the small bug-fixes for #vpp

2020-01-13 Thread Aleksander Djuric
On Mon, Jan 13, 2020 at 01:20 PM, Ole Troan wrote:

> 
> would you mind elaborating why you want the Python representation of an IP
> prefix to be a dictionary of address and length as opposed to an
> IPv6Network/IPv4Network object?

Hi Ole!

Thanks! It's strange, but the IPv[46]Network method some time ago were return 
the network address of object in my tests, instead of the host address I were 
expect to receive.
I will test it again.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#15140): https://lists.fd.io/g/vpp-dev/message/15140
Mute This Topic: https://lists.fd.io/mt/69665543/21656
Mute #vpp: https://lists.fd.io/mk?hashtag=vpp=1480452
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [vpp-dev] Set of the small bug-fixes for #vpp

2020-01-13 Thread Ole Troan
Hi Aleksander,

> 3) vpp_papi: correct unformat ip address for ip_address_dump, ip_route_dump, 
> etc (unformat-api-prefix.patch)

would you mind elaborating why you want the Python representation of an IP 
prefix to be a dictionary of address and length as opposed to an 
IPv6Network/IPv4Network object?

--- 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))


Best regards,
Ole-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#15137): https://lists.fd.io/g/vpp-dev/message/15137
Mute This Topic: https://lists.fd.io/mt/69665543/21656
Mute #vpp: https://lists.fd.io/mk?hashtag=vpp=1480452
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


[vpp-dev] Set of the small bug-fixes for #vpp

2020-01-13 Thread Aleksander Djuric
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 (, serialize_elog_main, em, flush_ring);
   if (!error)
 serialize_close ();
+
+  serialize_close_clib_file ();
   return error;
 }
 
@@ -555,6 +557,8 @@ elog_read_file (elog_main_t * em, char *clib_file)
   error = unserialize (, unserialize_elog_main, em);
   if (!error)
 unserialize_close ();
+
+  serialize_close_clib_file ();
   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, ) < 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