Author: sephe
Date: Mon May 30 04:48:06 2016
New Revision: 300982
URL: https://svnweb.freebsd.org/changeset/base/300982

Log:
  mbuf: Add a flag for M_HASHTYPE_ to indicate the type has hash properties
  
  This flag has not been used, and drivers setting M_HASHTYPE_OPAQUE have
  not been converted as of this commit.
  
  Reviewed by:  hps, gallatin (early version)
  Sponsored by: Microsoft OSTC
  Differential Revision:        https://reviews.freebsd.org/D6406

Modified:
  head/sys/sys/mbuf.h
  head/sys/sys/param.h

Modified: head/sys/sys/mbuf.h
==============================================================================
--- head/sys/sys/mbuf.h Mon May 30 03:31:37 2016        (r300981)
+++ head/sys/sys/mbuf.h Mon May 30 04:48:06 2016        (r300982)
@@ -318,30 +318,41 @@ struct mbuf {
  *
  * Most NICs support RSS, which provides ordering and explicit affinity, and
  * use the hash m_flag bits to indicate what header fields were covered by
- * the hash.  M_HASHTYPE_OPAQUE can be set by non-RSS cards or configurations
- * that provide an opaque flow identifier, allowing for ordering and
- * distribution without explicit affinity.
+ * the hash.  M_HASHTYPE_OPAQUE and M_HASHTYPE_OPAQUE_HASH can be set by non-
+ * RSS cards or configurations that provide an opaque flow identifier, allowing
+ * for ordering and distribution without explicit affinity.  Additionally,
+ * M_HASHTYPE_OPAQUE_HASH indicates that the flow identifier has hash
+ * properties.
  */
+#define        M_HASHTYPE_HASHPROP             0x80    /* has hash properties 
*/
+#define        M_HASHTYPE_HASH(t)              (M_HASHTYPE_HASHPROP | (t))
 /* Microsoft RSS standard hash types */
 #define        M_HASHTYPE_NONE                 0
-#define        M_HASHTYPE_RSS_IPV4             1       /* IPv4 2-tuple */
-#define        M_HASHTYPE_RSS_TCP_IPV4         2       /* TCPv4 4-tuple */
-#define        M_HASHTYPE_RSS_IPV6             3       /* IPv6 2-tuple */
-#define        M_HASHTYPE_RSS_TCP_IPV6         4       /* TCPv6 4-tuple */
-#define        M_HASHTYPE_RSS_IPV6_EX          5       /* IPv6 2-tuple + ext 
hdrs */
-#define        M_HASHTYPE_RSS_TCP_IPV6_EX      6       /* TCPv6 4-tiple + ext 
hdrs */
+#define        M_HASHTYPE_RSS_IPV4             M_HASHTYPE_HASH(1) /* IPv4 
2-tuple */
+#define        M_HASHTYPE_RSS_TCP_IPV4         M_HASHTYPE_HASH(2) /* TCPv4 
4-tuple */
+#define        M_HASHTYPE_RSS_IPV6             M_HASHTYPE_HASH(3) /* IPv6 
2-tuple */
+#define        M_HASHTYPE_RSS_TCP_IPV6         M_HASHTYPE_HASH(4) /* TCPv6 
4-tuple */
+#define        M_HASHTYPE_RSS_IPV6_EX          M_HASHTYPE_HASH(5) /* IPv6 
2-tuple +
+                                                           * ext hdrs */
+#define        M_HASHTYPE_RSS_TCP_IPV6_EX      M_HASHTYPE_HASH(6) /* TCPv6 
4-tiple +
+                                                           * ext hdrs */
 /* Non-standard RSS hash types */
-#define        M_HASHTYPE_RSS_UDP_IPV4         7       /* IPv4 UDP 4-tuple */
-#define        M_HASHTYPE_RSS_UDP_IPV4_EX      8       /* IPv4 UDP 4-tuple + 
ext hdrs */
-#define        M_HASHTYPE_RSS_UDP_IPV6         9       /* IPv6 UDP 4-tuple */
-#define        M_HASHTYPE_RSS_UDP_IPV6_EX      10      /* IPv6 UDP 4-tuple + 
ext hdrs */
-
-#define        M_HASHTYPE_OPAQUE               255     /* ordering, not 
affinity */
+#define        M_HASHTYPE_RSS_UDP_IPV4         M_HASHTYPE_HASH(7) /* IPv4 UDP 
4-tuple*/
+#define        M_HASHTYPE_RSS_UDP_IPV4_EX      M_HASHTYPE_HASH(8) /* IPv4 UDP 
4-tuple +
+                                                           * ext hdrs */
+#define        M_HASHTYPE_RSS_UDP_IPV6         M_HASHTYPE_HASH(9) /* IPv6 UDP 
4-tuple*/
+#define        M_HASHTYPE_RSS_UDP_IPV6_EX      M_HASHTYPE_HASH(10)/* IPv6 UDP 
4-tuple +
+                                                           * ext hdrs */
+
+#define        M_HASHTYPE_OPAQUE               63      /* ordering, not 
affinity */
+#define        M_HASHTYPE_OPAQUE_HASH          
M_HASHTYPE_HASH(M_HASHTYPE_OPAQUE)
+                                               /* ordering+hash, 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))
 #define        M_HASHTYPE_TEST(m, v)   (M_HASHTYPE_GET(m) == (v))
+#define        M_HASHTYPE_ISHASH(m)    (M_HASHTYPE_GET(m) & 
M_HASHTYPE_HASHPROP)
 
 /*
  * COS/QOS class and quality of service tags.

Modified: head/sys/sys/param.h
==============================================================================
--- head/sys/sys/param.h        Mon May 30 03:31:37 2016        (r300981)
+++ head/sys/sys/param.h        Mon May 30 04:48:06 2016        (r300982)
@@ -58,7 +58,7 @@
  *             in the range 5 to 9.
  */
 #undef __FreeBSD_version
-#define __FreeBSD_version 1100114      /* Master, propagated to newvers */
+#define __FreeBSD_version 1100115      /* Master, propagated to newvers */
 
 /*
  * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to