]> git.proxmox.com Git - ovs.git/log
ovs.git
10 years agodatapath: Don't allocate space for per-CPU flow stats from cache.
Jesse Gross [Fri, 6 Dec 2013 21:17:33 +0000 (13:17 -0800)]
datapath: Don't allocate space for per-CPU flow stats from cache.

Per-CPU flow stats are now allocated separately (if necessary) so
there's no longer any need to allocate space for them directly in
the base flow.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
10 years agoutil: Better count_1bits().
Jarno Rajahalme [Wed, 27 Nov 2013 20:58:46 +0000 (12:58 -0800)]
util: Better count_1bits().

Inline, use another well-known algorithm for 64-bit builds, and use
builtins when they are known to be fast at compile time.  A 32-bit
version of the alternate algorithm is slower than the existing
implementation, so the old one is used for 32-bit builds.  Inline
assembler would be a bit faster on 32-bit i7 build, but we use the GCC
builtin for portability.

It should be stressed builds for specific CPUs do not work on others
CPUs, and that OVS build system or runtime does not currently support
CPU detection.

Speed improvement v.s. existing implementation / GCC 4.7
__builtin_popcountll():

i386:         64%  (inlining)                         / 380%
i386 on i7:   240% (inlining + builtin)               / 820%
x86_64:       59%  (inlining + different algorithm)   / 190%
x86_64 on i7: 370% (inlining + builtin)               / 0%

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agolib/flow: Add IPv6 support for flow_compose().
Jarno Rajahalme [Fri, 6 Dec 2013 20:43:20 +0000 (12:43 -0800)]
lib/flow: Add IPv6 support for flow_compose().

Add the missing code for generating IPv6 packets for testing purposes.

Also make flow_compose() set the l4 and l7 pointers more consistently
with flow_extract().

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: compat: Fix compilation for kernel 3.5
Pravin B Shelar [Fri, 6 Dec 2013 19:43:02 +0000 (11:43 -0800)]
datapath: compat: Fix compilation for kernel 3.5

ipv6_addr_hash() is not available on kernel 3.5, Use compat version.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: compat: Fix Compiler error for kernel 3.3 to 3.8
Pravin B Shelar [Fri, 6 Dec 2013 18:43:12 +0000 (10:43 -0800)]
datapath: compat: Fix Compiler error for kernel 3.3 to 3.8

Kernel 3.3 to 3.8 has defined `struct flow_keys` but does not
contains flow_keys.thoff field.  Therefore we need to use
compat definition for flow_keys struct.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agovlog: Add option to send vlog syslog output to arbitrary UDP destination.
Henry Mai [Fri, 6 Dec 2013 01:01:30 +0000 (17:01 -0800)]
vlog: Add option to send vlog syslog output to arbitrary UDP destination.

Signed-off-by: Henry Mai <henrymai@nicira.com>
Co-authored-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: compat: Fix compiler error.
Pravin B Shelar [Fri, 6 Dec 2013 03:48:46 +0000 (19:48 -0800)]
datapath: compat: Fix compiler error.

Earlier RHEL6 kernel do not have linux/atomic.h header
file.  Use types.h to get atomic_t definition.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agolib/odp-util: Only use expected_bit when set.
Jarno Rajahalme [Fri, 6 Dec 2013 16:30:17 +0000 (08:30 -0800)]
lib/odp-util: Only use expected_bit when set.

parse_l2_5_onward() previously used out of range 'expected_bit' when
it was called with no attrs, which happens when parsing a mask with
zero length.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agocccl: Add the DEBUG option for linker.
Gurucharan Shetty [Thu, 21 Nov 2013 17:28:40 +0000 (09:28 -0800)]
cccl: Add the DEBUG option for linker.

The /DEBUG option creates debugging information for
the .exe file

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: Use percpu allocator for flow-stats.
Pravin B Shelar [Thu, 5 Dec 2013 23:50:27 +0000 (15:50 -0800)]
datapath: Use percpu allocator for flow-stats.

Use percpu allocator for stats due to objection to stats array.
But percpu allocator is not designed for high churn allocation/
deallcation. so we need to avoid allocating percpu flow for
short lived flows. One cheaper way to detect flow is by checking
if 5-tuple used in RSS are masked or not. if any one of them is
masked, flow is likely shared across CPU where percpu stat
should be more scalable. And that flow should be relatively
long lived flow.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: lisp: Use skb rxhash for source port.
Pravin B Shelar [Wed, 4 Dec 2013 19:26:44 +0000 (11:26 -0800)]
datapath: lisp: Use skb rxhash for source port.

Rather than using complete flow hash, we can use skb->rxhash for
calculating source port. Similar calculation is done by vxlan.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: Add compile time check for rxhash
Pravin B Shelar [Wed, 4 Dec 2013 19:26:36 +0000 (11:26 -0800)]
datapath: Add compile time check for rxhash

Some distribution kernel has backported skb->rxhash (e.g. RHEL)
Following patch allows use precalculated rxhash.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Reviewed-by: Thomas Graf <tgraf@redhat.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: Improve compat rxhash functionality.
Pravin B Shelar [Tue, 3 Dec 2013 16:33:36 +0000 (08:33 -0800)]
datapath: Improve compat rxhash functionality.

