Re: [PATCH net-next v5 13/15] ice: represent RSS LUTs as devlink resources

From
Jakub Kicinski <kuba@kernel.org>
Date
2026-11-19 01:11:22
Reply to
Przemek Kitszel, 2026-11-10
On Tue, 10 Nov 2026 15:07:22 +0100 Przemek Kitszel wrote:
E800 family offers three kinds of RSS LUTs: VSI LUT (sized 64), GLOBAL LUT
(sized 512), and PF LUT (sized 2048). Until now the GLOBAL kind was not
used at all. There are two possible usages for it, subsequent commit will
give VF option to acquire it, and this one enables PF to switch between PF
LUT and GLOBAL LUT - switching to smaller one is, again, to make it
possible for VF to then acquire the former one.

Devlink resources are used to let user show current usage and change the
allocation, see examples below.

Default state on 8-port card, asking for aggregate "whole device" usage,
note that there are as many PF LUTs as there is PFs, and, for e810, there
are 16 GLOBAL LUTs:
$ devlink resource show devlink_index/11
devlink_index/11:
  name rss size 8 unit entry size_min 0 size_max 24 size_gran 1 dpipe_tables none
    resources:
      name lut_512 size 0 unit entry size_min 0 size_max 16 size_gran 1 dpipe_tables none
      name lut_2048 size 8 unit entry size_min 0 size_max 8 size_gran 1 dpipe_tables none
The LUTs are not sub-dividable right? The 512 LUT tables "always
exist", they are not collapsed up to form the 2048 entry ones?
If so it'd be more intuitive to me to have:

 lut_512 size $hw-count size_max $hw-count occ $currently-used

size 0 size_max 16 would tell me we configured the device to not have
any 512 LUTs but IIUC it does still have them.

Then I'd have expected per-PF/VF resource which tells the driver
max LUT size allowed for the function:

 lut/pf0 size 1024 (<- we let it use 1024 LUT) 
         size_max 2048 (<- max configurable)
         occ 512 (<- currently only 512 is used)

maybe for you occ == size to day, but we tried to lay the foundation
for dynamic RSS table sizing in Netlink. Note that Netlink accepts RSS
tables smaller than the one reported by the device. I intend it to
mean that user wants the table at least that size. IOW if device
declares it's RSS table as 2048 but user send a table of 512 entries
via devlink - the driver should be free to reallocate the table down
to 512 (or a multiple, so 1024, Bjorn has added the "fold / unfold"
helpers already as part of other work).

What am I missing?
Now let's add GLOBAL LUT for a single PF (on one-port NIC):
$ sudo devlink resource set pci/0000:18:00.0 path rss/lut_512 size 1
And show it's resources after that:
$ devlink resource show pci/0000:18:00.0
pci/0000:18:00.0:
  name rss size 2 unit entry size_min 0 size_max 2 size_gran 1 dpipe_tables none
    resources:
      name lut_512 size 1 unit entry size_min 0 size_max 1 size_gran 1 dpipe_tables none
      name lut_2048 size 1 unit entry size_min 0 size_max 1 size_gran 1 dpipe_tables none
Let's take the PF LUT out of that PF afterwards:
$ sudo devlink resource set pci/0000:18:00.0 path rss/lut_2048 size 0
now `ethtool -x $ifacename` will report smaller RSS table.

Changing the LUT of a PF resets its RSS indirection table to the default
spread, as the table size changes, and the ethtool core is told that
the user table is lost. The PF LUT change is done under rtnl, as
the ethtool core sizes its RSS buffers by the table size under rtnl.
Why?! 😱️
The resource change should only control the max table size the driver
can allocate *when it allocates a new one*. Increasing the max allowed
table size certainly mustn't cause loss of config.
FW drops RSS LUT assignments on reset, so the driver gives the PF its PF
LUT back after each reset, and logs when that discards a devlink change.
Changes are rejected with -EBUSY while a reset is in progress.
Thread (35 messages) 35 messages, 6 authors, last reply 8h ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help