From owner-svn-src-head@FreeBSD.ORG Thu Jun 26 02:49:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B55C58B1; Thu, 26 Jun 2014 02:49:52 +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 88B872205; Thu, 26 Jun 2014 02:49:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s5Q2nqcE097013; Thu, 26 Jun 2014 02:49:52 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s5Q2nqMG097010; Thu, 26 Jun 2014 02:49:52 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201406260249.s5Q2nqMG097010@svn.freebsd.org> From: Adrian Chadd Date: Thu, 26 Jun 2014 02:49:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r267891 - 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 02:49:52 -0000 Author: adrian Date: Thu Jun 26 02:49:51 2014 New Revision: 267891 URL: http://svnweb.freebsd.org/changeset/base/267891 Log: Add another RSS method to query the indirection table entries. There's 128 indirection table entries which correspond to the low 7 bits of the 32 bit RSS hash. Each value will correspond to an RSS bucket. (Then each RSS bucket currently will map to a CPU.) This is a more explicit way of figuring out which RSS bucket is in each RSS indirection slot. It can be inferred by the other methods but I'd rather drivers use something more simplified and explicit. Modified: head/sys/netinet/in_rss.c head/sys/netinet/in_rss.h Modified: head/sys/netinet/in_rss.c ============================================================================== --- head/sys/netinet/in_rss.c Thu Jun 26 02:39:17 2014 (r267890) +++ head/sys/netinet/in_rss.c Thu Jun 26 02:49:51 2014 (r267891) @@ -400,6 +400,26 @@ rss_getbucket(u_int hash) } /* + * Query the RSS layer bucket associated with the given + * entry in the RSS hash space. + * + * The RSS indirection table is 0 .. rss_buckets-1, + * covering the low 'rss_bits' of the total 128 slot + * RSS indirection table. So just mask off rss_bits and + * return that. + * + * NIC drivers can then iterate over the 128 slot RSS + * indirection table and fetch which RSS bucket to + * map it to. This will typically be a CPU queue + */ +u_int +rss_get_indirection_to_bucket(u_int index) +{ + + return (index & rss_mask); +} + +/* * Query the RSS CPU associated with an RSS bucket. */ u_int Modified: head/sys/netinet/in_rss.h ============================================================================== --- head/sys/netinet/in_rss.h Thu Jun 26 02:39:17 2014 (r267890) +++ head/sys/netinet/in_rss.h Thu Jun 26 02:49:51 2014 (r267891) @@ -69,6 +69,7 @@ */ u_int rss_getbits(void); u_int rss_getbucket(u_int hash); +u_int rss_get_indirection_to_bucket(u_int index); u_int rss_getcpu(u_int bucket); void rss_getkey(uint8_t *key); u_int rss_gethashalgo(void);