2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-22 18:07:40 +00:00
ovs/lib/automake.mk

486 lines
11 KiB
Makefile
Raw Normal View History

# Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without warranty of any kind.
lib_LTLIBRARIES += lib/libopenvswitch.la
lib_libopenvswitch_la_LIBADD = $(SSL_LIBS)
if WIN32
lib_libopenvswitch_la_LIBADD += ${PTHREAD_LIBS}
endif
lib_libopenvswitch_la_LDFLAGS = -release $(VERSION)
lib_libopenvswitch_la_SOURCES = \
lib/aes128.c \
lib/aes128.h \
lib/async-append.h \
lib/backtrace.c \
lib/backtrace.h \
lib/bfd.c \
lib/bfd.h \
lib/bitmap.h \
lib/bundle.c \
lib/bundle.h \
lib/byte-order.h \
lib/byteq.c \
lib/byteq.h \
lib/cfm.c \
lib/cfm.h \
lib/classifier.c \
lib/classifier.h \
cmap: New module for cuckoo hash table. This implements an "optimistic concurrent cuckoo hash", a single-writer, multiple-reader hash table data structure. The point of this data structure is performance, so this commit message focuses on performance. I tested the performance of cmap with the test-cmap utility included in this commit. It takes three parameters for benchmarking: - n, the number of elements to insert. - n_threads, the number of threads to use for searching and mutating the hash table. - mutations, the percentage of operations that should modify the hash table, from 0% to 100%. e.g. "test-cmap 1000000 16 1" inserts one million elements, uses 16 threads, and 1% of the operations modify the hash table. Any given run does the following for both hmap and cmap implementations: - Inserts n elements into a hash table. - Iterates over all of the elements. - Spawns n_threads threads, each of which searches for each of the elements in the hash table, once, and removes the specified percentage of them. - Removes each of the (remaining) elements and destroys the hash table. and reports the time taken by each step, The tables below report results for various parameters with a draft version of this library. The tests were not formally rerun for the final version, but the intermediate changes should only have improved performance, and this seemed to be the case in some informal testing. n_threads=16 was used each time, on a 16-core x86-64 machine. The compiler used was Clang 3.5. (GCC yields different numbers but similar relative results.) The results show: - Insertion is generally 3x to 5x faster in an hmap. - Iteration is generally about 3x faster in a cmap. - Search and mutation is 4x faster with .1% mutations and the advantage grows as the fraction of mutations grows. This is because a cmap does not require locking for read operations, even in the presence of a writer. With no mutations, however, no locking is required in the hmap case, and the hmap is somewhat faster. This is because raw hmap search is somewhat simpler and faster than raw cmap search. - Destruction is faster, usually by less than 2x, in an hmap. n=10,000,000: .1% mutations 1% mutations 10% mutations no mutations cmap hmap cmap hmap cmap hmap cmap hmap insert: 6132 2182 6136 2178 6111 2174 6124 2180 iterate: 370 1203 378 1201 370 1200 371 1202 search: 1375 8692 2393 28197 18402 80379 1281 1097 destroy: 1382 1187 1197 1034 324 241 1405 1205 n=1,000,000: .1% mutations 1% mutations 10% mutations no mutations cmap hmap cmap hmap cmap hmap cmap hmap insert: 311 25 310 60 311 59 310 60 iterate: 25 62 25 64 25 57 25 60 search: 115 637 197 2266 1803 7284 101 67 destroy: 103 64 90 59 25 13 104 66 n=100,000: .1% mutations 1% mutations 10% mutations no mutations cmap hmap cmap hmap cmap hmap cmap hmap insert: 25 6 26 5 25 5 25 5 iterate: 1 3 1 3 1 3 2 3 search: 12 57 27 219 164 735 10 5 destroy: 5 3 6 3 2 1 6 4 Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
2014-05-20 16:51:42 -07:00
lib/cmap.c \
lib/cmap.h \
lib/command-line.c \
lib/command-line.h \
lib/compiler.h \
lib/connectivity.c \
lib/connectivity.h \
lib/coverage.c \
lib/coverage.h \
lib/crc32c.c \
lib/crc32c.h \
lib/csum.c \
lib/csum.h \
lib/daemon.c \
lib/daemon.h \
lib/daemon-private.h \
lib/dhcp.h \
lib/dummy.c \
lib/dummy.h \
lib/dhparams.h \
lib/dirs.h \
dpctl: add ovs-appctl dpctl/* commands to talk to dpif-netdev This commit introduces multiple appctl commands (dpctl/*) They are needed to interact with userspace datapaths (dpif-netdev), because the ovs-dpctl command runs in a separate process and cannot see the userspace datapaths inside vswitchd. This change moves most of the code of utilities/ovs-dpctl.c in lib/dpctl.c. Both the ovs-dpctl command and the ovs-appctl dpctl/* commands make calls to lib/dpctl.c functions, to interact with datapaths. The code from utilities/ovs-dpctl.c has been moved to lib/dpctl.c and has been changed for different reasons: - An exit() call in the old code made perfectly sense. Now (since the code can be run inside vswitchd) it would terminate the daemon. Same reasoning can be applied to ovs_fatal_*() calls. - The lib/dpctl.c code _should_ not leak memory. - All the print* have been replaced with a function pointer provided by the caller, since this code can be run in the ovs-dpctl process (in which case we need to print to stdout) or in response to a unixctl request (and in this case we need to send everything through a socket, using JSON encapsulation). The syntax is ovs-appctl dpctl/(COMMAND) [OPTIONS] [PARAMETERS] while the ovs-dpctl syntax (which _should_ remain the same after this change) is ovs-dpctl [OPTIONS] (COMMAND) [PARAMETERS] Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com> [blp@nicira.com made stylistic and documentation changes] Signed-off-by: Ben Pfaff <blp@nicira.com>
2014-07-17 17:26:00 -07:00
lib/dpctl.c \
lib/dpctl.h \
lib/dpif-netdev.c \
lib/dpif-netdev.h \
lib/dpif-provider.h \
lib/dpif.c \
lib/dpif.h \
lib/heap.c \
lib/heap.h \
lib/dynamic-string.c \
lib/dynamic-string.h \
lib/entropy.c \
lib/entropy.h \
lib/fat-rwlock.c \
lib/fat-rwlock.h \
lib/fatal-signal.c \
lib/fatal-signal.h \
lib/flow.c \
lib/flow.h \
lib/guarded-list.c \
lib/guarded-list.h \
lib/hash.c \
lib/hash.h \
lib/hindex.c \
lib/hindex.h \
lib/hmap.c \
lib/hmap.h \
2011-04-07 17:10:48 -07:00
lib/hmapx.c \
lib/hmapx.h \
lib/jhash.c \
lib/jhash.h \
lib/json.c \
lib/json.h \
2009-10-26 15:04:05 -07:00
lib/jsonrpc.c \
lib/jsonrpc.h \
lib/lacp.c \
lib/lacp.h \
lib/latch.h \
lib/learn.c \
lib/learn.h \
lib/learning-switch.c \
lib/learning-switch.h \
lib/list.c \
lib/list.h \
lib/lockfile.c \
lib/lockfile.h \
lib/mac-learning.c \
lib/mac-learning.h \
lib/match.c \
lib/match.h \
lib/mcast-snooping.c \
lib/mcast-snooping.h \
lib/memory.c \
lib/memory.h \
lib/meta-flow.c \
lib/meta-flow.h \
lib/multipath.c \
lib/multipath.h \
lib/netdev-dummy.c \
lib/netdev-provider.h \
lib/netdev-vport.c \
lib/netdev-vport.h \
lib/netdev.c \
lib/netdev.h \
lib/netflow.h \
lib/netlink.c \
lib/netlink.h \
lib/nx-match.c \
lib/nx-match.h \
lib/odp-execute.c \
lib/odp-execute.h \
lib/odp-util.c \
lib/odp-util.h \
lib/ofp-actions.c \
lib/ofp-actions.h \
lib/ofp-errors.c \
lib/ofp-errors.h \
lib/ofp-msgs.c \
lib/ofp-msgs.h \
lib/ofp-parse.c \
lib/ofp-parse.h \
lib/ofp-print.c \
lib/ofp-print.h \
lib/ofp-util.c \
lib/ofp-util.h \
lib/ofp-version-opt.h \
lib/ofp-version-opt.c \
lib/ofpbuf.c \
lib/ofpbuf.h \
lib/ovs-atomic-c11.h \
lib/ovs-atomic-clang.h \
lib/ovs-atomic-flag-gcc4.7+.h \
lib/ovs-atomic-gcc4+.h \
lib/ovs-atomic-gcc4.7+.h \
lib/ovs-atomic-i586.h \
ovs-atomic: Use raw types, not structs, when locks are required. Until now, the GCC 4+ and pthreads implementations of atomics have used struct wrappers for their atomic types. This had the advantage of allowing a mutex to be wrapped in, in some cases, and of better type-checking by preventing stray uses of atomic variables other than through one of the atomic_*() functions or macros. However, the mutex meant that an atomic_destroy() function-like macro needed to be used. The struct wrapper also made it impossible to define new atomic types that were compatible with each other without using a typedef. For example, one could not simply define a macro like #define ATOMIC(TYPE) struct { TYPE value; } and then have two declarations like: ATOMIC(void *) x; ATOMIC(void *) y; and do anything with these objects that require type-compatibility, even "&x == &y", because the two structs are not compatible. One can do it through a typedef: typedef ATOMIC(void *) atomic_voidp; atomic_voidp x, y; but that is inconvenient, especially because of the need to invent a name for the type. This commit aims to ease the problem by getting rid of the wrapper structs in the cases where the atomic library used them. It gets rid of the mutexes, in the cases where they are still needed, by using a global array of mutexes instead. This commit also defines the ATOMIC macro described above and documents its use in ovs-atomic.h. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Andy Zhou <azhou@nicira.com>
2014-03-11 12:46:29 -07:00
lib/ovs-atomic-locked.c \
lib/ovs-atomic-locked.h \
ovs-atomics: Add atomic support Windows. Before this change (i.e., with pthread locks for atomics on Windows), the benchmark for cmap and hmap was as follows: $ ./tests/ovstest.exe test-cmap benchmark 10000000 3 1 Benchmarking with n=10000000, 3 threads, 1.00% mutations: cmap insert: 61070 ms cmap iterate: 2750 ms cmap search: 14238 ms cmap destroy: 8354 ms hmap insert: 1701 ms hmap iterate: 985 ms hmap search: 3755 ms hmap destroy: 1052 ms After this change, the benchmark is as follows: $ ./tests/ovstest.exe test-cmap benchmark 10000000 3 1 Benchmarking with n=10000000, 3 threads, 1.00% mutations: cmap insert: 3666 ms cmap iterate: 365 ms cmap search: 2016 ms cmap destroy: 1331 ms hmap insert: 1495 ms hmap iterate: 1026 ms hmap search: 4167 ms hmap destroy: 1046 ms So there is clearly a big improvement for cmap. But the correspondig test on Linux (with gcc 4.6) yeilds the following: ./tests/ovstest test-cmap benchmark 10000000 3 1 Benchmarking with n=10000000, 3 threads, 1.00% mutations: cmap insert: 3917 ms cmap iterate: 355 ms cmap search: 871 ms cmap destroy: 1158 ms hmap insert: 1988 ms hmap iterate: 1005 ms hmap search: 5428 ms hmap destroy: 980 ms So for this particular test, except for "cmap search", Windows and Linux have similar performance. Windows is around 2.5x slower in "cmap search" compared to Linux. This has to be investigated. Signed-off-by: Gurucharan Shetty <gshetty@nicira.com> [With a lot of inputs and help from Jarno] Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
2014-08-21 13:57:37 -07:00
lib/ovs-atomic-msvc.h \
lib/ovs-atomic-pthreads.h \
lib/ovs-atomic-x86_64.h \
lib/ovs-atomic.h \
lib/ovs-rcu.c \
lib/ovs-rcu.h \
lib/ovs-thread.c \
lib/ovs-thread.h \
2009-11-04 15:11:44 -08:00
lib/ovsdb-data.c \
lib/ovsdb-data.h \
lib/ovsdb-error.c \
lib/ovsdb-error.h \
2009-12-02 11:26:15 -08:00
lib/ovsdb-idl-provider.h \
lib/ovsdb-idl.c \
lib/ovsdb-idl.h \
2009-11-04 15:11:44 -08:00
lib/ovsdb-parser.c \
lib/ovsdb-parser.h \
lib/ovsdb-types.c \
lib/ovsdb-types.h \
lib/packet-dpif.c \
lib/packet-dpif.h \
lib/packets.c \
lib/packets.h \
lib/pcap-file.c \
lib/pcap-file.h \
lib/poll-loop.c \
lib/poll-loop.h \
lib/process.c \
lib/process.h \
lib/pvector.c \
lib/pvector.h \
lib/random.c \
lib/random.h \
lib/rconn.c \
lib/rconn.h \
lib/reconnect.c \
lib/reconnect.h \
lib/rstp.c \
lib/rstp.h \
lib/rstp-common.h \
lib/rstp-state-machines.c \
lib/rstp-state-machines.h \
lib/sat-math.h \
lib/seq.c \
lib/seq.h \
lib/sha1.c \
lib/sha1.h \
lib/shash.c \
lib/shash.h \
lib/simap.c \
lib/simap.h \
lib/smap.c \
lib/smap.h \
lib/socket-util.c \
lib/socket-util.h \
2009-11-04 15:11:44 -08:00
lib/sort.c \
lib/sort.h \
lib/sset.c \
lib/sset.h \
lib/stp.c \
lib/stp.h \
lib/stream-fd.c \
lib/stream-fd.h \
lib/stream-provider.h \
lib/stream-ssl.h \
lib/stream-tcp.c \
lib/stream.c \
lib/stream.h \
lib/stdio.c \
lib/string.c \
lib/svec.c \
lib/svec.h \
lib/table.c \
lib/table.h \
lib/tag.c \
lib/tag.h \
lib/timer.c \
lib/timer.h \
lib/timeval.c \
lib/timeval.h \
lib/token-bucket.c \
lib/token-bucket.h \
lib/type-props.h \
lib/unaligned.h \
lib/unicode.c \
lib/unicode.h \
lib/unixctl.c \
lib/unixctl.h \
lib/util.c \
lib/util.h \
lib/uuid.c \
lib/uuid.h \
lib/valgrind.h \
lib/vconn-provider.h \
lib/vconn-stream.c \
lib/vconn.c \
lib/vconn.h \
2011-04-08 13:19:33 -07:00
lib/vlan-bitmap.c \
lib/vlan-bitmap.h \
lib/vlandev.c \
lib/vlandev.h \
lib/vlog.c \
lib/vlog.h \
lib/vswitch-idl.c \
lib/vswitch-idl.h \
lib/vtep-idl.c \
lib/vtep-idl.h
if WIN32
lib_libopenvswitch_la_SOURCES += \
lib/daemon-windows.c \
lib/getopt_long.c \
lib/getrusage-windows.c \
lib/latch-windows.c \
lib/route-table-stub.c \
lib/strsep.c
else
lib_libopenvswitch_la_SOURCES += \
lib/daemon-unix.c \
lib/latch-unix.c \
lib/signals.c \
lib/signals.h \
lib/socket-util-unix.c \
lib/stream-unix.c
endif
EXTRA_DIST += \
lib/stdio.h.in \
lib/string.h.in
nodist_lib_libopenvswitch_la_SOURCES = \
lib/dirs.c
CLEANFILES += $(nodist_lib_libopenvswitch_la_SOURCES)
lib_LTLIBRARIES += lib/libsflow.la
lib_libsflow_la_LDFLAGS = -release $(VERSION)
lib_libsflow_la_SOURCES = \
lib/sflow_api.h \
lib/sflow.h \
lib/sflow_agent.c \
lib/sflow_sampler.c \
lib/sflow_poller.c \
lib/sflow_receiver.c
lib_libsflow_la_CPPFLAGS = $(AM_CPPFLAGS)
lib_libsflow_la_CFLAGS = $(AM_CFLAGS)
if HAVE_WNO_UNUSED
lib_libsflow_la_CFLAGS += -Wno-unused
endif
if HAVE_WNO_UNUSED_PARAMETER
lib_libsflow_la_CFLAGS += -Wno-unused-parameter
endif
if LINUX
lib_libopenvswitch_la_SOURCES += \
lib/dpif-netlink.c \
lib/dpif-netlink.h \
lib/netdev-linux.c \
lib/netdev-linux.h \
lib/netlink-notifier.c \
lib/netlink-notifier.h \
lib/netlink-protocol.h \
lib/netlink-socket.c \
lib/netlink-socket.h \
lib/ovs-numa.c \
lib/ovs-numa.h \
lib/rtnetlink-link.c \
lib/rtnetlink-link.h \
lib/route-table.c \
lib/route-table.h
endif
if DPDK_NETDEV
lib_libopenvswitch_la_SOURCES += \
lib/netdev-dpdk.c \
lib/netdev-dpdk.h
endif
if WIN32
lib_libopenvswitch_la_SOURCES += \
lib/dpif-netlink.c \
lib/dpif-netlink.h \
lib/netdev-windows.c \
lib/netlink-notifier.c \
lib/netlink-notifier.h \
lib/netlink-protocol.h \
lib/netlink-socket.c \
lib/netlink-socket.h
endif
if HAVE_POSIX_AIO
lib_libopenvswitch_la_SOURCES += lib/async-append-aio.c
else
lib_libopenvswitch_la_SOURCES += lib/async-append-null.c
endif
if ESX
lib_libopenvswitch_la_SOURCES += \
lib/route-table-stub.c
endif
if HAVE_IF_DL
lib_libopenvswitch_la_SOURCES += \
lib/netdev-bsd.c \
lib/rtbsd.c \
lib/rtbsd.h \
lib/route-table-bsd.c
endif
if HAVE_OPENSSL
lib_libopenvswitch_la_SOURCES += lib/stream-ssl.c
nodist_lib_libopenvswitch_la_SOURCES += lib/dhparams.c
lib/dhparams.c: lib/dh1024.pem lib/dh2048.pem lib/dh4096.pem
$(AM_V_GEN)(echo '#include "lib/dhparams.h"' && \
openssl dhparam -C -in $(srcdir)/lib/dh1024.pem -noout && \
openssl dhparam -C -in $(srcdir)/lib/dh2048.pem -noout && \
openssl dhparam -C -in $(srcdir)/lib/dh4096.pem -noout) \
| sed 's/\(get_dh[0-9]*\)()/\1(void)/' > lib/dhparams.c.tmp && \
mv lib/dhparams.c.tmp lib/dhparams.c
else
lib_libopenvswitch_la_SOURCES += lib/stream-nossl.c
endif
EXTRA_DIST += \
lib/dh1024.pem \
lib/dh2048.pem \
lib/dh4096.pem \
lib/dirs.c.in
MAN_FRAGMENTS += \
lib/common.man \
lib/common-syn.man \
lib/coverage-unixctl.man \
lib/daemon.man \
lib/daemon-syn.man \
dpctl: add ovs-appctl dpctl/* commands to talk to dpif-netdev This commit introduces multiple appctl commands (dpctl/*) They are needed to interact with userspace datapaths (dpif-netdev), because the ovs-dpctl command runs in a separate process and cannot see the userspace datapaths inside vswitchd. This change moves most of the code of utilities/ovs-dpctl.c in lib/dpctl.c. Both the ovs-dpctl command and the ovs-appctl dpctl/* commands make calls to lib/dpctl.c functions, to interact with datapaths. The code from utilities/ovs-dpctl.c has been moved to lib/dpctl.c and has been changed for different reasons: - An exit() call in the old code made perfectly sense. Now (since the code can be run inside vswitchd) it would terminate the daemon. Same reasoning can be applied to ovs_fatal_*() calls. - The lib/dpctl.c code _should_ not leak memory. - All the print* have been replaced with a function pointer provided by the caller, since this code can be run in the ovs-dpctl process (in which case we need to print to stdout) or in response to a unixctl request (and in this case we need to send everything through a socket, using JSON encapsulation). The syntax is ovs-appctl dpctl/(COMMAND) [OPTIONS] [PARAMETERS] while the ovs-dpctl syntax (which _should_ remain the same after this change) is ovs-dpctl [OPTIONS] (COMMAND) [PARAMETERS] Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com> [blp@nicira.com made stylistic and documentation changes] Signed-off-by: Ben Pfaff <blp@nicira.com>
2014-07-17 17:26:00 -07:00
lib/dpctl.man \
lib/memory-unixctl.man \
lib/ofp-version.man \
lib/ovs.tmac \
lib/service.man \
lib/service-syn.man \
lib/ssl-bootstrap.man \
lib/ssl-bootstrap-syn.man \
lib/ssl-peer-ca-cert.man \
lib/ssl.man \
lib/ssl-syn.man \
lib/table.man \
lib/unixctl.man \
lib/unixctl-syn.man \
lib/vconn-active.man \
lib/vconn-passive.man \
lib/vlog-unixctl.man \
lib/vlog-syn.man \
lib/vlog.man
# vswitch IDL
OVSIDL_BUILT += \
$(srcdir)/lib/vswitch-idl.c \
$(srcdir)/lib/vswitch-idl.h \
$(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 = \
$(srcdir)/vswitchd/vswitch.ovsschema \
$(srcdir)/lib/vswitch-idl.ann
$(srcdir)/lib/vswitch-idl.ovsidl: $(VSWITCH_IDL_FILES)
$(AM_V_GEN)$(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)
$(AM_V_GEN)$(OVSDB_IDLC) annotate $(VTEP_IDL_FILES) > $@.tmp && \
mv $@.tmp $@
lib/dirs.c: lib/dirs.c.in Makefile
$(AM_V_GEN)($(ro_c) && sed < $(srcdir)/lib/dirs.c.in \
-e 's,[@]srcdir[@],$(srcdir),g' \
-e 's,[@]LOGDIR[@],"$(LOGDIR)",g' \
-e 's,[@]RUNDIR[@],"$(RUNDIR)",g' \
-e 's,[@]DBDIR[@],"$(DBDIR)",g' \
-e 's,[@]bindir[@],"$(bindir)",g' \
-e 's,[@]sysconfdir[@],"$(sysconfdir)",g' \
-e 's,[@]pkgdatadir[@],"$(pkgdatadir)",g') \
> lib/dirs.c.tmp && \
mv lib/dirs.c.tmp lib/dirs.c
lib/meta-flow.inc: $(srcdir)/build-aux/extract-ofp-fields lib/meta-flow.h
$(AM_V_GEN)$(run_python) $^ --meta-flow > $@.tmp && mv $@.tmp $@
lib/meta-flow.lo: lib/meta-flow.inc
lib/nx-match.inc: $(srcdir)/build-aux/extract-ofp-fields lib/meta-flow.h
$(AM_V_GEN)$(run_python) $^ --nx-match > $@.tmp && mv $@.tmp $@
lib/nx-match.lo: lib/nx-match.inc
CLEANFILES += lib/meta-flow.inc lib/nx-match.inc
EXTRA_DIST += build-aux/extract-ofp-fields
ofp-actions: Centralize all OpenFlow action code for maintainability. Until now, knowledge about OpenFlow has been somewhat scattered around the tree. Some of it is in ofp-actions, some of it is in ofp-util, some in separate files for individual actions, and most of the wire format declarations are in include/openflow. This commit centralizes all of that in ofp-actions. Encoding and decoding OpenFlow actions was previously broken up by OpenFlow version. This was OK with only OpenFlow 1.0 and 1.1, but each additional version added a new wrapper around the existing ones, which started to become hard to understand. This commit merges all of the processing for the different versions, to the extent that they are similar, making the version differences clearer. Previously, ofp-actions contained OpenFlow encoding and decoding, plus ofpact formatting, but OpenFlow parsing was separated into ofp-parse, which seems an odd division. This commit moves the parsing code into ofp-actions with the rest of the code. Before this commit, the four main bits of code associated with a particular ofpact--OpenFlow encoding and decoding, ofpact formatting and parsing--were all found far away from each other. This often made it hard to see what was going on for a particular ofpact, since you had to search around to many different pieces of code. This commit reorganizes so that all of the code for a given ofpact is in a single place. As a code refactoring, this commit has little visible behavioral change. The update to ofproto-dpif.at illustrates one minor bug fix as a side effect: a flow that was added with the action "dec_ttl" (a standard OpenFlow action) was previously formatted as "dec_ttl(0)" (using a Nicira extension to specifically direct packets bounced to the controller because of too-low TTL), but after this commit it is correctly formatted as "dec_ttl". The other visible effect is to drop support for the Nicira extension dec_ttl action in OpenFlow 1.1 and later in favor of the equivalent standard action. It seems unlikely that anyone was really using the Nicira extension in OF1.1 or later. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
2014-08-11 12:50:36 -07:00
lib/ofp-actions.inc1: $(srcdir)/build-aux/extract-ofp-actions lib/ofp-actions.c
$(AM_V_GEN)$(run_python) $^ --prototypes > $@.tmp && mv $@.tmp $@
ofp-actions: Centralize all OpenFlow action code for maintainability. Until now, knowledge about OpenFlow has been somewhat scattered around the tree. Some of it is in ofp-actions, some of it is in ofp-util, some in separate files for individual actions, and most of the wire format declarations are in include/openflow. This commit centralizes all of that in ofp-actions. Encoding and decoding OpenFlow actions was previously broken up by OpenFlow version. This was OK with only OpenFlow 1.0 and 1.1, but each additional version added a new wrapper around the existing ones, which started to become hard to understand. This commit merges all of the processing for the different versions, to the extent that they are similar, making the version differences clearer. Previously, ofp-actions contained OpenFlow encoding and decoding, plus ofpact formatting, but OpenFlow parsing was separated into ofp-parse, which seems an odd division. This commit moves the parsing code into ofp-actions with the rest of the code. Before this commit, the four main bits of code associated with a particular ofpact--OpenFlow encoding and decoding, ofpact formatting and parsing--were all found far away from each other. This often made it hard to see what was going on for a particular ofpact, since you had to search around to many different pieces of code. This commit reorganizes so that all of the code for a given ofpact is in a single place. As a code refactoring, this commit has little visible behavioral change. The update to ofproto-dpif.at illustrates one minor bug fix as a side effect: a flow that was added with the action "dec_ttl" (a standard OpenFlow action) was previously formatted as "dec_ttl(0)" (using a Nicira extension to specifically direct packets bounced to the controller because of too-low TTL), but after this commit it is correctly formatted as "dec_ttl". The other visible effect is to drop support for the Nicira extension dec_ttl action in OpenFlow 1.1 and later in favor of the equivalent standard action. It seems unlikely that anyone was really using the Nicira extension in OF1.1 or later. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
2014-08-11 12:50:36 -07:00
lib/ofp-actions.inc2: $(srcdir)/build-aux/extract-ofp-actions lib/ofp-actions.c
$(AM_V_GEN)$(run_python) $^ --definitions > $@.tmp && mv $@.tmp $@
ofp-actions: Centralize all OpenFlow action code for maintainability. Until now, knowledge about OpenFlow has been somewhat scattered around the tree. Some of it is in ofp-actions, some of it is in ofp-util, some in separate files for individual actions, and most of the wire format declarations are in include/openflow. This commit centralizes all of that in ofp-actions. Encoding and decoding OpenFlow actions was previously broken up by OpenFlow version. This was OK with only OpenFlow 1.0 and 1.1, but each additional version added a new wrapper around the existing ones, which started to become hard to understand. This commit merges all of the processing for the different versions, to the extent that they are similar, making the version differences clearer. Previously, ofp-actions contained OpenFlow encoding and decoding, plus ofpact formatting, but OpenFlow parsing was separated into ofp-parse, which seems an odd division. This commit moves the parsing code into ofp-actions with the rest of the code. Before this commit, the four main bits of code associated with a particular ofpact--OpenFlow encoding and decoding, ofpact formatting and parsing--were all found far away from each other. This often made it hard to see what was going on for a particular ofpact, since you had to search around to many different pieces of code. This commit reorganizes so that all of the code for a given ofpact is in a single place. As a code refactoring, this commit has little visible behavioral change. The update to ofproto-dpif.at illustrates one minor bug fix as a side effect: a flow that was added with the action "dec_ttl" (a standard OpenFlow action) was previously formatted as "dec_ttl(0)" (using a Nicira extension to specifically direct packets bounced to the controller because of too-low TTL), but after this commit it is correctly formatted as "dec_ttl". The other visible effect is to drop support for the Nicira extension dec_ttl action in OpenFlow 1.1 and later in favor of the equivalent standard action. It seems unlikely that anyone was really using the Nicira extension in OF1.1 or later. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
2014-08-11 12:50:36 -07:00
lib/ofp-actions.lo: lib/ofp-actions.inc1 lib/ofp-actions.inc2
CLEANFILES += lib/ofp-actions.inc1 lib/ofp-actions.inc2
EXTRA_DIST += build-aux/extract-ofp-actions
ofp-actions: Centralize all OpenFlow action code for maintainability. Until now, knowledge about OpenFlow has been somewhat scattered around the tree. Some of it is in ofp-actions, some of it is in ofp-util, some in separate files for individual actions, and most of the wire format declarations are in include/openflow. This commit centralizes all of that in ofp-actions. Encoding and decoding OpenFlow actions was previously broken up by OpenFlow version. This was OK with only OpenFlow 1.0 and 1.1, but each additional version added a new wrapper around the existing ones, which started to become hard to understand. This commit merges all of the processing for the different versions, to the extent that they are similar, making the version differences clearer. Previously, ofp-actions contained OpenFlow encoding and decoding, plus ofpact formatting, but OpenFlow parsing was separated into ofp-parse, which seems an odd division. This commit moves the parsing code into ofp-actions with the rest of the code. Before this commit, the four main bits of code associated with a particular ofpact--OpenFlow encoding and decoding, ofpact formatting and parsing--were all found far away from each other. This often made it hard to see what was going on for a particular ofpact, since you had to search around to many different pieces of code. This commit reorganizes so that all of the code for a given ofpact is in a single place. As a code refactoring, this commit has little visible behavioral change. The update to ofproto-dpif.at illustrates one minor bug fix as a side effect: a flow that was added with the action "dec_ttl" (a standard OpenFlow action) was previously formatted as "dec_ttl(0)" (using a Nicira extension to specifically direct packets bounced to the controller because of too-low TTL), but after this commit it is correctly formatted as "dec_ttl". The other visible effect is to drop support for the Nicira extension dec_ttl action in OpenFlow 1.1 and later in favor of the equivalent standard action. It seems unlikely that anyone was really using the Nicira extension in OF1.1 or later. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
2014-08-11 12:50:36 -07:00
$(srcdir)/lib/ofp-errors.inc: \
lib/ofp-errors.h include/openflow/openflow-common.h \
$(srcdir)/build-aux/extract-ofp-errors
$(AM_V_GEN)$(run_python) $(srcdir)/build-aux/extract-ofp-errors \
$(srcdir)/lib/ofp-errors.h \
$(srcdir)/include/openflow/openflow-common.h > $@.tmp && \
mv $@.tmp $@
$(srcdir)/lib/ofp-errors.c: $(srcdir)/lib/ofp-errors.inc
EXTRA_DIST += build-aux/extract-ofp-errors lib/ofp-errors.inc
$(srcdir)/lib/ofp-msgs.inc: \
lib/ofp-msgs.h $(srcdir)/build-aux/extract-ofp-msgs
$(AM_V_GEN)$(run_python) $(srcdir)/build-aux/extract-ofp-msgs \
$(srcdir)/lib/ofp-msgs.h $@ > $@.tmp && mv $@.tmp $@
$(srcdir)/lib/ofp-msgs.c: $(srcdir)/lib/ofp-msgs.inc
EXTRA_DIST += build-aux/extract-ofp-msgs lib/ofp-msgs.inc
INSTALL_DATA_LOCAL += lib-install-data-local
lib-install-data-local:
$(MKDIR_P) $(DESTDIR)$(RUNDIR)
$(MKDIR_P) $(DESTDIR)$(PKIDIR)
$(MKDIR_P) $(DESTDIR)$(LOGDIR)
$(MKDIR_P) $(DESTDIR)$(DBDIR)