cascardo/ovs.git
9 years agoxenserver: Fix build spec for XenServer 6.5.
Edwin Chiu [Tue, 10 Mar 2015 18:36:43 +0000 (11:36 -0700)]
xenserver: Fix build spec for XenServer 6.5.

The latest XenServer 6.5 uses a new way for kernel version naming.
Therein, the kernel flavor could not be found anymore.  Also, the
directory name in 'lib/modules/' becomes a shortened version of
kernel version. e.g.:

[root@localhost ~]# ls /lib/modules/
3.10.0+2

As a workaround, this commit modifies the spec file to make
%{kernel_flavor} optional and %{xen_version} definable by users.
In the long run, I'd like to spend time refining the spec file.

Signed-off-by: Edwin Chiu <echiu@vmware.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
9 years agovtep: fix '--enable-shared' build and 'make distcheck'.
Daniele Di Proietto [Mon, 9 Mar 2015 13:52:08 +0000 (13:52 +0000)]
vtep: fix '--enable-shared' build and 'make distcheck'.

Found by travis.  Broken by commit 9d8215698 ('vtep: Move vtep IDL files
into new "libvtep.la".')

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agobridge: Enable RSTP if both STP and RSTP are enabled.
Ben Pfaff [Thu, 5 Mar 2015 19:12:21 +0000 (11:12 -0800)]
bridge: Enable RSTP if both STP and RSTP are enabled.

Until now, if both STP and RSTP were enabled, ovs-vswitchd would actually
enable only the one it first noticed to be enabled, and actually turn off
the setting for the other one in the database (!).  This doesn't match
ovs-vswitchd behavior for other contradictory configurations, so this
commit changes its behavior so that, if both are enabled, RSTP takes
precedence.

Reported-by: Daniele Venturino <daniele.venturino@m3s.it>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ansis Atteka <aatteka@nicira.com>
9 years agoFAQ.md: Explain why "ovs-vsctl show" shows a port but it isn't there.
Ben Pfaff [Fri, 6 Mar 2015 04:15:37 +0000 (20:15 -0800)]
FAQ.md: Explain why "ovs-vsctl show" shows a port but it isn't there.

I've explained this a lot over the years.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Gurucharan Shetty <gshetty@nicira.com>
9 years agovtep: Move vtep IDL files into new "libvtep.la".
Justin Pettit [Thu, 5 Mar 2015 08:00:03 +0000 (00:00 -0800)]
vtep: Move vtep IDL files into new "libvtep.la".

There's no reason to build it in "lib" and include it in
"libopenvswitch.la".  This commit moves it to "vtep" and includes it in
a new "libvtep.la".

Signed-off-by: Justin Pettit <jpettit@nicira.com>
9 years agowindows/syslog: Remove duplicate definition.
Gurucharan Shetty [Thu, 5 Mar 2015 14:58:52 +0000 (06:58 -0800)]
windows/syslog: Remove duplicate definition.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agonetdev-windows: Fix broken compilation.
Gurucharan Shetty [Thu, 5 Mar 2015 15:30:12 +0000 (07:30 -0800)]
netdev-windows: Fix broken compilation.

Commit 6fd6ed71cb9f(ofpbuf: Simplify ofpbuf API.) removed ofpbuf_size
and ofpbuf_data. They still had reference from netdev-windows. Fix them.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoovsdb-idlc: Generate comments for "*_set_*" functions.
Justin Pettit [Wed, 4 Mar 2015 02:04:08 +0000 (18:04 -0800)]
ovsdb-idlc: Generate comments for "*_set_*" functions.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoovsdb-idlc: Remove "*_get_*" warning from header file.
Justin Pettit [Wed, 4 Mar 2015 07:45:18 +0000 (23:45 -0800)]
ovsdb-idlc: Remove "*_get_*" warning from header file.

The warning is now captured in the C file, which has documentation for
all the public functions.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoovsdb-idlc: Add comments for remaining non-"set" non-static functions.
Justin Pettit [Tue, 3 Mar 2015 23:12:49 +0000 (15:12 -0800)]
ovsdb-idlc: Add comments for remaining non-"set" non-static functions.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoovsdb-idlc: Use column name for "*_set_*" smap arguments.
Justin Pettit [Wed, 4 Mar 2015 02:05:59 +0000 (18:05 -0800)]
ovsdb-idlc: Use column name for "*_set_*" smap arguments.

Signed-off-by: Justin Pettit <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoofproto-dpif-upcall: Create ukey only for miss upcalls.
Jarno Rajahalme [Tue, 24 Feb 2015 23:33:59 +0000 (15:33 -0800)]
ofproto-dpif-upcall: Create ukey only for miss upcalls.

There is no point trying to create ukeys for non-miss upcalls, such as
upcalls due to an explicit userspace actions (e.g, slow-pathed flows).

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoofproto-dpif-xlate: Fix indentation.
Jarno Rajahalme [Tue, 24 Feb 2015 23:33:59 +0000 (15:33 -0800)]
ofproto-dpif-xlate: Fix indentation.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoofproto-dpif-xlate: Free recirculation ID in an error case.
Jarno Rajahalme [Tue, 24 Feb 2015 23:33:59 +0000 (15:33 -0800)]
ofproto-dpif-xlate: Free recirculation ID in an error case.

Found by inspection.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoofproto-dpif-xlate: Don't translate action set when dropping.
Jarno Rajahalme [Tue, 24 Feb 2015 23:33:59 +0000 (15:33 -0800)]
ofproto-dpif-xlate: Don't translate action set when dropping.

Translate action set only if not dropping the packet.

Found by inspection.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoovs-bugtool: Improve manpage.
Ben Pfaff [Wed, 4 Mar 2015 22:19:43 +0000 (14:19 -0800)]
ovs-bugtool: Improve manpage.

The manpage was poorly organized and failed to mention some options.

Example provided by Gurucharan Shetty <gshetty@nicira.com>.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Gurucharan Shetty <gshetty@nicira.com>
9 years agolib: upgrade to DPDK v1.8.0
Mark Kavanagh [Tue, 17 Feb 2015 21:20:04 +0000 (13:20 -0800)]
lib: upgrade to DPDK v1.8.0

DPDK v1.8.0 makes significant changes to struct rte_mbuf, including
removal of the 'pkt' and 'data' fields. The latter, formally a
pointer, is now calculated via an offset from the start of the
segment buffer.  So now dp_packet data is also stored as offset
from base pointer.

Signed-off-by: Mark Kavanagh <mark.b.kavanagh@intel.com>
Signed-off-by: Rory Sexton <rory.sexton@intel.com>
Signed-off-by: Kevin Traynor <kevin.traynor@intel.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
9 years agolldp: Fix DPDK build.
Pravin B Shelar [Tue, 3 Mar 2015 22:08:58 +0000 (14:08 -0800)]
lldp: Fix DPDK build.

Fixes following dp-packet access. Removes netinet/if_ether.h
include due to duplicate definition of ether_addr.

------
In file included from /usr/include/netinet/if_ether.h:60:0,
                 from lib/lldp/lldpd.h:23,
                 from lib/ovs-lldp.h:26,
                 from lib/ovs-lldp.c:30:
/usr/include/net/ethernet.h: At top level:
/usr/include/net/ethernet.h:32:8: error: redefinition of 'struct
ether_addr'
 struct ether_addr
        ^
In file included from
../dpdk/dpdk/x86_64-native-linuxapp-gcc/include/rte_ethdev.h:179:0,
                 from lib/netdev-dpdk.h:18,
                 from lib/dp-packet.h:25,
                 from lib/ovs-lldp.h:23,
                 from lib/ovs-lldp.c:30:
../dpdk/dpdk/x86_64-native-linuxapp-gcc/include/rte_ether.h:83:8: note:
originally defined here
 struct ether_addr {
        ^
lib/ovs-lldp.c: In function 'lldp_process_packet':
lib/ovs-lldp.c:676:30: error: 'const struct dp_packet' has no member
named 'data_'
                    (char *) p->data_, p->size_);
                              ^
lib/ovs-lldp.c:676:40: error: 'const struct dp_packet' has no member
named 'size_'
                    (char *) p->data_, p->size_);
