diff mbox

[odp-ovs,5/5] utilities: remove dependency on kernel module for ODP netdev

Message ID 1421943076-12240-6-git-send-email-ciprian.barbu@linaro.org
State New
Headers show

Commit Message

Ciprian Barbu Jan. 22, 2015, 4:11 p.m. UTC
Signed-off-by: Ciprian Barbu <ciprian.barbu@linaro.org>
---
ODP netdev does not rely on kernel datapath switching, this makes it possible to
start in ODP mode without the kernel module.

 utilities/ovs-ctl.in | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
diff mbox

Patch

diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in
index 8914b58..bb030a3 100755
--- a/utilities/ovs-ctl.in
+++ b/utilities/ovs-ctl.in
@@ -47,16 +47,16 @@  insert_mod_if_required () {
 
     # If the bridge module is loaded, then that might be blocking
     # openvswitch.  Try to unload it, if there are no bridges.
-    test -e /sys/module/bridge || return 1
+    test -e /sys/module/bridge || "X$USE_ODP" == "Xyes" && return 0 || return 1
     bridges=`echo /sys/class/net/*/bridge | sed 's,/sys/class/net/,,g;s,/bridge,,g'`
     if test "$bridges" != "*"; then
         log_warning_msg "not removing bridge module because bridges exist ($bridges)"
         return 1
     fi
-    action "removing bridge module" rmmod bridge || return 1
+    action "removing bridge module" rmmod bridge || "X$USE_ODP" == "Xyes" && return 0 || return 1
 
     # Try loading openvswitch again.
-    action "Inserting openvswitch module" modprobe openvswitch
+    action "Inserting openvswitch module" modprobe openvswitch || "X$USE_ODP" == "Xyes" && return 0
 }
 
 ovs_vsctl () {
@@ -225,7 +225,9 @@  add_managers () {
 start_forwarding () {
     check_force_cores
 
-    insert_mod_if_required || return 1
+    if test X"$USE_ODP" != Xno; then
+        insert_mod_if_required || return 1
+    fi
 
     if daemon_is_running ovs-vswitchd; then
         log_success_msg "ovs-vswitchd is already running"