summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhiren <hiren@FreeBSD.org>2015-05-11 20:26:35 +0000
committerhiren <hiren@FreeBSD.org>2015-05-11 20:26:35 +0000
commit0a6e6ea993a007ce227d8eaa208490b58c4c485b (patch)
tree0099439eb18e8e855d4773e890979b031493bb68
parentfa15cb3cc7c5cfe8c9e46afbc3cdf38ecece3025 (diff)
downloadFreeBSD-src-0a6e6ea993a007ce227d8eaa208490b58c4c485b.zip
FreeBSD-src-0a6e6ea993a007ce227d8eaa208490b58c4c485b.tar.gz
r281955 removed M_FLOWID which could cause problems for old drivers still using
the field. It cannot be removed from stable/10 so restore it. Change M_HASHTYPE_GET() and M_HASHTYPE_SET() to do the right thing when M_FLOWID exists. Also bumping the FreeBSD version to note the fact that M_FLOWID is brought back in stable/10. (Just a note that M_FLOWID has been removed from -head.) Spotted by: np Suggested by: hans Reviewed by: hans, tuexen (earlier version) Helped by: jhb, delphij, gjb Sponsored by: Limelight Networks
-rw-r--r--share/man/man9/netisr.912
-rw-r--r--sys/sys/mbuf.h18
-rw-r--r--sys/sys/param.h2
3 files changed, 20 insertions, 12 deletions
diff --git a/share/man/man9/netisr.9 b/share/man/man9/netisr.9
index a4fa108..808d902 100644
--- a/share/man/man9/netisr.9
+++ b/share/man/man9/netisr.9
@@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 11, 2015
+.Dd May 11, 2015
.Dt NETISR 9
.Os
.Sh NAME
@@ -126,13 +126,13 @@ MIB names, so should not contain whitespace.
Protocol handler function that will be invoked on each packet received for
the protocol.
.It Vt netisr_m2flow_t Va nh_m2flow
-Optional protocol function to generate a flow ID and set a valid
-hashtype for packets that enter the
+Optional protocol function to generate a flow ID and set
+.Dv M_FLOWID
+for packets that do not enter
.Nm
with
-.Dv M_HASHTYPE_GET(m)
-equal to
-.Dv M_HASHTYPE_NONE .
+.Dv M_FLOWID
+defined.
Will be used only with
.Dv NETISR_POLICY_FLOW .
.It Vt netisr_m2cpuid_t Va nh_m2cpuid
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index 6398ecd..400ea79 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -230,7 +230,7 @@ struct mbuf {
#define M_MCAST 0x00000020 /* send/received as link-level multicast */
#define M_PROMISC 0x00000040 /* packet was not for us */
#define M_VLANTAG 0x00000080 /* ether_vtag is valid */
-#define M_UNUSED_8 0x00000100 /* --available-- */
+#define M_FLOWID 0x00000100 /* deprecated: flowid is valid */
#define M_NOFREE 0x00000200 /* do not free mbuf, embedded in cluster */
#define M_PROTO1 0x00001000 /* protocol-specific */
@@ -257,7 +257,7 @@ struct mbuf {
* Flags preserved when copying m_pkthdr.
*/
#define M_COPYFLAGS \
- (M_PKTHDR|M_EOR|M_RDONLY|M_BCAST|M_MCAST|M_PROMISC|M_VLANTAG| \
+ (M_PKTHDR|M_EOR|M_RDONLY|M_BCAST|M_MCAST|M_PROMISC|M_VLANTAG|M_FLOWID| \
M_PROTOFLAGS)
/*
@@ -265,7 +265,7 @@ struct mbuf {
*/
#define M_FLAG_BITS \
"\20\1M_EXT\2M_PKTHDR\3M_EOR\4M_RDONLY\5M_BCAST\6M_MCAST" \
- "\7M_PROMISC\10M_VLANTAG"
+ "\7M_PROMISC\10M_VLANTAG\11M_FLOWID"
#define M_FLAG_PROTOBITS \
"\15M_PROTO1\16M_PROTO2\17M_PROTO3\20M_PROTO4\21M_PROTO5" \
"\22M_PROTO6\23M_PROTO7\24M_PROTO8\25M_PROTO9\26M_PROTO10" \
@@ -297,8 +297,16 @@ struct mbuf {
#define M_HASHTYPE_OPAQUE 255 /* ordering, not affinity */
#define M_HASHTYPE_CLEAR(m) ((m)->m_pkthdr.rsstype = 0)
-#define M_HASHTYPE_GET(m) ((m)->m_pkthdr.rsstype)
-#define M_HASHTYPE_SET(m, v) ((m)->m_pkthdr.rsstype = (v))
+/*
+ * Handle M_FLOWID for legacy drivers still using them.
+ */
+#define M_HASHTYPE_GET(m) ((m->m_flags & M_FLOWID) ? M_HASHTYPE_OPAQUE \
+ : (m)->m_pkthdr.rsstype)
+#define M_HASHTYPE_SET(m, v) do { \
+ if ((v) != M_HASHTYPE_NONE) \
+ m->m_flags |= M_FLOWID; \
+ (m)->m_pkthdr.rsstype = (v); \
+} while (0)
#define M_HASHTYPE_TEST(m, v) (M_HASHTYPE_GET(m) == (v))
/*
diff --git a/sys/sys/param.h b/sys/sys/param.h
index c891976..8900ea1 100644
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -58,7 +58,7 @@
* in the range 5 to 9.
*/
#undef __FreeBSD_version
-#define __FreeBSD_version 1001514 /* Master, propagated to newvers */
+#define __FreeBSD_version 1001515 /* Master, propagated to newvers */
/*
* __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
OpenPOWER on IntegriCloud