All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH net v1] iavf: Fix limit of total number of queues to active queues of VF
@ 2021-09-01  7:21 Karen Sornek
  2021-12-14 14:16 ` Jankowski, Konrad0
  0 siblings, 1 reply; 4+ messages in thread
From: Karen Sornek @ 2021-09-01  7:21 UTC (permalink / raw)
  To: intel-wired-lan

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: d5b33d024496 ("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>
---
 drivers/net/ethernet/intel/iavf/iavf_main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index 80437ef26..c215ca503 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -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;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Intel-wired-lan] [PATCH net v1] iavf: Fix limit of total number of queues to active queues of VF
  2021-09-01  7:21 [Intel-wired-lan] [PATCH net v1] iavf: Fix limit of total number of queues to active queues of VF Karen Sornek
@ 2021-12-14 14:16 ` Jankowski, Konrad0
  0 siblings, 0 replies; 4+ messages in thread
From: Jankowski, Konrad0 @ 2021-12-14 14:16 UTC (permalink / raw)
  To: intel-wired-lan



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Karen Sornek
> Sent: ?roda, 1 wrze?nia 2021 09:22
> To: intel-wired-lan at lists.osuosl.org
> Cc: Ashwin Vijayavel <ashwin.vijayavel@intel.com>; Sornek, Karen
> <karen.sornek@intel.com>
> Subject: [Intel-wired-lan] [PATCH net v1] 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: d5b33d024496 ("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>
> ---
>  drivers/net/ethernet/intel/iavf/iavf_main.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c
> b/drivers/net/ethernet/intel/iavf/iavf_main.c
> index 80437ef26..c215ca503 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_main.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
> @@ -2647,8 +2647,11 @@ static int iavf_validate_ch_config(struct

Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Intel-wired-lan] [PATCH net v1] iavf: Fix limit of total number of queues to active queues of VF
  2021-08-30  9:02 Karen Sornek
@ 2021-08-31 22:56 ` Nguyen, Anthony L
  0 siblings, 0 replies; 4+ messages in thread
From: Nguyen, Anthony L @ 2021-08-31 22:56 UTC (permalink / raw)
  To: intel-wired-lan

On Mon, 2021-08-30 at 11:02 +0200, Karen Sornek wrote:
> 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")


> Signed-off-by: Ashwin Vijayavel <ashwin.vijayavel@intel.com>
> Signed-off-by: Karen Sornek <karen.sornek@intel.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Intel-wired-lan] [PATCH net v1] iavf: Fix limit of total number of queues to active queues of VF
@ 2021-08-30  9:02 Karen Sornek
  2021-08-31 22:56 ` Nguyen, Anthony L
  0 siblings, 1 reply; 4+ messages in thread
From: Karen Sornek @ 2021-08-30  9:02 UTC (permalink / raw)
  To: intel-wired-lan

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")
Signed-off-by: Ashwin Vijayavel <ashwin.vijayavel@intel.com>
Signed-off-by: Karen Sornek <karen.sornek@intel.com>
---
 drivers/net/ethernet/intel/iavf/iavf_main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c b/drivers/net/ethernet/intel/iavf/iavf_main.c
index 80437ef26..c215ca503 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -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;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-12-14 14:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-01  7:21 [Intel-wired-lan] [PATCH net v1] iavf: Fix limit of total number of queues to active queues of VF Karen Sornek
2021-12-14 14:16 ` Jankowski, Konrad0
  -- strict thread matches above, loose matches on Subject: below --
2021-08-30  9:02 Karen Sornek
2021-08-31 22:56 ` Nguyen, Anthony L

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.