diff options
| author | Edward Cree <[email protected]> | 2024-08-07 16:06:12 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2024-08-08 15:54:33 +0000 |
| commit | b54de55990b0467538c6bb33523b28816384958a (patch) | |
| tree | 22dfd137cf6326d2af9e6386baad788cb3b41e9f /drivers/net/dsa/microchip/ksz_common.c | |
| parent | net: pse-pd: tps23881: include missing bitfield.h header (diff) | |
| download | kernel-b54de55990b0467538c6bb33523b28816384958a.tar.gz kernel-b54de55990b0467538c6bb33523b28816384958a.zip | |
net: ethtool: fix off-by-one error in max RSS context IDs
Both ethtool_ops.rxfh_max_context_id and the default value used when
it's not specified are supposed to be exclusive maxima (the former
is documented as such; the latter, U32_MAX, cannot be used as an ID
since it equals ETH_RXFH_CONTEXT_ALLOC), but xa_alloc() expects an
inclusive maximum.
Subtract one from 'limit' to produce an inclusive maximum, and pass
that to xa_alloc().
Increase bnxt's max by one to prevent a (very minor) regression, as
BNXT_MAX_ETH_RSS_CTX is an inclusive max. This is safe since bnxt
is not actually hard-limited; BNXT_MAX_ETH_RSS_CTX is just a
leftover from old driver code that managed context IDs itself.
Rename rxfh_max_context_id to rxfh_max_num_contexts to make its
semantics (hopefully) more obvious.
Fixes: 847a8ab18676 ("net: ethtool: let the core choose RSS context IDs")
Signed-off-by: Edward Cree <[email protected]>
Link: https://patch.msgid.link/5a2d11a599aa5b0cc6141072c01accfb7758650c.1723045898.git.ecree.xilinx@gmail.com
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'drivers/net/dsa/microchip/ksz_common.c')
0 files changed, 0 insertions, 0 deletions
