All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] net/mlx4: fix returned values upon failed probing
@ 2017-03-27 14:17 Gaetan Rivet
  2017-03-27 14:17 ` [PATCH 2/2] net/mlx5: " Gaetan Rivet
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Gaetan Rivet @ 2017-03-27 14:17 UTC (permalink / raw)
  To: dev; +Cc: stable

Let error messages in place, but return unambiguous values upon
probing errors.

Fixes: 66e1591687ac ("mlx4: avoid init errors when kernel modules are not loaded")
Cc: stable@dpdk.org

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 drivers/net/mlx4/mlx4.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 665d8f7..24166c9 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -5706,10 +5706,8 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 	list = ibv_exp_get_device_list(&i);
 	if (list == NULL) {
 		assert(errno);
-		if (errno == ENOSYS) {
-			WARN("cannot list devices, is ib_uverbs loaded?");
-			return 0;
-		}
+		if (errno == ENOSYS)
+			ERROR("cannot list devices, is ib_uverbs loaded?");
 		return -errno;
 	}
 	assert(i >= 0);
@@ -5741,11 +5739,11 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 		ibv_free_device_list(list);
 		switch (err) {
 		case 0:
-			WARN("cannot access device, is mlx4_ib loaded?");
-			return 0;
+			ERROR("cannot access device, is mlx4_ib loaded?");
+			return -ENODEV;
 		case EINVAL:
-			WARN("cannot use device, are drivers up to date?");
-			return 0;
+			ERROR("cannot use device, are drivers up to date?");
+			return -EINVAL;
 		}
 		assert(err > 0);
 		return -err;
-- 
2.1.4

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

* [PATCH 2/2] net/mlx5: fix returned values upon failed probing
  2017-03-27 14:17 [PATCH 1/2] net/mlx4: fix returned values upon failed probing Gaetan Rivet
@ 2017-03-27 14:17 ` Gaetan Rivet
  2017-03-28 10:15 ` [dpdk-stable] [PATCH 1/2] net/mlx4: " Ferruh Yigit
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Gaetan Rivet @ 2017-03-27 14:17 UTC (permalink / raw)
  To: dev; +Cc: Adrien Mazarguil, Nelio Laranjeiro, stable

Fixes: 771fa900b73a ("mlx5: introduce new driver for Mellanox ConnectX-4 adapters")
Cc: stable@dpdk.org

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 drivers/net/mlx5/mlx5.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index bc6a34f..f034e88 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -408,10 +408,8 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 	list = ibv_get_device_list(&i);
 	if (list == NULL) {
 		assert(errno);
-		if (errno == ENOSYS) {
-			WARN("cannot list devices, is ib_uverbs loaded?");
-			return 0;
-		}
+		if (errno == ENOSYS)
+			ERROR("cannot list devices, is ib_uverbs loaded?");
 		return -errno;
 	}
 	assert(i >= 0);
@@ -475,11 +473,11 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 		ibv_free_device_list(list);
 		switch (err) {
 		case 0:
-			WARN("cannot access device, is mlx5_ib loaded?");
-			return 0;
+			ERROR("cannot access device, is mlx5_ib loaded?");
+			return -ENODEV;
 		case EINVAL:
-			WARN("cannot use device, are drivers up to date?");
-			return 0;
+			ERROR("cannot use device, are drivers up to date?");
+			return -EINVAL;
 		}
 		assert(err > 0);
 		return -err;
-- 
2.1.4

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

* Re: [dpdk-stable] [PATCH 1/2] net/mlx4: fix returned values upon failed probing
  2017-03-27 14:17 [PATCH 1/2] net/mlx4: fix returned values upon failed probing Gaetan Rivet
  2017-03-27 14:17 ` [PATCH 2/2] net/mlx5: " Gaetan Rivet
