sliver-openvswitch.git
10 years agoSetting tag sliver-openvswitch-1.11.90-1 sliver-openvswitch-1.11.90-1
Giuseppe Lettieri [Sat, 6 Jul 2013 17:51:36 +0000 (19:51 +0200)]
Setting tag sliver-openvswitch-1.11.90-1
merge with mainstream

10 years agoMerge branch 'master' of ssh://git.onelab.eu/git/sliver-openvswitch
Giuseppe Lettieri [Sat, 6 Jul 2013 17:51:05 +0000 (19:51 +0200)]
Merge branch 'master' of ssh://git.onelab.eu/git/sliver-openvswitch

Conflicts:
sliver-openvswitch.spec

10 years agoSetting tag sliver-openvswitch-1.10.90-3 sliver-openvswitch-1.10.90-3
Giuseppe Lettieri [Sat, 6 Jul 2013 17:47:11 +0000 (19:47 +0200)]
Setting tag sliver-openvswitch-1.10.90-3
merge with mainstream

10 years agoupdate mainstream version number
Giuseppe Lettieri [Sat, 6 Jul 2013 17:45:01 +0000 (19:45 +0200)]
update mainstream version number

10 years agouse struct tun_pi in read/write to pltap
Giuseppe Lettieri [Sat, 6 Jul 2013 17:36:10 +0000 (19:36 +0200)]
use struct tun_pi in read/write to pltap

10 years agoupdate sliver-ovs to new ovsdb syntax
Giuseppe Lettieri [Sat, 6 Jul 2013 17:32:14 +0000 (19:32 +0200)]
update sliver-ovs to new ovsdb syntax

10 years agocomply with thread-safety checks
Giuseppe Lettieri [Sat, 6 Jul 2013 17:14:14 +0000 (19:14 +0200)]
comply with thread-safety checks

We hide tunproxy.c from the build, since thread-safety checks do not
make sense there.

10 years agoMerge branch 'mainstream'
Giuseppe Lettieri [Sat, 6 Jul 2013 17:00:44 +0000 (19:00 +0200)]
Merge branch 'mainstream'

10 years agoreplaced strerror to ovs_strerror in pltap&tunnel
Giuseppe Lettieri [Sat, 6 Jul 2013 17:00:19 +0000 (19:00 +0200)]
replaced strerror to ovs_strerror in pltap&tunnel

10 years agoMerge commit '10a89ef04df5669c5cdd02f786150a7ab8454e01'
Giuseppe Lettieri [Sat, 6 Jul 2013 16:57:17 +0000 (18:57 +0200)]
Merge commit '10a89ef04df5669c5cdd02f786150a7ab8454e01'

10 years agounification of netdev&netdev_dev in pltap&tunnel
Giuseppe Lettieri [Sat, 6 Jul 2013 16:56:09 +0000 (18:56 +0200)]
unification of netdev&netdev_dev in pltap&tunnel

10 years agoMerge commit 'b5d57fc87925cb3c029de19d0a94de5ca07ae28e'
Giuseppe Lettieri [Sat, 6 Jul 2013 16:06:37 +0000 (18:06 +0200)]
Merge commit 'b5d57fc87925cb3c029de19d0a94de5ca07ae28e'

10 years agorename superclass member to up in netdev-pltap
Giuseppe Lettieri [Sat, 6 Jul 2013 15:55:51 +0000 (17:55 +0200)]
rename superclass member to up in netdev-pltap

10 years agorename superclass member to up in netdev-tunnel
Giuseppe Lettieri [Sat, 6 Jul 2013 15:59:50 +0000 (17:59 +0200)]
rename superclass member to up in netdev-tunnel

10 years agoMerge commit '180c6d0b440961cbc873c4d045eb8b2daa1364e9'
Giuseppe Lettieri [Sat, 6 Jul 2013 16:05:12 +0000 (18:05 +0200)]
Merge commit '180c6d0b440961cbc873c4d045eb8b2daa1364e9'

10 years agorefactor for new netdev_rx class
Giuseppe Lettieri [Sat, 6 Jul 2013 10:31:58 +0000 (12:31 +0200)]
refactor for new netdev_rx class

10 years agoMerge commit '796223f5bc3a4896e6398733c798390158479400'
Giuseppe Lettieri [Fri, 5 Jul 2013 17:55:33 +0000 (19:55 +0200)]
Merge commit '796223f5bc3a4896e6398733c798390158479400'

