Merge "master" into "ovn".
authorJustin Pettit <jpettit@nicira.com>
Thu, 7 May 2015 23:52:06 +0000 (16:52 -0700)
committerJustin Pettit <jpettit@nicira.com>
Thu, 7 May 2015 23:52:06 +0000 (16:52 -0700)
This brings in STT.

Conflicts:
tutorial/ovs-sandbox

1  2 
AUTHORS
configure.ac
tests/automake.mk
tests/testsuite.at
tutorial/ovs-sandbox

diff --combined AUTHORS
+++ b/AUTHORS
@@@ -24,6 -24,7 +24,7 @@@ Arun Sharma             arun.sharma@cal
  Aryan TaheriMonfared    aryan.taherimonfared@uis.no
  Ashwin Swaminathan      ashwinds@arista.com
  Ben Pfaff               blp@nicira.com
+ Billy O'Mahony          billy.o.mahony@intel.com
  Brian Kruger            bkruger+ovsdev@gmail.com
  Bruce Davie             bsd@nicira.com
  Bryan Phillippe         bp@toroki.com
@@@ -62,7 -63,6 +63,7 @@@ Flavio Leitner          fbl@redhat.co
  Francesco Fusco         ffusco@redhat.com
  FUJITA Tomonori         fujita.tomonori@lab.ntt.co.jp
  Gaetano Catalli         gaetano.catalli@gmail.com
 +Gal Sagie               gal.sagie@gmail.com
  Geoffrey Wossum         gwossum@acm.org
  Gianluca Merlo          gianluca.merlo@gmail.com
  Giuseppe Lettieri       g.lettieri@iet.unipi.it
@@@ -171,6 -171,7 +172,7 @@@ Thomas Lacroix          thomas.lacroix@
  Todd Deshane            deshantm@gmail.com
  Tom Everman             teverman@google.com
  Tsvi Slonim             tsvi@toroki.com
+ Tuan Nguyen             tuan.nguyen@veriksystems.com
  Tyler Coumbes           coumbes@gmail.com
  Valient Gough           vgough@pobox.com
  Vivien Bernet-Rollande  vbr@soprive.net
@@@ -229,6 -230,7 +231,7 @@@ Chunhe Li               lichunhe@huawei
  Ciara Loftus            ciara.loftus@intel.com
  Daniel Badea            daniel.badea@windriver.com
  Dave Walker             DaveWalker@ubuntu.com
+ David Evans             davidjoshuaevans@gmail.com
  David Palma             palma@onesource.pt
  Derek Cormier           derek.cormier@lab.ntt.co.jp
  Dhaval Badiani          dbadiani@vmware.com
@@@ -255,6 -257,7 +258,7 @@@ Henrik Amren            henrik@nicira.c
  Hiroshi Tanaka          htanaka@nicira.com
  Hiroshi Miyata          miyahiro.dazu@gmail.com
  Hyojoon Kim             joonk@gatech.edu
+ Ian Stokes              ian.stokes@intel.com
  Igor Ganichev           iganichev@nicira.com
  Igor Sever              igor@xorops.com
  Jacob Cherkas           jcherkas@nicira.com
@@@ -360,6 -363,7 +364,7 @@@ likunyun                kunyunli@hotmai
  rahim entezari          rahim.entezari@gmail.com
  冯全树(Crab)            fqs888@126.com
  胡靖飞                  hujingfei914@msn.com
+ 张伟                     zhangwqh@126.com
  
  Thanks to all Open vSwitch contributors.  If you are not listed above
  but believe that you should be, please write to dev@openvswitch.org.
diff --combined configure.ac
@@@ -1,4 -1,4 +1,4 @@@
 -# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
 +# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Nicira, Inc.
  #
  # Licensed under the Apache License, Version 2.0 (the "License");
  # you may not use this file except in compliance with the License.
@@@ -60,7 -60,7 +60,7 @@@ m4_pattern_forbid([LT_INIT]) dnl Make a
  #    replacement, but programs using the new version may use APIs not
  #    present in the previous one. In other words, new symbols have been
  #    added and a program linking against the new version may fail with
- #    “unresolved symbols.” If linking against the old version at runtime:
+ #    "unresolved symbols." If linking against the old version at runtime:
  #    set revision to 0, bump current and age.
  #
  # 3. Programs may need to be changed, recompiled, relinked in order to use