Following patch improves rxhash calculation, It is taken from
upstream Linux kernel code.
From kernel 3.8, skb_get_rxhash() can handle hardware generated
l4-rxhash. Therefore compat skb_get_rxhash() is not used on
kernel 3.8 or new.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Reviewed-by: Thomas Graf <tgraf@redhat.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: Fix compat skb_get_rxhash()
Pravin B Shelar [Thu, 5 Dec 2013 05:24:49 +0000 (21:24 -0800)]
datapath: Fix compat skb_get_rxhash()

Add missing return statement.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agobridge: Improve iface_set_ofport() style.
Ben Pfaff [Thu, 5 Dec 2013 19:43:50 +0000 (11:43 -0800)]
bridge: Improve iface_set_ofport() style.

This should behave the same as before but the code reads more naturally to
me this way.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agom4: Remove assignment of otherwise unused variable RESOLVER_LIBS.
Ben Pfaff [Thu, 5 Dec 2013 17:27:54 +0000 (09:27 -0800)]
m4: Remove assignment of otherwise unused variable RESOLVER_LIBS.

Found by inspection.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoAdd check for -latomic
James Page [Thu, 5 Dec 2013 17:29:05 +0000 (17:29 +0000)]
Add check for -latomic

Later versions of gcc on some architectures push atomic functions
out into a separate atomic library; add a check to see when this
is required and add it to LIBS if need be.

Specifically the problem was observed on GCC 4.8.2 on powerpc
architecture for Ubuntu 14.04:

https://launchpadlibrarian.net/155235096/buildlog_ubuntu-trusty-powerpc.openvswitch_2.0.0-0ubuntu1_FAILEDTOBUILD.txt.gz

Signed-off-by: James Page <james.page@ubuntu.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agolib/meta-flow: remove unused function
Andy Zhou [Thu, 5 Dec 2013 05:56:25 +0000 (21:56 -0800)]
lib/meta-flow: remove unused function

Remove mf_random_value() which does not have any user now.

Signed-off-by: Andy Zhou <azhou@nicira.com>
10 years agofedora package: include python byte compiled files
Flavio Leitner [Tue, 3 Dec 2013 01:13:16 +0000 (23:13 -0200)]
fedora package: include python byte compiled files

Include byte compiled files to speed up the execution,
to avoid spurious SELinux AVC denials and also to make
rpm happy when checking for unpackaged files:

RPM build errors:
    Installed (but unpackaged) file(s) found:
   /usr/share/openvswitch/python/argparse.pyc
   /usr/share/openvswitch/python/argparse.pyo
   /usr/share/openvswitch/python/ovs/__init__.pyc
   [...]

Package guideline reference:
https://fedoraproject.org/wiki/Packaging:Python?rd=Packaging/Python#Files_to_include

Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
10 years agolib: refactor match_format() output functions
Andy Zhou [Wed, 4 Dec 2013 08:28:03 +0000 (00:28 -0800)]
lib: refactor match_format() output functions

Refactor to remove some duplicated logic in match_format()
implemenation and make the output more uniform.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-util: Implement OpenFlow 1.1 packet-in message.
Ben Pfaff [Wed, 4 Dec 2013 16:17:50 +0000 (08:17 -0800)]
ofp-util: Implement OpenFlow 1.1 packet-in message.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
10 years agoofp-util: Break ofputil_encode_packet_in() into multiple functions.
Ben Pfaff [Mon, 2 Dec 2013 21:17:37 +0000 (13:17 -0800)]
ofp-util: Break ofputil_encode_packet_in() into multiple functions.

This form makes it obvious that an OpenFlow 1.1 implementation is missing.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
10 years agodatapath: Enable memory mapped Netlink i/o
Thomas Graf [Wed, 4 Dec 2013 04:07:57 +0000 (20:07 -0800)]
datapath: Enable memory mapped Netlink i/o

Use memory mapped Netlink i/o for all unicast openvswitch
communication if a ring has been set up.

Benchmark
  * pktgen -> ovs internal port
  * 5M pkts, 5M flows
  * 4 threads, 8 cores

Before:
Result: OK: 67418743(c67108212+d310530) usec, 5000000 (9000byte,0frags)
  74163pps 5339Mb/sec (5339736000bps) errors: 0
+   2.98%     ovs-vswitchd  [k] copy_user_generic_string
+   2.49%     ovs-vswitchd  [k] memcpy
+   1.84%       kpktgend_2  [k] memcpy
+   1.81%       kpktgend_1  [k] memcpy
+   1.81%       kpktgend_3  [k] memcpy
+   1.78%       kpktgend_0  [k] memcpy

After:
Result: OK: 24229690(c24127165+d102524) usec, 5000000 (9000byte,0frags)
  206358pps 14857Mb/sec (14857776000bps) errors: 0
+   2.80%     ovs-vswitchd  [k] memcpy
+   1.31%       kpktgend_2  [k] memcpy
+   1.23%       kpktgend_0  [k] memcpy
+   1.09%       kpktgend_1  [k] memcpy
+   1.04%       kpktgend_3  [k] memcpy
+   0.96%     ovs-vswitchd  [k] copy_user_generic_string

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Reviewed-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: Add backport for genlmsg_new_unicast().
Jesse Gross [Wed, 4 Dec 2013 04:06:09 +0000 (20:06 -0800)]
datapath: Add backport for genlmsg_new_unicast().

genlmsg_new_unicast() will be proposed upstream to support memory
mapped Netlink but on existing kernels it just uses genlmsg_new().

Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agoofproto: Add OF1.4 elements to enum ofp_table_config
Simon Horman [Tue, 26 Nov 2013 07:34:23 +0000 (16:34 +0900)]
ofproto: Add OF1.4 elements to enum ofp_table_config

