Fix vrouter compilation issues for >3.15 kernels

* SET_ETHTOOL_OPS macro is removed in 3.16 kernels
* rxhash of sk_buff has been renamed to hash in 3.15 kernels.

This patch fixes this issue.

Change-Id: Ic0de873d0a5d869624ad9d5b883586222e8119cc
Closes-bug: #1383647
linux tunnel interface support in vrouter

For tunnel interface support, packets that ingresses and egresses the
tunnel interface will have network header rather than ethernet header
as vrouter today expects. vrouter will look the encap of the device
that is added to vrouter to see whether the interface supports an
ethernet encap or not. For now, if the interface does not support an
ethernet encap, vrouter will assume that the interface is a tunnel
interface.

TODO: segmentation and addition of ethernet header for packets that
go to vhost interface during vrouter reset

Bug:#1391051
Change-Id: I47717f4a9e332b8fcfbb2878c4659a5eead54ffb
Allow IPv6 link-local forwarding within the same VN

Flood Neighbor solicit for link-local prefixes. This will result in appropriate
MAC addresses getting learnt for link-local addresses (mimic L2-only behavior).

Pull in L4 headers into SKB for IPv6 packets

Change-Id: I417df4709a3bad77076f9deb186a27d15431bb31
Allow parallel build via scons -jNN
- Avoid use of chdir= in scons Command()
- Add .gitignore for files generated during build

Change-Id: I256a12da17ac0940a5ded81d2c2dec88abc3ca14
Merge "linux tunnel interface support in vrouter"
Merge "Allow parallel build via scons -jNN - Avoid use of chdir= in scons Command() - Add .gitignore for files generated during build"
Change the location from where we try to pull the outer headers

The function that pulls outer headers assumes that the packet data
points at layer 2 header. While this is true in case of ubuntu, the
commit that made this assumption did not reposition the call for
Centos, resulting in pull failures.

Change-Id: Iaae280817820feb87a525db8c028bcba4e905bb1
Closes-BUG: #1393730
Fixes neighbor solicit issue in ubuntu/Centos

In linux_pull_outer_headers(), ICMP header size was counted twice before skb_pull. this resulted in skb_pull
failing for the neighbor solicit packets. This bug fixes the same.

Change-Id: I878d6ae0d63ac5e7446a82aa462718f0589cb367
Closes-Bug: 1392638
Merge "Fix vrouter compilation issues for >3.15 kernels"
Merge "Fixes neighbor solicit issue in ubuntu/Centos"
Fix a double free error in vr_message_process_response

This patch fixes a double free error and introduces
user land unit test for the vrouter code. The cmocka
unit test framework is used for that purpose.

A first unit test is provided that check this fixes.

Change-Id: Ic8c84d076d078a87adaf6d4398373c368db0361c
Closes-bug: #1394147
Layer 3 unicast nexthops should update layer 2 protocol fields only if
layer 2 information needs to be added.

Layer 3 unicast nexthops is shared across ipv4 and ipv6. The layer 2
protocol field of the rewrite information is updated every time a packet hits
the nexthop, based on whether the packet is ipv4 or ipv6. There are a couple
of issues with this way of doing things. One is that it is not MP safe and
other is that the protocol field should be updated only if there is any rewrite
information to be added.

There will not be any rewrite information for packets egressing a tunnel interface,
and hence the layer 2 protocol information should not be added.

Closes-BUG: #1394461
Change-Id: If06c41127501ed1f5971228269cfbc8a533518c6
Remove the vhost tap if the physical interface corresponsing to a vhost
interface changes

If before a vrouter soft reset the physical interface was different and
post reset agent adds a different physical interface (corresponding to a
particular vhost), then a system crash is possible subsequently when
somebody tries to remove the module. (This situation can happen  because
interfaces mentioned in agent_param and contrail-vrouter-agent.conf are
different. Unlikely, but possible).

The system crash is because during reset we install a handler on the
physical interface that directly shunts the packet to vhost interface in
the kernel. Post reset, if the interface changes, we don't remove this tap.
If we then remove the vrouter module, the tap points to the module function
and hence an invalid memory.

Change-Id: I28d4a7691d7caea81f849110edf7c7f7170b0bc5
Closes-BUG: #1394473
Merge "Fix a double free error in vr_message_process_response"
Merge "Remove the vhost tap if the physical interface corresponsing to a vhost interface changes"
modify vr_compat.h to compile on centos 6.5 and later

Change-Id: Ibf124cf46cf4b07b073494707ee4d0c63da2bed3
Diagnostics - traceroute and ping support

A diagnostic packet is a packet that is injected by agent to accomplish
two main functionalities (for now) - reachability (ping) and path
information (traceroute), given the five tuple (sip,sport,dip,dport,proto).

While injecting the packet, agent explicitly marks the packet as a
diagnostic packet. If the packet transits a compute node, at the
receiving compute, the transport header checksum is used to identify
whether the packet is a diagnostic packet or not.

Ping, thus is straight forward

For traceroute to work, vrouter needs to decrement ttl and send icmp
time to live exceeded message. Every packet that vrouter forwards,
vrouter decerements the ttl and if the ttl goes to zero trap the packet
to agent, which processes the message and sends an icmp ttl exceeded
message. For a diagnostic packet, the inner network header ttl is
also copied onto outer network header so that the fabric routers
do send a ttl exceeded message and thus a map of the underlay is known.

Partial-BUG: #1379622
Change-Id: Idb785a6c25ee02578ee90254a0d6dd137a0eb6d6
Fix return code check

The current code reads:

   if ((ret = vr_fragment_table_init(vrouter) < 0))

The check is performed correctly, but since the "<" comparison takes
precedence, ret is now 1, which confuses the module loader into thinking
everything worked out.

Move the parentheses to fix this issue.

Change-Id: I1278cebbdcebe2aec445d491fa471f6f4ebcc8ba
Return ENOMEM when failing to allocate memory

When vr_btable_alloc fails, it should get reported back up the call
stack as ENOMEM, not EINVAL. This is also what happens in vr_flow.

Change-Id: I250b272c4274904cadb2c1e9a6dc92fc6bc4c7b5
Merge remote branch 'upstream/master'

Conflicts:
	include/vr_defs.h
	linux/vr_host_interface.c