10 years agoupgrade to new signature of update_flags
Giuseppe Lettieri [Fri, 5 Jul 2013 17:53:37 +0000 (19:53 +0200)]
upgrade to new signature of update_flags

10 years agoinclude config.h to silence build checks
Giuseppe Lettieri [Fri, 5 Jul 2013 17:50:31 +0000 (19:50 +0200)]
include config.h to silence build checks

10 years agoMerge commit '4b60911067a82fbdfa87b7c2824412da20287ed8'
Giuseppe Lettieri [Fri, 5 Jul 2013 17:37:07 +0000 (19:37 +0200)]
Merge commit '4b60911067a82fbdfa87b7c2824412da20287ed8'

10 years agoMerge commit '559eb2308b4d616590aba34bb8f4dd7f12ae4587'
Giuseppe Lettieri [Fri, 5 Jul 2013 17:36:43 +0000 (19:36 +0200)]
Merge commit '559eb2308b4d616590aba34bb8f4dd7f12ae4587'

Conflicts:
Makefile.am

10 years agodatapath: add netlink error message to help kernel userspace integration.
Andy Zhou [Wed, 3 Jul 2013 16:18:27 +0000 (09:18 -0700)]
datapath: add netlink error message to help kernel userspace integration.

When kernel rejects a netlink message, it usually returns EINVAL
error code to the userspace. The actual reason for rejecting the
netlinke message is not available, making it harder to debug netlink
issues.  This patch adds kernel log messages whenever a netlink message
is rejected with reasons. Those messages are logged at the info level.

Those messages are logged only once per message, to keep kernel log noise
level down. Reload the kernel module to re-enable already logged
messages.

The messages are meant to help developers to debug userspace and kernel
intergration issues. The actual message may change or be removed over time.
These messages are not expected to show up in a production environment.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: Use RCU lock for flow dump operation.
Pravin B Shelar [Tue, 2 Jul 2013 22:44:51 +0000 (15:44 -0700)]
datapath: Use RCU lock for flow dump operation.

Flow dump operation is read-only operation.  There is no need to
take ovs-lock.  Following patch use rcu-lock for dumping flows.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agodatapath: Fix version check in compat gre.h
Jarno Rajahalme [Fri, 28 Jun 2013 09:22:33 +0000 (12:22 +0300)]
datapath: Fix version check in compat gre.h

Taken the version checks in datapath/linux/compat/gre.c this seems correct.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
10 years agoodp-util: Clearly indicate VID mask is printed in hex.
Justin Pettit [Mon, 1 Jul 2013 18:03:23 +0000 (11:03 -0700)]
odp-util: Clearly indicate VID mask is printed in hex.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
10 years agoodp-util: Always encode mask of 0xffff for dl_type < ETH_TYPE_MIN.
Justin Pettit [Mon, 1 Jul 2013 17:43:18 +0000 (10:43 -0700)]
odp-util: Always encode mask of 0xffff for dl_type < ETH_TYPE_MIN.

For non-Ethernet II packets, we don't set an EtherType netlink attribute
and set the Ethertype mask attribute to 0xffff.  The code was encoding
whatever mask was passed in, which could lead to bugs if the caller
didn't know the userspace-kernel interface.

Found by inspection.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
10 years agodatapath: Fix tunnel source port selection for mega flow
Andy Zhou [Tue, 2 Jul 2013 22:58:19 +0000 (15:58 -0700)]
datapath: Fix tunnel source port selection for mega flow

Tunnel source port selection was based on hash value cached in the
flow. This no longer works with mega flow, since all flows matching
a mega flow will be transmitted with the same tunnel source port.

This patch computes the tunnel source port at run time based on each
incoming packet. Packets belong to the same micro flow would still get
the same source port, but multiple micro flows hitting the same mega flow
can get different source ports.

Packets injected from the usespace will be assigned to the same
source port as if they are forwarded in the kernel.

Bug #18216

Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agonetdev-bsd: Fix a build error.
YAMAMOTO Takashi [Tue, 2 Jul 2013 02:04:02 +0000 (11:04 +0900)]
netdev-bsd: Fix a build error.

fix a typo in the following commit.

> commit 10a89ef04df5669c5cdd02f786150a7ab8454e01
> Author: Ben Pfaff <blp@nicira.com>
> Date:   Mon Jun 24 10:54:49 2013 -0700
>
>     Replace all uses of strerror() by ovs_strerror(), for thread safety.
>
>     Signed-off-by: Ben Pfaff <blp@nicira.com>