------

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agotest-hash: Do not exit check_word_hash() when there is a failure.
Alex Wang [Fri, 27 Feb 2015 05:16:14 +0000 (21:16 -0800)]
test-hash: Do not exit check_word_hash() when there is a failure.

This commit makes check_word_hash() run to finish even when there
is a failure during the run.  The test will still fail due to the
output check in AT_CHECK.  And developers can benefit from having
all failed hashes instead of only the first one.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agotest-hash: Test hash_bytes128() with single 128-bit word.
Alex Wang [Thu, 26 Feb 2015 17:54:00 +0000 (09:54 -0800)]
test-hash: Test hash_bytes128() with single 128-bit word.

This commit adds a new test for hash_bytes128() using single 128-bit
word.  The test shows that there is no collision in all 19 consecutive
bits checks, which indicates the hash function is good.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Joe Stringer <joestringer@nicira.com>
9 years agoAUTHORS: Update Alexei Froloff's email address.
Ben Pfaff [Wed, 4 Mar 2015 16:23:26 +0000 (08:23 -0800)]
AUTHORS: Update Alexei Froloff's email address.

Requested-by: "Alexey I. Froloff" <raorn@raorn.name>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agodp-packet.h: Fix a typo in #endif comment
YAMAMOTO Takashi [Wed, 4 Mar 2015 05:10:11 +0000 (14:10 +0900)]
dp-packet.h: Fix a typo in #endif comment

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agonetdev-bsd: Fix a compilation error
YAMAMOTO Takashi [Wed, 4 Mar 2015 05:08:59 +0000 (14:08 +0900)]
netdev-bsd: Fix a compilation error

Fix a compilation problem introduced by
commit cf62fa4c7074121184a1f1d07980990113657612
("dp-packet: Remove ofpbuf dependency.")

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agolldp: Fully parenthesize some macro definitions.
Ben Pfaff [Mon, 23 Feb 2015 05:07:22 +0000 (21:07 -0800)]
lldp: Fully parenthesize some macro definitions.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agolldp: Remove unused definitions from headers.
Ben Pfaff [Mon, 23 Feb 2015 05:04:47 +0000 (21:04 -0800)]
lldp: Remove unused definitions from headers.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agolldpd: Fix use of list of struct lldpd_hardware.
Ben Pfaff [Mon, 23 Feb 2015 00:55:34 +0000 (16:55 -0800)]
lldpd: Fix use of list of struct lldpd_hardware.

A list of some type should have type "struct ovs_list", not some other
type that encapsulates it.

This ovs_list is a bit puzzling in itself, because it appears to always
have exactly one element.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agolldpd: Fix use of list of struct lldpd_chassis.
Ben Pfaff [Mon, 23 Feb 2015 00:47:01 +0000 (16:47 -0800)]
lldpd: Fix use of list of struct lldpd_chassis.

A list of some type should have type "struct ovs_list", not some other
type that encapsulates it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agolldpd-structs: Declare Boolean member as one bit, not two.
Ben Pfaff [Mon, 23 Feb 2015 00:45:05 +0000 (16:45 -0800)]
lldpd-structs: Declare Boolean member as one bit, not two.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agolldpd: Remove unused members from struct lldpd.
Ben Pfaff [Mon, 23 Feb 2015 00:44:47 +0000 (16:44 -0800)]
lldpd: Remove unused members from struct lldpd.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agolldp: Use ETH_ADDR_FMT.
Ben Pfaff [Mon, 23 Feb 2015 00:36:07 +0000 (16:36 -0800)]
lldp: Use ETH_ADDR_FMT.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agolldp: Remove excessive parentheses.
Ben Pfaff [Mon, 23 Feb 2015 00:35:43 +0000 (16:35 -0800)]
lldp: Remove excessive parentheses.

