aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/in_rss.c3
-rw-r--r--sys/netinet/ip_ecn.c16
-rw-r--r--sys/netinet/ip_ecn.h4
-rw-r--r--sys/netinet/ip_fw.h2
-rw-r--r--sys/netinet/tcp_usrreq.c10
5 files changed, 24 insertions, 11 deletions
diff --git a/sys/netinet/in_rss.c b/sys/netinet/in_rss.c
index f93a1d2bfd7b..4854265bd9f4 100644
--- a/sys/netinet/in_rss.c
+++ b/sys/netinet/in_rss.c
@@ -29,6 +29,7 @@
#include "opt_inet6.h"
+#include "opt_rss.h"
#include <sys/param.h>
#include <sys/mbuf.h>
@@ -350,6 +351,7 @@ rss_mbuf_software_hash_v4(const struct mbuf *m, int dir, uint32_t *hashval,
}
}
+#ifdef RSS
/*
* Similar to rss_m2cpuid, but designed to be used by the IP NETISR
* on incoming frames.
@@ -387,3 +389,4 @@ rss_soft_m2cpuid_v4(struct mbuf *m, uintptr_t source, u_int *cpuid)
}
return (m);
}
+#endif
diff --git a/sys/netinet/ip_ecn.c b/sys/netinet/ip_ecn.c
index 30d2c95ddbd7..2f700c43bbfa 100644
--- a/sys/netinet/ip_ecn.c
+++ b/sys/netinet/ip_ecn.c
@@ -92,7 +92,7 @@
* modify outer ECN (TOS) field on ingress operation (tunnel encapsulation).
*/
void
-ip_ecn_ingress(int mode, u_int8_t *outer, const u_int8_t *inner)
+ip_ecn_ingress(int mode, uint8_t *outer, const uint8_t *inner)
{
if (!outer || !inner)
@@ -124,7 +124,7 @@ ip_ecn_ingress(int mode, u_int8_t *outer, const u_int8_t *inner)
* the caller should drop the packet if the return value is 0.
*/
int
-ip_ecn_egress(int mode, const u_int8_t *outer, u_int8_t *inner)
+ip_ecn_egress(int mode, const uint8_t *outer, uint8_t *inner)
{
if (!outer || !inner)
@@ -158,9 +158,9 @@ ip_ecn_egress(int mode, const u_int8_t *outer, u_int8_t *inner)
#ifdef INET6
void
-ip6_ecn_ingress(int mode, u_int32_t *outer, const u_int32_t *inner)
+ip6_ecn_ingress(int mode, uint32_t *outer, const uint32_t *inner)
{
- u_int8_t outer8, inner8;
+ uint8_t outer8, inner8;
if (!outer || !inner)
panic("NULL pointer passed to ip6_ecn_ingress");
@@ -168,13 +168,13 @@ ip6_ecn_ingress(int mode, u_int32_t *outer, const u_int32_t *inner)
inner8 = (ntohl(*inner) >> 20) & 0xff;
ip_ecn_ingress(mode, &outer8, &inner8);
*outer &= ~htonl(0xff << 20);
- *outer |= htonl((u_int32_t)outer8 << 20);
+ *outer |= htonl((uint32_t)outer8 << 20);
}
int
-ip6_ecn_egress(int mode, const u_int32_t *outer, u_int32_t *inner)
+ip6_ecn_egress(int mode, const uint32_t *outer, uint32_t *inner)
{
- u_int8_t outer8, inner8, oinner8;
+ uint8_t outer8, inner8, oinner8;
if (!outer || !inner)
panic("NULL pointer passed to ip6_ecn_egress");
@@ -185,7 +185,7 @@ ip6_ecn_egress(int mode, const u_int32_t *outer, u_int32_t *inner)
return (0);
if (inner8 != oinner8) {
*inner &= ~htonl(0xff << 20);
- *inner |= htonl((u_int32_t)inner8 << 20);
+ *inner |= htonl((uint32_t)inner8 << 20);
}
return (1);
}
diff --git a/sys/netinet/ip_ecn.h b/sys/netinet/ip_ecn.h
index 7390d812606f..6632418fc9ca 100644
--- a/sys/netinet/ip_ecn.h
+++ b/sys/netinet/ip_ecn.h
@@ -44,7 +44,7 @@
#define ECN_NOCARE (-1) /* no consideration to ECN */
#ifdef _KERNEL
-extern void ip_ecn_ingress(int, u_int8_t *, const u_int8_t *);
-extern int ip_ecn_egress(int, const u_int8_t *, u_int8_t *);
+extern void ip_ecn_ingress(int, uint8_t *, const uint8_t *);
+extern int ip_ecn_egress(int, const uint8_t *, uint8_t *);
#endif
#endif
diff --git a/sys/netinet/ip_fw.h b/sys/netinet/ip_fw.h
index 51e68c310915..f3b2dc051c7d 100644
--- a/sys/netinet/ip_fw.h
+++ b/sys/netinet/ip_fw.h
@@ -752,7 +752,7 @@ struct ip_fw {
#endif
#define ACTION_PTR(rule) \
- (ipfw_insn *)( (u_int32_t *)((rule)->cmd) + ((rule)->act_ofs) )
+ ((ipfw_insn *)( (uint32_t *)((rule)->cmd) + ((rule)->act_ofs) ))
#define RULESIZE(rule) (sizeof(*(rule)) + (rule)->cmd_len * 4 - 4)
diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c
index 4d1a6455d09e..aeb28cd6a144 100644
--- a/sys/netinet/tcp_usrreq.c
+++ b/sys/netinet/tcp_usrreq.c
@@ -75,6 +75,7 @@
#include <netinet/in.h>
#include <netinet/in_kdtrace.h>
#include <netinet/in_pcb.h>
+#include <netinet/in_rss.h>
#include <netinet/in_systm.h>
#include <netinet/in_var.h>
#include <netinet/ip.h>
@@ -82,6 +83,7 @@
#ifdef INET6
#include <netinet/ip6.h>
#include <netinet6/in6_pcb.h>
+#include <netinet6/in6_rss.h>
#include <netinet6/ip6_var.h>
#include <netinet6/scope6_var.h>
#endif
@@ -1487,6 +1489,10 @@ tcp_connect(struct tcpcb *tp, struct sockaddr_in *sin, struct thread *td)
if (error != 0)
return (error);
+ /* set the hash on the connection */
+ rss_proto_software_hash_v4(inp->inp_faddr, inp->inp_laddr,
+ inp->inp_fport, inp->inp_lport, IPPROTO_TCP,
+ &inp->inp_flowid, &inp->inp_flowtype);
/*
* Compute window scaling to request:
* Scale to fit into sweet spot. See tcp_syncache.c.
@@ -1532,6 +1538,10 @@ tcp6_connect(struct tcpcb *tp, struct sockaddr_in6 *sin6, struct thread *td)
if (error != 0)
return (error);
+ /* set the hash on the connection */
+ rss_proto_software_hash_v6(&inp->in6p_faddr,
+ &inp->in6p_laddr, inp->inp_fport, inp->inp_lport, IPPROTO_TCP,
+ &inp->inp_flowid, &inp->inp_flowtype);
/* Compute window scaling to request. */
while (tp->request_r_scale < TCP_MAX_WINSHIFT &&
(TCP_MAXWIN << tp->request_r_scale) < sb_max)