patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] bus/vdev: fix wrong error log on secondary device scan
@ 2018-08-27 12:27 Qi Zhang
  2018-08-27 16:16 ` Burakov, Anatoly
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Qi Zhang @ 2018-08-27 12:27 UTC (permalink / raw)
  To: dev; +Cc: anatoly.burakov, gage.eads, Qi Zhang, stable

When a secondary process handles VDEV_SCAN_ONE mp action, it is possible
the device is already be inserted. This happens when we have multiple
secondary processes which cause multiple broadcasts from primary during
bus->scan. So we don't need to log any error for -EEXIST.

Bugzilla ID: 84
Fixes: cdb068f031c6 ("bus/vdev: scan by multi-process channel")
Cc: stable@dpdk.org

Reported-by: Eads Gage <gage.eads@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/bus/vdev/vdev.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
index 6139dd551..af9526fe6 100644
--- a/drivers/bus/vdev/vdev.c
+++ b/drivers/bus/vdev/vdev.c
@@ -346,6 +346,7 @@ vdev_action(const struct rte_mp_msg *mp_msg, const void *peer)
 	const struct vdev_param *in = (const struct vdev_param *)mp_msg->param;
 	const char *devname;
 	int num;
+	int ret;
 
 	strlcpy(mp_resp.name, VDEV_MP_KEY, sizeof(mp_resp.name));
 	mp_resp.len_param = sizeof(*ou);
@@ -380,7 +381,10 @@ vdev_action(const struct rte_mp_msg *mp_msg, const void *peer)
 		break;
 	case VDEV_SCAN_ONE:
 		VDEV_LOG(INFO, "receive vdev, %s", in->name);
-		if (insert_vdev(in->name, NULL, NULL) < 0)
+		ret = insert_vdev(in->name, NULL, NULL);
+		if (ret == -EEXIST)
+			VDEV_LOG(INFO, "device already exist, %s", in->name);
+		else if (ret < 0)
 			VDEV_LOG(ERR, "failed to add vdev, %s", in->name);
 		break;
 	default:
-- 
2.13.6

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

* Re: [dpdk-stable] [PATCH] bus/vdev: fix wrong error log on secondary device scan
  2018-08-27 12:27 [dpdk-stable] [PATCH] bus/vdev: fix wrong error log on secondary device scan Qi Zhang
@ 2018-08-27 16:16 ` Burakov, Anatoly
  2018-09-03  8:49 ` Qi Zhang
  2018-09-03  8:50 ` [dpdk-stable] [PATCH v2] " Qi Zhang
  2 siblings, 0 replies; 6+ messages in thread
From: Burakov, Anatoly @ 2018-08-27 16:16 UTC (permalink / raw)
  To: Qi Zhang, dev; +Cc: gage.eads, stable

On 27-Aug-18 1:27 PM, Qi Zhang wrote:
> When a secondary process handles VDEV_SCAN_ONE mp action, it is possible
> the device is already be inserted. This happens when we have multiple
> secondary processes which cause multiple broadcasts from primary during
> bus->scan. So we don't need to log any error for -EEXIST.
> 
> Bugzilla ID: 84
> Fixes: cdb068f031c6 ("bus/vdev: scan by multi-process channel")
> Cc: stable@dpdk.org
> 
> Reported-by: Eads Gage <gage.eads@intel.com>
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> ---
>   drivers/bus/vdev/vdev.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
> index 6139dd551..af9526fe6 100644
> --- a/drivers/bus/vdev/vdev.c
> +++ b/drivers/bus/vdev/vdev.c
> @@ -346,6 +346,7 @@ vdev_action(const struct rte_mp_msg *mp_msg, const void *peer)
>   	const struct vdev_param *in = (const struct vdev_param *)mp_msg->param;
>   	const char *devname;
>   	int num;
> +	int ret;
>   
>   	strlcpy(mp_resp.name, VDEV_MP_KEY, sizeof(mp_resp.name));
>   	mp_resp.len_param = sizeof(*ou);
> @@ -380,7 +381,10 @@ vdev_action(const struct rte_mp_msg *mp_msg, const void *peer)
>   		break;
>   	case VDEV_SCAN_ONE:
>   		VDEV_LOG(INFO, "receive vdev, %s", in->name);
> -		if (insert_vdev(in->name, NULL, NULL) < 0)
> +		ret = insert_vdev(in->name, NULL, NULL);
> +		if (ret == -EEXIST)
> +			VDEV_LOG(INFO, "device already exist, %s", in->name);

This is probably going to be printed a lot, and there's no real point in 
that. Maybe set log level to DEBUG instead?

> +		else if (ret < 0)
>   			VDEV_LOG(ERR, "failed to add vdev, %s", in->name);
>   		break;
>   	default:
> 


-- 
Thanks,
Anatoly

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