The OVS style is to usually avoid parentheses in cases like these where
they just make expressions harder to read.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agolldpd: Fix return value convention for "send" function.
Ben Pfaff [Mon, 23 Feb 2015 00:34:36 +0000 (16:34 -0800)]
lldpd: Fix return value convention for "send" function.

errno values are positive values, so it's not reasonable to use E2BIG as
an error return with positive values also indicating packet lengths.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agolldpd: Remove unused ALIGNED_CAST macro.
Ben Pfaff [Tue, 3 Mar 2015 23:35:34 +0000 (15:35 -0800)]
lldpd: Remove unused ALIGNED_CAST macro.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agolldpd: Use CONTAINER_OF instead of cast, for safety.
Ben Pfaff [Mon, 23 Feb 2015 00:19:27 +0000 (16:19 -0800)]
lldpd: Use CONTAINER_OF instead of cast, for safety.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agolldpd: Remove obsolete comment.
Ben Pfaff [Mon, 23 Feb 2015 00:14:58 +0000 (16:14 -0800)]
lldpd: Remove obsolete comment.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoovs-lldp: Remove unneeded NULL checks on free().
Ben Pfaff [Mon, 23 Feb 2015 00:13:14 +0000 (16:13 -0800)]
ovs-lldp: Remove unneeded NULL checks on free().

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agolldp: Miscellaneous coding style fixes.
Ben Pfaff [Sun, 22 Feb 2015 23:59:21 +0000 (15:59 -0800)]
lldp: Miscellaneous coding style fixes.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agolldpd-structs: Fix type of c_id member.
Ben Pfaff [Sun, 22 Feb 2015 22:41:18 +0000 (14:41 -0800)]
lldpd-structs: Fix type of c_id member.

This member is typically an Ethernet address so the appropriate type is
uint8_t, not char.  This eliminates a couple of casts.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoovs-lldp: Use better types for ISID and VLANs.
Ben Pfaff [Tue, 3 Mar 2015 23:36:28 +0000 (15:36 -0800)]
ovs-lldp: Use better types for ISID and VLANs.

An ISID is 24 bits, so it fits in a uint32_t.  A VLAN is 12 bits, so it
fits in a uint16_t.  Use these types consistently, instead of int64_t.

This removes a check in aa_mapping_unregister() that seems a little
mysterious to me: it previously checked for ISID and VLAN values >= 0.  I
don't see a way that they could be < 0 in this situation though.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agolldp-structs: Fix use of list of struct lldpd_port.
Ben Pfaff [Sun, 22 Feb 2015 21:39:54 +0000 (13:39 -0800)]
lldp-structs: Fix use of list of struct lldpd_port.

A list of some type should have type "struct ovs_list", not some other
type that encapsulates it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agolldp-structs: Fix use of list of struct lldpd_mgmt.
Ben Pfaff [Sun, 22 Feb 2015 21:37:18 +0000 (13:37 -0800)]
lldp-structs: Fix use of list of struct lldpd_mgmt.

A list of some type should have type "struct ovs_list", not some other
type that encapsulates it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agolldp-structs: Fix use of list of lldpd_aa_isid_vlan_maps_tlv.
Ben Pfaff [Sun, 22 Feb 2015 21:35:00 +0000 (13:35 -0800)]
lldp-structs: Fix use of list of lldpd_aa_isid_vlan_maps_tlv.

A list of some type should have type "struct ovs_list", not some other
type that encapsulates it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agolldp: Change representation of ISID to uint32_t.
Ben Pfaff [Tue, 3 Mar 2015 23:32:59 +0000 (15:32 -0800)]
lldp: Change representation of ISID to uint32_t.

It's a lot more straightforward to deal with integer values as integers
instead of arrays of bytes.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agotest-aa: Make variables local to this file static.
Ben Pfaff [Sun, 22 Feb 2015 21:23:17 +0000 (13:23 -0800)]
test-aa: Make variables local to this file static.

Found by sparse.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agolldpd-structs: Fix spelling error in message.
Ben Pfaff [Sun, 22 Feb 2015 20:45:51 +0000 (12:45 -0800)]
lldpd-structs: Fix spelling error in message.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agolldp: Declare "bool" variables as type "bool".
Ben Pfaff [Mon, 23 Feb 2015 00:44:30 +0000 (16:44 -0800)]
lldp: Declare "bool" variables as type "bool".

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agolldp: Use "bool" for boolean variables.
Ben Pfaff [Sun, 22 Feb 2015 20:45:17 +0000 (12:45 -0800)]
lldp: Use "bool" for boolean variables.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agolldp: Use OVS time functions.
Ben Pfaff [Tue, 3 Mar 2015 23:34:07 +0000 (15:34 -0800)]
lldp: Use OVS time functions.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoovs-lldp: Use correct printf specifiers.
Ben Pfaff [Sun, 22 Feb 2015 20:37:22 +0000 (12:37 -0800)]
ovs-lldp: Use correct printf specifiers.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agolldp: Use x*alloc() functions instead of writing them out in-place.
Ben Pfaff [Tue, 3 Mar 2015 23:30:46 +0000 (15:30 -0800)]
lldp: Use x*alloc() functions instead of writing them out in-place.

Also use flexible array member instead of array of length 1 in
struct lldpd_frame.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agolldp: Get rid of POKE macros in favor of inline functions.
Ben Pfaff [Tue, 3 Mar 2015 23:26:54 +0000 (15:26 -0800)]
lldp: Get rid of POKE macros in favor of inline functions.