Signed-off-by: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
10 years agotest-atomic: Drop atomic read-modify-write tests for the moment.
Ben Pfaff [Sat, 29 Jun 2013 15:18:54 +0000 (08:18 -0700)]
test-atomic: Drop atomic read-modify-write tests for the moment.

XenServer builds are failing because of link errors reporting that
__sync_fetch_and_<op>_<size> were not found, for <op> in add/sub/and/xor/or
and <size> in 1/2/4/8.  We're not actually using these RMW operations yet,
so as a stopgap measure just drop the tests.

The correct long-term fix is probably to do Autoconf linkage tests for
these operations instead of just testing the GCC version (if we really need
the operations at all).

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoOPENFLOW-1.1+: Remove items that I've verified to be implemented already.
Ben Pfaff [Wed, 17 Apr 2013 16:59:25 +0000 (09:59 -0700)]
OPENFLOW-1.1+: Remove items that I've verified to be implemented already.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agotests: Fix typo in test name.
Ben Pfaff [Fri, 15 Feb 2013 05:59:42 +0000 (21:59 -0800)]
tests: Fix typo in test name.

Other test names use a space here, so this one should also.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agovconn: Fix formatting of user message.
Ben Pfaff [Wed, 17 Apr 2013 17:51:52 +0000 (10:51 -0700)]
vconn: Fix formatting of user message.

This corrects "version 0x03and earlier" to "version 0x03 and earlier".

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Add ability to disable megaflows.
Justin Pettit [Sat, 29 Jun 2013 00:13:50 +0000 (17:13 -0700)]
ofproto-dpif: Add ability to disable megaflows.

Add new "dpif/disable-megaflows" and "dpif/enable-megaflows" commands to
ovs-appctl to disable and enable megaflows, respectively.  By default,
megaflows are enabled, and these commands should only be used for
debugging.

Feature #18265.

Requested-by: Ronghua Zhang <rzhang@vmware.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoflow: Don't assume non-IPv4 is IPv6 for un-wildcarding.
Justin Pettit [Fri, 28 Jun 2013 18:31:48 +0000 (11:31 -0700)]
flow: Don't assume non-IPv4 is IPv6 for un-wildcarding.

When determinining what fields to un-wildcard for the symmetric L4 hash,
don't include the IPv6 address fields if the packet isn't IPv6.

Reported-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoMakefile: Blacklist functions that threaded programs cannot use safely.
Ben Pfaff [Fri, 5 Apr 2013 13:58:57 +0000 (08:58 -0500)]
Makefile: Blacklist functions that threaded programs cannot use safely.

Some functions that POSIX says cannot be used safely in multithreaded
programs are not on the initial blacklist:

    - getenv() should be safe in real implementations in the absence of
      changes to the environment.  (putenv() and setenv() are blacklisted.)

    - We only use getopt() before spawning extra threads, and I expect this
      to continue to be true.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoUse random_*() instead of rand(), for thread safety.
Ben Pfaff [Tue, 25 Jun 2013 16:22:11 +0000 (09:22 -0700)]
Use random_*() instead of rand(), for thread safety.

None of these test programs are threaded, but has little cost and means
that "grep" doesn't turn up any instances of these thread-unsafe functions
in our tree.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoReplace all uses of strerror() by ovs_strerror(), for thread safety.
Ben Pfaff [Mon, 24 Jun 2013 17:54:49 +0000 (10:54 -0700)]
Replace all uses of strerror() by ovs_strerror(), for thread safety.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agorandom: Make thread-safe.
Ben Pfaff [Tue, 25 Jun 2013 20:53:36 +0000 (13:53 -0700)]
random: Make thread-safe.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoNew function ovs_strerror() as a thread-safe replacement for strerror().
Ben Pfaff [Wed, 19 Jun 2013 22:44:54 +0000 (15:44 -0700)]
New function ovs_strerror() as a thread-safe replacement for strerror().

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-thread: Add support for various thread-related assertions.
Ben Pfaff [Wed, 19 Jun 2013 20:07:35 +0000 (13:07 -0700)]
ovs-thread: Add support for various thread-related assertions.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoovs-thread: Add support for convenient once-only initializers.
Ben Pfaff [Wed, 19 Jun 2013 18:21:47 +0000 (11:21 -0700)]
ovs-thread: Add support for convenient once-only initializers.

