Commit 5ba8868
committed
aq(4): Distribute RSS over min(rings, 8) with a modulo
aq_if_attach_post() built the RSS indirection table with
rss_table[i] = i & (rx_rings_count - 1);
which assumes rx_rings_count is a power of two. iflib does not
guarantee that (queue counts such as 6, 12 or 24 are possible), so the
mask left some queues with no entries and skewed the hash distribution.
When rx_rings_count was 0 the (count - 1) underflow also turned the mask
into a no-op rather than failing safe.
Use a modulo over min(rx_rings_count, HW_ATL_RSS_QUEUES_MAX) instead.
The redirection-table field is 3 bits wide, so the hardware can only
hash across 8 queues regardless of ring count; capping here keeps the
table values in range and complements the bounds fix in aq_hw_rss_set().
Signed-off-by: Nick Price <nick@spun.io>1 parent f7b158a commit 5ba8868
2 files changed
Lines changed: 10 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| 200 | + | |
| 201 | + | |
200 | 202 | | |
201 | 203 | | |
202 | 204 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
464 | 464 | | |
465 | 465 | | |
466 | 466 | | |
467 | | - | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
468 | 471 | | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
469 | 475 | | |
470 | | - | |
| 476 | + | |
471 | 477 | | |
472 | 478 | | |
473 | 479 | | |
| |||
0 commit comments