Skip to contentSkip to conversation

iavf: Fix limit of total number of queues to active queues of VF

PATCH In review Karen Sornek 3 participants 3 messages Aug 30, 2021 – Aug 31, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iavf: Fix limit of total number of queues to active queues of VF

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 129cf89e5856 ("iavf: rename functions and structs to new name")
---
 drivers/net/ethernet/intel/iavf/iavf_main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/iavf/iavf_main.c +4 -1
index 80437ef26..c215ca503 100644
@@ -2647,8 +2647,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;
Signature · 1 line
2.27.0
#1 lore raw

[Intel-wired-lan] Incorrect time (was: [PATCH net v1] iavf: Fix limit of total number of queues to active queues of VF)

Dear Karen,

The date of your mail is from the future influencing the email sorting. This has been a problem in the past for emails from Intel accounts. Can you please look into it and fix it?

Kind regards,

Paul

#2 lore raw

PATCH 1/1 iavf: Fix limit of total number of queues to active queues of VF

In reply to Karen Sornek
Quoted 11 lines · Karen Sornek

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 129cf89e5856 ("iavf: rename functions and structs to new

name")

I believe this commit is more appropriate? d5b33d024496 ("i40evf: add ndo_setup_tc callback to i40evf")

Quoted 2 lines