summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2014-06-26 02:49:51 +0000
committeradrian <adrian@FreeBSD.org>2014-06-26 02:49:51 +0000
commit90965b8d6e915fe3ffd2608bfd6937d986f2abf4 (patch)
treed58e08161c6243f9c33851679afb6e725d82235b
parent6e86e0007a8393f192925fc28266b65eda68c621 (diff)
downloadFreeBSD-src-90965b8d6e915fe3ffd2608bfd6937d986f2abf4.zip
FreeBSD-src-90965b8d6e915fe3ffd2608bfd6937d986f2abf4.tar.gz
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.
-rw-r--r--sys/netinet/in_rss.c20
-rw-r--r--sys/netinet/in_rss.h1
2 files changed, 21 insertions, 0 deletions
diff --git a/sys/netinet/in_rss.c b/sys/netinet/in_rss.c
index f081db8..698373f 100644
--- a/sys/netinet/in_rss.c
+++ b/sys/netinet/in_rss.c
@@ -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
diff --git a/sys/netinet/in_rss.h b/sys/netinet/in_rss.h
index 0ee704b..8d390f1 100644
--- a/sys/netinet/in_rss.h
+++ b/sys/netinet/in_rss.h
@@ -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);
OpenPOWER on IntegriCloud