Fix build break in ofproto/tunnel.c for windows platform.

The breakage was introduced by commit: a36de779
("openvswitch: Userspace tunneling.").

Reported-by: Edwin Chiu <echiu@nicira.com>
Signed-off-by: Saurabh Shah <ssaurabh@vmware.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
datapath-windows: fixes in OvsGetExtInfoIoctl()

A few fixes around locking.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Ankur Sharma <ankursharma@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
datapath-windows: add WCHAR version of OvsFindVportByHvName()

In this patch, we rename the existing OvsFindVportByHvName() to
OvsFindVportByHvNameA() to indicate that the input string is an ASCII
string. We also define a OvsFindVportByHvNameW() that takes as input a
WCHAR string.

This will be used later in HvCreatPort() to check for ports with
duplicate names.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Ankur Sharma <ankursharma@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
datapath-windows: clarify 'portIdHashArray' in the swithc context

In this patch, we update the documentation for 'portIdHashArray' to
indicate that a vport would exist in this hash table if and only if it
also exists on the Hyper-V switch.

This functionality to implement this semantic will follow in subsequent
patches.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
datapath-windows: Changes to OvsRemoveAndDeleteVport()

In this patch, we add changes to OvsRemoveAndDeleteVport() to allow the
caller to specify if a vport is being deleted because it got deleted on
Hyper-V or if it got deleted from OVS userspace.

The reason we need to make the distinction is to be able to delete the
vport from the relevant hash tables.

If a port has been deleted from all the hash tables ie. has been deleted
from Hyper-V as well as OVS userspace, it gets deallocated.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Ankur Sharma <ankursharma@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
datapath-windows: Changes to InitOvsVportCommon()

If a Hyper-V port (for which there exists an OVS port), gets deleted and
re-added, we'll call into InitOvsVportCommon() for the port to insert
the port into the 'portIdHashArray' as well as do a few other
initialization in the switch ocntext.

We should not be incrementing 'numHvPorts' at this point since this
vport has been counted before when it was first allocated. To account
for this, we add a new parameter to InitOvsVportCommon(). The arguments
passed by some of the callers are not 100% correct, and will be fixed in
future commit in the series.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Ankur Sharma <ankursharma@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
datapath-windows: Change return type of OvsInitVxlanTunnel()

OvsInitVxlanTunnel() need not return a NL_ERROR. In this patch, we
change it to NTSTATUS, and also update the mapping function that maps a
NTSTATUS to NL_ERROR.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Ankur Sharma <ankursharma@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
datapath-windows: Fixes in HvCreatePort() to re-add a port

In this patch, we update HvCreatePort() to be able to re-add a Hyper-V
port. Specifically, we handle the case where the port had also been
added by OVS userspace, so that when the port was previously deleted
from Hyper-V, we did not deallocate the port.

The key to a vport is its name. We lookup the list of vports both in the
'portIdHashArray' as well as 'portNoHashArray' to make sure that we
don't have a port with the same name.

Validation:
- deleted an re-added a port with and without the corresponding OVS port
existing
- deleted, changed the name of a port, and re-added it back with and
without the corresponding OVS port existing.
- uninstall was succcessful. No asserts hit.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Ankur Sharma <ankursharma@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
datapath-windows: Avoid BSOD when switch context is NULL

I came around a BSOD that happened when trying to access pidHashLock
from the gOvsSwitchContext, which was NULL. The stop happened in
OvsAcquirePidHashLock function.

To reproduce this BSOD, make sure the extension is enabled and running,
disable it and, after that, execute 'ovs-dpctl.exe show'. The BSOD is
triggered afterwards.

Signed-off-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Reported-at: https://github.com/openvswitch/ovs-issues/issues/53
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
datapath-windows: nuke non-netlink based interface

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
datpath-windows: include/OvsPub.h => ovsext/DpInternal.h

OvsPub.h is not longer the interface file that published the interface
of the kernel datapath to userspace. Nevertheless it is still being used
internal to the kernel datapath.

We rename the file for this reason.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
datapath-windows: cleanup DpInternal.h

Getting rid of unused definitions in DpInternal.h.

This is only the first round. There's scope for more cleanup.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
datpaath-windows: consolidate check for output buffer

Earlier, output buffer was optional in a transaction command. Thus each
command handler, had to check if the output buffer had indeed been
specified by userspace or not.

Now that output buffer is mandatory in transaction command, let's
consolidate the check in one place, and also convert the previous check
to ASSERTs.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
datapath-windows: rename 'hvDeleted' to 'isPresentOnHv'

'hvDeleted' was originally added to track vports that got deleted from
the Hyper-V switch, but which still exists in OVS. Since then, it has
taken a new meaning: eg. it is set to TRUE for VXLAN ports which don't
exist on the Hyper-V switch at all.

Hence renaming it to something more appropriate.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
NEWS: Information about Ixia ANVL testing.

Update the NEWS section with some information about testing.

Signed-off-by: Martino Fornasa <mf@fornasa.it>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
ovs-vsctl: Update RSTP documentation.

Mention that the AUTO detection of admin point to point MAC parameter
is not implemented.

Signed-off-by: Martino Fornasa <mf@fornasa.it>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
Change Travis CI notification email to ljakab@ac.upc.edu
userspace: add support for pop_eth and push_eth actions

These actions will allow L2->L3 and L3->L2 switching, and are supposed
to be added to flows installed in the datapath transparently by
ovs-vswitchd.

Signed-off-by: Lorand Jakab <lojakab@cisco.com>
userspace: add layer 3 flow and switching support

This commit relaxes the assumption that all packets have an Ethernet
header, and adds support for layer 3 flows.  For each packet received on
the Linux kernel datapath the l2 and l3 members of struct ofpbuf are
intialized appropriately, and some functions now expect this (notably
flow_extract()), in order to differentiate between layer 2 and layer 3
packets.  struct flow has now a new 'base_layer' member, because we
cannot assume that a flow has no Ethernet header when eth_src and
eth_dst are 0.  For layer 3 packets, the protocol type is still stored
in the eth_type member.

Switching L2->L3 and L3->L2 are both implemented by adding the pop_eth
and push_eth actions respectively when a transition is detected.  The
push_eth action puts 0s on both source and destination MACs.  These
addresses can be modified with mod_dl_dst and mod_dl_src actions.

Added new prerequisite MFP_ETHERNET for fields MFF_VLAN_TCI,
MFF_DL_VLAN, MFF_VLAN_VID and MFF_DL_VLAN_PCP.

Signed-off-by: Lorand Jakab <lojakab@cisco.com>
datapath: add layer 3 flow/port support

Implementation of the pop_eth and push_eth actions in the kernel, and
layer 3 flow support.

Signed-off-by: Lorand Jakab <lojakab@cisco.com>