summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2014-06-26 04:12:41 +0000
committeradrian <adrian@FreeBSD.org>2014-06-26 04:12:41 +0000
commitd4fe515519adfe9db564595f1182018d76bbdd26 (patch)
treed88c82d2c8be330b2c76f51160912728a011067f
parent90965b8d6e915fe3ffd2608bfd6937d986f2abf4 (diff)
downloadFreeBSD-src-d4fe515519adfe9db564595f1182018d76bbdd26.zip
FreeBSD-src-d4fe515519adfe9db564595f1182018d76bbdd26.tar.gz
Retire IP_RSSCPUID ; the right thing to do is query the RSS bucket;
map the bucket to an RSS queue, then map the queue to a CPU ID. This way the bucket->queue and queue->CPU mapping can change over time. Introduce IP_RSSBUCKETID - which instead looks up the RSS bucket. User applications can then map the RSS bucket to a CPU.
-rw-r--r--sys/netinet/in.h7
-rw-r--r--sys/netinet/ip_output.c11
2 files changed, 12 insertions, 6 deletions
diff --git a/sys/netinet/in.h b/sys/netinet/in.h
index 08809d5..5f6708d 100644
--- a/sys/netinet/in.h
+++ b/sys/netinet/in.h
@@ -468,9 +468,10 @@ __END_DECLS
#define IP_MINTTL 66 /* minimum TTL for packet or drop */
#define IP_DONTFRAG 67 /* don't fragment packet */
#define IP_RECVTOS 68 /* bool; receive IP TOS w/dgram */
-#define IP_FLOWID 69 /* flow id for the given socket/inp */
-#define IP_FLOWTYPE 70 /* flow type (M_HASHTYPE) */
-#define IP_RSSCPUID 71 /* RSS flowid -> CPU id mapping */
+#define IP_FLOWID 69 /* get flow id for the given socket/inp */
+#define IP_FLOWTYPE 70 /* get flow type (M_HASHTYPE) */
+/* 71 - XXX was IP_RSSCPUID - can recycle whenever */
+#define IP_RSSBUCKETID 72 /* get RSS flowid -> bucket mapping */
/* IPv4 Source Filter Multicast API [RFC3678] */
#define IP_ADD_SOURCE_MEMBERSHIP 70 /* join a source-specific group */
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c
index 168fc98..44b40cb 100644
--- a/sys/netinet/ip_output.c
+++ b/sys/netinet/ip_output.c
@@ -1244,9 +1244,14 @@ ip_ctloutput(struct socket *so, struct sockopt *sopt)
optval = inp->inp_flowtype;
break;
#ifdef RSS
- case IP_RSSCPUID:
- optval = rss_hash2cpuid(inp->inp_flowid,
- inp->inp_flowtype);
+ case IP_RSSBUCKETID:
+ retval = rss_hash2bucket(inp->inp_flowid,
+ inp->inp_flowtype,
+ &rss_bucket);
+ if (retval == 0)
+ optval = rss_bucket;
+ else
+ error = EINVAL;
break;
#endif
}
OpenPOWER on IntegriCloud