Merge branch 'mainstream'
authorGiuseppe Lettieri <g.lettieri@iet.unipi.it>
Fri, 19 Jul 2013 10:51:38 +0000 (12:51 +0200)
committerGiuseppe Lettieri <g.lettieri@iet.unipi.it>
Fri, 19 Jul 2013 10:51:38 +0000 (12:51 +0200)
1  2 
Makefile.am
lib/automake.mk
lib/dpif-netdev.c

diff --combined Makefile.am
@@@ -108,7 -108,6 +108,7 @@@ ro_shell = printf '\043 Generated autom
  
  SUFFIXES += .in
  .in:
 +      @mkdir -p $$(dirname $@)
        $(PERL) $(srcdir)/build-aux/soexpand.pl -I$(srcdir) < $< | \
            sed \
                -e 's,[@]PKIDIR[@],$(PKIDIR),g' \
@@@ -150,7 -149,7 +150,7 @@@ dist-hook-git: distfile
          (cd datapath && $(MAKE) distfiles);                               \
          (cat distfiles; sed 's|^|datapath/|' datapath/distfiles) |        \
            sort -u > all-distfiles;                                        \
 -        (cd $(srcdir) && git ls-files) | grep -v '\.gitignore$$' |        \
 +        (cd $(srcdir) && git ls-files) | grep -vFf $(srcdir)/.non-distfiles |     \
            sort -u > all-gitfiles;                                         \
          comm -1 -3 all-distfiles all-gitfiles > missing-distfiles;        \
          if test -s missing-distfiles; then                                \
@@@ -203,7 -202,7 +203,7 @@@ ALL_LOCAL += check-assert-h-usag
  check-assert-h-usage:
        @if test -e $(srcdir)/.git && (git --version) >/dev/null 2>&1 && \
            (cd $(srcdir) && git --no-pager grep -l -E '[<]assert.h[>]') | \
-           $(EGREP) -v '^lib/(sflow_receiver|vlog|worker).c$$|^tests/'; \
+           $(EGREP) -v '^lib/(sflow_receiver|vlog).c$$|^tests/'; \
           then \
            echo "Files listed above unexpectedly #include <""assert.h"">."; \
            echo "Please use ovs_assert (from util.h) instead of assert."; \
@@@ -274,5 -273,4 +274,5 @@@ include rhel/automake.m
  include xenserver/automake.mk
  include python/automake.mk
  include python/compat/automake.mk
 +include planetlab/automake.mk
  include tutorial/automake.mk
diff --combined lib/automake.mk
@@@ -10,6 -10,7 +10,7 @@@ noinst_LIBRARIES += lib/libopenvswitch.
  lib_libopenvswitch_a_SOURCES = \
        lib/aes128.c \
        lib/aes128.h \
+       lib/async-append.h \
        lib/backtrace.c \
        lib/backtrace.h \
        lib/bfd.c \
@@@ -71,6 -72,8 +72,8 @@@
        lib/jsonrpc.h \
        lib/lacp.c \
        lib/lacp.h \
+       lib/latch.c \
+       lib/latch.h \
        lib/learn.c \
        lib/learn.h \
        lib/learning-switch.c \
@@@ -90,8 -93,6 +93,8 @@@
        lib/multipath.c \
        lib/multipath.h \
        lib/netdev-dummy.c \
 +      lib/netdev-tunnel.c \
 +      lib/netdev-pltap.c \
        lib/netdev-provider.h \
        lib/netdev-vport.c \
        lib/netdev-vport.h \
        lib/stream-unix.c \
        lib/stream.c \
        lib/stream.h \
-       lib/stress.c \
-       lib/stress.h \
        lib/string.c \
        lib/string.h \
        lib/svec.c \
        lib/timeval.h \
        lib/token-bucket.c \
        lib/token-bucket.h \
 +      lib/tunalloc.c \
 +      lib/tunalloc.h \
        lib/type-props.h \
        lib/unaligned.h \
        lib/unicode.c \
        lib/vlog.c \
        lib/vlog.h \
        lib/vswitch-idl.c \