pthread_once() is portable but it does not allow passing any parameters to
the initialization function, which is often inconvenient, because it means
that the function can only access data declared at file scope.  This commit
introduces an alternative with a more convenient interface.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoovs-atomic: New library for atomic operations.
Ben Pfaff [Fri, 28 Jun 2013 22:54:40 +0000 (15:54 -0700)]
ovs-atomic: New library for atomic operations.

This library should prove useful for the threading changes coming up.
The following commit introduces one (very simple) user.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agotunnel: Hide 'struct tnl_port' internally.
Ethan Jackson [Tue, 18 Jun 2013 22:24:33 +0000 (15:24 -0700)]
tunnel: Hide 'struct tnl_port' internally.

This simplifies the tunnel module's interface and prevents us from
having to sync 'struct tnl_port' once ofproto-dpif and
ofproto-dpif-xlate are disentangled.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agotunnel: Use ofport_dpif instead of ofport.
Ethan Jackson [Tue, 18 Jun 2013 21:40:30 +0000 (14:40 -0700)]
tunnel: Use ofport_dpif instead of ofport.

Necessary in a future patch.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-appctl: allow ofproto/trace to take mega flow input
Andy Zhou [Fri, 28 Jun 2013 22:20:49 +0000 (15:20 -0700)]
ovs-appctl: allow ofproto/trace to take mega flow input

ofproto/trace command was not updated to take mega flow input, which made
it hard to use by cutting and pasting output from "ovs-dpctl dump-flows".

(The mask is not actually used for tracing.)

Bug #18267.
Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: Resolve external module dependencies.
Jesse Gross [Tue, 25 Jun 2013 19:27:13 +0000 (12:27 -0700)]
datapath: Resolve external module dependencies.

The Open vSwitch kernel module now has dependencies on symbols
exported by other kernel modules (currently just for GRE). In
order for it to load, the dependencies must be correctly resolved
ahead of time. This runs depmod as part of the module installation
process and updates the installation instructions.

Reported-by: Justin Pettit <jpettit@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agoofp-errors: Fix typos in error enumeration names.
Ben Pfaff [Wed, 19 Jun 2013 20:55:17 +0000 (13:55 -0700)]
ofp-errors: Fix typos in error enumeration names.

OFPGMFC is so nice these constants said it twice.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovsdb-server: Add and remove databases during run time.
Ben Pfaff [Thu, 27 Jun 2013 17:27:57 +0000 (10:27 -0700)]
ovsdb-server: Add and remove databases during run time.

The commit allows a user to add a database file to a
ovsdb-server during run time. One can also remove a
database file from ovsdb-server's control.

Feature #14595.
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Co-authored-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoFix table checking for goto table instruction.
Jarno Rajahalme [Fri, 28 Jun 2013 16:44:03 +0000 (19:44 +0300)]
Fix table checking for goto table instruction.

Usually the table id in flow mods is 255, which means that goto table
instruction cannot be checked before the table is picked (for flow add),
or the rules to be modified are found (flow mod).

Move goto table checking from decode (ofp-util) to actions checking
(ofp-actions), and postpone the action checking until the table in
which the actions are added is known.

This fixes OFPBRC_BAD_TABLE_ID errors for flow adds that specify the table
id as 255, and have a goto table instruction.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-util: OpenFlow 1.0 can match IPv6 Ethertype even though not L3 or L4.
Ben Pfaff [Fri, 28 Jun 2013 17:06:58 +0000 (10:06 -0700)]
ofp-util: OpenFlow 1.0 can match IPv6 Ethertype even though not L3 or L4.

OpenFlow 1.0 can match on flows that have the IPv6 Ethertype, but
ofputil_usable_protocols() incorrectly reported that such a match required
NXM or OXM.  This commit fixes the problem.

Also, add some related tests.

Reported-by: Nagi Reddy Jonnala <njonnala@Brocade.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto: Implement OpenFlow 1.3 meter table.
Jarno Rajahalme [Wed, 26 Jun 2013 22:39:51 +0000 (01:39 +0300)]
ofproto: Implement OpenFlow 1.3 meter table.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Co-authored-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofpact: New function ovs_instruction_type_from_ofpact_type().
Ben Pfaff [Thu, 27 Jun 2013 18:01:18 +0000 (11:01 -0700)]
ofpact: New function ovs_instruction_type_from_ofpact_type().

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-actions: Give ovs_instruction funcs names that start with that prefix.
Ben Pfaff [Thu, 27 Jun 2013 18:04:50 +0000 (11:04 -0700)]
ofp-actions: Give ovs_instruction funcs names that start with that prefix.

