diff options
-rw-r--r-- | sys/dev/cxgb/cxgb_sge.c | 1 | ||||
-rw-r--r-- | sys/netinet/in_pcb.h | 4 | ||||
-rw-r--r-- | sys/netinet/ip_output.c | 4 | ||||
-rw-r--r-- | sys/netinet/tcp_input.c | 9 | ||||
-rw-r--r-- | sys/sys/mbuf.h | 1 |
5 files changed, 17 insertions, 2 deletions
diff --git a/sys/dev/cxgb/cxgb_sge.c b/sys/dev/cxgb/cxgb_sge.c index 6c5a17ef4211..47f36fd5e1cd 100644 --- a/sys/dev/cxgb/cxgb_sge.c +++ b/sys/dev/cxgb/cxgb_sge.c @@ -2879,6 +2879,7 @@ process_responses(adapter_t *adap, struct sge_qset *qs, int budget) eop = get_packet(adap, drop_thresh, qs, &rspq->rspq_mbuf, r); #endif #ifdef IFNET_MULTIQUEUE + rspq->rspq_mh.mh_head->m_flags |= M_FLOWID; rspq->rspq_mh.mh_head->m_pkthdr.flowid = rss_hash; #endif ethpad = 2; diff --git a/sys/netinet/in_pcb.h b/sys/netinet/in_pcb.h index 4ad473238593..aada1265e0b9 100644 --- a/sys/netinet/in_pcb.h +++ b/sys/netinet/in_pcb.h @@ -167,7 +167,7 @@ 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 */ - uint32_t inp_ispare1; /* (x) connection id / queue id */ + uint32_t inp_flowid; /* (x) flow id / queue id */ u_int inp_refcount; /* (i) refcount */ void *inp_pspare[2]; /* (x) rtentry / general use */ @@ -416,6 +416,8 @@ void inp_4tuple_get(struct inpcb *inp, uint32_t *laddr, uint16_t *lp, #define INP_ONESBCAST 0x02000000 /* send all-ones broadcast */ #define INP_DROPPED 0x04000000 /* protocol drop flag */ #define INP_SOCKREF 0x08000000 /* strong socket reference */ +#define INP_SW_FLOWID 0x10000000 /* software generated flow id */ +#define INP_HW_FLOWID 0x20000000 /* hardware generated flow id */ #define IN6P_RFC2292 0x40000000 /* used RFC2292 API on the socket */ #define IN6P_MTU 0x80000000 /* receive path MTU */ diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 90df60148f6c..fc811fa681d5 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -153,6 +153,10 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags, if (inp != NULL) { M_SETFIB(m, inp->inp_inc.inc_fibnum); INP_LOCK_ASSERT(inp); + if (inp->inp_flags & (INP_HW_FLOWID|INP_SW_FLOWID)) { + m->m_pkthdr.flowid = inp->inp_flowid; + m->m_flags |= M_FLOWID; + } } if (opt) { diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 1b9cf858ed11..9d85448b0f9a 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -594,7 +594,14 @@ findpcb: goto dropwithreset; } INP_WLOCK(inp); - + if (!(inp->inp_flags & INP_HW_FLOWID) + && (m->m_flags & M_FLOWID) + && ((inp->inp_socket == NULL) + || !(inp->inp_socket->so_options & SO_ACCEPTCONN))) { + inp->inp_flags |= INP_HW_FLOWID; + inp->inp_flags &= ~INP_SW_FLOWID; + inp->inp_flowid = m->m_pkthdr.flowid; + } #ifdef IPSEC #ifdef INET6 if (isipv6 && ipsec6_in_reject(m, inp)) { diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index 05b28de2c41d..e7f0b7ed1a7a 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -199,6 +199,7 @@ struct mbuf { #define M_PROTO6 0x00080000 /* protocol-specific */ #define M_PROTO7 0x00100000 /* protocol-specific */ #define M_PROTO8 0x00200000 /* protocol-specific */ +#define M_FLOWID 0x00400000 /* flowid is valid */ /* * For RELENG_{6,7} steal these flags for limited multiple routing table * support. In RELENG_8 and beyond, use just one flag and a tag. |