Commit ee13aa1a2c5a ("ice: use netif_get_num_default_rss_queues()") changed the default queue count from num_online_cpus() to netif_get_num_default_rss_queues() which returns roughly half the CPU count. ice_cfg_netdev() passes vsi->alloc_txq and vsi->alloc_rxq to alloc_etherdev_mqs(), so after that commit the netdevice is created with only ~half the CPU count of Tx/Rx queues (dev->num_tx_queues). However ice_get_channels() still reports the old maximum (num_online_cpus()), and ice_set_channels() accepts requests up to that limit. When ethtool -L sets combined to the maximum, rings are assigned q_index values up to num_online_cpus()-1, which exceed dev->num_tx_queues: # ethtool -L eth0 combined 96 ice 0000:18:00.0: Failed to allocate 96 q_vectors for VSI 12, new value 49 WARNING: CPU: 25 PID: 4484 at net/core/dev.c:2853 __netif_set_xps_queue+0x835/0x9a0 [...] Call Trace: netif_set_xps_queue+0x82/0xc0 ice_vsi_cfg_txq+0x124/0x440 [ice] ice_vsi_cfg_lan_txqs+0x53/0x90 [ice] ice_vsi_cfg_lan+0x40/0x190 [ice] ice_vsi_open+0x2b/0x120 [ice] ice_vsi_recfg_qs+0x94/0x120 [ice] ice_set_channels+0x261/0x370 [ice] [...] SUT: Intel S2600WFT, 96 CPUs (Xeon Platinum 8260), E810-C for QSFP Reproduce: ethtool -L combined $(nproc) Use min(num_online_cpus(), hw queue cap) for alloc_etherdev_mqs() to size the netdevice for the actual maximum queue count, matching what ice_get_channels() reports through ethtool. Fixes: ee13aa1a2c5a ("ice: use netif_get_num_default_rss_queues()") Cc: stable@vger.kernel.org Signed-off-by: Aleksandr Loktionov --- drivers/net/ethernet/intel/ice/ice_main.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index 4da37ca..5c21c2a 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -4699,8 +4699,11 @@ static int ice_cfg_netdev(struct ice_vsi *vsi) struct net_device *netdev; u8 mac_addr[ETH_ALEN]; - netdev = alloc_etherdev_mqs(sizeof(*np), vsi->alloc_txq, - vsi->alloc_rxq); + netdev = alloc_etherdev_mqs(sizeof(*np), + min_t(int, num_online_cpus(), + vsi->back->hw.func_caps.common_cap.num_txq), + min_t(int, num_online_cpus(), + vsi->back->hw.func_caps.common_cap.num_rxq)); if (!netdev) return -ENOMEM; -- 2.43.0