diff mbox series

[ovs-dev,v1] utilities: check datapath exists before conntrack flush

Message ID 1533016038-12577-1-git-send-email-martinxu9.ovs@gmail.com
State Accepted
Headers show
Series [ovs-dev,v1] utilities: check datapath exists before conntrack flush | expand

Commit Message

Martin Xu July 31, 2018, 5:47 a.m. UTC
As part of "force-reload-kmod," conntrack flush command is issued as
'action "ovs-appctl dpctl/flush-conntrack"'. In case no datapath exists
yet when issuing "force-reload-kmod," there is an error message
"ovs-vswitchd: no datapaths exist\ ovs-appctl: ovs-vswitchd: server
returned an error", which is harmless but potentially shows up as "FAILED."
Add an if condition to check whether datapath exists before running the
conntrack flush command.

VMware-BZ: #2170402
Fixes: 265d70310c69 ("utilities: Fix conntrack flush command")

Signed-off-by: Martin Xu <martinxu9.ovs@gmail.com>
CC: Greg Rose <gvrose8192@gmail.com>
CC: Aaron Conole <aconole@redhat.com>
CC: Justin Pettit <jpettit@ovn.org>
---
 utilities/ovs-lib.in | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

0-day Robot July 31, 2018, 5:55 a.m. UTC | #1
Bleep bloop.  Greetings Martin Xu, I am a robot and I have tried out your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


build:
depbase=`echo ovn/controller/lflow.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -std=gnu99 -DHAVE_CONFIG_H -I.    -I ./include -I ./include -I ./lib -I ./lib    -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Wno-null-pointer-arithmetic -Werror -Werror   -g -O2 -MT ovn/controller/lflow.o -MD -MP -MF $depbase.Tpo -c -o ovn/controller/lflow.o ovn/controller/lflow.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo ovn/controller/lport.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -std=gnu99 -DHAVE_CONFIG_H -I.    -I ./include -I ./include -I ./lib -I ./lib    -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Wno-null-pointer-arithmetic -Werror -Werror   -g -O2 -MT ovn/controller/lport.o -MD -MP -MF $depbase.Tpo -c -o ovn/controller/lport.o ovn/controller/lport.c &&\
mv -f $depbase.Tpo $depbase.Po
depbase=`echo ovn/controller/ofctrl.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -std=gnu99 -DHAVE_CONFIG_H -I.    -I ./include -I ./include -I ./lib -I ./lib    -Wstrict-prototypes -Wall -Wextra -Wno-sign-compare -Wpointer-arith -Wformat -Wformat-security -Wswitch-enum -Wunused-parameter -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -fno-strict-aliasing -Wshadow -Wno-null-pointer-arithmetic -Werror -Werror   -g -O2 -MT ovn/controller/ofctrl.o -MD -MP -MF $depbase.Tpo -c -o ovn/controller/ofctrl.o ovn/controller/ofctrl.c &&\
mv -f $depbase.Tpo $depbase.Po
ovn/controller/ofctrl.c: In function ‘ofctrl_put’:
ovn/controller/ofctrl.c:1086:9: error: missing initializer for field ‘flags’ of ‘struct ofputil_meter_config’ [-Werror=missing-field-initializers]
         };
         ^
In file included from ovn/controller/ofctrl.c:35:0:
./include/openvswitch/ofp-meter.h:53:14: note: ‘flags’ declared here
     uint16_t flags;
              ^
ovn/controller/ofctrl.c: At top level:
cc1: error: unrecognized command line option "-Wno-null-pointer-arithmetic" [-Werror]
cc1: all warnings being treated as errors
make[2]: *** [ovn/controller/ofctrl.o] Error 1
make[2]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/lib/jenkins/jobs/upstream_build_from_pw/workspace'
make: *** [all] Error 2


Please check this out.  If you feel there has been an error, please email aconole@bytheb.org

Thanks,
0-day Robot
Ben Pfaff July 31, 2018, 8:56 p.m. UTC | #2
On Mon, Jul 30, 2018 at 10:47:18PM -0700, Martin Xu wrote:
> As part of "force-reload-kmod," conntrack flush command is issued as
> 'action "ovs-appctl dpctl/flush-conntrack"'. In case no datapath exists
> yet when issuing "force-reload-kmod," there is an error message
> "ovs-vswitchd: no datapaths exist\ ovs-appctl: ovs-vswitchd: server
> returned an error", which is harmless but potentially shows up as "FAILED."
> Add an if condition to check whether datapath exists before running the
> conntrack flush command.
> 
> VMware-BZ: #2170402
> Fixes: 265d70310c69 ("utilities: Fix conntrack flush command")
> 
> Signed-off-by: Martin Xu <martinxu9.ovs@gmail.com>
> CC: Greg Rose <gvrose8192@gmail.com>
> CC: Aaron Conole <aconole@redhat.com>
> CC: Justin Pettit <jpettit@ovn.org>

Thanks, applied to master and branch-2.10.
diff mbox series

Patch

diff --git a/utilities/ovs-lib.in b/utilities/ovs-lib.in
index 92f98ad..d6ef77b 100644
--- a/utilities/ovs-lib.in
+++ b/utilities/ovs-lib.in
@@ -605,7 +605,9 @@  force_reload_kmod () {
     stop_ovsdb
     start_ovsdb || return 1
 
-    action "Flush old conntrack entries" ovs-appctl dpctl/flush-conntrack
+    if [[ $(ovs-dpctl show) ]]; then
+        action "Flush old conntrack entries" ovs-appctl dpctl/flush-conntrack
+    fi
     stop_forwarding
 
     if action "Saving interface configuration" save_interfaces; then