i40e: Fix creation of first queue by omitting it if is not power of two
authorJedrzej Jagielski <jedrzej.jagielski@intel.com>
Mon, 21 Jun 2021 08:37:31 +0000 (08:37 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Nov 2021 09:39:17 +0000 (10:39 +0100)
commit028ea7b090ec265d31957e47ef4bebc980339e1d
tree0b4ba07ebf65c78e813501501c02149a69ac1a44
parent69868d7a8853cebb5a4e197da323bab5bc2470ec
i40e: Fix creation of first queue by omitting it if is not power of two

[ Upstream commit 2e6d218c1ec6fb9cd70693b78134cbc35ae0b5a9 ]

Reject TCs creation with proper message if the first queue
assignment is not equal to the power of two.
The first queue number was checked too late in the second queue
iteration, if second queue was configured at all. Now if first queue value
is not a power of two, then trying to create qdisc will be rejected.

Fixes: 8f88b3034db3 ("i40e: Add infrastructure for queue channel support")
Signed-off-by: Grzegorz Szczurek <grzegorzx.szczurek@intel.com>
Signed-off-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
Tested-by: Tony Brelinski <tony.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/i40e/i40e_main.c