bus/vdev: fix wrong error log on secondary device scan
PATCH 1/1 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
--- drivers/bus/vdev/vdev.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/bus/vdev/vdev.c +5 -1
@@ -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 :
Signature · 1 line
2.13.6
Quoted 28 lines · Qi Zhang
When a secondary process handles
VDEV_SCAN_ONEmp action, it is possible the device is already be inserted. This happens when we have multiple secondary processes which cause multiple broadcasts from primary duringbus->scan. So we don't need to log any error for-EEXIST.Bugzilla ID: 84
Fixes cdb068f031c6 ("bus/vdev: scan by multi-process channel")Reported-by Eads Gage <[email protected]>Signed-off-by Qi Zhang <[email protected]>--- drivers/bus/vdev/vdev.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/bus/vdev/vdev.c +1
-0@@ -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);
drivers/bus/vdev/vdev.c vdev_action(const struct rte_mp_msg *mp_msg, const void *peer) · line 386
Quoted 7 lines
drivers/bus/vdev/vdev.c +3
-1@@ -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?
Quoted 5 lines
drivers/bus/vdev/vdev.c +1
-0+else if (ret <0 )VDEV_LOG (ERR ,"failed to add vdev, %s" , in->name);break ;default :
Signature · 2 lines
Thanks, Anatoly
PATCH 1/1 bus/vdev: fix wrong error log on secondary device scan
In reply to Qi ZhangWhen 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
---
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(-)
drivers/bus/vdev/vdev.c +5 -1
@@ -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 :
Signature · 1 line
2.13.6
PATCH v2 1/1 bus/vdev: fix wrong error log on secondary device scan
In reply to Qi ZhangWhen 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
---
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(-)
drivers/bus/vdev/vdev.c +5 -1
@@ -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 :
Signature · 1 line
2.13.6
Thanks!
Gage
Quoted 58 lines
-----Original Message-----
From: Zhang, Qi Z
Sent: Monday, September 3, 2018 3:50 AM
To: [email protected]
Cc: [email protected]; Burakov, Anatoly <[email protected]>; Eads, Gage <[email protected]>; Zhang, Qi Z <[email protected]>; [email protected]
Subject: [PATCH v2] bus/vdev: fix wrong error log on secondary device scanWhen a secondary process handles
VDEV_SCAN_ONEmp action, it is possible the device is already be inserted. This happens when we have multiple secondary processes which cause multiple broadcasts from primary duringbus->scan. So we don't need to log any error for-EEXIST.Bugzilla ID: 84
Fixes cdb068f031c6 ("bus/vdev: scan by multi-process channel")Reported-by Eads Gage <[email protected]>Signed-off-by Qi Zhang <[email protected]>---
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(-)drivers/bus/vdev/vdev.c index renamed from drivers/bus/vdev/vdev.c +0
-0
6139dd551..69dee89a8100644drivers/bus/vdev/vdev.c +1
-0@@ -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;drivers/bus/vdev/vdev.c +4
-1strlcpy (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);drivers/bus/vdev/vdev.c +0
-1break ;default : --2.13.6
Thomas Monjalon
AppliedQuoted 5 lines
Quoted 5 lines
When a secondary process handles
VDEV_SCAN_ONEmp action, it is possible the device is already be inserted. This happens when we have multiple secondary processes which cause multiple broadcasts from primary duringbus->scan. So we don't need to log any error for-EEXIST.
Quoted 7 lines
Quoted 6 lines
Bugzilla ID: 84
Fixes cdb068f031c6 ("bus/vdev: scan by multi-process channel")Reported-by Eads Gage <[email protected]>Signed-off-by Qi Zhang <[email protected]>Acked-by Gage Eads <[email protected]>
Applied, thanks