Skip to content

Commit 3ca132e

Browse files
ksornekgregkh
authored andcommitted
iavf: Fix limit of total number of queues to active queues of VF
commit b712941 upstream. 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: d5b33d0 ("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 396e301 commit 3ca132e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎drivers/net/ethernet/intel/iavf/iavf_main.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2598,8 +2598,11 @@ static int iavf_validate_ch_config(struct iavf_adapter *adapter,
25982598
total_max_rate += tx_rate;
25992599
num_qps += mqprio_qopt->qopt.count[i];
26002600
}
2601-
if (num_qps > IAVF_MAX_REQ_QUEUES)
2601+
if (num_qps > adapter->num_active_queues) {
2602+
dev_err(&adapter->pdev->dev,
2603+
"Cannot support requested number of queues\n");
26022604
return -EINVAL;
2605+
}
26032606

26042607
ret = iavf_validate_tx_bandwidth(adapter, total_max_rate);
26052608
return ret;

0 commit comments

Comments
 (0)