svn commit: r282781 - in stable/10: share/man/man9 sys/sys
Hiren Panchasara
hiren at FreeBSD.org
Mon May 11 20:26:36 UTC 2015
Author: hiren
Date: Mon May 11 20:26:35 2015
New Revision: 282781
URL: https://svnweb.freebsd.org/changeset/base/282781
Log:
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
Modified:
stable/10/share/man/man9/netisr.9
stable/10/sys/sys/mbuf.h
stable/10/sys/sys/param.h
Modified: stable/10/share/man/man9/netisr.9
==============================================================================
--- stable/10/share/man/man9/netisr.9 Mon May 11 19:55:01 2015 (r282780)
+++ stable/10/share/man/man9/netisr.9 Mon May 11 20:26:35 2015 (r282781)
@@ -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 whitesp
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
Modified: stable/10/sys/sys/mbuf.h
==============================================================================
--- stable/10/sys/sys/mbuf.h Mon May 11 19:55:01 2015 (r282780)
+++ stable/10/sys/sys/mbuf.h Mon May 11 20:26:35 2015 (r282781)
@@ -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))
/*
Modified: stable/10/sys/sys/param.h
==============================================================================
--- stable/10/sys/sys/param.h Mon May 11 19:55:01 2015 (r282780)
+++ stable/10/sys/sys/param.h Mon May 11 20:26:35 2015 (r282781)
@@ -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,
More information about the svn-src-all
mailing list