patches for DPDK stable branches
 help / color / mirror / Atom feed
* [PATCH] common/mlx5: fix error handling in multi-class probe
@ 2021-11-24 22:02 michaelba
  2021-11-25  9:26 ` Thomas Monjalon
  2022-01-06  9:05 ` Raslan Darawsheh
  0 siblings, 2 replies; 4+ messages in thread
From: michaelba @ 2021-11-24 22:02 UTC (permalink / raw)
  To: dev
  Cc: Matan Azrad, Raslan Darawsheh, Viacheslav Ovsiienko,
	Michael Baum, stable

From: Michael Baum <michaelba@nvidia.com>

The common drivers_probe function calls in a loop to all probe functions
for classes requested by the user. After it manages to probe them all,
it updates this on the device in the "classes_loaded" field.

If one of them fails, all those probed to it are remove using the
drivers_remove function. However, this function only releases the
classes in the "classes_loaded" field on the given device and misses the
newly probed classes.

This patch removes the condition from the release function, and ensures
that the caller function sends a more accurate parameter.

Fixes: 8a41f4deccc3 ("common/mlx5: introduce layer for multiple class drivers")
Cc: stable@dpdk.org

Signed-off-by: Michael Baum <michaelba@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
---
 drivers/common/mlx5/mlx5_common.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/common/mlx5/mlx5_common.c b/drivers/common/mlx5/mlx5_common.c
index f1650f94c6..faa3d65ab3 100644
--- a/drivers/common/mlx5/mlx5_common.c
+++ b/drivers/common/mlx5/mlx5_common.c
@@ -616,7 +616,6 @@ drivers_remove(struct mlx5_common_device *cdev, uint32_t enabled_classes)
 	unsigned int i = 0;
 	int ret = 0;
 