The POKE macros previously used here don't match the style usually used in
OVS and they require the user to know exactly how many bytes to reserve.
This commit replaces them by easier-to-use inline functions that take
advantage of the ofpbuf interface.

Also removes a few PEEK macros that weren't used anywhere.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoovs-vsctl: Fix misused casts.
Ben Pfaff [Sun, 22 Feb 2015 23:59:59 +0000 (15:59 -0800)]
ovs-vsctl: Fix misused casts.

Without the casts, the argument types match the format specifiers.

Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoauto-attach: Add auto-attach support to bridge layer and command set
Dennis Flynn [Fri, 20 Feb 2015 19:17:11 +0000 (14:17 -0500)]
auto-attach: Add auto-attach support to bridge layer and command set

This is the final commit in the series of commits that deliver initial support
for Auto-Attach. Specifically this commit delivers auto-attach support to the
OVS bridge layer as well as the new auto-attach commands. The OVSDB schema is
modified to define the new auto-attach entries. The man pages, unit tests, and
news and license notice files are also updated. A unit test is provided to
validate the construction of auto-attach packets.

Signed-off-by: Ludovic Beliveau <ludovic.beliveau@windriver.com>
Signed-off-by: Dennis Flynn <drflynn@avaya.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoauto-attach: Add auto-attach support to ofproto layer
Dennis Flynn [Fri, 20 Feb 2015 19:17:10 +0000 (14:17 -0500)]
auto-attach: Add auto-attach support to ofproto layer

Signed-off-by: Ludovic Beliveau <ludovic.beliveau@windriver.com>
Signed-off-by: Dennis Flynn <drflynn@avaya.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoauto-attach: Initial support for Auto-Attach standard
Dennis Flynn [Fri, 20 Feb 2015 19:17:09 +0000 (14:17 -0500)]
auto-attach: Initial support for Auto-Attach standard

This commit provides the initial delivery of support for the Auto-Attach
standard to Open vSwitch. This standard describes a compact method of using
IEEE 802.1AB Link Layer Discovery Protocol (LLDP) with a IEEE 802.1aq Shortest
Path Bridging (SPB) network to automatically attach network devices not
supporting IEEE 802.1ah to individual services in a SPB network. Specifically
this commit adds base LLDP support to OVS along with the LLDP extension
required to support Auto-Attach.

The base LLDP code within this commit is adapted from the open source LLDPD
project headed by Vincent Bernat. This base code is augmented with OVS specific
logic which integrates LLDP into OVS and which extends LLDP to support
Auto-Attach. The required build system changes are provided to include this new
Auto-Attach feature.

This is the first of a series of commits. Subsequent commits will be provided
to complete the task of adding Auto-Attach to OVS.

Signed-off-by: Ludovic Beliveau <ludovic.beliveau@windriver.com>
Signed-off-by: Dennis Flynn <drflynn@avaya.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agostream-ssl: Fix broken build.
Ben Pfaff [Tue, 3 Mar 2015 23:54:58 +0000 (15:54 -0800)]
stream-ssl: Fix broken build.

In all the churn around ofpbuf and dp_packet, this code seems to have been
overlooked.  This fixes the problem.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
9 years agoofpbuf: Simplify ofpbuf API.
Pravin B Shelar [Tue, 3 Mar 2015 01:29:44 +0000 (17:29 -0800)]
ofpbuf: Simplify ofpbuf API.

ofpbuf was complicated due to its wide usage across all
layers of OVS, Now we have introduced independent dp_packet
which can be used for datapath packet, we can simplify ofpbuf.
Following patch removes DPDK mbuf and access API of ofpbuf
members.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agodp-packet: Remove ofpbuf dependency.
Pravin B Shelar [Sun, 22 Feb 2015 11:21:09 +0000 (03:21 -0800)]
dp-packet: Remove ofpbuf dependency.

Currently dp-packet make use of ofpbuf for managing packet
buffers. That complicates ofpbuf, by making dp-packet
independent of ofpbuf both libraries can be optimized for
their own use case.
This avoids mapping operation between ofpbuf and dp_packet
in datapath upcalls.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agodpif_packet: Rename to dp_packet
Pravin B Shelar [Wed, 25 Feb 2015 20:01:53 +0000 (12:01 -0800)]
dpif_packet: Rename to dp_packet

dp_packet is short and better name for datapath packet
structure.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
9 years agovtep: Limit the split elements to 2 (maxsplit + 1)
Mark Maglana [Mon, 2 Mar 2015 21:41:35 +0000 (13:41 -0800)]
vtep: Limit the split elements to 2 (maxsplit + 1)

This change ensures that we always end up with two elements even
if the name of the physical port contains dashes. For example, a
binding of "0100-br0-eth1" will be split to ["0100", "br0-eth1"]
instead of ["0100", "br0", "eth1"].

Signed-off-by: Mark Maglana <mmaglana@gmail.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
9 years agoAUTHORS: Add Gianluca Merlo as an author.
Gurucharan Shetty [Tue, 3 Mar 2015 16:53:30 +0000 (08:53 -0800)]
AUTHORS: Add Gianluca Merlo as an author.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
9 years agoovs-docker: check if port is already attached for container/interface
Gianluca Merlo [Sun, 1 Mar 2015 05:05:37 +0000 (21:05 -0800)]
ovs-docker: check if port is already attached for container/interface

Reuse code for determining attached port to prevent ovs-docker to proceed if a
port for the given container and interface is already attached.

Signed-off-by: Gianluca Merlo <gianluca.merlo@gmail.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
9 years agoovs-save: Preserve IPv6 link-local address on interface save.
Alexey I. Froloff [Wed, 11 Feb 2015 12:28:52 +0000 (15:28 +0300)]
ovs-save: Preserve IPv6 link-local address on interface save.

