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>
Thu, 25 Nov 2021 08:48:39 +0000 (09:48 +0100)
commit6c9c9f48b462f3fb473f58b6bd90219007558638
tree5d38afadc53f6756cfc959b596f09118c2fb4cbc
parent593015973591a14c4f42b887ae0e9ec2dfb66ff4
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