Use __linux__ instead of LINUX_DATAPATH in C code.

The LINUX_DATAPATH C preprocessor symbol was originally meant to be used as
a signal for whether the Linux datapath module could be used, but it was
used as a proxy for a lot of other stuff that is really just Linux
specific.  This commit switches all of these users to just test for
__linux__, which is more straightforward and should have the same result.

CC: Luigi Rizzo <rizzo@iet.unipi.it>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Makefile: Compile Linux-specific files based on __linux__ macro.

We want to conditionally compile several files based on whether we're
building for a Linux host, so we need some Automake conditional for that.
Previously this was based on whether Netlink is available and we're not
on ESX (since ESX has Netlink but isn't Linux), but it's more
straightforward to just test for Linux directly.

CC: Luigi Rizzo <rizzo@iet.unipi.it>
Signed-off-by: Ben Pfaff <blp@nicira.com>
timeval: clock_gettime() for Windows.

QueryPerformanceCounter() retrieves the current value of the performance
counter, which is a high resolution (<1us) time stamp that can be used for
time-interval measurements. So, use it for MONOTONIC clock.

The GetSystemTimePreciseAsFileTime() function retrieves the current system date
and time with the highest possible level of precision (<1us). Use it for
real time clock. This function returns a counter representing the number of
100-nanosecond intervals since January 1, 1601. To make it compatible with
Linux CLOCK_REALTIME, we need to calculate the 100-nanoseconds counter value
till 01/01/1970.

An upcoming commit implements gettimeofday() using the same clock, so,
carve out a function.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
timeval: gettimeofday() for Windows.

Use GetSystemTimePreciseAsFileTime() for gettimeofday().
GetSystemTimePreciseAsFileTime() provides the result that is more
high resolution than just the microsecond that gittimeofday() in
Linux provides. So we need to remove some additional precision.

Signed-off-by: Gurucharan Shetty <gshetty@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
Initial noEthernetOnly work
Changes asked by Jesse
Add is_layer3 property to struct ofport_dpif
Implement format_odp_action() for push/pop eth
Fix whitespace according to style
Remove unnecessary assignment after rebase
Shifting TODOs
dataplane: fix layer 3 marking
Implement L2 -> L3 switching
ofproto-dpif: fix some unit tests

port->is_layer3 is uninitialized when patch ports are added, set its
value before the patch port test
Don't update learning table with input from L3 ports
Make Ethernet attribute optional
Fix datapath flow validation
datapath: fix push_eth() action
odp-util: add support for reading push_eth and pop_eth actions from CLI
Partially implement L3 -> L2 switching