getrusage-windows: getrusage() for Windows.

We use getrusage mainly to get user CPU time and system CPU time.
Windows has a GetProcessTimes and GetThreadTimes that does the
same job. So use them.

We also use getrusage to get page faults. Use GetProcessMemoryInfo()
for that.

We also get number of context switches, block i/o times and use it for
debug information when we wake up from poll_block late. I haven't found
functions for that in Windows. We only use it for debug information, so
it should be okay not implementing it.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Co-authored-by: Linda Sun <lsun@vmware.com>
Signed-off-by: Linda Sun <lsun@vmware.com>
Acked-by: Ben Pfaff <blp@nicira.com>
upcall: Configure datapath max-idle through ovs-vsctl.

This patch adds a new configuration option, "max-idle" to the
Open_vSwitch "other-config" column. This sets how long datapath flows
are cached in the datapath before revalidators expire them.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Justin Pettit <jpettit@nicira.com>
datapath: Add support for Linux 3.12

Bump kernel support for datapath module to include 3.12.
Make use of native ip-tunnel API for Kernel >= 3.12.

Based on patch from James Page.

Signed-off-by: James Page <james.page@ubuntu.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Reviewed-by: Kyle Mestery <mestery@noironetworks.com>
netdev-linux: Remove unnecessary header.

netdev-linux does not depend on linux kernel version. So
remove header file include.

Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
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>
datapath: add layer 3 flow/port support

Implementation of the pop_eth and push_eth actions in the kernel, also
layer 3 flow support.  Jesse Gross provided feedback on a previous
version of this RFC patch, all of those comments are resolved here.

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