Add elements to enum ofp_table_config for table mod bits
defined in OpenFlow1.4.

Also tidy up the indentation of existing elements.

Signed-off-by: Simon Horman <horms@verge.net.au>
Co-authored-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agotests/ofproto-dpif.at: Avoid testing with incomplete TCP packets.
Jarno Rajahalme [Tue, 3 Dec 2013 21:41:41 +0000 (13:41 -0800)]
tests/ofproto-dpif.at: Avoid testing with incomplete TCP packets.

Use nw_proto values that generate less "expected but not present”
debug logging due to parsing errors for netdev-dummy/receive.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agolib/util: Add clz32() and clz64().
Jarno Rajahalme [Tue, 3 Dec 2013 21:41:41 +0000 (13:41 -0800)]
lib/util: Add clz32() and clz64().

Count leading zeroes using builtin if available.

Make log_2_floor() use raw_clz() and inline log_2_floor() and
log_2_ceil().

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agolib/util: Rename ctz() as ctz32().
Jarno Rajahalme [Tue, 3 Dec 2013 21:41:41 +0000 (13:41 -0800)]
lib/util: Rename ctz() as ctz32().

ctz() returns 32 for zero input, and we already have ctz64(),
so it makes sense to rename ctz() as ctz32().

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: Silence RCU lockdep checks from flow lookup.
Jesse Gross [Tue, 3 Dec 2013 02:56:32 +0000 (18:56 -0800)]
datapath: Silence RCU lockdep checks from flow lookup.

Flow lookup can happen either in packet processing context or userspace
context but it was annotated as requiring RCU read lock to be held. This
also allows OVS mutex to be held without causing warnings.

Reported-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Reviewed-by: Thomas Graf <tgraf@redhat.com>
10 years agolib: More intuitive syntax for TCP flags matching.
Jarno Rajahalme [Mon, 2 Dec 2013 23:14:09 +0000 (15:14 -0800)]
lib: More intuitive syntax for TCP flags matching.

Allow TCP flags match specification with symbolic flag names.  TCP
flags are optionally specified as a string of flag names, each
preceded by '+' when the flag must be one, or '-' when the flag must
be zero.  Any flags not explicitly included are wildcarded.  The
existing hex syntax is still allowed, and is used in flow dumps when
all the flags are matched.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agobyte-order: Make uint32_byteswap() available regardless of endianness.
Ben Pfaff [Mon, 2 Dec 2013 22:53:27 +0000 (14:53 -0800)]
byte-order: Make uint32_byteswap() available regardless of endianness.

pcap_read() can use it whether we're big-endian or not.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
10 years agoofproto-dpif: keep slow path flow time stamp up-to-date
Ben Pfaff [Fri, 22 Nov 2013 23:57:23 +0000 (15:57 -0800)]
ofproto-dpif: keep slow path flow time stamp up-to-date

Noting updating slow path subfacet's time stamp can cause their datapath
flows deleted periodically. For example, CFM datapath flow have usespace
actions that are handled in dpif slow path. They are deleted and
recreated periodically without the fix.

This bug are not obvious during normal operation. Deleted CFM flow
would cause CFM packets to be handled by flow miss handler which will
reinstall the flow in the datapath. The only potentially observable
behavior is that when the user space is overwhelmed with flow miss packets,
the periodic CFM miss packets may get stuck behind other miss packets,
cause tunnel flapping.

Ben refactored the patch to its current form.

Reported-by: Guolin Yang <gyang@nicira.com>
Co-authored-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>
10 years agoOPENFLOW-1.1+: Remove note about per-connection event filtering
Simon Horman [Mon, 2 Dec 2013 12:04:45 +0000 (12:04 +0000)]
OPENFLOW-1.1+: Remove note about per-connection event filtering

It appears to me that this was implemented using existing NXT code in
2e1ae2005ed347d2 ("Initial OpenFlow 1.3 support").

Cc: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoutil: fix a printf format
YAMAMOTO Takashi [Wed, 27 Nov 2013 05:25:24 +0000 (14:25 +0900)]
util: fix a printf format

revert a mistake in commit 34582733.
("Avoid printf type modifiers not supported by MSVC C runtime library.")

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agoOPENFLOW-1.1+: Remove note about action translation.
Jarno Rajahalme [Wed, 13 Nov 2013 22:07:55 +0000 (14:07 -0800)]
OPENFLOW-1.1+: Remove note about action translation.

Action translation to/from OpenFlow 1.2 set-field actions is done.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
10 years agoAvoid printf type modifiers not supported by MSVC C runtime library.
Alin Serdean [Tue, 26 Nov 2013 07:38:48 +0000 (23:38 -0800)]
Avoid printf type modifiers not supported by MSVC C runtime library.

The MSVC C library printf() implementation does not support the 'z', 't',
'j', or 'hh' format specifiers.  This commit changes the Open vSwitch code
to avoid those format specifiers, switching to standard macros from
<inttypes.h> where available and inventing new macros resembling them
where necessary.  It also updates CodingStyle to specify the macros' use
and adds a Makefile rule to report violations.

Signed-off-by: Alin Serdean <aserdean@cloudbasesolutions.com>
Co-authored-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agosparse: Include stddef.h to ensure NULL is defined.
Simon Horman [Mon, 25 Nov 2013 03:41:33 +0000 (12:41 +0900)]
sparse: Include stddef.h to ensure NULL is defined.