-	enabled_classes &= cdev->classes_loaded;
 	while (enabled_classes) {
 		driver = driver_get(RTE_BIT64(i));
 		if (driver != NULL) {
@@ -665,9 +664,11 @@ drivers_probe(struct mlx5_common_device *cdev, uint32_t user_classes)
 	cdev->classes_loaded |= enabled_classes;
 	return 0;
 probe_err:
-	/* Only unload drivers which are enabled which were enabled
-	 * in this probe instance.
+	/*
+	 * Need to remove only drivers which were not probed before this probe
+	 * instance, but have already been probed before this failure.
 	 */
+	enabled_classes &= ~cdev->classes_loaded;
 	drivers_remove(cdev, enabled_classes);
 	return ret;
 }
-- 
2.25.1


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

* Re: [PATCH] common/mlx5: fix error handling in multi-class probe
  2021-11-24 22:02 [PATCH] common/mlx5: fix error handling in multi-class probe michaelba
@ 2021-11-25  9:26 ` Thomas Monjalon
  2021-11-25 10:34   ` Matan Azrad
  2022-01-06  9:05 ` Raslan Darawsheh
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Monjalon @ 2021-11-25  9:26 UTC (permalink / raw)
  To: Matan Azrad, Raslan Darawsheh, Michael Baum
  Cc: dev, Viacheslav Ovsiienko, stable, Lior Margalit, asafp

24/11/2021 23:02, michaelba@nvidia.com:
> From: Michael Baum <michaelba@nvidia.com>
> 
> The common drivers_probe function calls in a loop to all probe functions
> for classes requested by the user. After it manages to probe them all,
> it updates this on the device in the "classes_loaded" field.
> 
> If one of them fails, all those probed to it are remove using the
> drivers_remove function. However, this function only releases the
> classes in the "classes_loaded" field on the given device and misses the
> newly probed classes.
> 
> This patch removes the condition from the release function, and ensures
> that the caller function sends a more accurate parameter.
> 
> Fixes: 8a41f4deccc3 ("common/mlx5: introduce layer for multiple class drivers")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Michael Baum <michaelba@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>

How well it has been tested?
How critical it is to have in 21.11?





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

* RE: [PATCH] common/mlx5: fix error handling in multi-class probe
  2021-11-25  9:26 ` Thomas Monjalon
@ 2021-11-25 10:34   ` Matan Azrad
  0 siblings, 0 replies; 4+ messages in thread
From: Matan Azrad @ 2021-11-25 10:34 UTC (permalink / raw)
  To: NBU-Contact-Thomas Monjalon (EXTERNAL), Raslan Darawsheh, Michael Baum
  Cc: dev, Slava Ovsiienko, stable, Lior Margalit, Asaf Penso



From: Thomas Monjalon
> 24/11/2021 23:02, michaelba@nvidia.com:
> > From: Michael Baum <michaelba@nvidia.com>
> >
> > The common drivers_probe function calls in a loop to all probe
> > functions for classes requested by the user. After it manages to probe
> > them all, it updates this on the device in the "classes_loaded" field.
> >
> > If one of them fails, all those probed to it are remove using the
> > drivers_remove function. However, this function only releases the
> > classes in the "classes_loaded" field on the given device and misses
> > the newly probed classes.
> >
> > This patch removes the condition from the release function, and
> > ensures that the caller function sends a more accurate parameter.
> >
> > Fixes: 8a41f4deccc3 ("common/mlx5: introduce layer for multiple class
> > drivers")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Michael Baum <michaelba@nvidia.com>
> > Acked-by: Matan Azrad <matan@nvidia.com>
> 
> How well it has been tested?

It was tested carefully for all the remove cases.

> How critical it is to have in 21.11?

It is error flow issue, not critical.

> 


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

* RE: [PATCH] common/mlx5: fix error handling in multi-class probe
  2021-11-24 22:02 [PATCH] common/mlx5: fix error handling in multi-class probe michaelba
  2021-11-25  9:26 ` Thomas Monjalon
@ 2022-01-06  9:05 ` Raslan Darawsheh
  1 sibling, 0 replies; 4+ messages in thread
From: Raslan Darawsheh @ 2022-01-06  9:05 UTC (permalink / raw)
  To: Michael Baum, dev; +Cc: Matan Azrad, Slava Ovsiienko, stable

Hi,

> -----Original Message-----
> From: Michael Baum <michaelba@nvidia.com>
> Sent: Thursday, November 25, 2021 12:03 AM
> To: dev@dpdk.org
> Cc: Matan Azrad <matan@nvidia.com>; Raslan Darawsheh
> <rasland@nvidia.com>; Slava Ovsiienko <viacheslavo@nvidia.com>; Michael
> Baum <michaelba@nvidia.com>; stable@dpdk.org
> Subject: [PATCH] common/mlx5: fix error handling in multi-class probe
> 
> From: Michael Baum <michaelba@nvidia.com>
> 
> The common drivers_probe function calls in a loop to all probe functions
> for classes requested by the user. After it manages to probe them all,
> it updates this on the device in the "classes_loaded" field.
> 
> If one of them fails, all those probed to it are remove using the
> drivers_remove function. However, this function only releases the
> classes in the "classes_loaded" field on the given device and misses the
> newly probed classes.
> 
> This patch removes the condition from the release function, and ensures
> that the caller function sends a more accurate parameter.
> 
> Fixes: 8a41f4deccc3 ("common/mlx5: introduce layer for multiple class
> drivers")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Michael Baum <michaelba@nvidia.com>
> Acked-by: Matan Azrad <matan@nvidia.com>

Patch applied to next-net-mlx,

Kindest regards,
Raslan Darawsheh

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

end of thread, other threads:[~2022-01-06  9:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-24 22:02 [PATCH] common/mlx5: fix error handling in multi-class probe michaelba
2021-11-25  9:26 ` Thomas Monjalon
2021-11-25 10:34   ` Matan Azrad
2022-01-06  9:05 ` Raslan Darawsheh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).