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.
This commit is contained in:
Adrian Chadd 2014-06-26 02:49:51 +00:00
parent 60e5655540
commit a6c88ec4fb
2 changed files with 21 additions and 0 deletions

View File

@ -399,6 +399,26 @@ rss_getbucket(u_int hash)
return (hash & rss_mask);
}
/*
* 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.
*/

View File

@ -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);