diff options
author | Adrian Chadd <adrian@FreeBSD.org> | 2014-06-26 02:49:51 +0000 |
---|---|---|
committer | Adrian Chadd <adrian@FreeBSD.org> | 2014-06-26 02:49:51 +0000 |
commit | a6c88ec4fb1538f51c809230e23336355a4c57d6 (patch) | |
tree | d58e08161c6243f9c33851679afb6e725d82235b | |
parent | 60e565554047690211aae3c346f8d2715868b527 (diff) | |
download | src-a6c88ec4fb1538f51c809230e23336355a4c57d6.tar.gz src-a6c88ec4fb1538f51c809230e23336355a4c57d6.zip |
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.
Notes
Notes:
svn path=/head/; revision=267891
-rw-r--r-- | sys/netinet/in_rss.c | 20 | ||||
-rw-r--r-- | sys/netinet/in_rss.h | 1 |
2 files changed, 21 insertions, 0 deletions
diff --git a/sys/netinet/in_rss.c b/sys/netinet/in_rss.c index f081db8aaf76..698373fa7aa2 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 0ee704b9f50f..8d390f1e17fb 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); |