Include stddef.h in include/sparse/sys/socket.h to ensure
that NULL is defined and thus avoid the following sparse warning.

./include/sparse/sys/socket.h:74:15: error: undefined identifier 'NULL'

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoopenflow-1.2.h: Fix definition of OXM_OF_PBB_ISID.
Ben Pfaff [Fri, 22 Nov 2013 23:58:31 +0000 (15:58 -0800)]
openflow-1.2.h: Fix definition of OXM_OF_PBB_ISID.

The ONF header file shows this as a 3-byte field.

Reported-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
10 years agodatapath: gre: Fix kernel 3.11 compatibility.
Pravin B Shelar [Wed, 20 Nov 2013 17:50:14 +0000 (09:50 -0800)]
datapath: gre: Fix kernel 3.11 compatibility.

On 3.11 kernel, gre module exports IP_GRE demux API, ovs needs
to use it to register for GRE protocol handler.

Reported-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Tested-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agodebian: Don't recreate bridges during manual restart.
Gurucharan Shetty [Wed, 20 Nov 2013 21:43:45 +0000 (13:43 -0800)]
debian: Don't recreate bridges during manual restart.

Open vSwitch bridges and ports can be configured through
the /etc/network/interfaces script. During system startup,
Open vSwitch startup script reads the interfaces file
and creates the bridges and ports. During system shutdown,
the bridges and ports are removed.

The same behavior also can occur with a manual 'restart' of
Open vswitch (ex: service openvswitch-switch restart).
This behavior has come across as undesirable in some cases.
ex: When some one manually creates interfaces through ovs-vsctl
and then restarts Open vSwitch, that interface is lost.

This commit changes the startup script such that, interfaces
are created and deleted through the startup script only when
RUNLEVEL environment variable is set. This behavior will be
consistent with the OVS RHEL ifcfg-* scripts too.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-msgs: Fix limits of OFPMP_TABLE_FEATURES.
Alexander Wu [Thu, 21 Nov 2013 09:04:28 +0000 (17:04 +0800)]
ofp-msgs: Fix limits of OFPMP_TABLE_FEATURES.

Signed-off-by: Alexander Wu <alexander.wu@huawei.com>
Reviewed-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoipfix: allow empty targets column in table IPFIX
Romain Lenglet [Wed, 20 Nov 2013 18:57:53 +0000 (10:57 -0800)]
ipfix: allow empty targets column in table IPFIX

The "targets" column in IPFIX had a min=1 constraints, so OVSDB
implicitly adds an empty string "" into that column if no value is
given.  No connection can be opened to a target with address "", so
the whole IPFIX exporter for that row was disabled until that ""
target was removed by users.  That behavior is correct but proved to
be unintuitive to users.

This patch removes the min=1 constraint, to avoid the trouble for
users who insert IPFIX rows with no targets: it eliminates the log
messages due to failed connections to target "", and eliminates the
need to manually remove the "" target after row insertion.

This doesn't impact the behavior for any existing row, whether it has
a "" target or not.

Signed-off-by: Romain Lenglet <rlenglet@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoipfix: fix segfault for Flow_Sample_Collector_Set without ipfix
Romain Lenglet [Wed, 20 Nov 2013 18:57:52 +0000 (10:57 -0800)]
ipfix: fix segfault for Flow_Sample_Collector_Set without ipfix

Guard any access to an IPFIX row referenced from
Flow_Sample_Collector_Set by a test that the reference is not NULL.

Signed-off-by: Romain Lenglet <rlenglet@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agobfd: Add new key "flap_count" to "bfd_status".
Alex Wang [Wed, 20 Nov 2013 19:38:29 +0000 (11:38 -0800)]
bfd: Add new key "flap_count" to "bfd_status".

This commit adds a new key "flap_count" to "bfd_status" to count
the number of bfd "forwarding" flag flaps.  A flap is considered
as a change of the "forwarding" flag value.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agobfd: Add forwarding flag to struct bfd.
Alex Wang [Wed, 20 Nov 2013 19:15:54 +0000 (11:15 -0800)]
bfd: Add forwarding flag to struct bfd.

This commit adds a forwarding flag to "struct bfd".  This flag
is for indicating the interface's capability of packet I/O.
Also, this flag makes it possible to count the number of interface
state flapping.  bfd_forwarding__() will update this flag at
each invocation.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agocoverage: Synchronize per-thread counters less aggressively
Joe Stringer [Fri, 15 Nov 2013 23:25:00 +0000 (15:25 -0800)]
coverage: Synchronize per-thread counters less aggressively

When profiling CPU usage in situations involving high numbers of ports,
coverage_clear() was highlighted as a commonly called function. It
appears that it can be quite expensive to access all of the per-thread
coverage counters when threads are constantly waking up.

This patch makes each thread only do coverage_clear() logic roughly once
per second by introducing per-thread timers. Upcall handler counters may
become less accurate, as these threads may sleep without synchronising
and not wake up for some time. When the main thread is under load at
~90% CPU, this drops to ~85%. Upcall handler threads sitting at ~2.5%
drop to ~1.5%.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoMakefile.am: Distribute BUILD.Windows.
Ben Pfaff [Wed, 20 Nov 2013 17:42:47 +0000 (09:42 -0800)]
Makefile.am: Distribute BUILD.Windows.

Fixes a build failure:
    The distribution is missing the following files:
    BUILD.Windows