* [dpdk-stable] [PATCH] bus/vdev: fix wrong error log on secondary device scan
  2018-08-27 12:27 [dpdk-stable] [PATCH] bus/vdev: fix wrong error log on secondary device scan Qi Zhang
  2018-08-27 16:16 ` Burakov, Anatoly
@ 2018-09-03  8:49 ` Qi Zhang
  2018-09-03  8:50 ` [dpdk-stable] [PATCH v2] " Qi Zhang
  2 siblings, 0 replies; 6+ messages in thread
From: Qi Zhang @ 2018-09-03  8:49 UTC (permalink / raw)
  To: dev; +Cc: thomas, anatoly.burakov, gage.eads, Qi Zhang, stable

When a secondary process handles VDEV_SCAN_ONE mp action, it is possible
the device is already be inserted. This happens when we have multiple
secondary processes which cause multiple broadcasts from primary during
bus->scan. So we don't need to log any error for -EEXIST.

Bugzilla ID: 84
Fixes: cdb068f031c6 ("bus/vdev: scan by multi-process channel")
Cc: stable@dpdk.org

Reported-by: Eads Gage <gage.eads@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---

v2:
- change log level to DEBUG for the case device already exist.

 drivers/bus/vdev/vdev.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
index 6139dd551..69dee89a8 100644
--- a/drivers/bus/vdev/vdev.c
+++ b/drivers/bus/vdev/vdev.c
@@ -346,6 +346,7 @@ vdev_action(const struct rte_mp_msg *mp_msg, const void *peer)
 	const struct vdev_param *in = (const struct vdev_param *)mp_msg->param;
 	const char *devname;
 	int num;
+	int ret;
 
 	strlcpy(mp_resp.name, VDEV_MP_KEY, sizeof(mp_resp.name));
 	mp_resp.len_param = sizeof(*ou);
@@ -380,7 +381,10 @@ vdev_action(const struct rte_mp_msg *mp_msg, const void *peer)
 		break;
 	case VDEV_SCAN_ONE:
 		VDEV_LOG(INFO, "receive vdev, %s", in->name);
-		if (insert_vdev(in->name, NULL, NULL) < 0)
+		ret = insert_vdev(in->name, NULL, NULL);
+		if (ret == -EEXIST)
+			VDEV_LOG(DEBUG, "device already exist, %s", in->name);
+		else if (ret < 0)
 			VDEV_LOG(ERR, "failed to add vdev, %s", in->name);
 		break;
 	default:
-- 
2.13.6

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

* [dpdk-stable] [PATCH v2] bus/vdev: fix wrong error log on secondary device scan
  2018-08-27 12:27 [dpdk-stable] [PATCH] bus/vdev: fix wrong error log on secondary device scan Qi Zhang
  2018-08-27 16:16 ` Burakov, Anatoly
  2018-09-03  8:49 ` Qi Zhang
@ 2018-09-03  8:50 ` Qi Zhang
  2018-09-04 14:45   ` Eads, Gage
  2 siblings, 1 reply; 6+ messages in thread
From: Qi Zhang @ 2018-09-03  8:50 UTC (permalink / raw)
  To: dev; +Cc: thomas, anatoly.burakov, gage.eads, Qi Zhang, stable

When a secondary process handles VDEV_SCAN_ONE mp action, it is possible
the device is already be inserted. This happens when we have multiple
secondary processes which cause multiple broadcasts from primary during
bus->scan. So we don't need to log any error for -EEXIST.

Bugzilla ID: 84
Fixes: cdb068f031c6 ("bus/vdev: scan by multi-process channel")
Cc: stable@dpdk.org

Reported-by: Eads Gage <gage.eads@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---

v2:
- change log level to DEBUG for the case device already exist.

 drivers/bus/vdev/vdev.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
index 6139dd551..69dee89a8 100644
--- a/drivers/bus/vdev/vdev.c
+++ b/drivers/bus/vdev/vdev.c
@@ -346,6 +346,7 @@ vdev_action(const struct rte_mp_msg *mp_msg, const void *peer)
 	const struct vdev_param *in = (const struct vdev_param *)mp_msg->param;
 	const char *devname;
 	int num;
+	int ret;
 
 	strlcpy(mp_resp.name, VDEV_MP_KEY, sizeof(mp_resp.name));
 	mp_resp.len_param = sizeof(*ou);
@@ -380,7 +381,10 @@ vdev_action(const struct rte_mp_msg *mp_msg, const void *peer)
 		break;
 	case VDEV_SCAN_ONE:
 		VDEV_LOG(INFO, "receive vdev, %s", in->name);
-		if (insert_vdev(in->name, NULL, NULL) < 0)
+		ret = insert_vdev(in->name, NULL, NULL);
+		if (ret == -EEXIST)
+			VDEV_LOG(DEBUG, "device already exist, %s", in->name);
+		else if (ret < 0)
 			VDEV_LOG(ERR, "failed to add vdev, %s", in->name);
 		break;
 	default:
-- 
2.13.6

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

* Re: [dpdk-stable] [PATCH v2] bus/vdev: fix wrong error log on secondary device scan
  2018-09-03  8:50 ` [dpdk-stable] [PATCH v2] " Qi Zhang
