From owner-svn-src-head@FreeBSD.ORG Thu Jun 26 04:12:42 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 12FDD75E; Thu, 26 Jun 2014 04:12:42 +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 D949B293F; Thu, 26 Jun 2014 04:12:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5Q4CfEK038165; Thu, 26 Jun 2014 04:12:41 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5Q4CfXU038163; Thu, 26 Jun 2014 04:12:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201406260412.s5Q4CfXU038163@svn.freebsd.org> From: Adrian Chadd Date: Thu, 26 Jun 2014 04:12:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267895 - 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: Thu, 26 Jun 2014 04:12:42 -0000 Author: adrian Date: Thu Jun 26 04:12:41 2014 New Revision: 267895 URL: http://svnweb.freebsd.org/changeset/base/267895 Log: Retire IP_RSSCPUID ; the right thing to do is query the RSS bucket; map the bucket to an RSS queue, then map the queue to a CPU ID. This way the bucket->queue and queue->CPU mapping can change over time. Introduce IP_RSSBUCKETID - which instead looks up the RSS bucket. User applications can then map the RSS bucket to a CPU. Modified: head/sys/netinet/in.h head/sys/netinet/ip_output.c Modified: head/sys/netinet/in.h ============================================================================== --- head/sys/netinet/in.h Thu Jun 26 04:04:53 2014 (r267894) +++ head/sys/netinet/in.h Thu Jun 26 04:12:41 2014 (r267895) @@ -468,9 +468,10 @@ __END_DECLS #define IP_MINTTL 66 /* minimum TTL for packet or drop */ #define IP_DONTFRAG 67 /* don't fragment packet */ #define IP_RECVTOS 68 /* bool; receive IP TOS w/dgram */ -#define IP_FLOWID 69 /* flow id for the given socket/inp */ -#define IP_FLOWTYPE 70 /* flow type (M_HASHTYPE) */ -#define IP_RSSCPUID 71 /* RSS flowid -> CPU id mapping */ +#define IP_FLOWID 69 /* get flow id for the given socket/inp */ +#define IP_FLOWTYPE 70 /* get flow type (M_HASHTYPE) */ +/* 71 - XXX was IP_RSSCPUID - can recycle whenever */ +#define IP_RSSBUCKETID 72 /* get RSS flowid -> bucket mapping */ /* IPv4 Source Filter Multicast API [RFC3678] */ #define IP_ADD_SOURCE_MEMBERSHIP 70 /* join a source-specific group */ Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Thu Jun 26 04:04:53 2014 (r267894) +++ head/sys/netinet/ip_output.c Thu Jun 26 04:12:41 2014 (r267895) @@ -1244,9 +1244,14 @@ ip_ctloutput(struct socket *so, struct s optval = inp->inp_flowtype; break; #ifdef RSS - case IP_RSSCPUID: - optval = rss_hash2cpuid(inp->inp_flowid, - inp->inp_flowtype); + case IP_RSSBUCKETID: + retval = rss_hash2bucket(inp->inp_flowid, + inp->inp_flowtype, + &rss_bucket); + if (retval == 0) + optval = rss_bucket; + else + error = EINVAL; break; #endif }