If IPv6 link-local address is removed from interface, it is unable to
receive any IPv6 packets, including Route Advertisements.

In save_interface only skip IPv4 "scope link" addresses.

Signed-off-by: Alexey I. Froloff <raorn@raorn.name>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoofproto-dpif: Fix UFID typo.
Joe Stringer [Fri, 27 Feb 2015 19:28:09 +0000 (11:28 -0800)]
ofproto-dpif: Fix UFID typo.

While UFIDs are technically userspace flow IDs, the canonical name is
"unique flow identifiers".

Signed-off-by: Joe Stringer <joestringer@nicira.com>
9 years agodatapath: Fix masked key serialization.
Pravin B Shelar [Sun, 15 Feb 2015 22:58:51 +0000 (14:58 -0800)]
datapath: Fix masked key serialization.

Fix typo where mask is used rather than key.

Fixes: 74ed7ab9264("openvswitch: Add support for unique flow IDs.")
Reported-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
9 years agodatapath: Initialize unmasked key and uid len.
Pravin B Shelar [Sun, 15 Feb 2015 23:01:42 +0000 (15:01 -0800)]
datapath: Initialize unmasked key and uid len.

Flow alloc needs to initialize unmasked key pointer. Otherwise
it can crash kernel trying to free random unmasked-key pointer.

