diff options
author | rwatson <rwatson@FreeBSD.org> | 2011-06-04 16:33:06 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2011-06-04 16:33:06 +0000 |
commit | e9eb5d3b9cabfc492871c5e6a6b40f13063f17f9 (patch) | |
tree | f8c4b2222ac90d9dcf29f0f56f99b2e15040c5b0 /sys/netinet/tcp_input.c | |
parent | f2e70f34fff765930c45c50d9cb2c5a6c47c24df (diff) | |
download | FreeBSD-src-e9eb5d3b9cabfc492871c5e6a6b40f13063f17f9.zip FreeBSD-src-e9eb5d3b9cabfc492871c5e6a6b40f13063f17f9.tar.gz |
Add _mbuf() variants of various inpcb-related interfaces, including lookup,
hash install, etc. For now, these are arguments are unused, but as we add
RSS support, we will want to use hashes extracted from mbufs, rather than
manually calculated hashes of header fields, due to the expensive of the
software version of Toeplitz (and similar hashes).
Add notes that it would be nice to be able to pass mbufs into lookup
routines in pf(4), optimising firewall lookup in the same way, but the
code structure there doesn't facilitate that currently.
(In principle there is no reason this couldn't be MFCed -- the change
extends rather than modifies the KBI. However, it won't be useful without
other previous possibly less MFCable changes.)
Reviewed by: bz
Sponsored by: Juniper Networks, Inc.
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r-- | sys/netinet/tcp_input.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 080b4da..e3e9aa6 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -791,12 +791,14 @@ findpcb: * Transparently forwarded. Pretend to be the destination. * already got one like this? */ - inp = in_pcblookup(&V_tcbinfo, ip->ip_src, th->th_sport, + inp = in_pcblookup_mbuf(&V_tcbinfo, ip->ip_src, th->th_sport, ip->ip_dst, th->th_dport, INPLOOKUP_WLOCKPCB, - m->m_pkthdr.rcvif); + m->m_pkthdr.rcvif, m); if (!inp) { /* * It's new. Try to find the ambushing socket. + * Because we've rewritten the destination address, + * any hardware-generated hash is ignored. */ inp = in_pcblookup(&V_tcbinfo, ip->ip_src, th->th_sport, next_hop->sin_addr, @@ -812,19 +814,19 @@ findpcb: { #ifdef INET6 if (isipv6) - inp = in6_pcblookup(&V_tcbinfo, &ip6->ip6_src, + inp = in6_pcblookup_mbuf(&V_tcbinfo, &ip6->ip6_src, th->th_sport, &ip6->ip6_dst, th->th_dport, INPLOOKUP_WILDCARD | INPLOOKUP_WLOCKPCB, - m->m_pkthdr.rcvif); + m->m_pkthdr.rcvif, m); #endif #if defined(INET) && defined(INET6) else #endif #ifdef INET - inp = in_pcblookup(&V_tcbinfo, ip->ip_src, + inp = in_pcblookup_mbuf(&V_tcbinfo, ip->ip_src, th->th_sport, ip->ip_dst, th->th_dport, INPLOOKUP_WILDCARD | INPLOOKUP_WLOCKPCB, - m->m_pkthdr.rcvif); + m->m_pkthdr.rcvif, m); #endif } |