Commit a3c5fca1 authored by Gurucharan Shetty's avatar Gurucharan Shetty

ovs-ctl: Don't remember vport-* kernel modules

From OVS 2.8, ovs-vswitchd, when it starts, will
load the kernel modules for tunnels. It has logic
inside it to choose either upstream kernel module
or vport-* kernel module.

So, when we run 'force-reload-kmod' to upgrade to
OVS 2.8 from a previous version,  we do not need to
remember the vport-* kernel module that was previously
loaded.  It is not really harmful to load vport-* kernel
module though.

On RHEL7.x and OVS 2.8, we use the upstream "geneve" kernel
module for tunnels.

But, on RHEL 7.x we have hit a bug caused by iptables
startup script which tries to remove all kernel modules
related to linux conntrack. It fails to unload openvswitch
kernel module because it has a reference count on it. But it
succeeds in unloading vport-geneve and in turn the upstream
"geneve" kernel module.  This causes the tunnels to go down.

With this patch, we avoid the above situation, by not loading
vport-geneve kernel module.  ovs-vswitchd when it starts will
load upstream geneve. And when "iptables stop" runs, since
"geneve" has nothing to do with conntrack, it spares it.
Ideally, we should fix this by incrementing the refcount
on the kernel modules.
Signed-off-by: default avatarGurucharan Shetty <>
Acked-by: default avatarWilliam Tu <>
parent d9f79b6a
......@@ -30,17 +30,9 @@ done
## start ##
## ----- ##
# Keep track of removed vports so we can reload them if needed
insert_mods () {
# Try loading openvswitch again.
action "Inserting openvswitch module" modprobe openvswitch
for vport in $removed_vports; do
# Don't treat failures to load vports as fatal error
action "Inserting $vport module" modprobe $vport || true
insert_mod_if_required () {
......@@ -398,9 +390,6 @@ force_reload_kmod () {
for vport in `awk '/^vport_/ { print $1 }' /proc/modules`; do
action "Removing $vport module" rmmod $vport
if ! grep -q $vport /proc/modules; then
removed_vports="$removed_vports $vport"
if test -e /sys/module/openvswitch; then
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment