From owner-svn-src-stable-10@FreeBSD.ORG Mon May 11 20:26:36 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A6F69DFD; Mon, 11 May 2015 20:26:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94D171760; Mon, 11 May 2015 20:26:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4BKQaLR064578; Mon, 11 May 2015 20:26:36 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4BKQZEh064574; Mon, 11 May 2015 20:26:35 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201505112026.t4BKQZEh064574@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Mon, 11 May 2015 20:26:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r282781 - in stable/10: share/man/man9 sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2015 20:26:36 -0000 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,