@ 2017-03-28 10:15 ` Ferruh Yigit
  2017-03-28 14:14   ` Gaëtan Rivet
  2017-03-28 14:13 ` [PATCH v2 " Gaetan Rivet
  2017-03-28 14:13 ` [PATCH v2 2/2] net/mlx5: " Gaetan Rivet
  3 siblings, 1 reply; 7+ messages in thread
From: Ferruh Yigit @ 2017-03-28 10:15 UTC (permalink / raw)
  To: Gaetan Rivet, dev; +Cc: stable

On 3/27/2017 3:17 PM, Gaetan Rivet wrote:
> Let error messages in place, but return unambiguous values upon
> probing errors.
> 
> Fixes: 66e1591687ac ("mlx4: avoid init errors when kernel modules are not loaded")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

Hi Gaetan,

I am getting merge conflict in this patch, can you please rebase it on
top of latest next-net?

Thanks,
ferruh

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

* [PATCH v2 1/2] net/mlx4: fix returned values upon failed probing
  2017-03-27 14:17 [PATCH 1/2] net/mlx4: fix returned values upon failed probing Gaetan Rivet
  2017-03-27 14:17 ` [PATCH 2/2] net/mlx5: " Gaetan Rivet
  2017-03-28 10:15 ` [dpdk-stable] [PATCH 1/2] net/mlx4: " Ferruh Yigit
@ 2017-03-28 14:13 ` Gaetan Rivet
  2017-04-19 15:58   ` [dpdk-stable] " Ferruh Yigit
  2017-03-28 14:13 ` [PATCH v2 2/2] net/mlx5: " Gaetan Rivet
  3 siblings, 1 reply; 7+ messages in thread
From: Gaetan Rivet @ 2017-03-28 14:13 UTC (permalink / raw)
  To: dev; +Cc: Adrien Mazarguil, Nelio Laranjeiro, stable

Let error messages in place, but return unambiguous values upon
probing errors.

Fixes: 66e1591687ac ("mlx4: avoid init errors when kernel modules are not loaded")
Cc: stable@dpdk.org

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 drivers/net/mlx4/mlx4.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 4427ca3..350b2f4 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -5521,10 +5521,8 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 	list = ibv_get_device_list(&i);
 	if (list == NULL) {
 		assert(errno);
-		if (errno == ENOSYS) {
-			WARN("cannot list devices, is ib_uverbs loaded?");
-			return 0;
-		}
+		if (errno == ENOSYS)
+			ERROR("cannot list devices, is ib_uverbs loaded?");
 		return -errno;
 	}
 	assert(i >= 0);
@@ -5556,11 +5554,11 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 		ibv_free_device_list(list);
 		switch (err) {
 		case 0:
-			WARN("cannot access device, is mlx4_ib loaded?");
-			return 0;
+			ERROR("cannot access device, is mlx4_ib loaded?");
+			return -ENODEV;
 		case EINVAL:
-			WARN("cannot use device, are drivers up to date?");
-			return 0;
+			ERROR("cannot use device, are drivers up to date?");
+			return -EINVAL;
 		}
 		assert(err > 0);
 		return -err;
-- 
2.1.4

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

* [PATCH v2 2/2] net/mlx5: fix returned values upon failed probing
  2017-03-27 14:17 [PATCH 1/2] net/mlx4: fix returned values upon failed probing Gaetan Rivet
                   ` (2 preceding siblings ...)
  2017-03-28 14:13 ` [PATCH v2 " Gaetan Rivet
@ 2017-03-28 14:13 ` Gaetan Rivet
  3 siblings, 0 replies; 7+ messages in thread
From: Gaetan Rivet @ 2017-03-28 14:13 UTC (permalink / raw)
  To: dev; +Cc: Adrien Mazarguil, Nelio Laranjeiro, stable

