Date: Mon, 29 Dec 2008 23:41:13 +0000 (UTC) From: Kip Macy <kmacy@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r186577 - user/kmacy/HEAD_fast_net/sys/net Message-ID: <200812292341.mBTNfDfi069986@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kmacy Date: Mon Dec 29 23:41:12 2008 New Revision: 186577 URL: http://svn.freebsd.org/changeset/base/186577 Log: use cached lle where possible Modified: user/kmacy/HEAD_fast_net/sys/net/if_ethersubr.c user/kmacy/HEAD_fast_net/sys/net/if_var.h Modified: user/kmacy/HEAD_fast_net/sys/net/if_ethersubr.c ============================================================================== --- user/kmacy/HEAD_fast_net/sys/net/if_ethersubr.c Mon Dec 29 23:31:04 2008 (r186576) +++ user/kmacy/HEAD_fast_net/sys/net/if_ethersubr.c Mon Dec 29 23:41:12 2008 (r186577) @@ -164,9 +164,9 @@ int ether_output(struct ifnet *ifp, struct mbuf *m, struct route *ro) { short type; - int error, hdrcmplt = 0; + int error = 0, hdrcmplt = 0; u_char esrc[ETHER_ADDR_LEN], edst[ETHER_ADDR_LEN]; - struct llentry *lle = NULL; + struct llentry *lle = ro->ro_lle; struct ether_header *eh; struct pf_mtag *t; int loop_copy = 1; @@ -192,7 +192,10 @@ ether_output(struct ifnet *ifp, struct m switch (dst->sa_family) { #ifdef INET case AF_INET: - error = arpresolve(ifp, rt0, m, dst, edst, &lle); + if (lle != NULL && (lle->la_flags & LLE_VALID)) + memcpy(edst, &lle->ll_addr.mac16, ETHER_ADDR_LEN); + else + error = arpresolve(ifp, rt0, m, dst, edst, &lle); if (error) return (error == EWOULDBLOCK ? 0 : error); type = htons(ETHERTYPE_IP); @@ -227,7 +230,10 @@ ether_output(struct ifnet *ifp, struct m #endif #ifdef INET6 case AF_INET6: - error = nd6_storelladdr(ifp, m, dst, (u_char *)edst, &lle); + if (lle != NULL && (lle->la_flags & LLE_VALID)) + memcpy(edst, &lle->ll_addr.mac16, ETHER_ADDR_LEN); + else + error = nd6_storelladdr(ifp, m, dst, (u_char *)edst, &lle); if (error) return error; type = htons(ETHERTYPE_IPV6); Modified: user/kmacy/HEAD_fast_net/sys/net/if_var.h ============================================================================== --- user/kmacy/HEAD_fast_net/sys/net/if_var.h Mon Dec 29 23:31:04 2008 (r186576) +++ user/kmacy/HEAD_fast_net/sys/net/if_var.h Mon Dec 29 23:41:12 2008 (r186577) @@ -664,6 +664,8 @@ struct ifmultiaddr { }; #ifdef _KERNEL +#define LLTABLE(ifp) ((struct lltable *)(ifp)->if_afdata[AF_INET]) + #define IFAFREE(ifa) \ do { \ IFA_LOCK(ifa); \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812292341.mBTNfDfi069986>