general protection fault: 0000 [#1] SMP
3.19.0-rc6-net-next+ #457
Hardware name: Supermicro X7DWU/X7DWU, BIOS  1.1 04/30/2008
RIP: 0010:[<ffffffff8111df0e>] [<ffffffff8111df0e>] kfree+0xac/0x196
Call Trace:
 [<ffffffffa060bd87>] flow_free+0x21/0x59 [openvswitch]
 [<ffffffffa060bde0>] ovs_flow_free+0x21/0x23 [openvswitch]
 [<ffffffffa0605b4a>] ovs_packet_cmd_execute+0x2f3/0x35f [openvswitch]
 [<ffffffffa0605995>] ? ovs_packet_cmd_execute+0x13e/0x35f [openvswitch]
 [<ffffffff811fe6fb>] ? nla_parse+0x4f/0xec
 [<ffffffff8139a2fc>] genl_family_rcv_msg+0x26d/0x2c9
 [<ffffffff8107620f>] ? __lock_acquire+0x90e/0x9aa
 [<ffffffff8139a3be>] genl_rcv_msg+0x66/0x89
 [<ffffffff8139a358>] ? genl_family_rcv_msg+0x2c9/0x2c9
 [<ffffffff81399591>] netlink_rcv_skb+0x3e/0x95
 [<ffffffff81399898>] ? genl_rcv+0x18/0x37
 [<ffffffff813998a7>] genl_rcv+0x27/0x37
 [<ffffffff81399033>] netlink_unicast+0x103/0x191
 [<ffffffff81399382>] netlink_sendmsg+0x2c1/0x310
 [<ffffffff811007ad>] ? might_fault+0x50/0xa0
 [<ffffffff8135c773>] do_sock_sendmsg+0x5f/0x7a
 [<ffffffff8135c799>] sock_sendmsg+0xb/0xd
 [<ffffffff8135cacf>] ___sys_sendmsg+0x1a3/0x218
 [<ffffffff8113e54b>] ? get_close_on_exec+0x86/0x86
 [<ffffffff8115a9d0>] ? fsnotify+0x32c/0x348
 [<ffffffff8115a720>] ? fsnotify+0x7c/0x348
 [<ffffffff8113e5f5>] ? __fget+0xaa/0xbf
 [<ffffffff8113e54b>] ? get_close_on_exec+0x86/0x86
 [<ffffffff8135cccd>] __sys_sendmsg+0x3d/0x5e
 [<ffffffff8135cd02>] SyS_sendmsg+0x14/0x16
 [<ffffffff81411852>] system_call_fastpath+0x12/0x17

Reported-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
9 years agodatapath: Add support for unique flow IDs.
Joe Stringer [Thu, 22 Jan 2015 00:42:52 +0000 (16:42 -0800)]
datapath: Add support for unique flow IDs.

Previously, flows were manipulated by userspace specifying a full,
unmasked flow key. This adds significant burden onto flow
serialization/deserialization, particularly when dumping flows.

This patch adds an alternative way to refer to flows using a
variable-length "unique flow identifier" (UFID). At flow setup time,
userspace may specify a UFID for a flow, which is stored with the flow
and inserted into a separate table for lookup, in addition to the
standard flow table. Flows created using a UFID must be fetched or
deleted using the UFID.

All flow dump operations may now be made more terse with OVS_UFID_F_*
flags. For example, the OVS_UFID_F_OMIT_KEY flag allows responses to
omit the flow key from a datapath operation if the flow has a
corresponding UFID. This significantly reduces the time spent assembling
and transacting netlink messages. With all OVS_UFID_F_OMIT_* flags
enabled, the datapath only returns the UFID and statistics for each flow
during flow dump, increasing ovs-vswitchd revalidator performance by 40%
or more.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agocompat: Add genlmsg_parse() helper function.
Joe Stringer [Thu, 22 Jan 2015 00:42:51 +0000 (16:42 -0800)]
compat: Add genlmsg_parse() helper function.

The first user will be the next patch.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agodatapath: Use sw_flow_key_range for key ranges.
Joe Stringer [Thu, 22 Jan 2015 00:42:50 +0000 (16:42 -0800)]
datapath: Use sw_flow_key_range for key ranges.

These minor tidyups make a future patch a little tidier.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agodatapath: Refactor ovs_flow_tbl_insert().
Joe Stringer [Thu, 22 Jan 2015 00:42:49 +0000 (16:42 -0800)]
datapath: Refactor ovs_flow_tbl_insert().

Rework so that ovs_flow_tbl_insert() calls flow_{key,mask}_insert().
This tidies up a future patch.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agodatapath: Refactor ovs_nla_fill_match().
Joe Stringer [Thu, 22 Jan 2015 00:42:48 +0000 (16:42 -0800)]
datapath: Refactor ovs_nla_fill_match().

Refactor the ovs_nla_fill_match() function into separate netlink
serialization functions ovs_nla_put_{unmasked_key,mask}(). Modify
ovs_nla_put_flow() to handle attribute nesting and expose the 'is_mask'
parameter - all callers need to nest the flow, and callers have better
knowledge about whether it is serializing a mask or not.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agotest-hash: Remove the check_word_hash() for hash_bytes128_cb.
Alex Wang [Fri, 27 Feb 2015 17:07:18 +0000 (09:07 -0800)]
test-hash: Remove the check_word_hash() for hash_bytes128_cb.

The original test fails on big-endian system due to the hash function
performing not as well when input is uint32_t.  In reality, users should
only use hash_bytes128() to hash words larger than 128 bits (e.g. struct
flow).  Besides, we do check the 1-bit set case for 16 128-bit words in
following test case.  Therefore, the cleanest way to fix the failure
in big-endian system seems to be just removing the check_word_hash()
test for hash_bytes128_cb.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agotest-hash: Refine the check_256byte_hash().
Alex Wang [Thu, 26 Feb 2015 00:12:23 +0000 (16:12 -0800)]
test-hash: Refine the check_256byte_hash().

This commit refines the check_256byte_hash() function by moving
some checks to outer loop.

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agotest-hash: Make check_256byte_hash() test no 1-bits set case.
Alex Wang [Wed, 25 Feb 2015 23:08:51 +0000 (15:08 -0800)]
test-hash: Make check_256byte_hash() test no 1-bits set case.

The test comment mentions that we will test the no 1-bits set case.
So, this commit makes sure that it is tested.

Signed-off-by: Alex Wang <alexw@nicira.com>
---
PATCH->V2:
- explain why calling set_bit128 with i or j == n_bits is okay.

9 years agoutil: Fix typo in comment.
Ben Pfaff [Fri, 27 Feb 2015 04:26:05 +0000 (20:26 -0800)]
util: Fix typo in comment.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
9 years agodatapath: Fix return of uninitialized variable.
Alex Wang [Thu, 26 Feb 2015 06:32:52 +0000 (22:32 -0800)]
datapath: Fix return of uninitialized variable.

This commit fixes a return of uninitialized variable bug.
The bug can cause failures of operations like flow_add.

VMware-BZ: #1405810

Signed-off-by: Alex Wang <alexw@nicira.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
9 years agoOpenFlow 1.5 is final, so change OF1.5 draft references to just say OF1.5.
Ben Pfaff [Wed, 25 Feb 2015 05:02:50 +0000 (21:02 -0800)]
OpenFlow 1.5 is final, so change OF1.5 draft references to just say OF1.5.

Reported-by: Jean Tourrilhes <jt@hpl.hp.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jean Tourrilhes <jt@hpl.hp.com>
9 years agoovsdb: Raise the jsonrpc server session limit
Andy Zhou [Tue, 24 Feb 2015 07:20:17 +0000 (23:20 -0800)]
ovsdb: Raise the jsonrpc server session limit

Raise the connection limit to allow larger number of concurrent
ovsdb-server connections. Note, ovsdb-server may not perform well
at the new limit. It is rather a prelude to further scaling tests and
optimizations.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoovsdb: Warn about reaching max session limit
Andy Zhou [Tue, 24 Feb 2015 07:15:23 +0000 (23:15 -0800)]
ovsdb: Warn about reaching max session limit

Without the log message, it was not obvious why ovsdb-server no longer
accepts new connections when the session limit was reached. This patch
adds a log message to make it obvious.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoFAQ.md: Mention Linux version that first could handle IPFIX flow monitoring.
Ben Pfaff [Sun, 22 Feb 2015 19:29:54 +0000 (11:29 -0800)]
FAQ.md: Mention Linux version that first could handle IPFIX flow monitoring.

I think that the critical commit is commit 4490108b4a5ada (openvswitch:
Allow OVS_USERSPACE_ATTR_USERDATA to be variable length.), which first
appeared in Linux 3.10.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Romain Lenglet <romain.lenglet@oracle.com>
9 years agostream-tcp: Remove extra initializer in pwindows_pstream_class.
Saurabh Shah [Tue, 24 Feb 2015 00:28:56 +0000 (16:28 -0800)]
stream-tcp: Remove extra initializer in pwindows_pstream_class.

commit c2e3cbaf ("stream: Eliminate pstream_set_dscp().") removed
the set_dscp() callback from pstream_class.

Signed-off-by: Saurabh Shah <ssaurabh@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoovs-docker: Use a different mechanism to check for commands.
Gurucharan Shetty [Mon, 23 Feb 2015 05:52:04 +0000 (21:52 -0800)]
ovs-docker: Use a different mechanism to check for commands.

Currently, the script uses '--version' option from different commands
to check for their availability. uuidgen on Centos6 has been reported
not to have the '--version' option causing failure in script invocation.

This commit looks for the utilities in $PATH instead. The code is
copied from build-aux/dist-docs.

Reported-by: Michael J. Smalley <michaeljsmalley@gmail.com>
Suggested-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoovs-sandbox: Add -d option to run ovsdb-server under GDB
Andy Zhou [Fri, 20 Feb 2015 21:01:36 +0000 (13:01 -0800)]
ovs-sandbox: Add -d option to run ovsdb-server under GDB

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agoovs-sandbox: Show the running program on xterm's title
Andy Zhou [Fri, 20 Feb 2015 20:55:25 +0000 (12:55 -0800)]
ovs-sandbox: Show the running program on xterm's title

When debugging multiple programs under GDB, it will be easier to
identify xterms with the program name displayed as title. Without
this patch, xterms will have the title of "gdb", which is the first
program the xterm executes. This change is useful for the next patch.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agodatapath: Account for "openvswitch: Add support for checksums on UDP tunnels."
Jesse Gross [Wed, 18 Feb 2015 01:46:09 +0000 (17:46 -0800)]
datapath: Account for "openvswitch: Add support for checksums on UDP tunnels."

Upstream commit:
    openvswitch: Add support for checksums on UDP tunnels.

    Currently, it isn't possible to request checksums on the outer UDP
    header of tunnels - the TUNNEL_CSUM flag is ignored. This adds
    support for requesting that UDP checksums be computed on transmit
    and properly reported if they are present on receive.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream: b8693877 ("openvswitch: Add support for checksums on UDP tunnels.")
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
9 years agodatapath: Backport upstream Geneve implementation.
Jesse Gross [Fri, 6 Feb 2015 21:24:27 +0000 (13:24 -0800)]
datapath: Backport upstream Geneve implementation.

This resolves the differences between the OVS Geneve implementation
and the upstream kernel, particularly in the area of the split
between vport-geneve.c and the generic Geneve data plane.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
9 years agodatapath: Account for "udp: Do not require sock in udp_tunnel_xmit_skb"
Jesse Gross [Wed, 18 Feb 2015 01:28:58 +0000 (17:28 -0800)]
datapath: Account for "udp: Do not require sock in udp_tunnel_xmit_skb"

Upstream commit:
    udp: Do not require sock in udp_tunnel_xmit_skb

    The UDP tunnel transmit functions udp_tunnel_xmit_skb and
    udp_tunnel6_xmit_skb include a socket argument. The socket being
    passed to the functions (from VXLAN) is a UDP created for receive
    side. The only thing that the socket is used for in the transmit
    functions is to get the setting for checksum (enabled or zero).
    This patch removes the argument and and adds a nocheck argument
    for checksum setting. This eliminates the unnecessary dependency
    on a UDP socket for UDP tunnel transmit.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream: d998f8ef ("udp: Do not require sock in udp_tunnel_xmit_skb")
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
9 years agodatapath: Account for "vlan: introduce *vlan_hwaccel_push_inside helpers"
Jesse Gross [Wed, 18 Feb 2015 00:06:42 +0000 (16:06 -0800)]
datapath: Account for "vlan: introduce *vlan_hwaccel_push_inside helpers"

Upstream commit:
    vlan: introduce *vlan_hwaccel_push_inside helpers

    Use them to push skb->vlan_tci into the payload and avoid code
    duplication.

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream: 5968250c ("vlan: introduce *vlan_hwaccel_push_inside helpers")
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
9 years agodatapath: Use additional common UDP functions for LISP.
Jesse Gross [Mon, 9 Feb 2015 19:35:44 +0000 (11:35 -0800)]
datapath: Use additional common UDP functions for LISP.

LISP can also take advantage of setup_udp_tunnel_sock() and
udp_tunnel_xmit_skb() to increase code reuse.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
9 years agodatapath: Account for "vxlan: Refactor vxlan driver to make use of the common UDP...
Jesse Gross [Sun, 8 Feb 2015 06:40:52 +0000 (22:40 -0800)]
datapath: Account for "vxlan: Refactor vxlan driver to make use of the common UDP tunnel functions."

Upstream commit:
    vxlan: Refactor vxlan driver to make use of the common UDP tunnel functions.

    Simplify vxlan implementation using common UDP tunnel APIs.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Using the upstream functions where available also has the side effect
of ensuring that we can use hardware offloads. The GBP changes forced
the use of the OVS emulated GSO path on kernels that lack GBP. This
resulted in the loss of VXLAN offload on earlier kernels. This restores
the offload support (for both GBP and non-GBP VXLAN).

Upstream: acbf74a7 ("vxlan: Refactor vxlan driver to make use of the common UDP tunnel functions.")
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
9 years agodatapath: Consistently set skb->inner_protocol for tunnels.
Jesse Gross [Wed, 18 Feb 2015 00:27:04 +0000 (16:27 -0800)]
datapath: Consistently set skb->inner_protocol for tunnels.

skb->inner_protocol is used by GSO and TSO for tunnels on new
kernels. Since we are setting up packets to be handled by the
kernel's GSO and not just our own, we need to initialize this
field properly.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
9 years agodatapath: Account for "udp-tunnel: Add a few more UDP tunnel APIs"
Jesse Gross [Sat, 7 Feb 2015 03:25:09 +0000 (19:25 -0800)]
datapath: Account for "udp-tunnel: Add a few more UDP tunnel APIs"

Upstream commit:
    udp-tunnel: Add a few more UDP tunnel APIs

    Added a few more UDP tunnel APIs that can be shared by UDP based
    tunnel protocol implementation. The main ones are highlighted below.

    setup_udp_tunnel_sock() configures UDP listener socket for
    receiving UDP encapsulated packets.

    udp_tunnel_xmit_skb() and upd_tunnel6_xmit_skb() transmit skb
    using UDP encapsulation.

    udp_tunnel_sock_release() closes the UDP tunnel listener socket.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream: 6a93cc90 ("udp-tunnel: Add a few more UDP tunnel APIs")
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
9 years agodatapath: Enable OVS GSO to be used up to 3.18 if necessary.
Jesse Gross [Wed, 18 Feb 2015 22:27:17 +0000 (14:27 -0800)]
datapath: Enable OVS GSO to be used up to 3.18 if necessary.

There are two important GSO tunnel features that were introduced
after the 3.12 cutoff for our current out of tree GSO implementation:
 * 3.16 introduced support for outer UDP checksums.
 * 3.18 introduced support for verifying hardware support for protocols
   other than VXLAN.

In cases where these features are used, we should use OVS GSO to
ensure correct behavior. However, we also want to continue to use
kernel GSO or hardware TSO in existing situations. Therefore, this
extends the range of kernels where OVS GSO is available to 3.18 and
makes it easier to select which one to use.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Pravin B Shelar <pshelar@nicira.com>
9 years agodatapath: Fix net exit.
Pravin B Shelar [Fri, 20 Feb 2015 22:59:47 +0000 (14:59 -0800)]
datapath: Fix net exit.

Open vSwitch allows moving internal vport to different namespace
while still connected to the bridge. But when namespace deleted
OVS does not detach these vports, that results in dangling
pointer to netdevice which causes kernel panic as follows.
This issue is fixed by detaching all ovs ports from the deleted
namespace at net-exit.

BUG: unable to handle kernel NULL pointer dereference at 0000000000000028
IP: [<ffffffffa0aadaa5>] ovs_vport_locate+0x35/0x80 [openvswitch]
Oops: 0000 [#1] SMP
Call Trace:
 [<ffffffffa0aa6391>] lookup_vport+0x21/0xd0 [openvswitch]
 [<ffffffffa0aa65f9>] ovs_vport_cmd_get+0x59/0xf0 [openvswitch]
 [<ffffffff8167e07c>] genl_family_rcv_msg+0x1bc/0x3e0
 [<ffffffff8167e319>] genl_rcv_msg+0x79/0xc0
 [<ffffffff8167d919>] netlink_rcv_skb+0xb9/0xe0
 [<ffffffff8167deac>] genl_rcv+0x2c/0x40
 [<ffffffff8167cffd>] netlink_unicast+0x12d/0x1c0
 [<ffffffff8167d3da>] netlink_sendmsg+0x34a/0x6b0
 [<ffffffff8162e140>] sock_sendmsg+0xa0/0xe0
 [<ffffffff8162e5e8>] ___sys_sendmsg+0x408/0x420
 [<ffffffff8162f541>] __sys_sendmsg+0x51/0x90
 [<ffffffff8162f592>] SyS_sendmsg+0x12/0x20
 [<ffffffff81764ee9>] system_call_fastpath+0x12/0x17

Reported-by: Assaf Muller <amuller@redhat.com>
Fixes: 46df7b81454("openvswitch: Add support for network namespaces.")
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Reviewed-by: Thomas Graf <tgraf@noironetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Upstream: 7b4577a9da ("openvswitch: Fix net exit").
Acked-by: Andy Zhou <azhou@nicira.com>
9 years agoINSTALL.Docker: Fix malformed sentence.
Gurucharan Shetty [Fri, 20 Feb 2015 19:12:32 +0000 (11:12 -0800)]
INSTALL.Docker: Fix malformed sentence.

While adding support to Github markup language, the sentence had
gotten malformed.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
9 years agouserspace: Replace all uses of strncpy() by ovs_strlcpy().
Ben Pfaff [Fri, 20 Feb 2015 20:32:08 +0000 (12:32 -0800)]
userspace: Replace all uses of strncpy() by ovs_strlcpy().

strncpy() has a lot of pitfalls.  A while back we replaced all its uses by
calls to ovs_strlcpy() or ovs_strzcpy(), but some more have crept in.  This
commit fixes them.

Reported-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
9 years agosocket-util: Use correct address family in set_dscp(), instead of guessing.
Ben Pfaff [Fri, 20 Feb 2015 19:30:50 +0000 (11:30 -0800)]
socket-util: Use correct address family in set_dscp(), instead of guessing.

The set_dscp() function, until now, tried to set the DSCP as IPv4 and as
IPv6. This worked OK on Linux, where an ENOPROTOOPT error made it really
clear which one was wrong, but FreeBSD uses EINVAL instead, which has
multiple meanings and which it therefore seems somewhat risky to ignore.
Instead, this commit just tries to set the correct address family's DSCP
option.

Tested by Alex Wang on FreeBSD 9.3.

Reported-by: Atanu Ghosh <atanu@acm.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Co-authored-by: Alex Wang <alexw@nicira.com>
Signed-off-by: Alex Wang <alexw@nicira.com>
Tested-by: Alex Wang <alexw@nicira.com>
9 years agostream: Eliminate pstream_set_dscp().
Ben Pfaff [Fri, 20 Feb 2015 16:44:48 +0000 (08:44 -0800)]
stream: Eliminate pstream_set_dscp().

This function is really of marginal utility.  This commit drops it and
makes the existing callers instead open a new pstream with the desired
dscp.

The ulterior motive here is that the set_dscp() function that actually sets
the DSCP on a socket really wants to know the address family (AF_INET vs.
AF_INET6).  We could plumb that down through the stream code, and that's
one reasonable option, but I thought that simply eliminating some calls
to set_dscp() where we don't already have the address family handy was
another reasonable way to go.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Alex Wang <alexw@nicira.com>
9 years agotimeval: Remove duplicate memset().
Russell Bryant [Fri, 20 Feb 2015 18:22:14 +0000 (13:22 -0500)]
timeval: Remove duplicate memset().

init_clock begins with a memset of 0 of the full clock struct.  This
memset at the end of a single struct member just makes extra sure that
it's set to 0, which is unnecessary.

Signed-off-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
9 years agoFAQ.md: Update LTS release version number from 1.9 to 2.3.
Ben Pfaff [Fri, 20 Feb 2015 17:01:17 +0000 (09:01 -0800)]
FAQ.md: Update LTS release version number from 1.9 to 2.3.

The 2.3 branch has been the long-term release for a while now, but somehow
we forgot to update the FAQ.

Reported-by: Kentaro Ebisawa <ebiken.g@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Gurucharan Shetty <gshetty@nicira.com>