]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commit
i40e: Fix virtchnl_queue_select bitmap validation
authorBrett Creeley <brett.creeley@intel.com>
Wed, 13 Nov 2019 19:28:17 +0000 (11:28 -0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 13 Mar 2020 04:52:39 +0000 (00:52 -0400)
commit979c5c61f9d71ebe36d09a59a9e5e9fefbc9bed2
tree8c2a063c0949b8d1ab3538c1b753c02b6b66e9e0
parent824e83458f30e8435016e22a7a4c6e8339ca72f3
i40e: Fix virtchnl_queue_select bitmap validation

BugLink: https://bugs.launchpad.net/bugs/1866403
[ Upstream commit d9d6a9aed3f66f8ce5fa3ca6ca26007d75032296 ]

Currently in i40e_vc_disable_queues_msg() we are incorrectly
validating the virtchnl queue select bitmaps. The
virtchnl_queue_select rx_queues and tx_queue bitmap is being
compared against ICE_MAX_VF_QUEUES, but the problem is that
these bitmaps can have a value greater than I40E_MAX_VF_QUEUES.
Fix this by comparing the bitmaps against BIT(I40E_MAX_VF_QUEUES).

Also, add the function i40e_vc_validate_vqs_bitmaps() that checks to see
if both virtchnl_queue_select bitmaps are empty along with checking that
the bitmaps only have valid bits set. This function can then be used in
both the queue enable and disable flows.

Suggested-by: Arkady Gilinksky <arkady.gilinsky@harmonicinc.com>
Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c