CC: Gurucharan Shetty <gshetty@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoFAQ: More explicitly draw attention to explanation of different flow types.
Ben Pfaff [Wed, 20 Nov 2013 17:07:13 +0000 (09:07 -0800)]
FAQ: More explicitly draw attention to explanation of different flow types.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
10 years agoFAQ: Update description of datapath flows.
Ben Pfaff [Wed, 20 Nov 2013 16:55:10 +0000 (08:55 -0800)]
FAQ: Update description of datapath flows.

They have not been exact-match only for a while.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
10 years agoofp-actions: Make ofpacts_check() report consistency for all protocols.
Ben Pfaff [Fri, 15 Nov 2013 22:19:57 +0000 (14:19 -0800)]
ofp-actions: Make ofpacts_check() report consistency for all protocols.

Until now ofpacts_check() has been told either to enforce consistency or
not, but that means that the caller has to know exactly what protocol is
going to be in use (because some protocols require consistency to be
enforced and others don't).  This commit changes ofpacts_check() to just
rule out protocols that require enforcement when it detects
inconsistencies.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
10 years agoBUILD.Windows: Some details on the proposed build system.
Gurucharan Shetty [Sun, 17 Nov 2013 17:25:34 +0000 (09:25 -0800)]
BUILD.Windows: Some details on the proposed build system.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agocccl: Provide '-' before the options instead of double slash.
Gurucharan Shetty [Sun, 17 Nov 2013 02:49:06 +0000 (18:49 -0800)]
cccl: Provide '-' before the options instead of double slash.

While compiling Open vSwitch with visual c++ in
a mingw environment, I have observed that "//" before
options does not work for all the compiler options of
MSVC. Using "-" on the other hand seems to work.

Also, echo the command line options passed to
the MSVC compiler.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agocccl: A wrapper that calls visual c++ compiler.
Gurucharan Shetty [Sun, 17 Nov 2013 02:36:38 +0000 (18:36 -0800)]
cccl: A wrapper that calls visual c++ compiler.

One option to compile Open vSwitch code in windows
is to use Visual c++ compiler.

From http://cccl.sourceforge.net/ :
"cccl is a wrapper around Microsoft Visual C++'s cl.exe
and link.exe.  It converts Unix compiler parameters
into parameters understood by cl and link.  cccl's main
use is for using Unix build processes with Microsoft
compilers. Using cccl in conjunction with ports of Unix
utilities, it is possible to build many Unix packages
using MSVC, without modifying the build process."

There are couple of forks of the project in the internet.
This particular piece is copied from:
https://gitorious.org/swift/swift/source/\
cf9b391b40a9c59a620c8093d438370381949c60:autoconf/cccl

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoClassifier: Staged subtable matching.
Jarno Rajahalme [Wed, 20 Nov 2013 01:31:29 +0000 (17:31 -0800)]
Classifier: Staged subtable matching.

Subtable lookup is performed in ranges defined for struct flow,
starting from metadata (registers, in_port, etc.), then L2 header, L3,
and finally L4 ports.  Whenever it is found that there are no matches
in the current subtable, the rest of the subtable can be skipped.  The
rationale of this logic is that as many fields as possible can remain
wildcarded.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
10 years agodatapath: Change ovs_flow_tbl_lookup_xx() APIs
Andy Zhou [Wed, 13 Nov 2013 20:04:40 +0000 (12:04 -0800)]
datapath: Change ovs_flow_tbl_lookup_xx() APIs

API changes only for code readability. No functional chnages.

This patch removes the underscored version. Added a new API ovs_flow_tbl_lookup_stats() that
returns the n_mask_hits.

Reported by: Ben Pfaff <blp@nicira.com>
Reviewed-by: Thomas Graf <tgraf@redhat.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>
10 years agoofproto-dpif: add support for layer 3 ports
Lorand Jakab [Tue, 19 Nov 2013 09:06:44 +0000 (11:06 +0200)]
ofproto-dpif: add support for layer 3 ports

Add member is_layer3 to struct ofport_dpif to mark layer 3 ports.  Set
it to "true" for the only layer 3 port we support for now: lisp.

Additionally, prevent flooding to layer 3 ports.  A later patch will
also prevent MAC learning.

Signed-off-by: Lorand Jakab <lojakab@cisco.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoutilities: Regenerate ovs-lib if configuration changes.
Ben Pfaff [Tue, 19 Nov 2013 19:02:08 +0000 (11:02 -0800)]
utilities: Regenerate ovs-lib if configuration changes.

Otherwise running "configure" twice with different --prefix (etc.) will
fail to update ovs-lib, so that "make install" installs an ovs-lib with
the wrong paths.

Reported-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
10 years agoutil: Rename popcount to count_1bits
Ben Pfaff [Tue, 19 Nov 2013 18:59:10 +0000 (10:59 -0800)]
util: Rename popcount to count_1bits

This avoids a conflict with NetBSD's strings.h/libc.
(http://netbsd.gw.com/cgi-bin/man-cgi?popcount++NetBSD-current)

The new name is suggested by Ben Pfaff.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@gmail.com>
10 years agodatapath: Shrink sw_flow_mask by 8 bytes (64-bit) or 4 bytes (32-bit).
Ben Pfaff [Wed, 13 Nov 2013 17:50:54 +0000 (09:50 -0800)]
datapath: Shrink sw_flow_mask by 8 bytes (64-bit) or 4 bytes (32-bit).

We won't normally have a ton of flow masks but using a size_t to store
values no bigger than sizeof(struct sw_flow_key) seems excessive.

This reduces sw_flow_key_range and sw_flow_mask by 4 bytes on 32-bit
systems.  On 64-bit systems it shrinks sw_flow_key_range by 12 bytes but
sw_flow_mask only by 8 bytes due to padding.

Compile tested only.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
10 years agodatapath: Correct comment.
Ben Pfaff [Wed, 13 Nov 2013 17:33:26 +0000 (09:33 -0800)]
datapath: Correct comment.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agoutil: Make popcount() handle 64-bit integers, not separate popcount64().
Ben Pfaff [Mon, 18 Nov 2013 21:18:41 +0000 (13:18 -0800)]
util: Make popcount() handle 64-bit integers, not separate popcount64().

Having a single function that can do popcount() on any integer type is
easier for callers to get right.  The implementation is probably slower
if the caller actually provides a 32-bit (or shorter) integer, but the
only existing callers always provide a full 64-bit integer so this seems
unimportant for now.

This also restores use, in practice, of the optimized implementation of
population count.  (As the comment on popcount32() says, this version is
2x faster than __builtin_popcount().)

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
10 years agoutil: Make raw_ctz() accept 64-bit integers.
Ben Pfaff [Mon, 18 Nov 2013 19:30:38 +0000 (11:30 -0800)]
util: Make raw_ctz() accept 64-bit integers.

Having a single function that can do raw_ctz() on any integer type is
easier for callers to get right, and there is no real downside in the
implementation.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
10 years agoMakefile.am: Make PYTHONPATH work on Mingw.
Gurucharan Shetty [Sun, 17 Nov 2013 03:23:13 +0000 (19:23 -0800)]
Makefile.am: Make PYTHONPATH work on Mingw.

The ":" used as a seperator does not work when
the make is run. ";" is the correct separator.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoconfigure: Windows can have spaces in directories.
Gurucharan Shetty [Sun, 17 Nov 2013 02:14:51 +0000 (18:14 -0800)]
configure: Windows can have spaces in directories.

Running ./configure and testing for python through PATH
gives out a bunch of errors because of the extra arguments.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoconfigure.ac: Identify when compiling on windows.
Gurucharan Shetty [Sat, 16 Nov 2013 19:42:46 +0000 (11:42 -0800)]
configure.ac: Identify when compiling on windows.

Presence of windows.h will set the WIN32 variable.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoconfigure.ac: Make autoconf in Mingw happy.
Gurucharan Shetty [Fri, 15 Nov 2013 23:32:09 +0000 (15:32 -0800)]
configure.ac: Make autoconf in Mingw happy.

Autoconf version 2.68 in Mingw environment does not
like the new lines in AC_CONFIG_FILES macro.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agominiflow: Use 64-bit map.
Jarno Rajahalme [Mon, 18 Nov 2013 17:28:44 +0000 (09:28 -0800)]
miniflow: Use 64-bit map.

Signed-off By: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agolib/util: Add ctz64() and popcount64().
Jarno Rajahalme [Mon, 18 Nov 2013 17:28:44 +0000 (09:28 -0800)]
lib/util: Add ctz64() and popcount64().

Add raw_ctz64(), ctz64(), and popcount64() using builtins when
available.

Signed-off By: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agolib/util: Make raw_ctz() implementation non-static.
Jarno Rajahalme [Mon, 18 Nov 2013 17:28:44 +0000 (09:28 -0800)]
lib/util: Make raw_ctz() implementation non-static.

Signed-off By: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agodpif-linux: Fix minor typo OVS_DP_ATTR_UPCALL_PID
Thomas Graf [Mon, 18 Nov 2013 14:24:10 +0000 (15:24 +0100)]
dpif-linux: Fix minor typo OVS_DP_ATTR_UPCALL_PID

Signed-off-by: Thomas Graf <tgraf@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoutil: Fix bad constant in ovs_scan() implementation on 64-bit.
Ben Pfaff [Fri, 15 Nov 2013 18:34:34 +0000 (10:34 -0800)]
util: Fix bad constant in ovs_scan() implementation on 64-bit.

scan_chars() compares an "unsigned int" against SIZE_MAX, which will
always be false on 64-bit architectures.  The correct constant is
UINT_MAX.

Reported-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-actions: Consider L4 actions after mpls_push as inconsistent
Simon Horman [Fri, 15 Nov 2013 09:10:18 +0000 (18:10 +0900)]
ofp-actions: Consider L4 actions after mpls_push as inconsistent

After an mpls_push action the resulting packet is MPLS and
the MPLS payload is opaque. Thus nothing can be assumed
about the packets network protocol and it is inconsistent
to apply L4 actions.

With regards to actions that affect the packet at other layers
of the protocol stack:

* L3: The consistency of L3 actions should already be handled correctly
  by virtue of the dl_type of the flow being temporarily altered
  during consistency checking by both push_mpls and pop_mpls actions.

* MPLS: The consistency checking of MPLS actions appear to already be
  handled correctly.

* VLAN: At this time Open vSwitch on mpls_push an MPLS LSE is always
  added after any VLAN tags that follow the ethernet header.
  That is the tag ordering defined prior to OpenFlow1.3. As such
  VLAN actions should sill be equally valid before and after mpls_push
  and mpls_pop actions.

* L2 actions are equally valid before and after mpls_push and mpls_pop actions.

Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoSwitch from sscanf() to ovs_scan() throughout the tree.
Ben Pfaff [Sat, 9 Nov 2013 23:44:23 +0000 (15:44 -0800)]
Switch from sscanf() to ovs_scan() throughout the tree.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoutil: New function ovs_scan().
Ben Pfaff [Fri, 15 Nov 2013 16:54:56 +0000 (08:54 -0800)]
util: New function ovs_scan().

This new function is essentially an implementation of sscanf() with
slightly different behavior (see the comment) that is more convenient for
Open vSwitch internal use.  Also, this implementation ought to work out of
the box on Windows, which has a defective sscanf() that lacks the 'hh'
modifier required to scan into a char variable.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agobitmap: New macro BITMAP_N_LONGS for use in constant expressions.
Ben Pfaff [Sat, 9 Nov 2013 23:21:12 +0000 (15:21 -0800)]
bitmap: New macro BITMAP_N_LONGS for use in constant expressions.

An upcoming commit will declare a bitmap on the stack, rather than heap
allocating it, which means that it is not possible to use a function call
in the declaration.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agometa-flow: Fix typo in error message.
Ben Pfaff [Sat, 9 Nov 2013 23:12:12 +0000 (15:12 -0800)]
meta-flow: Fix typo in error message.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodpif-netdev: Maintain the original key during execution.
Jarno Rajahalme [Thu, 14 Nov 2013 22:35:58 +0000 (14:35 -0800)]
dpif-netdev: Maintain the original key during execution.

Userspace action needs the original flow key.  This also
matches the kernel datapath behavior.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agodpif_netdev_execute: Extract flow key from the packet.
Jarno Rajahalme [Thu, 14 Nov 2013 22:35:58 +0000 (14:35 -0800)]
dpif_netdev_execute: Extract flow key from the packet.

Extract the flow key from the packet instead of the execute->key.
This reflects how the kernel datapath behaves.

Also use ofpbuf_clone_with_headroom() instead of open coding the same.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-actions: Remove unneeded redeclaration of vlog_rate_limit rl.
Marco Diego Aurélio Mesquita [Mon, 11 Nov 2013 18:54:06 +0000 (15:54 -0300)]
ofp-actions: Remove unneeded redeclaration of vlog_rate_limit rl.

Signed-off-by: Marco Diego Aurélio Mesquita <marcodiegomesquita@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoOPENFLOW-1.1+: Update MPLS items
Simon Horman [Thu, 14 Nov 2013 02:19:07 +0000 (11:19 +0900)]
OPENFLOW-1.1+: Update MPLS items

* MPLS BoS match is supported as much as other MPLS matches.
  That is, all that is missing is the kernel datapath side
  which is part my pending patchset.

* The rework of tag order does require work but it is
  covered by my pending patchset.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoFAQ, NEWS: Notes on TCP flags matching.
Jarno Rajahalme [Wed, 13 Nov 2013 19:19:56 +0000 (11:19 -0800)]
FAQ, NEWS: Notes on TCP flags matching.

Add a FAQ categorry "Performance Problems".  So far the only entry
addresses the issue with using a new kernel module with an older
(pre-megaflows) userspace.

10 years agoovs-ofctl: Document arp_spa and arp_tpa matches
Simon Horman [Wed, 13 Nov 2013 08:53:31 +0000 (17:53 +0900)]
ovs-ofctl: Document arp_spa and arp_tpa matches

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-ofctl: Document set_mpls_{label,tc} actions
Simon Horman [Wed, 13 Nov 2013 06:19:17 +0000 (15:19 +0900)]
ovs-ofctl: Document set_mpls_{label,tc} actions

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-ofctl: Document mpls_{label,bos,tc} matches
Simon Horman [Wed, 13 Nov 2013 06:16:18 +0000 (15:16 +0900)]
ovs-ofctl: Document mpls_{label,bos,tc} matches

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: test ARP SPA and TPA load actions
Simon Horman [Wed, 13 Nov 2013 06:15:37 +0000 (15:15 +0900)]
ofproto-dpif: test ARP SPA and TPA load actions

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-ofctl: Document masked versions of arp_sha and arp_tha matches
Simon Horman [Wed, 13 Nov 2013 06:13:42 +0000 (15:13 +0900)]
ovs-ofctl: Document masked versions of arp_sha and arp_tha matches

Document masked versions of arp_sha and arp_tha matches.
Also update documentation of unmasked versions of these
matches to include an example address as is the case with
the documentation of dl_src and dl_dst.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodpif-netdev: Introduce a classifier in userspace datapath.
Gurucharan Shetty [Mon, 4 Nov 2013 14:23:54 +0000 (06:23 -0800)]
dpif-netdev: Introduce a classifier in userspace datapath.

Instead of an exact match flow table, we introduce a classifier.
This enables mega-flows in userspace datapath.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
[blp@nicira.com tweaked flow lookup]
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agonetlink: Do not enforce alignment of last Netlink attribute
Thomas Graf [Mon, 11 Nov 2013 11:11:36 +0000 (12:11 +0100)]
netlink: Do not enforce alignment of last Netlink attribute

There is no reason to enforce padding after the last attribute.
Dropping this enforcement will ease efforts to implement zerocopy
upcall.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agodpif: Document datapath masking.
Ben Pfaff [Wed, 13 Nov 2013 01:10:16 +0000 (17:10 -0800)]
dpif: Document datapath masking.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
10 years agobond: Use active-backup mode on LACP failure.
Ravi Kondamuru [Mon, 4 Nov 2013 23:07:10 +0000 (23:07 +0000)]
bond: Use active-backup mode on LACP failure.

Commit bdebeece5 (lacp: Require successful LACP negotiations when
configured.) makes successful LACP negotiation mandatory for the
bond to come UP. This patch provides a configuration option to
bring up the bond by falling back to active-backup mode on LACP
negotiation failure.

Several of the physical switches that support LACP block all traffic
for ports that are configured to use LACP, until LACP is negotiated
with the host. When configuring a LACP bond on a OVS host
(eg: XenServer), this means that there will be an interruption of the
network connectivity between the time the ports on the physical
switch and the bond on the OVS host are configured. The interruption
may be relatively long, if different people are responsible for
managing the switches and the OVS host.

Such network connectivity failure can be avoided if LACP can be
configured on the OVS host before configuring the physical switch,
and having the OVS host fall back to a bond mode (active-backup) till
the physical switch LACP configuration is complete. An option
"lacp-fallback-ab" is introduced with this patch to provide such
behavior on openvswitch.

Signed-off-by: Ravi Kondamuru <Ravi.Kondamuru@citrix.com>
Signed-off-by: Dominic Curran <Dominic.Curran@citrix.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto: Add enum ofp_table_config
Simon Horman [Tue, 12 Nov 2013 07:45:51 +0000 (16:45 +0900)]
ofproto: Add enum ofp_table_config

Cc: Andy Zhou <azhou@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto: Add enum ofp_table
Simon Horman [Tue, 12 Nov 2013 07:45:50 +0000 (16:45 +0900)]
ofproto: Add enum ofp_table

Add enum ofp_table and use it for Flow Mod.

Cc: Andy Zhou <azhou@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodebian: Avoid logrotate error if /var/run/openvswitch does not exist.
Alfredo Finelli [Tue, 12 Nov 2013 16:03:41 +0000 (08:03 -0800)]
debian: Avoid logrotate error if /var/run/openvswitch does not exist.

Signed-off-by: Alfredo Finelli <alf@computationes.de>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-dev.py: Remove duplicate name from the help string.
Saurabh Shah [Mon, 11 Nov 2013 21:19:30 +0000 (13:19 -0800)]
ovs-dev.py: Remove duplicate name from the help string.

Signed-off-by: Saurabh Shah <ssaurabh@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoodp-util: Fix formatting of ipfix action cookies, to fix a testsuite failure
Ben Pfaff [Mon, 11 Nov 2013 21:32:23 +0000 (13:32 -0800)]
odp-util: Fix formatting of ipfix action cookies, to fix a testsuite failure

Problem introduced by previous commit 96ed775f19 (odp-util: Fix IPFIX
breakage with old kernel modules.)

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoodp-util: Fix IPFIX breakage with old kernel modules.
Ben Pfaff [Mon, 7 Oct 2013 21:26:28 +0000 (14:26 -0700)]
odp-util: Fix IPFIX breakage with old kernel modules.

Before commit e995e3df57ea (Allow OVS_USERSPACE_ATTR_USERDATA to be
variable length.) userdata attributes in userspace actions were expected
to be exactly 64 bits long.  The kernel only actually enforced that they
were at least 64 bits long (the previously referenced commit's log message
contains misinformation on this account).

Initially this was no problem, because all of the userdata that userspace
actually used was exactly 8 bytes long.  Commit 29089a540c (Implement IPFIX
export), however, exposed a problem by reducing the length of userdata for
IPFIX support to just 4 bytes.  This meant that IPFIX no longer worked on
older datapaths, because the userdata was no longer at least 8 bytes long.

This commit fixes the problem by padding out userdata attributes less than
8 bytes long to 8 bytes.

CC: Romain Lenglet <rlenglet@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Romain Lenglet <rlenglet at vmware.com>
10 years agonetlink: New function nl_msg_put_unspec_zero().
Ben Pfaff [Mon, 7 Oct 2013 21:11:40 +0000 (14:11 -0700)]
netlink: New function nl_msg_put_unspec_zero().

This function already had a few potential users, which this commit
converts.  An upcoming commit adds more users.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-ofctl: Improve manpage.
Ben Pfaff [Mon, 6 May 2013 17:20:27 +0000 (10:20 -0700)]
ovs-ofctl: Improve manpage.

Fixes misspelling of "OpenFlow".

Fixes the indentation of the paragraph beginning "Any \fIreason\fR...".

Changes "target" to "action" in the introduction of actions, which seems
like a better name.

Reorders action descriptions to group all the simple forms of output
together.

Consistently mentions that output actions don't output to the input port.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-actions: Switch away from odd use of "q" in "enqueue" action format.
Ben Pfaff [Mon, 6 May 2013 17:55:06 +0000 (10:55 -0700)]
ofp-actions: Switch away from odd use of "q" in "enqueue" action format.

The formatting of the "enqueue" action uses a "q" to separate the port
number from the queue number, as in "enqueue:123q456".  This is different
from every other action.  This commit improves the situation by:

    * Switching the formatting to use a colon (e.g. "enqueue:123:456"),
      which is a little less odd-looking but still accepted by older
      versions of Open vSwitch.

    * Improving the parser to accept "enqueue(123,456)" also.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: New unixctl command ofproto/trace-packet-out.
Ben Pfaff [Mon, 11 Nov 2013 18:50:47 +0000 (10:50 -0800)]
ofproto-dpif: New unixctl command ofproto/trace-packet-out.

Feature #20543.
Requested-by: Ronghua Zhang <rzhang@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>