@@@ -81,7 -81,7 +81,7 @@@ AC_SUBST([LT_AGE]
  AC_SEARCH_LIBS([pow], [m])
  AC_SEARCH_LIBS([clock_gettime], [rt])
  AC_SEARCH_LIBS([timer_create], [rt])
- AC_SEARCH_LIBS([pthread_sigmask], [pthread])
+ AC_SEARCH_LIBS([pthread_create], [pthread])
  AC_FUNC_STRERROR_R
  
  OVS_CHECK_ESX
@@@ -111,6 -111,7 +111,7 @@@ OVS_CHECK_PKIDI
  OVS_CHECK_RUNDIR
  OVS_CHECK_DBDIR
  OVS_CHECK_BACKTRACE
+ OVS_CHECK_PERF_EVENT
  OVS_CHECK_VALGRIND
  OVS_CHECK_SOCKET_LIBS
  OVS_CHECK_XENSERVER_VERSION
@@@ -136,7 -137,6 +137,7 @@@ AC_CONFIG_FILES(
      ofproto/libofproto.sym
      lib/libsflow.sym
      lib/libopenvswitch.sym
 +    ovn/lib/libovn.sym
      vtep/libvtep.sym])
  
  OVS_ENABLE_OPTION([-Wall])
@@@ -155,6 -155,7 +156,7 @@@ OVS_ENABLE_OPTION([-Wmissing-prototypes
  OVS_ENABLE_OPTION([-Wmissing-field-initializers])
  OVS_ENABLE_OPTION([-Wthread-safety])
  OVS_ENABLE_OPTION([-fno-strict-aliasing])
+ OVS_ENABLE_OPTION([-Qunused-arguments])
  OVS_CONDITIONAL_CC_OPTION([-Wno-unused], [HAVE_WNO_UNUSED])
  OVS_CONDITIONAL_CC_OPTION([-Wno-unused-parameter], [HAVE_WNO_UNUSED_PARAMETER])
  OVS_ENABLE_WERROR
@@@ -184,7 -185,6 +186,7 @@@ dnl This makes sure that include/openfl
  AC_CONFIG_COMMANDS([include/openflow/openflow.h.stamp])
  
  AC_CONFIG_COMMANDS([utilities/bugtool/dummy], [:])
 +AC_CONFIG_COMMANDS([ovn/dummy], [:])
  
  m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
  
diff --combined tests/automake.mk
@@@ -51,6 -51,7 +51,7 @@@ TESTSUITE_AT = 
        tests/reconnect.at \
        tests/ovs-vswitchd.at \
        tests/dpif-netdev.at \
+       tests/dpctl.at \
        tests/ofproto-dpif.at \
        tests/bridge.at \
        tests/vlan-splinters.at \
@@@ -81,8 -82,7 +82,8 @@@
        tests/interface-reconfigure.at \
        tests/vlog.at \
        tests/vtep-ctl.at \
 -      tests/auto-attach.at
 +      tests/auto-attach.at \
 +      tests/ovn.at
  
  KMOD_TESTSUITE_AT = \
        tests/kmod-testsuite.at \
@@@ -200,10 -200,17 +201,17 @@@ clean-local
        test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' -C tests --clean
  
  AUTOTEST = $(AUTOM4TE) --language=autotest
+ if WIN32
  $(TESTSUITE): package.m4 $(TESTSUITE_AT) $(COMMON_MACROS_AT) $(TESTSUITE_PATCH)
        $(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o testsuite.tmp $@.at
        patch -p0 testsuite.tmp $(TESTSUITE_PATCH)
        $(AM_V_at)mv testsuite.tmp $@
+ else
+ $(TESTSUITE): package.m4 $(TESTSUITE_AT) $(COMMON_MACROS_AT)
+       $(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
+       $(AM_V_at)mv $@.tmp $@
+ endif
  
  $(KMOD_TESTSUITE): package.m4 $(KMOD_TESTSUITE_AT) $(COMMON_MACROS_AT)
        $(AM_V_GEN)$(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
@@@ -273,7 -280,6 +281,7 @@@ tests_ovstest_SOURCES = 
        tests/test-multipath.c \
        tests/test-netflow.c \
        tests/test-odp.c \
 +      tests/test-ovn.c \
        tests/test-packets.c \
        tests/test-random.c \
        tests/test-reconnect.c \
@@@ -292,7 -298,7 +300,7 @@@ tests_ovstest_SOURCES += 
        tests/test-unix-socket.c
  endif
  
 -tests_ovstest_LDADD = lib/libopenvswitch.la
 +tests_ovstest_LDADD = lib/libopenvswitch.la ovn/lib/libovn.la
  dist_check_SCRIPTS = tests/flowgen.pl
  
  noinst_PROGRAMS += tests/test-strtok_r
diff --combined tests/testsuite.at
@@@ -53,6 -53,7 +53,7 @@@ m4_include([tests/reconnect.at]
  m4_include([tests/ovs-vswitchd.at])
  m4_include([tests/ofproto.at])
  m4_include([tests/dpif-netdev.at])
+ m4_include([tests/dpctl.at])
  m4_include([tests/ofproto-dpif.at])
  m4_include([tests/bridge.at])
  m4_include([tests/vlan-splinters.at])
@@@ -66,4 -67,3 +67,4 @@@ m4_include([tests/rstp.at]
  m4_include([tests/vlog.at])
  m4_include([tests/vtep-ctl.at])
  m4_include([tests/auto-attach.at])
 +m4_include([tests/ovn.at])
diff --combined tutorial/ovs-sandbox
@@@ -28,7 -28,10 +28,10 @@@ run_xterm() 
  
  rungdb() {
      under_gdb=$1
+     gdb_run=$2
      shift
+     shift
      # Remove the --detach and to put the process under gdb control.
      # Also remove --vconsole:off to allow error message to show up
      # on the console.
      if $under_gdb && [ "$DISPLAY" ]; then
          args=`echo $@ |sed s/--detach//g | sed s/--vconsole:off//g`
          xterm_title=$1
-         run_xterm $xterm_title gdb -ex run --args $args
+         gdb_cmd=""
+         if $gdb_run; then
+             gdb_cmd="-ex run"
+         fi
+         run_xterm $xterm_title gdb $gdb_cmd --args $args
      else
          run $@
      fi
  
  gdb_vswitchd=false
  gdb_ovsdb=false
+ gdb_vswitchd_ex=false
+ gdb_ovsdb_ex=false
 +gdb_ovn_northd=false
 +gdb_ovn_controller=false
  builddir=
  srcdir=
  schema=
  installed=false
  built=false
 +ovn=false
 +ovnsb_schema=
 +ovnnb_schema=
  
  for option; do
      # This option-parsing mechanism borrowed from a Autoconf-generated
@@@ -94,10 -100,7 +105,10 @@@ These options force ovs-sandbox to use 
    -i, --installed      use installed Open vSwitch
    -g, --gdb-vswitchd   run ovs-vswitchd under gdb
    -d, --gdb-ovsdb      run ovsdb-server under gdb
 +  --gdb-ovn-northd     run ovn-northd under gdb
 +  --gdb-ovn-controller run ovn-controller under gdb
    -S, --schema=FILE    use FILE as vswitch.ovsschema
 +  -o, --ovn            enable OVN
  
  Other options:
    -h, --help           Print this usage message.
@@@ -134,19 -137,20 +145,29 @@@ EO
              ;;
          -g|--gdb-v*)
              gdb_vswitchd=true
+             gdb_vswitchd_ex=false
+             ;;
+         -e|--gdb-ex-v*)
+             gdb_vswitchd=true
+             gdb_vswitchd_ex=true
              ;;
 -        -d|--gdb-o*)
 +        -d|--gdb-ovsdb)
              gdb_ovsdb=true
+             gdb_ovsdb_ex=false
+             ;;
+         -r|--gdb-ex-o*)
+             gdb_ovsdb=true
+             gdb_ovsdb_ex=true
              ;;
 +        --gdb-ovn-northd)
 +            gdb_ovn_northd=true
 +            ;;
 +        --gdb-ovn-controller)
 +            gdb_ovn_controller=true
 +            ;;
 +        -o|--ovn)
 +            ovn=true
 +            ;;
          -*)
              echo "unrecognized option $option (use --help for help)" >&2
              exit 1
