datapath-windows: Don't leak NBLs with multiple NBs.

Currently, if we receive an NBL with multiple NBs from NDIS, we just
ASSERT() and not do anything. The right thing to do obviously is to
process the NBL. This is a work in progress.

In the meantime, we should complete the NBL and not just leak it.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Tested-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath-windows: Nuke USE_NEW_VPORT_ADD_WORKFLOW.

We were using USE_NEW_VPORT_ADD_WORKFLOW while transitioning from old
workflow for adding ports. We don't need it anymore.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath-windows: Fix locking code in OvsGetNetdevCmdHandler().

We were acquiring locks twice, and forgotten to release a lock in an
error case.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath-windows: Increase the maximum size of port name.

In userspace, port name sizes are restricted to IFNAMSIZ which is
defined to IF_NAME_SIZE in:
C:\Program Files (x86)\Windows Kits\8.1\Include\shared\netioapi.h

In the kernel, since IFNAMSIZ was not available, we previously defined a
value of 16 for the kernel. This is restrictive for Openstack
integration where we use UUID as the name.

In this patch, we make the kernel code also use the same value as the
userspace.

Also updated is the OVS.psm1 powershell script which now allows friendly
names to be upto 48 bytes.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
AUTHORS: Add Scott Lowe <scott.lowe@scottlowe.org>.

Contributors to the webpage deserve authorship credit too.

CC: Scott Lowe <scott.lowe@scottlowe.org>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ovs-ofctl: Free group buckets.

To some extent this is cosmetic because ovs-ovfctl will immediately
exit. However, it does seem to be in keeping with freeing 'gms' in
ofctl_group_mod_file().

Found by inspection using make check-valgrind.

Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofp-print-ofctl: Free group buckets.

Found by inspection using make check-valgrind.

Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ovs-ofctl: Improve error message for meter=0.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
odp-util: Fix segfault in MPLS attribute parsing.

Just because the ethertype is MPLS, this doesn't mean that the datapath
understands and provides OVS_KEY_ATTR_MPLS attributes for the flow.
Previously we would check the size of the OVS_KEY_ATTR_MPLS attribute
before checking whether the attribute is present. This would cause a
segfault in nl_attr_get_size(), usually triggered from a handler thread.

This patch brings the MPLS parsing code more in line with the rest of
the parse_l2_5_onward() function, by only processing MPLS if the
attribute is present.

Reported-by: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: Joe Stringer <joestringer@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
classifier: Use rculist.

The list of identical, but lower priority rules is not currently used
in classifier lookup.  A later patch introducing conjunctive matches
needs to access the list during lookups, so we must make the list RCU.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
test-classifier: Ensure priority is not INT_MIN.

Classifier reserves the priority value INT_MIN for its own use.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
packets: Use WORDS_BIGENDIAN for struct geneve_opt.

The macro LITTLE_ENDIAN is a constant, not a test for endianness,
so it doesn't actually tell us anything about the machine.
WORDS_BIGENDIAN is both correct and defined by configure so it is
more portable.

Reported-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
xenserver: Turn on SSE and SSE2 for the build, for atomic 64-bit ops.

The ovs-atomic-i586 implementation of atomic operations can implement
64-bit atomics more efficiently when SSE is supported.  XenServer runs only
on 64-bit capable processors, in 32-bit mode, so we know on XenServer that
SSE and SSE2 are supported because they are architectural for amd64.  Thus,
this commit enables SSE and SSE2 when building for XenServer to get the
improved atomics support.

I tested that this successfully adds -msse -msse2 to the compiler flags
inside a XenServer DDK, but I didn't actually run it on a real XenServer
install.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
route-table: get rid of name-table

name table maintains device ifindex to name mapping.  On any name
table changes it invalidate name table and routing table. So
rather than building two tables this patch moves dev name to routing
entry and build routing table on any name table changes.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
route-table: Use classifier to store routing table.

Rather than using hmap for storing routing entries we can directly use
classifier which has support for priority and wildcard entries.
This makes route lookup lockless. This help when we use route lookup
for native tunneling.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
route-table: extract gw information.

Routing table will be used by ovs userspace tunneling, it need to
know gw address, following commit extract gw information from
netlink message so that ovs can populate it in ovs route table.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Thomas Graf <tgraf@noironetworks.com>
tests/ofproto-dpif - fragment handling: Add detail.

Add transport port modifications to the existing frags handling test
case.

This demonstrates incorrect behavior by not moving the destination
port number to source port in normal mode for first fragment, as the
transport port numbers have been zeroed and the move has no effect,
and by allowing moves to/from transport ports on later fragments
(which do not have a transport header).

Next patches fix these problems.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ofproto-dpif-xlate: Do not clear ports with frags in xlate_actions().

Transport ports are already cleared for lookup if need be, and they
should be available for action processing, so do not clear them in
xlate_actions().

A drop flow takes care of dropping the packet, so no special case is
needed in xlate_actions().

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
datapath: Fix compat checks for ipv6_skip_exthdr()

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
nx-match: Add support for multiple OXM field assignments for one field.

actset_output, to be added in an upcoming commit, has one OXM assignment
in OpenFlow 1.3 and another one in OpenFlow 1.5.  This commit allows both
of them to be supported in appropriate OpenFlow versions.

This feature is difficult to test on its own, so the same commit that adds
actset_output support also tests this feature.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>