diff options
author | Larysa Zaremba <[email protected]> | 2024-05-21 12:39:53 -0700 |
---|---|---|
committer | Paolo Abeni <[email protected]> | 2024-05-23 13:02:26 +0200 |
commit | 05d6f442f31f901d27dbc64fd504a8ec7d5013de (patch) | |
tree | 3f39aa5555dfc14f555ce06d1c64725f8dc453c6 /include/linux/fpga/fpga-mgr.h | |
parent | 6671e352497ca4bb07a96c48e03907065ff77d8a (diff) |
ice: Interpret .set_channels() input differently
A bug occurs because a safety check guarding AF_XDP-related queues in
ethnl_set_channels(), does not trigger. This happens, because kernel and
ice driver interpret the ethtool command differently.
How the bug occurs:
1. ethtool -l <IFNAME> -> combined: 40
2. Attach AF_XDP to queue 30
3. ethtool -L <IFNAME> rx 15 tx 15
combined number is not specified, so command becomes {rx_count = 15,
tx_count = 15, combined_count = 40}.
4. ethnl_set_channels checks, if there are any AF_XDP of queues from the
new (combined_count + rx_count) to the old one, so from 55 to 40, check
does not trigger.
5. ice interprets `rx 15 tx 15` as 15 combined channels and deletes the
queue that AF_XDP is attached to.
Interpret the command in a way that is more consistent with ethtool
manual [0] (--show-channels and --set-channels).
Considering that in the ice driver only the difference between RX and TX
queues forms dedicated channels, change the correct way to set number of
channels to:
ethtool -L <IFNAME> combined 10 /* For symmetric queues */
ethtool -L <IFNAME> combined 8 tx 2 rx 0 /* For asymmetric queues */
[0] https://man7.org/linux/man-pages/man8/ethtool.8.html
Fixes: 87324e747fde ("ice: Implement ethtool ops for channels")
Reviewed-by: Michal Swiatkowski <[email protected]>
Signed-off-by: Larysa Zaremba <[email protected]>
Tested-by: Chandan Kumar Rout <[email protected]>
Tested-by: Pucha Himasekhar Reddy <[email protected]>
Acked-by: Maciej Fijalkowski <[email protected]>
Signed-off-by: Jacob Keller <[email protected]>
Signed-off-by: Paolo Abeni <[email protected]>
Diffstat (limited to 'include/linux/fpga/fpga-mgr.h')
0 files changed, 0 insertions, 0 deletions