-       lib/vswitch-idl.h \
-       lib/worker.c \
-       lib/worker.h
+       lib/vswitch-idl.h
  
  nodist_lib_libopenvswitch_a_SOURCES = \
        lib/dirs.c
@@@ -265,6 -260,12 +264,12 @@@ lib_libopenvswitch_a_SOURCES += 
        lib/route-table.h
  endif
  
+ if HAVE_POSIX_AIO
+ lib_libopenvswitch_a_SOURCES += lib/async-append-aio.c
+ else
+ lib_libopenvswitch_a_SOURCES += lib/async-append-sync.c
+ endif
  if ESX
  lib_libopenvswitch_a_SOURCES += \
          lib/route-table-stub.c
@@@ -312,7 -313,6 +317,6 @@@ MAN_FRAGMENTS += 
        lib/ssl-peer-ca-cert.man \
        lib/ssl.man \
        lib/ssl-syn.man \
-       lib/stress-unixctl.man \
        lib/table.man \
        lib/unixctl.man \
        lib/unixctl-syn.man \
@@@ -389,11 -389,6 +393,6 @@@ lib/coverage.def: $(DIST_SOURCES
        sed -n 's|^COVERAGE_DEFINE(\([_a-zA-Z0-9]\{1,\}\)).*$$|COVERAGE_COUNTER(\1)|p' $(all_sources) | LC_ALL=C sort -u > $@
  CLEANFILES += lib/coverage.def
  
- lib/stress.$(OBJEXT): lib/stress.def
- lib/stress.def: $(DIST_SOURCES)
-       sed -n '/^STRESS_OPTION(/,/);$$/{s/);$$/)/;p}' $(all_sources) > $@
- CLEANFILES += lib/stress.def
  lib/vlog.$(OBJEXT): lib/vlog-modules.def
  lib/vlog-modules.def: $(DIST_SOURCES)
        sed -n 's|^VLOG_DEFINE_\(THIS_\)\{0,1\}MODULE(\([_a-zA-Z0-9]\{1,\}\)).*$$|VLOG_MODULE(\2)|p' $(all_sources) | LC_ALL=C sort -u > $@
diff --combined lib/dpif-netdev.c
@@@ -194,17 -194,10 +194,17 @@@ dpif_netdev_class_is_dummy(const struc
      return class != &dpif_netdev_class;
  }
  
 +static bool
 +dpif_netdev_class_is_planetlab(const struct dpif_class *class)
 +{
 +    return class == &dpif_planetlab_class;
 +}
 +
  static const char *
  dpif_netdev_port_open_type(const struct dpif_class *class, const char *type)
  {
      return strcmp(type, "internal") ? type
 +                  : dpif_netdev_class_is_planetlab(class) ? "pltap"
                    : dpif_netdev_class_is_dummy(class) ? "dummy"
                    : "tap";
  }
@@@ -232,8 -225,7 +232,8 @@@ choose_port(struct dp_netdev *dp, cons
  {
      uint32_t port_no;
  
 -    if (dp->class != &dpif_netdev_class) {
 +    if (dp->class != &dpif_netdev_class && 
 +        dp->class != &dpif_planetlab_class) {
          const char *p;
          int start_no = 0;
  
@@@ -702,6 -694,8 +702,8 @@@ static in
  dpif_netdev_flow_from_nlattrs(const struct nlattr *key, uint32_t key_len,
                                struct flow *flow)
  {
+     odp_port_t in_port;
      if (odp_flow_key_to_flow(key, key_len, flow) != ODP_FIT_PERFECT) {
          /* This should not happen: it indicates that odp_flow_key_from_flow()
           * and odp_flow_key_to_flow() disagree on the acceptable form of a
          return EINVAL;
      }
  
-     if (!is_valid_port_number(flow->in_port.odp_port)) {
+     in_port = flow->in_port.odp_port;
+     if (!is_valid_port_number(in_port) && in_port != ODPP_NONE) {
          return EINVAL;
      }
  
@@@ -1198,49 -1193,41 +1201,49 @@@ dp_netdev_execute_actions(struct dp_net
                          dp_netdev_output_port, dp_netdev_action_userspace);
  }
  
 +#define DPIF_NETDEV_CLASS_FUNCTIONS                   \
 +    dpif_netdev_enumerate,                            \
 +    dpif_netdev_port_open_type,                               \
 +    dpif_netdev_open,                                 \
 +    dpif_netdev_close,                                        \
 +    dpif_netdev_destroy,                              \
 +    dpif_netdev_run,                                  \
 +    dpif_netdev_wait,                                 \
 +    dpif_netdev_get_stats,                            \
 +    dpif_netdev_port_add,                             \
 +    dpif_netdev_port_del,                             \
 +    dpif_netdev_port_query_by_number,                 \
 +    dpif_netdev_port_query_by_name,                   \
 +    dpif_netdev_get_max_ports,                                \
 +    NULL,                       /* port_get_pid */    \
 +    dpif_netdev_port_dump_start,                      \
 +    dpif_netdev_port_dump_next,                               \
 +    dpif_netdev_port_dump_done,                               \
 +    dpif_netdev_port_poll,                            \
 +    dpif_netdev_port_poll_wait,                               \
 +    dpif_netdev_flow_get,                             \
 +    dpif_netdev_flow_put,                             \
 +    dpif_netdev_flow_del,                             \
 +    dpif_netdev_flow_flush,                           \
 +    dpif_netdev_flow_dump_start,                      \
 +    dpif_netdev_flow_dump_next,                               \
 +    dpif_netdev_flow_dump_done,                               \
 +    dpif_netdev_execute,                              \
 +    NULL,                       /* operate */         \
 +    dpif_netdev_recv_set,                             \
 +    dpif_netdev_queue_to_priority,                    \
 +    dpif_netdev_recv,                                 \
 +    dpif_netdev_recv_wait,                            \
 +    dpif_netdev_recv_purge,                           \
 +
  const struct dpif_class dpif_netdev_class = {
      "netdev",
 -    dpif_netdev_enumerate,
 -    dpif_netdev_port_open_type,
 -    dpif_netdev_open,
 -    dpif_netdev_close,
 -    dpif_netdev_destroy,
 -    dpif_netdev_run,
 -    dpif_netdev_wait,
 -    dpif_netdev_get_stats,
 -    dpif_netdev_port_add,
 -    dpif_netdev_port_del,
 -    dpif_netdev_port_query_by_number,
 -    dpif_netdev_port_query_by_name,
 -    dpif_netdev_get_max_ports,
 -    NULL,                       /* port_get_pid */
 -    dpif_netdev_port_dump_start,
 -    dpif_netdev_port_dump_next,
 -    dpif_netdev_port_dump_done,
 -    dpif_netdev_port_poll,
 -    dpif_netdev_port_poll_wait,
 -    dpif_netdev_flow_get,
 -    dpif_netdev_flow_put,
 -    dpif_netdev_flow_del,
 -    dpif_netdev_flow_flush,
 -    dpif_netdev_flow_dump_start,
 -    dpif_netdev_flow_dump_next,
 -    dpif_netdev_flow_dump_done,
 -    dpif_netdev_execute,
 -    NULL,                       /* operate */
 -    dpif_netdev_recv_set,
 -    dpif_netdev_queue_to_priority,
 -    dpif_netdev_recv,
 -    dpif_netdev_recv_wait,
 -    dpif_netdev_recv_purge,
 +    DPIF_NETDEV_CLASS_FUNCTIONS
 +};
 +
 +const struct dpif_class dpif_planetlab_class = {
 +    "planetlab",
 +    DPIF_NETDEV_CLASS_FUNCTIONS
  };
  
  static void
@@@ -1273,4 -1260,3 +1276,4 @@@ dpif_dummy_register(bool override
  
      dpif_dummy_register__("dummy");
  }
 +