]> git.baikalelectronics.ru Git - kernel.git/commitdiff
iavf: Fix limit of total number of queues to active queues of VF
authorKaren Sornek <karen.sornek@intel.com>
Wed, 1 Sep 2021 07:21:46 +0000 (09:21 +0200)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 4 Jan 2022 22:12:52 +0000 (14:12 -0800)
In the absence of this validation, if the user requests to
configure queues more than the enabled queues, it results in
sending the requested number of queues to the kernel stack
(due to the asynchronous nature of VF response), in which
case the stack might pick a queue to transmit that is not
enabled and result in Tx hang. Fix this bug by
limiting the total number of queues allocated for VF to
active queues of VF.

Fixes: e3a3d208c68d ("i40evf: add ndo_setup_tc callback to i40evf")
Signed-off-by: Ashwin Vijayavel <ashwin.vijayavel@intel.com>
Signed-off-by: Karen Sornek <karen.sornek@intel.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/iavf/iavf_main.c

index 4e7c04047f91760a88e7232415588a1f1d91b16d..e4439b095533881b8a9d915d5d8347a85987d125 100644 (file)
@@ -2708,8 +2708,11 @@ static int iavf_validate_ch_config(struct iavf_adapter *adapter,
                total_max_rate += tx_rate;
                num_qps += mqprio_qopt->qopt.count[i];
        }
-       if (num_qps > IAVF_MAX_REQ_QUEUES)
+       if (num_qps > adapter->num_active_queues) {
+               dev_err(&adapter->pdev->dev,
+                       "Cannot support requested number of queues\n");
                return -EINVAL;
+       }
 
        ret = iavf_validate_tx_bandwidth(adapter, total_max_rate);
        return ret;