net: add IPv4 routing FIB support for swdev

To offload IPv4 L3 routing function to swdev device, the swdev device driver
implements two new ndo ops (ndo_switch_fib_ipv4_add/del).  The ops are called
by the core IPv4 FIB code when installing/removing FIB entries from the kernel
FIB.  On install, the driver should return 0 if FIB entry (route) can be
installed to device for offloading; -EOPNOTSUPP if route cannot be installed
due to device limitations; and other negative error code on failure to install
route to device.  On failure error code, the route is not installed to device,
and not installed in kernel FIB, and the return code is propagated back to the
user-space caller (via netlink).

The FIB entry (route) pushed down to device/driver is scanned for nexthops.
The nexthops referenced by the device must all be ports on the same swdev
device.  (If not, the swdev can't offload this route because it's spanning ports
in and out of the swdev).

Since the FIB entry is "naked" when push from the kernel, the driver/device
is responsible for resolving the route's nexthops to neighbor MAC addresses.
This can be done by the driver by monitoring NETEVENT_NEIGH_UPDATE
netevent notifier to watch for ARP activity.  Once a nexthop is resolved to
neighbor MAC address, it can be installed to the device and the device will
do the L3 routing in HW.

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
net: call swdev fib del for flushed routes

This is essentially the same patch Nicolas Dichtel posted, but was rejected.
The difference here is rather than calling netlink to notify, this patch
calls swdev to del the fib entry.  Without this patch, routes that are flushed,
for example when an interface goes down, the normal route delete paths aren't
called, so we need to hook the flush path so swdev get's called.

Nicolas' patch is here:

http://marc.info/?l=linux-netdev&m=135161909714545&w=2

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
rocker: implement IPv4 fib offloading

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Merge branch 'scott_l3' into net-next-rocker

From: Scott Feldman <sfeldma@gmail.com>

Add L3 routing offload support for switch devices capable of offloading L3
fwding from kernel to HW.  The kernel FIB is the reference FIB, but FIB entries
offloaded to HW will not hit kernel fwding data path and rather be fwded by HW.

This patch adds two new ops for IPv4 FIB offload: ndo_switch_fib_ipv4_add/del
to add/del FIB entries to/from/HW.  If the add fails for HW, the entry is not
installed in SW, and the user (via netlink RTM_NEWROUTE) is returned err code.

The port driver listens to the ARP neigh table for updates to resolve route
nexthops gateway MAC address.  If a nexthop is unresolved, the driver will
send gratuitous ARP to neigh to resolve.

This patch is single path only routes.  ECMP (multipathing) route support will
be added later.  IPv6 support will be added later.