Merge branch 'intel-interpret-set_channels-input-differently'
authorPaolo Abeni <pabeni@redhat.com>
Thu, 23 May 2024 11:02:28 +0000 (13:02 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 23 May 2024 11:02:28 +0000 (13:02 +0200)
commit3d8597d8d7d9b3faffe0f2361032123ee6c09c02
treeca0f475835937dc836ff51b6e774b3113de991e6
parent6671e352497ca4bb07a96c48e03907065ff77d8a
parent5e7695e0219bf6acb96081af3ba0ca08b1829656
Merge branch 'intel-interpret-set_channels-input-differently'

Jacob Keller says:

====================
intel: Interpret .set_channels() input differently

The ice and idpf drivers can trigger a crash with AF_XDP due to incorrect
interpretation of the asymmetric Tx and Rx parameters in their
.set_channels() implementations:

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. the driver interprets `rx 15 tx 15` as 15 combined channels and deletes
   the queue that AF_XDP is attached to.

This is fundamentally a problem with interpreting a request for asymmetric
queues as symmetric combined queues.

Fix the ice and idpf drivers to stop interpreting such requests as a
request for combined queues. Due to current driver design for both ice and
idpf, it is not possible to support requests of the same count of Tx and Rx
queues with independent interrupts, (i.e. ethtool -L <IFNAME> rx 15 tx 15)
so such requests are now rejected.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
====================

Link: https://lore.kernel.org/r/20240521-iwl-net-2024-05-14-set-channels-fixes-v2-0-7aa39e2e99f1@intel.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>