@ 2018-09-04 14:45   ` Eads, Gage
  2018-09-16  9:35     ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon
  0 siblings, 1 reply; 6+ messages in thread
From: Eads, Gage @ 2018-09-04 14:45 UTC (permalink / raw)
  To: Zhang, Qi Z, dev; +Cc: thomas, Burakov, Anatoly, stable

Acked-by: Gage Eads <gage.eads@intel.com>

Thanks!
Gage

> -----Original Message-----
> From: Zhang, Qi Z
> Sent: Monday, September 3, 2018 3:50 AM
> To: dev@dpdk.org
> Cc: thomas@monjalon.net; Burakov, Anatoly <anatoly.burakov@intel.com>;
> Eads, Gage <gage.eads@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> stable@dpdk.org
> Subject: [PATCH v2] bus/vdev: fix wrong error log on secondary device scan
> 
> When a secondary process handles VDEV_SCAN_ONE mp action, it is possible
> the device is already be inserted. This happens when we have multiple secondary
> processes which cause multiple broadcasts from primary during
> bus->scan. So we don't need to log any error for -EEXIST.
> 
> Bugzilla ID: 84
> Fixes: cdb068f031c6 ("bus/vdev: scan by multi-process channel")
> Cc: stable@dpdk.org
> 
> Reported-by: Eads Gage <gage.eads@intel.com>
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> ---
> 
> v2:
> - change log level to DEBUG for the case device already exist.
> 
>  drivers/bus/vdev/vdev.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c index
> 6139dd551..69dee89a8 100644
> --- a/drivers/bus/vdev/vdev.c
> +++ b/drivers/bus/vdev/vdev.c
> @@ -346,6 +346,7 @@ vdev_action(const struct rte_mp_msg *mp_msg, const
> void *peer)
>  	const struct vdev_param *in = (const struct vdev_param *)mp_msg-
> >param;
>  	const char *devname;
>  	int num;
> +	int ret;
> 
>  	strlcpy(mp_resp.name, VDEV_MP_KEY, sizeof(mp_resp.name));
>  	mp_resp.len_param = sizeof(*ou);
> @@ -380,7 +381,10 @@ vdev_action(const struct rte_mp_msg *mp_msg, const
> void *peer)
>  		break;
>  	case VDEV_SCAN_ONE:
>  		VDEV_LOG(INFO, "receive vdev, %s", in->name);
> -		if (insert_vdev(in->name, NULL, NULL) < 0)
> +		ret = insert_vdev(in->name, NULL, NULL);
> +		if (ret == -EEXIST)
> +			VDEV_LOG(DEBUG, "device already exist, %s", in-
> >name);
> +		else if (ret < 0)
>  			VDEV_LOG(ERR, "failed to add vdev, %s", in->name);
>  		break;
>  	default:
> --
> 2.13.6

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

* Re: [dpdk-stable] [dpdk-dev] [PATCH v2] bus/vdev: fix wrong error log on secondary device scan
  2018-09-04 14:45   ` Eads, Gage
@ 2018-09-16  9:35     ` Thomas Monjalon
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2018-09-16  9:35 UTC (permalink / raw)
  To: Zhang, Qi Z; +Cc: dev, Eads, Gage, Burakov, Anatoly, stable

> > When a secondary process handles VDEV_SCAN_ONE mp action, it is possible
> > the device is already be inserted. This happens when we have multiple secondary
> > processes which cause multiple broadcasts from primary during
> > bus->scan. So we don't need to log any error for -EEXIST.
> > 
> > Bugzilla ID: 84
> > Fixes: cdb068f031c6 ("bus/vdev: scan by multi-process channel")
> > Cc: stable@dpdk.org
> > 
> > Reported-by: Eads Gage <gage.eads@intel.com>
> > Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> Acked-by: Gage Eads <gage.eads@intel.com>

Applied, thanks

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

end of thread, other threads:[~2018-09-16  9:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-27 12:27 [dpdk-stable] [PATCH] bus/vdev: fix wrong error log on secondary device scan Qi Zhang
2018-08-27 16:16 ` Burakov, Anatoly
2018-09-03  8:49 ` Qi Zhang
2018-09-03  8:50 ` [dpdk-stable] [PATCH v2] " Qi Zhang
2018-09-04 14:45   ` Eads, Gage
2018-09-16  9:35     ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon

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).