From owner-svn-src-head@FreeBSD.ORG Sun May 18 22:37:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A520342D; Sun, 18 May 2014 22:37:31 +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 787BE225E; Sun, 18 May 2014 22:37:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s4IMbV3s058298; Sun, 18 May 2014 22:37:31 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s4IMbVmx058297; Sun, 18 May 2014 22:37:31 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201405182237.s4IMbVmx058297@svn.freebsd.org> From: Adrian Chadd Date: Sun, 18 May 2014 22:37:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r266421 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2014 22:37:31 -0000 Author: adrian Date: Sun May 18 22:37:31 2014 New Revision: 266421 URL: http://svnweb.freebsd.org/changeset/base/266421 Log: * When copying the flowid from inp -> outbound mbuf, also assign the hashtype to to the outbound mbuf as well as the flowid. * Add in socket options to fetch the hashid, the hashtype and RSS CPU ID for a given socket. Modified: head/sys/netinet/ip_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Sun May 18 22:34:06 2014 (r266420) +++ head/sys/netinet/ip_output.c Sun May 18 22:37:31 2014 (r266421) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include "opt_mpath.h" #include "opt_route.h" #include "opt_sctp.h" +#include "opt_rss.h" #include #include @@ -71,6 +72,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -144,6 +146,7 @@ ip_output(struct mbuf *m, struct mbuf *o M_SETFIB(m, inp->inp_inc.inc_fibnum); if (inp->inp_flags & (INP_HW_FLOWID|INP_SW_FLOWID)) { m->m_pkthdr.flowid = inp->inp_flowid; + M_HASHTYPE_SET(m, inp->inp_flowtype); m->m_flags |= M_FLOWID; } } @@ -1171,6 +1174,11 @@ ip_ctloutput(struct socket *so, struct s case IP_DONTFRAG: case IP_BINDANY: case IP_RECVTOS: + case IP_FLOWID: + case IP_FLOWTYPE: +#ifdef RSS + case IP_RSSCPUID: +#endif switch (sopt->sopt_name) { case IP_TOS: @@ -1232,6 +1240,18 @@ ip_ctloutput(struct socket *so, struct s case IP_RECVTOS: optval = OPTBIT(INP_RECVTOS); break; + case IP_FLOWID: + optval = inp->inp_flowid; + break; + case IP_FLOWTYPE: + optval = inp->inp_flowtype; + break; +#ifdef RSS + case IP_RSSCPUID: + optval = rss_hash2cpuid(inp->inp_flowid, + inp->inp_flowtype); + break; +#endif } error = sooptcopyout(sopt, &optval, sizeof optval); break;