Merge branch 'mainstream'
authorGiuseppe Lettieri <g.lettieri@iet.unipi.it>
Fri, 25 Oct 2013 20:15:00 +0000 (22:15 +0200)
committerGiuseppe Lettieri <g.lettieri@iet.unipi.it>
Fri, 25 Oct 2013 20:15:00 +0000 (22:15 +0200)
1  2 
Makefile.am
lib/automake.mk
lib/dpif-netdev.c

diff --combined Makefile.am
@@@ -27,10 -27,13 +27,13 @@@ endi
  # vSwitch, but it causes trouble if you switch from a version with
  # foo/__init__.py into an (older) version with plain foo.py, since
  # foo/__init__.pyc will cause Python to ignore foo.py.
- run_python = \
-       PYTHONDONTWRITEBYTECODE=yes \
-       PYTHONPATH=$(top_srcdir)/python:$$PYTHONPATH \
-       $(PYTHON)
+ if INCLUDE_PYTHON_COMPAT
+ run_python = PYTHONPATH=$(top_srcdir)/python:$(top_srcdir)/python/compat:$$PYTHONPATH
+ else
+ run_python = PYTHONPATH=$(top_srcdir)/python:$$PYTHONPATH
+ endif
+ run_python += PYTHONDONTWRITEBYTECODE=yes $(PYTHON)
  
  ALL_LOCAL =
  BUILT_SOURCES =
@@@ -108,7 -111,6 +111,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 -152,7 +153,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                                \
@@@ -274,5 -276,5 +277,6 @@@ 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
+ include vtep/automake.mk
diff --combined lib/automake.mk
@@@ -97,8 -97,6 +97,8 @@@ lib_libopenvswitch_a_SOURCES = 
        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/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/vswitch-idl.h \
+       lib/vtep-idl.c \
+       lib/vtep-idl.h
  
  nodist_lib_libopenvswitch_a_SOURCES = \
        lib/dirs.c
@@@ -338,7 -336,10 +340,10 @@@ MAN_FRAGMENTS += 
  OVSIDL_BUILT += \
        $(srcdir)/lib/vswitch-idl.c \
        $(srcdir)/lib/vswitch-idl.h \
-       $(srcdir)/lib/vswitch-idl.ovsidl
+       $(srcdir)/lib/vswitch-idl.ovsidl \
+       $(srcdir)/lib/vtep-idl.c \
+       $(srcdir)/lib/vtep-idl.h \
+       $(srcdir)/lib/vtep-idl.ovsidl
  
  EXTRA_DIST += $(srcdir)/lib/vswitch-idl.ann
  VSWITCH_IDL_FILES = \
@@@ -348,6 -349,14 +353,14 @@@ $(srcdir)/lib/vswitch-idl.ovsidl: $(VSW
        $(OVSDB_IDLC) annotate $(VSWITCH_IDL_FILES) > $@.tmp
        mv $@.tmp $@
  
+ EXTRA_DIST += $(srcdir)/lib/vtep-idl.ann
+ VTEP_IDL_FILES = \
+       $(srcdir)/vtep/vtep.ovsschema \
+       $(srcdir)/lib/vtep-idl.ann
+ $(srcdir)/lib/vtep-idl.ovsidl: $(VTEP_IDL_FILES)
+       $(OVSDB_IDLC) annotate $(VTEP_IDL_FILES) > $@.tmp
+       mv $@.tmp $@
  lib/dirs.c: lib/dirs.c.in Makefile
        ($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
                -e 's,[@]srcdir[@],$(srcdir),g' \
diff --combined lib/dpif-netdev.c
@@@ -201,17 -201,10 +201,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";
  }
@@@ -239,8 -232,7 +239,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;
  
@@@ -402,6 -394,8 +402,8 @@@ dpif_netdev_get_stats(const struct dpi
      stats->n_hit = dp->n_hit;
      stats->n_missed = dp->n_missed;
      stats->n_lost = dp->n_lost;
+     stats->n_masks = UINT64_MAX;
+     stats->n_mask_hit = UINT64_MAX;
      ovs_mutex_unlock(&dp_netdev_mutex);
  
      return 0;
@@@ -1316,49 -1310,41 +1318,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
@@@ -1430,4 -1416,3 +1432,4 @@@ dpif_dummy_register(bool override
                               "DP PORT NEW-NUMBER",
                               3, 3, dpif_dummy_change_port_number, NULL);
  }
 +