Fixes: 771fa900b73a ("mlx5: introduce new driver for Mellanox ConnectX-4 adapters")
Cc: stable@dpdk.org

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
 drivers/net/mlx5/mlx5.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index bc6a34f..f034e88 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -408,10 +408,8 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 	list = ibv_get_device_list(&i);
 	if (list == NULL) {
 		assert(errno);
-		if (errno == ENOSYS) {
-			WARN("cannot list devices, is ib_uverbs loaded?");
-			return 0;
-		}
+		if (errno == ENOSYS)
+			ERROR("cannot list devices, is ib_uverbs loaded?");
 		return -errno;
 	}
 	assert(i >= 0);
@@ -475,11 +473,11 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 		ibv_free_device_list(list);
 		switch (err) {
 		case 0:
-			WARN("cannot access device, is mlx5_ib loaded?");
-			return 0;
+			ERROR("cannot access device, is mlx5_ib loaded?");
+			return -ENODEV;
 		case EINVAL:
-			WARN("cannot use device, are drivers up to date?");
-			return 0;
+			ERROR("cannot use device, are drivers up to date?");
+			return -EINVAL;
 		}
 		assert(err > 0);
 		return -err;
-- 
2.1.4

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

* Re: [dpdk-stable] [PATCH 1/2] net/mlx4: fix returned values upon failed probing
  2017-03-28 10:15 ` [dpdk-stable] [PATCH 1/2] net/mlx4: " Ferruh Yigit
@ 2017-03-28 14:14   ` Gaëtan Rivet
  0 siblings, 0 replies; 7+ messages in thread
From: Gaëtan Rivet @ 2017-03-28 14:14 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev, stable

Hi Ferruh,

On Tue, Mar 28, 2017 at 11:15:42AM +0100, Ferruh Yigit wrote:
>On 3/27/2017 3:17 PM, Gaetan Rivet wrote:
>> Let error messages in place, but return unambiguous values upon
>> probing errors.
>>
>> Fixes: 66e1591687ac ("mlx4: avoid init errors when kernel modules are not loaded")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
>> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
>
>Hi Gaetan,
>
>I am getting merge conflict in this patch, can you please rebase it on
>top of latest next-net?
>

Here: http://dpdk.org/ml/archives/dev/2017-March/061871.html

>Thanks,
>ferruh
>
>

-- 
Gaëtan Rivet
6WIND

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

* Re: [dpdk-stable] [PATCH v2 1/2] net/mlx4: fix returned values upon failed probing
  2017-03-28 14:13 ` [PATCH v2 " Gaetan Rivet
@ 2017-04-19 15:58   ` Ferruh Yigit
  0 siblings, 0 replies; 7+ messages in thread
From: Ferruh Yigit @ 2017-04-19 15:58 UTC (permalink / raw)
  To: Gaetan Rivet, dev; +Cc: Adrien Mazarguil, Nelio Laranjeiro, stable

On 3/28/2017 3:13 PM, Gaetan Rivet wrote:
> Let error messages in place, but return unambiguous values upon
> probing errors.
> 
> Fixes: 66e1591687ac ("mlx4: avoid init errors when kernel modules are not loaded")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
> Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>

Series applied to dpdk-next-net/master, thanks.

(These were included into RC1, patches updated in patchwork, but it
seems missed notifying via e-mail, which is done now)

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

end of thread, other threads:[~2017-04-19 15:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-27 14:17 [PATCH 1/2] net/mlx4: fix returned values upon failed probing Gaetan Rivet
2017-03-27 14:17 ` [PATCH 2/2] net/mlx5: " Gaetan Rivet
2017-03-28 10:15 ` [dpdk-stable] [PATCH 1/2] net/mlx4: " Ferruh Yigit
2017-03-28 14:14   ` Gaëtan Rivet
2017-03-28 14:13 ` [PATCH v2 " Gaetan Rivet
2017-04-19 15:58   ` [dpdk-stable] " Ferruh Yigit
2017-03-28 14:13 ` [PATCH v2 2/2] net/mlx5: " Gaetan Rivet

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.