Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Jun 2014 02:49:52 +0000 (UTC)
From:      Adrian Chadd <adrian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r267891 - head/sys/netinet
Message-ID:  <201406260249.s5Q2nqMG097010@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201406260249.s5Q2nqMG097010>