ice: Don't allow more channels than LAN MSI-X available
authorBrett Creeley <brett.creeley@intel.com>
Thu, 21 Jan 2021 18:38:05 +0000 (10:38 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Feb 2021 22:28:48 +0000 (23:28 +0100)
commit04cd96db6f888cf8a79c8163c136eb30400ce206
treeac9242f6f1492bfdbe67c2f0ffea748ddcda51a5
parent55717a10a6b837355bf0dc3346346782f9302869
ice: Don't allow more channels than LAN MSI-X available

[ Upstream commit 943b881e35829403da638fcb34a959125deafef3 ]

Currently users could create more channels than LAN MSI-X available.
This is happening because there is no check against pf->num_lan_msix
when checking the max allowed channels and will cause performance issues
if multiple Tx and Rx queues are tied to a single MSI-X. Fix this by not
allowing more channels than LAN MSI-X available in pf->num_lan_msix.

Fixes: 87324e747fde ("ice: Implement ethtool ops for channels")
Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/ice/ice_ethtool.c