Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177311390
D3562.1794122429.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
3 KB
Referenced Files
None
Subscribers
None
D3562.1794122429.diff
View Options
Index: head/sys/netinet6/in6.h
===================================================================
--- head/sys/netinet6/in6.h
+++ head/sys/netinet6/in6.h
@@ -485,6 +485,8 @@
#define IPV6_FLOWID 67 /* int; flowid of given socket */
#define IPV6_FLOWTYPE 68 /* int; flowtype of given socket */
#define IPV6_RSSBUCKETID 69 /* int; RSS bucket ID of given socket */
+#define IPV6_RECVFLOWID 70 /* bool; receive IP6 flowid/flowtype w/ datagram */
+#define IPV6_RECVRSSBUCKETID 71 /* bool; receive IP6 RSS bucket id w/ datagram */
/*
* The following option is private; do not use it from user applications.
Index: head/sys/netinet6/ip6_input.c
===================================================================
--- head/sys/netinet6/ip6_input.c
+++ head/sys/netinet6/ip6_input.c
@@ -93,6 +93,7 @@
#include <net/if_dl.h>
#include <net/route.h>
#include <net/netisr.h>
+#include <net/rss_config.h>
#include <net/pfil.h>
#include <net/vnet.h>
@@ -1349,6 +1350,44 @@
loopend:
;
}
+
+ if (in6p->inp_flags2 & INP_RECVFLOWID) {
+ uint32_t flowid, flow_type;
+
+ flowid = m->m_pkthdr.flowid;
+ flow_type = M_HASHTYPE_GET(m);
+
+ /*
+ * XXX should handle the failure of one or the
+ * other - don't populate both?
+ */
+ *mp = sbcreatecontrol((caddr_t) &flowid,
+ sizeof(uint32_t), IPV6_FLOWID, IPPROTO_IPV6);
+ if (*mp)
+ mp = &(*mp)->m_next;
+ *mp = sbcreatecontrol((caddr_t) &flow_type,
+ sizeof(uint32_t), IPV6_FLOWTYPE, IPPROTO_IPV6);
+ if (*mp)
+ mp = &(*mp)->m_next;
+ }
+
+#ifdef RSS
+ if (in6p->inp_flags2 & INP_RECVRSSBUCKETID) {
+ uint32_t flowid, flow_type;
+ uint32_t rss_bucketid;
+
+ flowid = m->m_pkthdr.flowid;
+ flow_type = M_HASHTYPE_GET(m);
+
+ if (rss_hash2bucket(flowid, flow_type, &rss_bucketid) == 0) {
+ *mp = sbcreatecontrol((caddr_t) &rss_bucketid,
+ sizeof(uint32_t), IPV6_RSSBUCKETID, IPPROTO_IPV6);
+ if (*mp)
+ mp = &(*mp)->m_next;
+ }
+ }
+#endif
+
}
#undef IS2292
Index: head/sys/netinet6/ip6_output.c
===================================================================
--- head/sys/netinet6/ip6_output.c
+++ head/sys/netinet6/ip6_output.c
@@ -1400,6 +1400,10 @@
case IPV6_RECVRTHDR:
case IPV6_RECVPATHMTU:
case IPV6_RECVTCLASS:
+ case IPV6_RECVFLOWID:
+#ifdef RSS
+ case IPV6_RECVRSSBUCKETID:
+#endif
case IPV6_V6ONLY:
case IPV6_AUTOFLOWLABEL:
case IPV6_BINDANY:
@@ -1548,6 +1552,16 @@
OPTSET(IN6P_MTU);
break;
+ case IPV6_RECVFLOWID:
+ OPTSET2(INP_RECVFLOWID, optval);
+ break;
+
+#ifdef RSS
+ case IPV6_RECVRSSBUCKETID:
+ OPTSET2(INP_RECVRSSBUCKETID, optval);
+ break;
+#endif
+
case IPV6_V6ONLY:
/*
* make setsockopt(IPV6_V6ONLY)
@@ -1811,8 +1825,10 @@
case IPV6_BINDANY:
case IPV6_FLOWID:
case IPV6_FLOWTYPE:
+ case IPV6_RECVFLOWID:
#ifdef RSS
case IPV6_RSSBUCKETID:
+ case IPV6_RECVRSSBUCKETID:
#endif
switch (optname) {
@@ -1883,6 +1899,10 @@
case IPV6_FLOWTYPE:
optval = in6p->inp_flowtype;
break;
+
+ case IPV6_RECVFLOWID:
+ optval = OPTBIT2(INP_RECVFLOWID);
+ break;
#ifdef RSS
case IPV6_RSSBUCKETID:
retval =
@@ -1894,6 +1914,10 @@
else
error = EINVAL;
break;
+
+ case IPV6_RECVRSSBUCKETID:
+ optval = OPTBIT2(INP_RECVRSSBUCKETID);
+ break;
#endif
case IPV6_BINDMULTI:
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 8, 7:20 AM (16 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41573585
Default Alt Text
D3562.1794122429.diff (3 KB)
Attached To
Mode
D3562: Add support for receiving flowtype, flowid and RSS bucket information as part of recvmsg()
Attached
Detach File
Event Timeline