datapath-windows: Fix CtrlLock acquire issue in OvsReadEventCmdHandler

OvsReadEventCmdHandler was calling OvsRemoveEventEntry after acquiring
CtrlLock. OvsRemoveEventEntry in turn also tries to acquire the same lock.

Added a new lock in Event.c for the eventQueue.

Signed-off-by: Ankur Sharma <ankursharma@vmware.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Acked-by: Sorin Vinturis <svinturis@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/classifier: Minimize critical section.

classifier_find_rule_exactly() only needs the mutex to protect the
list traversal.  Subtables are already RCU protected.

Locking here can be eliminated completely when RCU list is available.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Revert "lib/classifier: Minimize critical section."

This reverts commit d2064437e2bf91859a0a50fba30dcabba668a811, which
fails clang thread satefy analysis.

A more complete patch will be introduced later.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
datapath-windows: Upcall NL packet format: Add NL utilities

Add NlAttrSize and NlAttrTotalSize

Signed-off-by: Eitan Eliahu <eliahue@vmware.com>
Acked-by: Ankur Sharma <ankursharma@vmware.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath-windows: Upcall NL packet format: Parametrized Key to NL conversion.

Extend the key and tunnel key conversion to nested NL format functions use the
NL attribute as a parameter so we can use them for missed packet formatting.

Add functions for calculating the space needed for storing the key and the
tunnel key in NL format

Signed-off-by: Eitan Eliahu <eliahue@vmware.com>
Acked-by: Ankur Sharma <ankursharma@vmware.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath-windows: Upcall NL packet format: Queue elem for packe in NL format.

[1] Allocate a queue element and space to hold the packet, key, tunnel key
and user data in NL format.
[2] Format the NL header
[3] Store packet, key, tunnel key and user data in NL format
[4] Calculates and insert checksum if offloaded.

signed-off-by: Eitan Eliahu <eliahue@vmware.com>
Acked-by: Ankur Sharma <ankursharma@vmware.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath-windows: Upcall NL packet format: Call NL missed packet function

Remove hard coded queue is, pass the key rather the tunnel key,
Remove the none NL implementation

Signed-off-by: Eitan Eliahu <eliahue@vmware.com>
Acked-by: Ankur Sharma <ankursharma@vmware.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath-windows: Transactional error fix for flow dump.

My changes for trasacation error handling for not needed for dump commands.
Fixed the same.

Signed-off-by: Ankur Sharma <ankursharma@vmware.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath-windows: Making Flow parsing policies global.

In this patch we have made the Flow parsing policies global.
Pakcet execute handling requires these policies.

Signed-off-by: Ankur Sharma <ankursharma@vmware.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath-windows: OVS_PACKET_CMD_EXECUTE command handler.

In this patch we cover the basic registeration of OVS_PACKET_CMD_EXECUTE
command handler.

Signed-off-by: Ankur Sharma <ankursharma@vmware.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath-windows: changes to existing PACKET_CMD handler.

In this patch we have made following changes:

OvsPacketExecute =>
Changed the data structure to have packet and
actions as pointer (instead of zero length array). It is done because
we will not do memcpy of packet now, pointer will just point
to corresponding offset in input buffer.

OvsExecuteDpIoctl =>
We only need input buffer now. Hence Changed the function signature.

Signed-off-by: Ankur Sharma <ankursharma@vmware.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath-windows: OVS_PACKET_CMD_EXECUTE handler.

In this patch we have implemented the handler for OVS_PACKET_CMD_EXECUTE command.

Signed-off-by: Ankur Sharma <ankursharma@vmware.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
datapath-windows: Action not supported error handling

Added changes to support error handling for non supported actions.
Added changes in packet execute for sending transactional errors.

Signed-off-by: Ankur Sharma <ankursharma@vmware.com>
Acked-by: Nithin Raju <nithin@vmware.com>
Signed-off-by: Ben Pfaff <blp@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_ETH_SRC, MFF_ETH_DST,
MFF_VLAN_TCI, MFF_DL_VLAN, MFF_VLAN_VID and MFF_DL_VLAN_PCP.

Signed-off-by: Lorand Jakab <lojakab@cisco.com>
squash
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>
Address Jesse's comment #1
Address Jesse's comment #8