[ovs-dev] ovs-ctl: Remove rtnetlink geneve and vxlan interfaces
diff mbox series

Message ID 1561584345-671-1-git-send-email-gvrose8192@gmail.com
State New
Headers show
Series
  • [ovs-dev] ovs-ctl: Remove rtnetlink geneve and vxlan interfaces
Related show

Commit Message

Gregory Rose June 26, 2019, 9:25 p.m. UTC
Bug 2128511 is a result of a conflict that arises when upgrading
on RHEL 7.x systems when the built-in geneve and vxlan kernel modules
were in use before the upgrade but then the newer compat geneve
and vxlan interfaces embedded in the openvswitch kernel module
are used after the upgrade.

This patch fixes the problem by deleting the rtnetlink based geneve
and vxlan interfaces before executing the kernel module reload.

VMware-BZ: 2128511
Signed-off-by: Greg Rose <gvrose8192@gmail.com>
---
 utilities/ovs-lib.in | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

Comments

Gregory Rose June 26, 2019, 10:02 p.m. UTC | #1
Please ignore - mistakes were made...

Thanks,

- Greg

On 6/26/2019 2:25 PM, Greg Rose wrote:
> Bug 2128511 is a result of a conflict that arises when upgrading
> on RHEL 7.x systems when the built-in geneve and vxlan kernel modules
> were in use before the upgrade but then the newer compat geneve
> and vxlan interfaces embedded in the openvswitch kernel module
> are used after the upgrade.
>
> This patch fixes the problem by deleting the rtnetlink based geneve
> and vxlan interfaces before executing the kernel module reload.
>
> VMware-BZ: 2128511
> Signed-off-by: Greg Rose <gvrose8192@gmail.com>
> ---
>   utilities/ovs-lib.in | 14 ++++++++++++++
>   1 file changed, 14 insertions(+)
>
> diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in
> index fa840ec..dbb6179 100644
> --- a/utilities/ovs-lib.in
> +++ b/utilities/ovs-lib.in
> @@ -632,6 +632,20 @@ force_reload_kmod () {
>           action "Removing datapath: $dp" ovs-dpctl del-dp "$dp"
>       done
>   
> +    # Older releases may be using the rtnetlink interface while a
> +    # newer release will want to use the internal compat interface
> +    # for geneve and vxlan.  Execute these blind - if they exist
> +    # as rtnetlink type interfaces then they'll be removed, if not
> +    # then the error is ignored and no harm is done.
> +    action "ip link del link genev_sys_6081 dev genev_sys_6081"
> +    action "ip link del link vxlan_sys_4789 dev vxlan_sys_4789"
> +
> +    action "ovs-appctl dpctl/flush-conntrack"
> +
> +    for vport in `awk '/^vport_/ { print $1 }' /proc/modules`; do
> +        action "Removing $vport module" rmmod $vport
> +    done
> +
>       if test -e /sys/module/ip_gre; then
>           action "Forcing removal of ip_gre module" rmmod ip_gre
>       fi

Patch
diff mbox series

diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in
index fa840ec..dbb6179 100644
--- a/utilities/ovs-lib.in
+++ b/utilities/ovs-lib.in
@@ -632,6 +632,20 @@  force_reload_kmod () {
         action "Removing datapath: $dp" ovs-dpctl del-dp "$dp"
     done
 
+    # Older releases may be using the rtnetlink interface while a
+    # newer release will want to use the internal compat interface
+    # for geneve and vxlan.  Execute these blind - if they exist
+    # as rtnetlink type interfaces then they'll be removed, if not
+    # then the error is ignored and no harm is done.
+    action "ip link del link genev_sys_6081 dev genev_sys_6081"
+    action "ip link del link vxlan_sys_4789 dev vxlan_sys_4789"
+
+    action "ovs-appctl dpctl/flush-conntrack"
+
+    for vport in `awk '/^vport_/ { print $1 }' /proc/modules`; do
+        action "Removing $vport module" rmmod $vport
+    done
+
     if test -e /sys/module/ip_gre; then
         action "Forcing removal of ip_gre module" rmmod ip_gre
     fi