# -*- autoconf -*-
-# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
+# Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
;;
esac
fi])
+
+dnl OVS_CHECK_LINUX_HOST.
+dnl
+dnl Checks whether we're building for a Linux host, based on the presence of
+dnl the __linux__ preprocessor symbol, and sets up an Automake conditional
+dnl LINUX based on the result.
+AC_DEFUN([OVS_CHECK_LINUX_HOST],
+ [AC_CACHE_CHECK(
+ [whether __linux__ is defined],
+ [ovs_cv_linux],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([enum { LINUX = __linux__};], [])],
+ [ovs_cv_linux=true],
+ [ovs_cv_linux=false])])
+ AM_CONDITIONAL([LINUX], [$ovs_cv_linux])])
OVS_CHECK_ATOMIC_ALWAYS_LOCK_FREE(8)
OVS_CHECK_POSIX_AIO
OVS_CHECK_PTHREAD_SET_NAME
+OVS_CHECK_LINUX_HOST
OVS_CHECK_INCLUDE_NEXT([stdio.h string.h])
AC_CONFIG_FILES([lib/stdio.h lib/string.h])
AC_CONFIG_COMMANDS([utilities/bugtool/dummy], [:])
-AM_CONDITIONAL([LINUX_DATAPATH], [test "$HAVE_NETLINK" = yes && test "$ESX" = no])
-if test "$HAVE_NETLINK" = yes && test "$ESX" = no; then
- AC_DEFINE([LINUX_DATAPATH], [1], [System uses the linux datapath module.])
-fi
-
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
AC_OUTPUT
noinst_HEADERS += \
include/windows/getopt.h \
include/windows/syslog.h \
+ include/windows/sys/resource.h \
include/windows/windefs.h
--- /dev/null
+/*
+ * Copyright (c) 2014 Nicira, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SYS_RESOURCE_H
+#define SYS_RESOURCE_H 1
+
+struct rusage {
+ struct timeval ru_utime; /* user CPU time used */
+ struct timeval ru_stime; /* system CPU time used */
+ long ru_maxrss; /* maximum resident set size */
+ long ru_ixrss; /* integral shared memory size */
+ long ru_idrss; /* integral unshared data size */
+ long ru_isrss; /* integral unshared stack size */
+ long ru_minflt; /* page reclaims (soft page faults) */
+ long ru_majflt; /* page faults (hard page faults) */
+ long ru_nswap; /* swaps */
+ long ru_inblock; /* block input operations */
+ long ru_oublock; /* block output operations */
+ long ru_msgsnd; /* IPC messages sent */
+ long ru_msgrcv; /* IPC messages received */
+ long ru_nsignals; /* signals received */
+ long ru_nvcsw; /* voluntary context switches */
+ long ru_nivcsw; /* involuntary context switches */
+};
+
+#ifndef RUSAGE_SELF
+#define RUSAGE_SELF 1
+#endif
+
+#ifndef RUSAGE_CHILDREN
+#define RUSAGE_CHILDREN 2
+#endif
+
+#ifndef RUSAGE_THREAD
+#define RUSAGE_THREAD 3
+#endif
+
+#endif /* sys/resource.h */
lib_libopenvswitch_la_SOURCES += \
lib/daemon-windows.c \
lib/getopt_long.c \
+ lib/getrusage-windows.c \
lib/latch-windows.c \
lib/stream-fd-windows.c
else
lib_libsflow_la_CFLAGS += -Wno-unused-parameter
endif
-if LINUX_DATAPATH
+if LINUX
lib_libopenvswitch_la_SOURCES += \
lib/dpif-linux.c \
lib/dpif-linux.h \
/*
- * Copyright (c) 2008, 2009, 2010, 2011, 2013 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2013, 2014 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
\f
/* Process title. */
-#ifdef LINUX_DATAPATH
+#ifdef __linux__
static struct ovs_mutex proctitle_mutex = OVS_MUTEX_INITIALIZER;
/* Start of command-line arguments in memory. */
}
ovs_mutex_unlock(&proctitle_mutex);
}
-#else /* !LINUX_DATAPATH*/
+#else /* !__linux__ */
/* Stubs that don't do anything on non-Linux systems. */
void
proctitle_restore(void)
{
}
-#endif /* !LINUX_DATAPATH */
+#endif /* !__linux__ */
/*
- * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
+ * Copyright (c) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
COVERAGE_DEFINE(dpif_execute_with_help);
static const struct dpif_class *base_dpif_classes[] = {
-#ifdef LINUX_DATAPATH
+#ifdef __linux__
&dpif_linux_class,
#endif
&dpif_netdev_class,
--- /dev/null
+/*
+ * Copyright (c) 2014 Nicira, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <config.h>
+#include <errno.h>
+#include <psapi.h>
+#include <sys/resource.h>
+#include <time.h>
+#include "util.h"
+#include "vlog.h"
+
+VLOG_DEFINE_THIS_MODULE(getrusage_windows);
+
+static void
+usage_to_timeval(FILETIME *ft, struct timeval *tv)
+{
+ ULARGE_INTEGER time;
+ time.LowPart = ft->dwLowDateTime;
+ time.HighPart = ft->dwHighDateTime;
+
+ tv->tv_sec = time.QuadPart / 10000000;
+ tv->tv_usec = (time.QuadPart % 10000000) / 10;
+}
+
+int
+getrusage(int who, struct rusage *usage)
+{
+ FILETIME creation_time, exit_time, kernel_time, user_time;
+ PROCESS_MEMORY_COUNTERS pmc;
+
+ memset(usage, 0, sizeof(struct rusage));
+
+ if (who == RUSAGE_SELF) {
+ if (!GetProcessTimes(GetCurrentProcess(), &creation_time, &exit_time,
+ &kernel_time, &user_time)) {
+ VLOG_ERR("failed at GetProcessTimes: %s",
+ ovs_lasterror_to_string());
+ return -1;
+ }
+
+ if (!GetProcessMemoryInfo(GetCurrentProcess(), &pmc, sizeof(pmc))) {
+ VLOG_ERR("failed at GetProcessMemoryInfo: %s",
+ ovs_lasterror_to_string());
+ return -1;
+ }
+
+ usage_to_timeval(&kernel_time, &usage->ru_stime);
+ usage_to_timeval(&user_time, &usage->ru_utime);
+ usage->ru_majflt = pmc.PageFaultCount;
+ usage->ru_maxrss = pmc.PeakWorkingSetSize / 1024;
+ return 0;
+ } else if (who == RUSAGE_THREAD) {
+ if (!GetThreadTimes(GetCurrentThread(), &creation_time, &exit_time,
+ &kernel_time, &user_time)) {
+ VLOG_ERR("failed at GetThreadTimes: %s",
+ ovs_lasterror_to_string());
+ return -1;
+ }
+ usage_to_timeval(&kernel_time, &usage->ru_stime);
+ usage_to_timeval(&user_time, &usage->ru_utime);
+ return 0;
+ } else {
+ return -1;
+ }
+}
fatal_signal_add_hook(restore_all_flags, NULL, NULL, true);
netdev_vport_patch_register();
-#ifdef LINUX_DATAPATH
+#ifdef __linux__
netdev_register_provider(&netdev_linux_class);
netdev_register_provider(&netdev_internal_class);
netdev_register_provider(&netdev_tap_class);
ovs_abort(error, "%s failed", #FUNCTION); \
} \
}
+#define XPTHREAD_FUNC3(FUNCTION, PARAM1, PARAM2, PARAM3)\
+ void \
+ x##FUNCTION(PARAM1 arg1, PARAM2 arg2, PARAM3 arg3) \
+ { \
+ int error = FUNCTION(arg1, arg2, arg3); \
+ if (OVS_UNLIKELY(error)) { \
+ ovs_abort(error, "%s failed", #FUNCTION); \
+ } \
+ }
XPTHREAD_FUNC1(pthread_mutex_lock, pthread_mutex_t *);
XPTHREAD_FUNC1(pthread_mutex_unlock, pthread_mutex_t *);
XPTHREAD_FUNC1(pthread_cond_signal, pthread_cond_t *);
XPTHREAD_FUNC1(pthread_cond_broadcast, pthread_cond_t *);
+XPTHREAD_FUNC3(pthread_barrier_init, pthread_barrier_t *,
+ pthread_barrierattr_t *, unsigned int);
+XPTHREAD_FUNC1(pthread_barrier_destroy, pthread_barrier_t *);
+
XPTHREAD_FUNC2(pthread_join, pthread_t, void **);
typedef void destructor_func(void *);
ovs_abort(error, "pthread_cond_wait failed");
}
}
+
+int
+xpthread_barrier_wait(pthread_barrier_t *barrier)
+{
+ int error;
+
+ error = pthread_barrier_wait(barrier);
+ if (error && OVS_UNLIKELY(error != PTHREAD_BARRIER_SERIAL_THREAD)) {
+ ovs_abort(error, "pthread_barrier_wait failed");
+ }
+
+ return error;
+}
\f
DEFINE_EXTERN_PER_THREAD_DATA(ovsthread_id, 0);
void xpthread_cond_signal(pthread_cond_t *);
void xpthread_cond_broadcast(pthread_cond_t *);
+/* Wrappers for pthread_barrier_*() that abort the process on any error. */
+void xpthread_barrier_init(pthread_barrier_t *, pthread_barrierattr_t *,
+ unsigned int count);
+int xpthread_barrier_wait(pthread_barrier_t *);
+void xpthread_barrier_destroy(pthread_barrier_t *);
+
void xpthread_key_create(pthread_key_t *, void (*destructor)(void *));
void xpthread_key_delete(pthread_key_t);
void xpthread_setspecific(pthread_key_t, const void *);
#include "poll-loop.h"
#include "util.h"
#include "vlog.h"
-#if AF_PACKET && LINUX_DATAPATH
+#ifdef __linux__
#include <linux/if_packet.h>
#endif
#ifdef HAVE_NETLINK
/* #ifdefs make it a pain to maintain code: you have to try to build both ways.
* Thus, this file compiles all of the code regardless of the target, by
- * writing "if (LINUX_DATAPATH)" instead of "#ifdef __linux__". */
-#ifndef LINUX_DATAPATH
-#define LINUX_DATAPATH 0
+ * writing "if (LINUX)" instead of "#ifdef __linux__". */
+#ifdef __linux__
+#define LINUX 0
+#else
+#define LINUX 1
#endif
#ifndef O_DIRECTORY
*
* On other Unix-like OSes, MSG_TRUNC has no effect in the flags
* argument. */
- char buffer[LINUX_DATAPATH ? 1 : 2048];
+ char buffer[LINUX ? 1 : 2048];
ssize_t n_bytes = recv(fd, buffer, sizeof buffer,
MSG_TRUNC | MSG_DONTWAIT);
if (n_bytes <= 0 || n_bytes >= rcvbuf) {
int dirfd;
int len;
- if (!LINUX_DATAPATH) {
+ if (LINUX) {
return ENAMETOOLONG;
}
}
}
#endif
-#if AF_PACKET && LINUX_DATAPATH
+#if __linux__
else if (ss.ss_family == AF_PACKET) {
struct sockaddr_ll sll;
}
-#ifdef LINUX_DATAPATH
+#ifdef __linux__
static void
put_fd_filename(struct ds *string, int fd)
{
: S_ISFIFO(s.st_mode) ? "FIFO"
: S_ISLNK(s.st_mode) ? "symbolic link"
: "unknown"));
-#ifdef LINUX_DATAPATH
+#ifdef __linux__
put_fd_filename(&string, fd);
#endif
}
VLOG_DEFINE_THIS_MODULE(timeval);
+#ifdef _WIN32
+typedef unsigned int clockid_t;
+
+#ifndef CLOCK_MONOTONIC
+#define CLOCK_MONOTONIC 1
+#endif
+
+#ifndef CLOCK_REALTIME
+#define CLOCK_REALTIME 2
+#endif
+
+/* Number of 100 ns intervals from January 1, 1601 till January 1, 1970. */
+static ULARGE_INTEGER unix_epoch;
+#endif /* _WIN32 */
+
struct clock {
clockid_t id; /* CLOCK_MONOTONIC or CLOCK_REALTIME. */
{
struct timespec ts;
+#ifdef _WIN32
+ /* Calculate number of 100-nanosecond intervals till 01/01/1970. */
+ SYSTEMTIME unix_epoch_st = { 1970, 1, 0, 1, 0, 0, 0, 0};
+ FILETIME unix_epoch_ft;
+
+ SystemTimeToFileTime(&unix_epoch_st, &unix_epoch_ft);
+ unix_epoch.LowPart = unix_epoch_ft.dwLowDateTime;
+ unix_epoch.HighPart = unix_epoch_ft.dwHighDateTime;
+#endif
+
coverage_init();
init_clock(&monotonic_clock, (!clock_gettime(CLOCK_MONOTONIC, &ts)
return boot_time;
}
+#ifdef _WIN32
+static ULARGE_INTEGER
+xgetfiletime(void)
+{
+ ULARGE_INTEGER current_time;
+ FILETIME current_time_ft;
+
+ /* Returns current time in UTC as a 64-bit value representing the number
+ * of 100-nanosecond intervals since January 1, 1601 . */
+ GetSystemTimePreciseAsFileTime(¤t_time_ft);
+ current_time.LowPart = current_time_ft.dwLowDateTime;
+ current_time.HighPart = current_time_ft.dwHighDateTime;
+
+ return current_time;
+}
+
+static int
+clock_gettime(clock_t id, struct timespec *ts)
+{
+ if (id == CLOCK_MONOTONIC) {
+ static LARGE_INTEGER freq;
+ LARGE_INTEGER count;
+ long long int ns;
+
+ if (!freq.QuadPart) {
+ /* Number of counts per second. */
+ QueryPerformanceFrequency(&freq);
+ }
+ /* Total number of counts from a starting point. */
+ QueryPerformanceCounter(&count);
+
+ /* Total nano seconds from a starting point. */
+ ns = (double) count.QuadPart / freq.QuadPart * 1000000000;
+
+ ts->tv_sec = count.QuadPart / freq.QuadPart;
+ ts->tv_nsec = ns % 1000000000;
+ } else if (id == CLOCK_REALTIME) {
+ ULARGE_INTEGER current_time = xgetfiletime();
+
+ /* Time from Epoch to now. */
+ ts->tv_sec = (current_time.QuadPart - unix_epoch.QuadPart) / 10000000;
+ ts->tv_nsec = ((current_time.QuadPart - unix_epoch.QuadPart) %
+ 10000000) * 100;
+ } else {
+ return -1;
+ }
+}
+#endif /* _WIN32 */
+
void
xgettimeofday(struct timeval *tv)
{
+#ifndef _WIN32
if (gettimeofday(tv, NULL) == -1) {
VLOG_FATAL("gettimeofday failed (%s)", ovs_strerror(errno));
}
+#else
+ ULARGE_INTEGER current_time = xgetfiletime();
+
+ tv->tv_sec = (current_time.QuadPart - unix_epoch.QuadPart) / 10000000;
+ tv->tv_usec = ((current_time.QuadPart - unix_epoch.QuadPart) %
+ 10000000) / 10;
+#endif
}
void
#define TIME_MAX TYPE_MAXIMUM(time_t)
#define TIME_MIN TYPE_MINIMUM(time_t)
+#ifdef _WIN32
+#define localtime_r(timep, result) localtime_s(result, timep)
+#define gmtime_r(timep, result) gmtime_s(result, timep)
+#endif /* _WIN32 */
+
struct tm_msec {
struct tm tm;
int msec;
/*
- * Copyright (c) 2011, 2013 Nicira, Inc.
+ * Copyright (c) 2011, 2013, 2014 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
int (*vd_del)(const char *vlan_dev);
};
-#ifdef LINUX_DATAPATH
+#ifdef __linux__
static const struct vlandev_class vlandev_linux_class;
#endif
static const struct vlandev_class vlandev_stub_class;
vlandev_get_class(void)
{
if (!vd_class) {
-#ifdef LINUX_DATAPATH
+#if __linux__
vd_class = &vlandev_linux_class;
#else
vd_class = &vlandev_stub_class;
\f
/* The Linux vlandev implementation. */
-#ifdef LINUX_DATAPATH
+#ifdef __linux__
#include "rtnetlink-link.h"
#include <linux/if_vlan.h>
#include <linux/sockios.h>
#define MAX_QUEUE_LENGTH 512
#define FLOW_MISS_MAX_BATCH 50
#define REVALIDATE_MAX_BATCH 50
-#define MAX_IDLE 1500
VLOG_DEFINE_THIS_MODULE(ofproto_dpif_upcall);
}
skip:
- poll_timer_wait_until(start_time + MIN(MAX_IDLE, 500));
+ poll_timer_wait_until(start_time + MIN(ofproto_max_idle, 500));
seq_wait(udpif->reval_seq, udpif->last_reval_seq);
latch_wait(&udpif->exit_latch);
poll_block();
n_flows = udpif_get_n_flows(udpif);
must_del = false;
- max_idle = MAX_IDLE;
+ max_idle = ofproto_max_idle;
if (n_flows > flow_limit) {
must_del = n_flows > 2 * flow_limit;
max_idle = 100;
* ofproto-dpif implementation. */
extern unsigned ofproto_flow_limit;
+/* Maximum idle time (in ms) for flows to be cached in the datapath.
+ * Revalidators may expire flows more quickly than the configured value based
+ * on system load and other factors. This variable is subject to change. */
+extern unsigned ofproto_max_idle;
+
/* Number of upcall handler and revalidator threads. Only affects the
* ofproto-dpif implementation. */
extern size_t n_handlers, n_revalidators;
struct ovs_mutex ofproto_mutex = OVS_MUTEX_INITIALIZER;
unsigned ofproto_flow_limit = OFPROTO_FLOW_LIMIT_DEFAULT;
+unsigned ofproto_max_idle = OFPROTO_MAX_IDLE_DEFAULT;
size_t n_handlers, n_revalidators;
ofproto_flow_limit = limit;
}
+/* Sets the maximum idle time for flows in the datapath before they are
+ * expired. */
+void
+ofproto_set_max_idle(unsigned max_idle)
+{
+ ofproto_max_idle = max_idle;
+}
+
/* If forward_bpdu is true, the NORMAL action will forward frames with
* reserved (e.g. STP) destination Ethernet addresses. if forward_bpdu is false,
* the NORMAL action will drop these frames. */
)
#define OFPROTO_FLOW_LIMIT_DEFAULT 200000
+#define OFPROTO_MAX_IDLE_DEFAULT 1500
const char *ofproto_port_open_type(const char *datapath_type,
const char *port_type);
const struct sockaddr_in *, size_t n);
void ofproto_set_in_band_queue(struct ofproto *, int queue_id);
void ofproto_set_flow_limit(unsigned limit);
+void ofproto_set_max_idle(unsigned max_idle);
void ofproto_set_forward_bpdu(struct ofproto *, bool forward_bpdu);
void ofproto_set_mac_table_config(struct ofproto *, unsigned idle_time,
size_t max_entries);
# ovsdb-tool
bin_PROGRAMS += ovsdb/ovsdb-tool
ovsdb_ovsdb_tool_SOURCES = ovsdb/ovsdb-tool.c
-ovsdb_ovsdb_tool_LDADD = ovsdb/libovsdb.la lib/libopenvswitch.la $(SSL_LIBS)
+ovsdb_ovsdb_tool_LDADD = ovsdb/libovsdb.la lib/libopenvswitch.la
# ovsdb-tool.1
man_MANS += ovsdb/ovsdb-tool.1
DISTCLEANFILES += ovsdb/ovsdb-tool.1
# ovsdb-client
bin_PROGRAMS += ovsdb/ovsdb-client
ovsdb_ovsdb_client_SOURCES = ovsdb/ovsdb-client.c
-ovsdb_ovsdb_client_LDADD = ovsdb/libovsdb.la lib/libopenvswitch.la $(SSL_LIBS)
+ovsdb_ovsdb_client_LDADD = ovsdb/libovsdb.la lib/libopenvswitch.la
# ovsdb-client.1
man_MANS += ovsdb/ovsdb-client.1
DISTCLEANFILES += ovsdb/ovsdb-client.1
# ovsdb-server
sbin_PROGRAMS += ovsdb/ovsdb-server
ovsdb_ovsdb_server_SOURCES = ovsdb/ovsdb-server.c
-ovsdb_ovsdb_server_LDADD = ovsdb/libovsdb.la lib/libopenvswitch.la $(SSL_LIBS)
+ovsdb_ovsdb_server_LDADD = ovsdb/libovsdb.la lib/libopenvswitch.la
# ovsdb-server.1
man_MANS += ovsdb/ovsdb-server.1
DISTCLEANFILES += ovsdb/ovsdb-server.1
noinst_PROGRAMS += tests/test-aes128
tests_test_aes128_SOURCES = tests/test-aes128.c
-tests_test_aes128_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_aes128_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-atomic
tests_test_atomic_SOURCES = tests/test-atomic.c
-tests_test_atomic_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_atomic_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-bundle
tests_test_bundle_SOURCES = tests/test-bundle.c
-tests_test_bundle_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_bundle_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-classifier
tests_test_classifier_SOURCES = tests/test-classifier.c
-tests_test_classifier_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_classifier_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-controller
MAN_ROOTS += tests/test-controller.8.in
DISTCLEANFILES += tests/test-controller.8
noinst_man_MANS += tests/test-controller.8
tests_test_controller_SOURCES = tests/test-controller.c
-tests_test_controller_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_controller_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-csum
tests_test_csum_SOURCES = tests/test-csum.c
-tests_test_csum_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_csum_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-file_name
tests_test_file_name_SOURCES = tests/test-file_name.c
-tests_test_file_name_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_file_name_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-flows
tests_test_flows_SOURCES = tests/test-flows.c
-tests_test_flows_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_flows_LDADD = lib/libopenvswitch.la
dist_check_SCRIPTS = tests/flowgen.pl
noinst_PROGRAMS += tests/test-hash
noinst_PROGRAMS += tests/test-heap
tests_test_heap_SOURCES = tests/test-heap.c
-tests_test_heap_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_heap_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-hindex
tests_test_hindex_SOURCES = tests/test-hindex.c
-tests_test_hindex_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_hindex_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-hmap
tests_test_hmap_SOURCES = tests/test-hmap.c
-tests_test_hmap_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_hmap_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-json
tests_test_json_SOURCES = tests/test-json.c
-tests_test_json_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_json_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-jsonrpc
tests_test_jsonrpc_SOURCES = tests/test-jsonrpc.c
-tests_test_jsonrpc_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_jsonrpc_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-list
tests_test_list_SOURCES = tests/test-list.c
-tests_test_list_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_list_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-lockfile
tests_test_lockfile_SOURCES = tests/test-lockfile.c
-tests_test_lockfile_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_lockfile_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-multipath
tests_test_multipath_SOURCES = tests/test-multipath.c
-tests_test_multipath_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_multipath_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-packets
tests_test_packets_SOURCES = tests/test-packets.c
-tests_test_packets_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_packets_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-random
tests_test_random_SOURCES = tests/test-random.c
-tests_test_random_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_random_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-stp
tests_test_stp_SOURCES = tests/test-stp.c
-tests_test_stp_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_stp_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-sflow
tests_test_sflow_SOURCES = tests/test-sflow.c
-tests_test_sflow_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_sflow_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-netflow
tests_test_netflow_SOURCES = tests/test-netflow.c
-tests_test_netflow_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_netflow_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-unix-socket
tests_test_unix_socket_SOURCES = tests/test-unix-socket.c
-tests_test_unix_socket_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_unix_socket_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-odp
tests_test_odp_SOURCES = tests/test-odp.c
-tests_test_odp_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_odp_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-ovsdb
tests_test_ovsdb_SOURCES = \
tests/idltest.c \
tests/idltest.h
EXTRA_DIST += tests/uuidfilt.pl tests/ovsdb-monitor-sort.pl
-tests_test_ovsdb_LDADD = ovsdb/libovsdb.la lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_ovsdb_LDADD = ovsdb/libovsdb.la lib/libopenvswitch.la
# idltest schema and IDL
OVSIDL_BUILT += tests/idltest.c tests/idltest.h tests/idltest.ovsidl
noinst_PROGRAMS += tests/test-reconnect
tests_test_reconnect_SOURCES = tests/test-reconnect.c
-tests_test_reconnect_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_reconnect_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-sha1
tests_test_sha1_SOURCES = tests/test-sha1.c
-tests_test_sha1_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_sha1_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-strtok_r
tests_test_strtok_r_SOURCES = tests/test-strtok_r.c
noinst_PROGRAMS += tests/test-util
tests_test_util_SOURCES = tests/test-util.c
-tests_test_util_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_util_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-uuid
tests_test_uuid_SOURCES = tests/test-uuid.c
-tests_test_uuid_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_uuid_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-vconn
tests_test_vconn_SOURCES = tests/test-vconn.c
-tests_test_vconn_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+tests_test_vconn_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += tests/test-byte-order
tests_test_byte_order_SOURCES = tests/test-byte-order.c
dist_man_MANS += utilities/ovs-ctl.8
utilities_ovs_appctl_SOURCES = utilities/ovs-appctl.c
-utilities_ovs_appctl_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+utilities_ovs_appctl_LDADD = lib/libopenvswitch.la
utilities_ovs_dpctl_SOURCES = utilities/ovs-dpctl.c
-utilities_ovs_dpctl_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+utilities_ovs_dpctl_LDADD = lib/libopenvswitch.la
utilities_ovs_ofctl_SOURCES = utilities/ovs-ofctl.c
utilities_ovs_ofctl_LDADD = \
ofproto/libofproto.la \
- lib/libopenvswitch.la \
- $(SSL_LIBS)
+ lib/libopenvswitch.la
utilities_ovs_vsctl_SOURCES = utilities/ovs-vsctl.c
-utilities_ovs_vsctl_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+utilities_ovs_vsctl_LDADD = lib/libopenvswitch.la
-if LINUX_DATAPATH
+if LINUX
sbin_PROGRAMS += utilities/ovs-vlan-bug-workaround
utilities_ovs_vlan_bug_workaround_SOURCES = utilities/ovs-vlan-bug-workaround.c
-utilities_ovs_vlan_bug_workaround_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+utilities_ovs_vlan_bug_workaround_LDADD = lib/libopenvswitch.la
noinst_PROGRAMS += utilities/nlmon
utilities_nlmon_SOURCES = utilities/nlmon.c
-utilities_nlmon_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+utilities_nlmon_LDADD = lib/libopenvswitch.la
endif
bin_PROGRAMS += utilities/ovs-benchmark
utilities_ovs_benchmark_SOURCES = utilities/ovs-benchmark.c
-utilities_ovs_benchmark_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+utilities_ovs_benchmark_LDADD = lib/libopenvswitch.la
include utilities/bugtool/automake.mk
vswitchd_ovs_vswitchd_LDADD = \
ofproto/libofproto.la \
lib/libsflow.la \
- lib/libopenvswitch.la \
- $(SSL_LIBS)
+ lib/libopenvswitch.la
EXTRA_DIST += vswitchd/INTERNALS
MAN_ROOTS += vswitchd/ovs-vswitchd.8.in
ofproto_set_flow_limit(smap_get_int(&ovs_cfg->other_config, "flow-limit",
OFPROTO_FLOW_LIMIT_DEFAULT));
+ ofproto_set_max_idle(smap_get_int(&ovs_cfg->other_config, "max-idle",
+ OFPROTO_MAX_IDLE_DEFAULT));
ofproto_set_threads(
smap_get_int(&ovs_cfg->other_config, "n-handler-threads", 0),
-/* Copyright (c) 2010, 2012, 2013 Nicira, Inc.
+/* Copyright (c) 2010, 2012, 2013, 2014 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/* #ifdefs make it a pain to maintain code: you have to try to build both ways.
* Thus, this file tries to compile as much of the code as possible regardless
- * of the target, by writing "if (LINUX_DATAPATH)" instead of "#ifdef
- * __linux__" where this is possible. */
-#ifdef LINUX_DATAPATH
+ * of the target, by writing "if (LINUX)" instead of "#ifdef __linux__" where
+ * this is possible. */
+#ifdef __linux__
+#define LINUX 1
#include <asm/param.h>
#else
-#define LINUX_DATAPATH 0
+#define LINUX 0
#endif
static void
static void
get_memory_stats(struct smap *stats)
{
- if (!LINUX_DATAPATH) {
+ if (!LINUX) {
unsigned int pagesize = get_page_size();
#ifdef _SC_PHYS_PAGES
long int phys_pages = sysconf(_SC_PHYS_PAGES);
static long long int cache_expiration = LLONG_MIN;
static long long int boot_time;
- ovs_assert(LINUX_DATAPATH);
+ ovs_assert(LINUX);
if (time_msec() >= cache_expiration) {
static const char stat_file[] = "/proc/stat";
static unsigned long long int
ticks_to_ms(unsigned long long int ticks)
{
- ovs_assert(LINUX_DATAPATH);
+ ovs_assert(LINUX);
#ifndef USER_HZ
#define USER_HZ 100
FILE *stream;
int n;
- ovs_assert(LINUX_DATAPATH);
+ ovs_assert(LINUX);
sprintf(file_name, "/proc/%lu/stat", (unsigned long int) pid);
stream = fopen(file_name, "r");
int crashes = 0;
FILE *stream;
- ovs_assert(LINUX_DATAPATH);
+ ovs_assert(LINUX);
sprintf(file_name, "/proc/%lu/cmdline", (unsigned long int) pid);
stream = fopen(file_name, "r");
{
struct raw_process_info child;
- ovs_assert(LINUX_DATAPATH);
+ ovs_assert(LINUX);
if (!get_raw_process_info(pid, &child)) {
return false;
}
key = xasprintf("process_%.*s",
(int) (extension - de->d_name), de->d_name);
if (!smap_get(stats, key)) {
- if (LINUX_DATAPATH && get_process_info(pid, &pinfo)) {
+ if (LINUX && get_process_info(pid, &pinfo)) {
smap_add_format(stats, key, "%lu,%lu,%lld,%d,%lld,%lld",
pinfo.vsz, pinfo.rss, pinfo.cputime,
pinfo.crashes, pinfo.booted, pinfo.uptime);
vtep/vtep-ctl.8
vtep_vtep_ctl_SOURCES = vtep/vtep-ctl.c
-vtep_vtep_ctl_LDADD = lib/libopenvswitch.la $(SSL_LIBS)
+vtep_vtep_ctl_LDADD = lib/libopenvswitch.la
# ovs-vtep
scripts_SCRIPTS += \