[ovs-discuss] Inserting and using the compiled OVS kernel modules

Gregory Rose gvrose8192 at gmail.com
Thu Jan 3 16:47:47 UTC 2019


On 1/3/2019 6:32 AM, Levente Csikor wrote:
> Dear All,
>
> I am trying to use OVS kernel module that can be compiled from the OVS
> source instead of the built-in openvswitch module provided by the
> kernel.
> Besides some certificate/signing issues (newer kernels do not allow
> inserting third-party modules if they are not signed by the vendor), I
> finally managed (with self-signed certificates) to load the compiled
> openvswitch.ko module located under OVS_SOURCE/datapath/linux/.
>
> I am using Ubuntu 18.04, linux kernel 4.15.0-32-generic with
> openvswitch-2.10.0 from source (2.9.x did not even compile on my
> system).
>
> Once the module is loaded via insmod, dmesg says it is loaded
> "correctly" (even the version is shown - when the stock kernel module
> is loaded via modprobe, no version information is shown):
> [ 2833.903781] openvswitch: Open vSwitch switching datapath 2.10.0

Did you run 'sudo make modules_install'?  You shouldn't have to use 
insmod. The 'modprobe' utility should
load the correct kernel module.

>
> Then, I manually initialize and start OVS with the following commands
> (environment variables are pointing to the binaries in the OVS source
> directory):
>
> 1) sudo rm -rf /usr/local/etc/openvswitch/conf.db 2>&1
>
> 2) sudo mkdir -p /usr/local/etc/openvswitch/
>
> 3) sudo $OVSDB_PATH/ovsdb-tool create
> /usr/local/etc/openvswitch/conf.db  $OVSVSWITCHD_PATH/vswitch.ovsschema
>
> 4) sudo mkdir -p /usr/local/var/run/openvswitch
>
> 5) sudo $OVSDB_PATH/ovsdb-server --
> remote=punix:/usr/local/var/run/openvswitch/db.sock --
> remote=db:Open_vSwitch,Open_vSwitch,manager_options --pidfile --detach
>
> 6) sudo $OVSUTILITIES_PATH/ovs-vsctl --no-wait init
>
> 7) export DB_SOCK=/usr/local/var/run/openvswitch/db.sock
>
> 8) sudo $OVSVSWITCHD_PATH/ovs-vswitchd unix:$DB_SOCK --pidfile --detach
>
> After these command OVS is initialized and started (at least the
> vswitchd) and now I can create a bridge and add ports to it, etc.
> However, right after the last command (8), in the output of dmesg I
> have realized the following strange line:
>
> [ 2975.940723] openvswitch: Open vSwitch switching datapath
>
> Now, I am a bit confused :S
> Did ovs-vswitchd command automatically (re)load the kernel module
> provided by the stock kernel and replace my previous inserted module
> compiled from the OVS source?
>
> For debuggin, how can I check the info of the loaded module - I cannot
> find any useful tool/command for this?

Run 'cat /sys/module/openvswitch/version' and that should give you 
output like this:

# cat /sys/module/openvswitch/version
2.10.1

- Greg



More information about the discuss mailing list