version 1.166, 2016/08/02 04:50:16 |
version 1.167, 2016/08/31 09:14:47 |
Line 87 __KERNEL_RCSID(0, "$NetBSD$"); |
|
Line 87 __KERNEL_RCSID(0, "$NetBSD$"); |
|
#include <sys/proc.h> |
#include <sys/proc.h> |
#include <sys/sysctl.h> |
#include <sys/sysctl.h> |
#include <sys/cprng.h> |
#include <sys/cprng.h> |
|
#include <sys/percpu.h> |
|
|
#include <net/if.h> |
#include <net/if.h> |
#include <net/if_types.h> |
#include <net/if_types.h> |
Line 143 pfil_head_t *inet6_pfil_hook; |
|
Line 144 pfil_head_t *inet6_pfil_hook; |
|
|
|
percpu_t *ip6stat_percpu; |
percpu_t *ip6stat_percpu; |
|
|
|
percpu_t *ip6_forward_rt_percpu __cacheline_aligned; |
|
|
static void ip6_init2(void); |
static void ip6_init2(void); |
static void ip6intr(void *); |
static void ip6intr(void *); |
static struct m_tag *ip6_setdstifaddr(struct mbuf *, const struct in6_ifaddr *); |
static struct m_tag *ip6_setdstifaddr(struct mbuf *, const struct in6_ifaddr *); |
|
|
KASSERT(inet6_pfil_hook != NULL); |
KASSERT(inet6_pfil_hook != NULL); |
|
|
ip6stat_percpu = percpu_alloc(sizeof(uint64_t) * IP6_NSTATS); |
ip6stat_percpu = percpu_alloc(sizeof(uint64_t) * IP6_NSTATS); |
|
|
|
ip6_forward_rt_percpu = percpu_alloc(sizeof(struct route)); |
|
if (ip6_forward_rt_percpu == NULL) |
|
panic("failed to alllocate ip6_forward_rt_percpu"); |
} |
} |
|
|
static void |
static void |
Line 239 ip6intr(void *arg __unused) |
|
Line 246 ip6intr(void *arg __unused) |
|
mutex_exit(softnet_lock); |
mutex_exit(softnet_lock); |
} |
} |
|
|
extern struct route ip6_forward_rt; |
|
|
|
void |
void |
ip6_input(struct mbuf *m, struct ifnet *rcvif) |
ip6_input(struct mbuf *m, struct ifnet *rcvif) |
{ |
{ |
Line 256 ip6_input(struct mbuf *m, struct ifnet * |
|
Line 261 ip6_input(struct mbuf *m, struct ifnet * |
|
struct sockaddr dst; |
struct sockaddr dst; |
struct sockaddr_in6 dst6; |
struct sockaddr_in6 dst6; |
} u; |
} u; |
|
struct route *ro; |
|
|
/* |
/* |
* make sure we don't have onion peering information into m_tag. |
* make sure we don't have onion peering information into m_tag. |
Line 461 ip6_input(struct mbuf *m, struct ifnet * |
|
Line 467 ip6_input(struct mbuf *m, struct ifnet * |
|
/* |
/* |
* Unicast check |
* Unicast check |
*/ |
*/ |
rt = rtcache_lookup2(&ip6_forward_rt, &u.dst, 1, &hit); |
ro = percpu_getref(ip6_forward_rt_percpu); |
|
rt = rtcache_lookup2(ro, &u.dst, 1, &hit); |
|
percpu_putref(ip6_forward_rt_percpu); |
if (hit) |
if (hit) |
IP6_STATINC(IP6_STAT_FORWARD_CACHEHIT); |
IP6_STATINC(IP6_STAT_FORWARD_CACHEHIT); |
else |
else |