This seems slightly clearer, because ofpact_instruction_* makes me look
for a type named ofpact_instruction.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agobridge: Don't log flow miss model on every reconfiguration.
Ben Pfaff [Wed, 26 Jun 2013 15:35:14 +0000 (08:35 -0700)]
bridge: Don't log flow miss model on every reconfiguration.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-dpctl: Fix mega flow output
Andy Zhou [Fri, 28 Jun 2013 05:02:58 +0000 (22:02 -0700)]
ovs-dpctl: Fix mega flow output

ovs-dpctl sometimes displays wildcarded fields as exact match. This
patch fixes those cases.

This patch implements the following logic. When OVS_FLOW_ATTR_MASK is
missing, the entire key attributes will be displayed as exact match fields.
When OVS_FLOW_ATTR_MASK is present, but some individual key attributes do
not have matching attributes in the mask, those key attributes will be
displayed as wildcarded fields.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agonetflow: Only un-wildcard IPv4 packets.
Justin Pettit [Thu, 27 Jun 2013 00:13:33 +0000 (17:13 -0700)]
netflow: Only un-wildcard IPv4 packets.

NetFlow v5 only supports IPv4, so don't bother un-wildcarding
non-IPv4 packets.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoflow: Only un-wildcard relevant IP headers.
Justin Pettit [Wed, 26 Jun 2013 23:37:16 +0000 (16:37 -0700)]
flow: Only un-wildcard relevant IP headers.

When determining the fields to un-wildcard, we need to be careful
about only un-wildcarding fields that are relevant.  Also, we
didn't properly handle IPv6 addresses.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoodp-util: Fix converting masked VLAN from flow.
Justin Pettit [Fri, 28 Jun 2013 00:57:57 +0000 (17:57 -0700)]
odp-util: Fix converting masked VLAN from flow.

When converting the VLAN from a flow to an ODP key, the processing logic
would always store the VLAN ethertype.  However, when handling a mask,
it should be a mask, not an ethertype.  And since we don't support
bit-wise masking of the ethertype, just make it an exact-match mask.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoodp-util: Correct printing the VLAN PCP mask.
Justin Pettit [Thu, 27 Jun 2013 22:02:12 +0000 (15:02 -0700)]
odp-util: Correct printing the VLAN PCP mask.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoofproto-dpif: Remove old comment.
Justin Pettit [Thu, 27 Jun 2013 23:09:03 +0000 (16:09 -0700)]
ofproto-dpif: Remove old comment.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agodatapath: Bug fix: Kernel rejects flow with valid vlan field
Andy Zhou [Wed, 26 Jun 2013 15:54:45 +0000 (08:54 -0700)]
datapath: Bug fix: Kernel rejects flow with valid vlan field

Bug #18233

Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agoDatapath: Bug fix: kernel rejects mega flow with encap masks
Andy Zhou [Wed, 26 Jun 2013 15:54:44 +0000 (08:54 -0700)]
Datapath: Bug fix: kernel rejects mega flow with encap masks

Bug #18233

Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agobond: Handle unknown slaves in bond_check_admissibility().
Ethan Jackson [Wed, 19 Jun 2013 21:34:35 +0000 (14:34 -0700)]
bond: Handle unknown slaves in bond_check_admissibility().

In future patches, ofproto-dpif-xlate may be temporarily out of
sync with ofproto-dpif and pass a non-bonded ofport into
bond_check_admissibility().  This patch handles that edge case
gracefully.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Move tag_the_flow() to ofproto-dpif.c
Ethan Jackson [Sat, 22 Jun 2013 20:16:26 +0000 (13:16 -0700)]
ofproto-dpif: Move tag_the_flow() to ofproto-dpif.c

This will help disentangle ofproto-dpif and ofproto-dpif-xlate.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Refactor checking for in-band special case.
Ben Pfaff [Wed, 26 Jun 2013 21:44:39 +0000 (14:44 -0700)]
ofproto-dpif: Refactor checking for in-band special case.

