[ovs-dev] [PATCH v2 0/3] userspace: enable tap interface statistics and status update support

Aaron Conole aconole at redhat.com
Wed Sep 16 16:37:55 UTC 2020


yang_y_yi at 163.com writes:

> From: Yi Yang <yangyi01 at inspur.com>
>
> OVS userspace datapath can't support tap interface statistics
> and status update, so users can't get these information by cmd
> "ovs-vsctl list interface tap1", the root cause of this issue
> is OVS doesn't know network namespace of tap interface.
>
> This patch series fixed this issue and make sure tap interface
> can show statistics and get status update.
>
> Yi Yang (3):
>   Add netns option for tap interface in userspace datapath
>   Fix tap interface statistics issue
>   Fix tap interface status update issue in network namespace
>
>  lib/dpif-netlink.c         |  51 +++++
>  lib/dpif-netlink.h         |   3 +
>  lib/netdev-linux-private.h |   1 +
>  lib/netdev-linux.c         | 481 ++++++++++++++++++++++++++++++++++++++++-----
>  lib/netlink-socket.c       | 146 ++++++++++++++
>  lib/netlink-socket.h       |   2 +
>  lib/socket-util-unix.c     |  37 ++++
>  lib/socket-util.h          |   3 +
>  8 files changed, 675 insertions(+), 49 deletions(-)
>
> --
>
> Changelog
>
>   v1 -> v2:
>     * Split pmd thread support to seperate patch series
>     * Check enter_netns return error
>     * Limit setns to network namespace only by CLONE_NEWNET

Sorry, but more thinking about this I don't support this series going
in.  It reassociates the thread with a netns that may disappear causing
faults in the middle of processing - I don't think it's safe.

NAK.

I think the correct solution is to add support in the kernel for getting
the netns/ifindex from the tap socket, and then use that to query the
statistics.  This should be solved by using (or creating if one doesn't
exist) a kernel API to do this query by getting the netns information
and using that to do these get operations.

Maybe someone disagrees.



More information about the dev mailing list