@@@ -197,18 -201,6 +218,18 @@@ if $built; the
          echo >&2 'source directory not found, please use --srcdir'
          exit 1
      fi
 +    if $ovn; then
 +        ovnsb_schema=$srcdir/ovn/ovn-sb.ovsschema
 +        if test ! -e "$ovnsb_schema"; then
 +            echo >&2 'source directory not found, please use --srcdir'
 +            exit 1
 +        fi
 +        ovnnb_schema=$srcdir/ovn/ovn-nb.ovsschema
 +        if test ! -e "$ovnnb_schema"; then
 +            echo >&2 'source directory not found, please use --srcdir'
 +            exit 1
 +        fi
 +    fi
  
      # Put built tools early in $PATH.
      if test ! -e $builddir/vswitchd/ovs-vswitchd; then
          exit 1
      fi
      PATH=$builddir/ovsdb:$builddir/vswitchd:$builddir/utilities:$PATH
 +    if $ovn; then
 +        PATH=$builddir/ovn:$builddir/ovn/controller:$builddir/ovn/northd:$PATH
 +    fi
      export PATH
  else
      case $schema in
          echo "can't find vswitch.ovsschema, please specify --schema" >&2
          exit 1
      fi
 +    if $ovn; then
 +        echo "running with ovn is only supported from the build dir." >&2
 +        exit 1
 +    fi
  fi
  
  # Create sandbox.