The comments on in_band_rule_check() were more or less wrong (the return
value was no longer used to determine whether a flow could be set up).
This commit fixes the comments and refactors the interface to make better
sense in the current context.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoconnmgr: Remove connmgr_must_output_local().
Ethan Jackson [Sat, 22 Jun 2013 17:48:42 +0000 (10:48 -0700)]
connmgr: Remove connmgr_must_output_local().

connmgr_must_output_local() requires a 'struct connmgr' handle,
when in principle, it should simply be enough to know whether or
not in_band is enabled.  Breaking this up will allow
ofproto-dpif-xlate to disentangle itself from ofproto-dpif in future
patches.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agonetdev: Support null netdev argument in netdev_ref().
Ethan Jackson [Tue, 25 Jun 2013 00:23:15 +0000 (17:23 -0700)]
netdev: Support null netdev argument in netdev_ref().

This will be convenient in future patches.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Remove 'has_bundle_action'.
Ethan Jackson [Sat, 22 Jun 2013 20:21:39 +0000 (13:21 -0700)]
ofproto-dpif: Remove 'has_bundle_action'.

It requires ofproto-dpif-xlate to poke into 'struct ofproto-dpif'
which won't be allowed in future patches.  It's also a case of
premature optimization.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-ipfix: Reference count 'struct dpif_ipfix'.
Ethan Jackson [Wed, 19 Jun 2013 02:36:44 +0000 (19:36 -0700)]
ofproto-dpif-ipfix: Reference count 'struct dpif_ipfix'.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-sflow: Reference count 'struct dpif_sflow'.
Ethan Jackson [Wed, 19 Jun 2013 02:33:51 +0000 (19:33 -0700)]
ofproto-dpif-sflow: Reference count 'struct dpif_sflow'.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agomac-learning: Reference count 'struct mac_learning".
Ethan Jackson [Wed, 19 Jun 2013 02:41:51 +0000 (19:41 -0700)]
mac-learning: Reference count 'struct mac_learning".

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agobond: Reference count 'struct bond'.
Ethan Jackson [Tue, 18 Jun 2013 23:48:31 +0000 (16:48 -0700)]
bond: Reference count 'struct bond'.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agolacp: Reference count 'struct lacp'.
Ethan Jackson [Tue, 18 Jun 2013 23:44:23 +0000 (16:44 -0700)]
lacp: Reference count 'struct lacp'.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agobfd: Reference count 'struct bfd'.
Ethan Jackson [Tue, 18 Jun 2013 23:40:19 +0000 (16:40 -0700)]
bfd: Reference count 'struct bfd'.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agocfm: Reference count 'struct cfm'.
Ethan Jackson [Tue, 18 Jun 2013 23:31:43 +0000 (16:31 -0700)]
cfm: Reference count 'struct cfm'.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: Make GRE support conditional on CONFIG_NET_IPGRE_DEMUX.
Jesse Gross [Mon, 24 Jun 2013 22:02:18 +0000 (15:02 -0700)]
datapath: Make GRE support conditional on CONFIG_NET_IPGRE_DEMUX.

Now that GRE support has been upstreamed into Linux, OVS is
using the components in the native kernel when available. However,
this means that it is now dependent on the appropriate kernel
config, which is CONFIG_NET_IPGRE_DEMUX on 2.6.37 and later.

Reported-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
10 years agodatapath: Convert IPv6 TCP and UDP port netlink attributes properly.
Justin Pettit [Thu, 27 Jun 2013 20:42:14 +0000 (13:42 -0700)]
datapath: Convert IPv6 TCP and UDP port netlink attributes properly.

The code that converts netlink attributes to a flow match always
stored TCP and UDP ports in the IPv4 structure.  This commit
properly puts TCP and UDP traffic into appropriate IPv4 and IPv6
structures.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
10 years agoofp-util: Meter fixes.
Jarno Rajahalme [Thu, 27 Jun 2013 09:10:42 +0000 (12:10 +0300)]
ofp-util: Meter fixes.

Validate claimed message length for meter stats in ofp-util.c.
Clean up meters in ofp-util.h.
Fix the impossible duration values in ofp-print.at.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto: Use OFPRR_EVICTION consistently when evicting flows.
Jarno Rajahalme [Wed, 26 Jun 2013 22:39:49 +0000 (01:39 +0300)]
ofproto: Use OFPRR_EVICTION consistently when evicting flows.

