net: Add fast path in ARP lookups

This patch adds a fast path to arpresolve. A RCU protected ARP cache is
introduced to accelerate arpresolve lookup. A IPv4 address and llentry are
cached. If we hit the cache, no mutexes are taken and we go to the fast
path. If not, we go to the normal slow path. Most of the time will we
hit the fast path, in this case, in a single lookup,
IF_AFDATA_RLOCK(ifp), IF_AFDATA_RUNLOCK(ifp), LLE_RLOCK(lle),
LLE_RUNLOCK(lle) will be saved. Normally, the size of the cache should
be small, a linear list should be enough.

Currently, arpresolve returns a 'struct llentry* lle' which is used in
ether_output. We might hit use-after-free if we do not take the lle lock
in the fast path. However, in ether_output, lle is only used to check if
the lle contains LLE_IFADDR flag. To solve this issue, we return a
is_ifaddr flag instead of lle.

Fixes #300.

Signed-off-by: Asias He <asias@cloudius-systems.com>
net: Remove dead code in if.cc

This is backport from freebsd:

   commit 58f7b15da98d85f702ada8a45f4e1f50c97f5155
   Author: melifaro <melifaro@FreeBSD.org>
   Date:   Tue Jan 7 19:00:40 2014 +0000

       Remove dead code.

       Reported by:        Coverity
       Coverity CID:       1018057
       MFC after:  2 weeks

       Reviewed by:        bz

Signed-off-by: Asias He <asias@cloudius-systems.com>
net: Remove ifa_ref()/ifa_free(), which are atomic(9), from ip_output()

This is backport from freebsd:

   commit 2c50988dca8f1c498ada4b3c8c0c275a7c324622
   Author: glebius <glebius@FreeBSD.org>
   Date:   Tue Mar 4 19:49:41 2014 +0000

       Remove ifa_ref()/ifa_free(), which are atomic(9), from ip_output().

       The ifaddr is already referenced by the rtentry, and we are holding
       reference on the rtentry throughout the function execution.

       Sponsored by:       Netflix
       Sponsored by:       Nginx, Inc.

Signed-off-by: Asias He <asias@cloudius-systems.com>