@@@ -268,36 -253,28 +289,48 @@@ trap 'kill `cat "$sandbox"/*.pid`' 0 1 
  # Create database and start ovsdb-server.
  touch "$sandbox"/.conf.db.~lock~
  run ovsdb-tool create conf.db "$schema"
- rungdb $gdb_ovsdb ovsdb-server --detach --no-chdir --pidfile -vconsole:off --log-file \
 +ovsdb_server_args=
 +if $ovn; then
 +    touch "$sandbox"/.ovnsb.db.~lock~
 +    touch "$sandbox"/.ovnnb.db.~lock~
 +    run ovsdb-tool create ovnsb.db "$ovnsb_schema"
 +    run ovsdb-tool create ovnnb.db "$ovnnb_schema"
 +    ovsdb_server_args="ovnsb.db ovnnb.db conf.db"
 +fi
 -    --remote=punix:"$sandbox"/db.sock
+ rungdb $gdb_ovsdb $gdb_ovsdb_ex ovsdb-server --detach --no-chdir --pidfile -vconsole:off --log-file \
 +    --remote=punix:"$sandbox"/db.sock $ovsdb_server_args
  
+ #Add a small delay to allow ovsdb-server to launch.
+ sleep 0.1
+ #Wait for ovsdb-server to finish launching.
+ if test ! -e "$sandbox"/db.sock; then
+     echo -n "Waiting for ovsdb-server to start..."
+     while test ! -e "$sandbox"/db.sock; do
+         sleep 1;
+     done
+     echo "  Done"
+ fi
  # Initialize database.
  run ovs-vsctl --no-wait -- init
  
  # Start ovs-vswitchd.
- rungdb $gdb_vswitchd ovs-vswitchd --detach --no-chdir --pidfile -vconsole:off --log-file \
+ rungdb $gdb_vswitchd $gdb_vswitchd_ex ovs-vswitchd --detach --no-chdir --pidfile -vconsole:off --log-file \
      --enable-dummy=override -vvconn -vnetdev_dummy
  
 +if $ovn; then
 +    ovs-vsctl set open . external-ids:system-id=56b18105-5706-46ef-80c4-ff20979ab068
 +    ovs-vsctl set open . external-ids:ovn-remote=unix:"$sandbox"/db.sock
 +    ovs-vsctl set open . external-ids:ovn-encap-type=geneve
 +    ovs-vsctl set open . external-ids:ovn-encap-ip=127.0.0.1
 +    ovs-vsctl add-br br-int \
 +        -- set bridge br-int fail-mode=secure other-config:disable-in-band=true
 +
 +    rungdb $gdb_ovn_northd ovn-northd --detach --no-chdir --pidfile -vconsole:off --log-file
 +    rungdb $gdb_ovn_controller ovn-controller --detach --no-chdir --pidfile -vconsole:off --log-file
 +fi
 +
  cat <<EOF