Multiple code paths can evict flows, but before this commit only one of
those code paths used OFPRR_EVICTION as the reason code.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agobfd: Fix typo in comment.
Ben Pfaff [Wed, 26 Jun 2013 20:50:53 +0000 (13:50 -0700)]
bfd: Fix typo in comment.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoINSTALL: Add db name to path in the example.
James P [Wed, 26 Jun 2013 22:32:16 +0000 (15:32 -0700)]
INSTALL: Add db name to path in the example.

Signed-off-by: James P. <roampune@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoopenflow-common: Change flow removal reason codes.
Jarno Rajahalme [Wed, 26 Jun 2013 22:39:48 +0000 (01:39 +0300)]
openflow-common: Change flow removal reason codes.

Swap places of OFPRR_METER_DELETE and OFPRR_EVICTION in enumeration to be
compatible with OpenFlow 1.4.

Prior to OpenFlow 1.4 OFPRR_EVICTION was a Nicira specific flow removal reason
code.  OpenFlow 1.3 added support for meters, which require dependent flow
removal when meters are deleted.  The reason code for this is also added in
OpenFlow 1.4, but OFPRR_METER_DELETE now has the value OVS previously had for
OFPRR_EVICTION.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovsdb-server: Make database name mandatory when specifying db paths.
Gurucharan Shetty [Mon, 24 Jun 2013 15:38:22 +0000 (08:38 -0700)]
ovsdb-server: Make database name mandatory when specifying db paths.

Currently, if we have just one database, we can optionally skip the
database name when providing the DB path for certain options (ex:
--remote=db:[db,]table,column). But in case we have multiple databases,
it is mandatory.

With this commit, we make the database name mandatory. This provides
increased flexibility for an upcoming commit that provides the ability
to add and remove databases during run time.

Feature #14595.
Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
10 years agoovsdb-server: Store databases in shash instead of array.
Gurucharan Shetty [Thu, 13 Jun 2013 11:30:32 +0000 (04:30 -0700)]
ovsdb-server: Store databases in shash instead of array.

An upcoming commit provides the ability to add and remove databases.
Having the databases in a shash instead of an array makes it easier
to add and remove databases.

Feature #14595.
Acked-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
10 years agoofproto-dpif: Add 'force-miss-model' configuration
Joe Stringer [Wed, 26 Jun 2013 08:25:55 +0000 (17:25 +0900)]
ofproto-dpif: Add 'force-miss-model' configuration

This adds support for specifying flow miss handling behaviour at
runtime, through a new "other-config" option in the Open_vSwitch table.
This takes precedence over flow-eviction-threshold.

By default, the behaviour is the same as before. If force-miss-model is
set to 'with-facets', then flow miss handling will always result in the
creation of new facets and flow-eviction-threshold will be ignored. If
force-miss-model is set to 'without-facets', then flow miss handling will never
result in the creation of new facets (effectively the same as setting the
flow-eviction-threshold to 0, which is not currently configurable).

We intend to use this configuration option in the testsuite to force
particular code paths to be used, allowing us to improve test coverage.

Signed-off-by: Joe Stringer <joe@wand.net.nz>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Always un-wildcard 'dl_type'.
Justin Pettit [Tue, 25 Jun 2013 23:55:36 +0000 (16:55 -0700)]
ofproto-dpif: Always un-wildcard 'dl_type'.

We always look at the fragment status and often look at other L3
headers when processing the packet, so just un-wildcard the
Ethertype.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
10 years agotunnel: Only un-wildcard the ECN bits for IP traffic.
Justin Pettit [Tue, 25 Jun 2013 23:40:50 +0000 (16:40 -0700)]
tunnel: Only un-wildcard the ECN bits for IP traffic.

With tunnels carrying IP packets, ECN bits are always inherited by
the encapsulating tunnel.  However, it doesn't make sense to
unwildcard the inner packet's TOS fields if the packet is not IP.

Found by inspection.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
10 years agoofp-parse: Fix parsing of out_port.
Ben Pfaff [Wed, 19 Jun 2013 21:01:43 +0000 (14:01 -0700)]
ofp-parse: Fix parsing of out_port.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoovs-thread: Add per-thread data support.
Ben Pfaff [Tue, 25 Jun 2013 20:50:26 +0000 (13:50 -0700)]
ovs-thread: Add per-thread data support.

