svn commit: r189206 - in user/kmacy/releng_7_fast_net/sys: netinet
sys
Kip Macy
kmacy at FreeBSD.org
Sat Feb 28 21:09:35 PST 2009
Author: kmacy
Date: Sun Mar 1 05:09:34 2009
New Revision: 189206
URL: http://svn.freebsd.org/changeset/base/189206
Log:
multiq step 5:
flowid: allow TCP to track driver furnished flow identifier and pass it down
to the driver in ip_output to give the driver the option of identifying flows to
provide connection ordering while using multiple transmit queues
Modified:
user/kmacy/releng_7_fast_net/sys/netinet/in_pcb.h
user/kmacy/releng_7_fast_net/sys/netinet/ip_output.c
user/kmacy/releng_7_fast_net/sys/netinet/tcp_input.c
user/kmacy/releng_7_fast_net/sys/sys/mbuf.h
Modified: user/kmacy/releng_7_fast_net/sys/netinet/in_pcb.h
==============================================================================
--- user/kmacy/releng_7_fast_net/sys/netinet/in_pcb.h Sun Mar 1 04:59:54 2009 (r189205)
+++ user/kmacy/releng_7_fast_net/sys/netinet/in_pcb.h Sun Mar 1 05:09:34 2009 (r189206)
@@ -160,7 +160,8 @@ struct inpcb {
u_char inp_ip_ttl; /* (i) time to live proto */
u_char inp_ip_p; /* (c) protocol proto */
u_char inp_ip_minttl; /* (i) minimum TTL or drop */
- u_int inp_refcount; /* (i) refcount */
+ uint16_t inp_connid; /* (x) connection id / queue id */
+ uint16_t inp_refcount; /* (i) refcount */
struct ucred *inp_cred; /* (c) cache of socket cred */
void *inp_pspare[1]; /* L2 information */
struct rtentry *inp_rt; /* L3 information */
Modified: user/kmacy/releng_7_fast_net/sys/netinet/ip_output.c
==============================================================================
--- user/kmacy/releng_7_fast_net/sys/netinet/ip_output.c Sun Mar 1 04:59:54 2009 (r189205)
+++ user/kmacy/releng_7_fast_net/sys/netinet/ip_output.c Sun Mar 1 05:09:34 2009 (r189206)
@@ -129,6 +129,7 @@ ip_output(struct mbuf *m, struct mbuf *o
if (inp != NULL) {
M_SETFIB(m, inp->inp_inc.inc_fibnum);
+ M_SETFLOWID(m, inp->inp_connid);
INP_LOCK_ASSERT(inp);
if ((ro == &iproute) && (inp->inp_vflag & INP_RT_VALID)) {
if (inp->inp_rt->rt_flags & RTF_UP) {
Modified: user/kmacy/releng_7_fast_net/sys/netinet/tcp_input.c
==============================================================================
--- user/kmacy/releng_7_fast_net/sys/netinet/tcp_input.c Sun Mar 1 04:59:54 2009 (r189205)
+++ user/kmacy/releng_7_fast_net/sys/netinet/tcp_input.c Sun Mar 1 05:09:34 2009 (r189206)
@@ -478,7 +478,9 @@ findpcb:
goto dropwithreset;
}
INP_WLOCK(inp);
-
+ if (inp->inp_connid == 0)
+ inp->inp_connid = M_GETFLOWID(m);
+
#ifdef IPSEC
#ifdef INET6
if (isipv6 && ipsec6_in_reject(m, inp)) {
Modified: user/kmacy/releng_7_fast_net/sys/sys/mbuf.h
==============================================================================
--- user/kmacy/releng_7_fast_net/sys/sys/mbuf.h Sun Mar 1 04:59:54 2009 (r189205)
+++ user/kmacy/releng_7_fast_net/sys/sys/mbuf.h Sun Mar 1 05:09:34 2009 (r189206)
@@ -962,15 +962,25 @@ m_tag_find(struct mbuf *m, int type, str
#define M_FIBSHIFT 28
#define M_FIBMASK 0x0F
+#define M_FLOWIDSHIFT 16
+
/* get the fib from an mbuf and if it is not set, return the default */
#define M_GETFIB(_m) \
((((_m)->m_flags & M_FIB) >> M_FIBSHIFT) & M_FIBMASK)
#define M_SETFIB(_m, _fib) do { \
_m->m_flags &= ~M_FIB; \
- _m->m_flags |= (((_fib) << M_FIBSHIFT) & M_FIB); \
+ _m->m_flags |= (((_fib) << M_FIBSHIFT) & M_FIB); \
} while (0)
+#define M_GETFLOWID(_m) \
+ ((_m)->m_pkthdr.csum_flags >> M_FLOWIDSHIFT)
+
+#define M_SETFLOWID(_m, _flowid) do { \
+ _m->m_pkthdr.csum_flags |= ((_flowid) << M_FLOWIDSHIFT); \
+} while (0)
+
+
#endif /* _KERNEL */
#endif /* !_SYS_MBUF_H_ */
More information about the svn-src-user
mailing list