[ovs-dev] OvS port on QNX issue

Ilya Maximets i.maximets at ovn.org
Tue Jun 8 13:59:18 UTC 2021

On 6/8/21 2:20 PM, Miladin Jovanović wrote:
> Hello,
> We managed to compile OpenVSwitch to a Blackberry QNX. Idea is to use complete user-space switching in OvS (like it is done for NetBSD, QNX netstack is based on it ). In order for compilation to pass, compile flag __NetBSD__ was needed to be added and some small changes in code :
>  - replace #include <sys/types.h>  with #include <sys/types_bsd.h>
>  - replace #include <timeval.h>  with #include <sys/times.h>
> By following instructions from https://docs.openvswitch.org/en/latest/intro/install/userspace/  we get next error in ovs-vswitchd.log and no bridge device was created.
> #/data/tmp/ovs/bin/ovs-vsctl add-br br0
> 2021-06-08T12:02:38.455Z|03726|ofproto|WARN|unknown datapath type system
> 2021-06-08T12:02:38.455Z|03727|ofproto|WARN|could not create datapath br0 of unknown type system
> 2021-06-08T12:02:38.456Z|03728|bridge|ERR|failed to create bridge br0: Address family not supported by protocol family

These errors are expected since there is no datapath implementation
in the kernel.

> # /data/tmp/ovs/bin/ovs-vsctl set bridge br0 datapath_type=netdev
> 2021-06-08T12:02:47.896Z|03730|dpif|WARN|failed to create datapath ovs-netdev: Invalid argument

You need to investigate why exactly this error happened.
I guess, netdev_open() failed for the "internal" port 'br0'
for some reason.  And this might be the root cause of all
the subsequent problems.  As a first step, I'd suggest to
enable debug logging to see what happened or go through
the datapath creation path under debugger.

> 2021-06-08T12:02:47.896Z|03731|ofproto_dpif|ERR|failed to open datapath of type netdev: Invalid argument
> 2021-06-08T12:02:47.897Z|03732|ofproto|ERR|failed to open datapath br0: Invalid argument
> 2021-06-08T12:02:47.898Z|03733|bridge|ERR|failed to create bridge br0: Invalid argument
> When trying to turn on device:
> # ifconfig br0 up
> ifconfig: SIOCGIFFLAGS br0: No such device or address
> #
> But, it is added in the ovs-db.
> # /data/tmp/ovs/bin/ovs-vsctl show
> e395c275-c071-4887-adf3-dfe0e8ce5d8d
>     Bridge br0
>         datapath_type: netdev
>         Port br0
>             Interface br0
>                 type: internal
>     ovs_version: "2.15.90"
> #
> Did you maybe test user-space switching on NetBsd (at least I didn't manage to find)?
> Did you try to port it on QNX?
> Do we need to implement dpif-provider/netdev-provider for QNX in order for OvS to work, or can we reuse existing NetBSD?
> If you have any information or hint, I would appreciate if you can share it with us.

I don't think that it should be necessary to create a new
dpif or netdev type.  FreeBSD works fine with dpif-netdev
and the netdev-bsd.  I'd expect that netdev-bsd should work
fine for NetBSD too.  It's possible, though, that there are
some NetBSD-specific bugs there, because we're not running any
periodic tests on this type of systems.

Best regards, Ilya Maximets.

More information about the dev mailing list