POSIX defines a portable pthread_key_t API for per-thread data.  GCC and
C11 have two different forms of per-thread data that are generally faster
than the POSIX API, where they are available.  This commit adds a
macro-based wrapper, DEFINE_PER_THREAD_DATA, that takes advantage of these
features where they are available and falls back to the POSIX API
otherwise.

The Clang compiler implements C11 thread_local in its <threads.h>.

This commit also adds a convenience wrapper for the POSIX API, via the
DEFINE_PER_THREAD_MALLOCED_DATA macro.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoovs-thread: New module, initially just with pthreads wrapper functions.
Ben Pfaff [Mon, 24 Jun 2013 18:05:10 +0000 (11:05 -0700)]
ovs-thread: New module, initially just with pthreads wrapper functions.

The only tricky part here is that I'm throwing in annotations to allow
"sparse" to report unbalanced locking.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
10 years agoAdd VLAN splinters unit test.
Ben Pfaff [Tue, 25 Jun 2013 21:00:58 +0000 (14:00 -0700)]
Add VLAN splinters unit test.

CC: Ethan Jackson <ethan@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agobuild-aux/extract-ofp-errors: Delete trailing whitespaces
Alex Wang [Tue, 25 Jun 2013 18:26:41 +0000 (11:26 -0700)]
build-aux/extract-ofp-errors: Delete trailing whitespaces

Delete trailing whitespaces.

Signed-off-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agodatapath: Make OVS_ACTION_ATTR_USERSPACE action to send packet key
Andy Zhou [Tue, 25 Jun 2013 16:21:16 +0000 (09:21 -0700)]
datapath: Make OVS_ACTION_ATTR_USERSPACE action to send packet key

OVS_ACTION_ATTR_USERSPACE action was sending the key from the matching
flow. This works for exact match flows because flow keys are the
same as packet keys. However, it does not work with wildcarded flows as
the packet keys may be different than the flow keys. This patch uses
the packet keys carried in OVS_CB(skb) when calling output_userspace().

Bug #18163

Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
10 years agoofp-errors: New error code ONFBIC_DUP_INSTRUCTION.
Ben Pfaff [Mon, 24 Jun 2013 20:49:47 +0000 (13:49 -0700)]
ofp-errors: New error code ONFBIC_DUP_INSTRUCTION.

This is a prototype of OpenFlow enhancement proposal EXT-260 "Add error
code for duplicate instruction."  It uses the error code proposed there.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-errors: Implement OpenFlow 1.2+ experimenter error codes.
Ben Pfaff [Mon, 24 Jun 2013 20:49:40 +0000 (13:49 -0700)]
ofp-errors: Implement OpenFlow 1.2+ experimenter error codes.

OpenFlow 1.2 standardized experimenter error codes in a way different from
the Nicira extension.  This commit implements the OpenFlow 1.2+ version.

This commit also makes it easy to add error codes for new experimenter IDs
by adding new *_VENDOR_ID definitions to openflow-common.h.

Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agoofp-util: Support for OpenFlow 1.3 meters.
Jarno Rajahalme [Thu, 20 Jun 2013 14:26:18 +0000 (17:26 +0300)]
ofp-util: Support for OpenFlow 1.3 meters.

Signed-off-by: Jarno Rajahalme <jarno.rajahalme@nsn.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
10 years agolacp: Remove unused lacp_slave_get_port_id().
Ethan Jackson [Mon, 24 Jun 2013 22:46:42 +0000 (15:46 -0700)]
lacp: Remove unused lacp_slave_get_port_id().

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoflow: New function hash_ofp_port() and hash_ofp_port().
Ethan Jackson [Sat, 22 Jun 2013 17:33:27 +0000 (10:33 -0700)]
flow: New function hash_ofp_port() and hash_ofp_port().

These functions are used so often, that having an easy to read
helper is worth it.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif: Minor need_revalidate tweaks.
Ethan Jackson [Wed, 19 Jun 2013 02:24:44 +0000 (19:24 -0700)]
ofproto-dpif: Minor need_revalidate tweaks.

This patch makes some minor tweaks to need_revalidate sets in
ofproto-dpif.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
10 years agoofproto-dpif-ipfix: Use XXX instead of TODO.
Ethan Jackson [Sat, 22 Jun 2013 20:18:48 +0000 (13:18 -0700)]
ofproto-dpif-ipfix: Use XXX instead of TODO.

XXX is preferred over TODO according to the style guide.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>