All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] librdmacm: Make some functions report proper errno
@ 2020-12-16  9:22 Xiao Yang
  2020-12-16  9:51 ` Xiao Yang
  2020-12-22  8:33 ` Leon Romanovsky
  0 siblings, 2 replies; 7+ messages in thread
From: Xiao Yang @ 2020-12-16  9:22 UTC (permalink / raw)
  To: linux-rdma; +Cc: leon, Xiao Yang

Some functions reports fixed ENOMEM when getting any failure, so
it's hard for user to know which actual error happens on them.

Fixes(ucma_get_device):
2ffda7f29913 ("librdmacm: Only allocate verbs resources when needed")
191c9346f335 ("librdmacm: Reference count access to verbs context")
Fixes(ucma_create_cqs):
f8f1335ad8d8 ("librdmacm: make CQs optional for rdma_create_qp")
9e33488e8e50 ("librdmacm: fix all calls to set errno")
Fixes(rdma_create_qp_ex):
d2efdede11f7 ("r4019: Add support for userspace RDMA connection management abstraction (CMA)")
4e33a4109a62 ("librdmacm: returns errors from the library consistently")
995eb0c90c1a ("rdmacm: Add support for XRC QPs")

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 librdmacm/cma.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/librdmacm/cma.c b/librdmacm/cma.c
index 8c820ccf..a2575156 100644
--- a/librdmacm/cma.c
+++ b/librdmacm/cma.c
@@ -635,7 +635,7 @@ static int ucma_get_device(struct cma_id_private *id_priv, __be64 guid,
 	if (!cma_dev->pd)
 		cma_dev->pd = ibv_alloc_pd(cma_dev->verbs);
 	if (!cma_dev->pd) {
-		ret = ERR(ENOMEM);
+		ret = -1;
 		goto out;
 	}
 
@@ -1490,7 +1490,7 @@ static int ucma_create_cqs(struct rdma_cm_id *id, uint32_t send_size, uint32_t r
 	return 0;
 err:
 	ucma_destroy_cqs(id);
-	return ERR(ENOMEM);
+	return -1;
 }
 
 int rdma_create_srq_ex(struct rdma_cm_id *id, struct ibv_srq_init_attr_ex *attr)
@@ -1662,7 +1662,7 @@ int rdma_create_qp_ex(struct rdma_cm_id *id,
 		attr->srq = id->srq;
 	qp = ibv_create_qp_ex(id->verbs, attr);
 	if (!qp) {
-		ret = ERR(ENOMEM);
+		ret = -1;
 		goto err1;
 	}
 
-- 
2.25.1




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

* Re: [PATCH v2] librdmacm: Make some functions report proper errno
  2020-12-16  9:22 [PATCH v2] librdmacm: Make some functions report proper errno Xiao Yang
@ 2020-12-16  9:51 ` Xiao Yang
  2020-12-16  9:55   ` Leon Romanovsky
  2020-12-22  8:33 ` Leon Romanovsky
  1 sibling, 1 reply; 7+ messages in thread
From: Xiao Yang @ 2020-12-16  9:51 UTC (permalink / raw)
  To: Xiao Yang; +Cc: linux-rdma, leon

Hi Leon,

Thanks for your quick reply. :-)
I have done the same change on three
functions(ucma_get_device,ucma_create_cqs, rdma_create_qp_ex).

On 2020/12/16 17:22, Xiao Yang wrote:
> Some functions reports fixed ENOMEM when getting any failure, so
> it's hard for user to know which actual error happens on them.
>
> Fixes(ucma_get_device):
> 2ffda7f29913 ("librdmacm: Only allocate verbs resources when needed")
> 191c9346f335 ("librdmacm: Reference count access to verbs context")
> Fixes(ucma_create_cqs):
> f8f1335ad8d8 ("librdmacm: make CQs optional for rdma_create_qp")
> 9e33488e8e50 ("librdmacm: fix all calls to set errno")
> Fixes(rdma_create_qp_ex):
> d2efdede11f7 ("r4019: Add support for userspace RDMA connection management abstraction (CMA)")
> 4e33a4109a62 ("librdmacm: returns errors from the library consistently")
> 995eb0c90c1a ("rdmacm: Add support for XRC QPs")
For every function, I am not sure which one is an exact commit so just
attach all related commits ids.

Best Regards,
Xiao Yang
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
> ---
>  librdmacm/cma.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/librdmacm/cma.c b/librdmacm/cma.c
> index 8c820ccf..a2575156 100644
> --- a/librdmacm/cma.c
> +++ b/librdmacm/cma.c
> @@ -635,7 +635,7 @@ static int ucma_get_device(struct cma_id_private *id_priv, __be64 guid,
>  	if (!cma_dev->pd)
>  		cma_dev->pd = ibv_alloc_pd(cma_dev->verbs);
>  	if (!cma_dev->pd) {
> -		ret = ERR(ENOMEM);
> +		ret = -1;
>  		goto out;
>  	}
>  
> @@ -1490,7 +1490,7 @@ static int ucma_create_cqs(struct rdma_cm_id *id, uint32_t send_size, uint32_t r
>  	return 0;
>  err:
>  	ucma_destroy_cqs(id);
> -	return ERR(ENOMEM);
> +	return -1;
>  }
>  
>  int rdma_create_srq_ex(struct rdma_cm_id *id, struct ibv_srq_init_attr_ex *attr)
> @@ -1662,7 +1662,7 @@ int rdma_create_qp_ex(struct rdma_cm_id *id,
>  		attr->srq = id->srq;
>  	qp = ibv_create_qp_ex(id->verbs, attr);
>  	if (!qp) {
> -		ret = ERR(ENOMEM);
> +		ret = -1;
>  		goto err1;
>  	}
>  




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

* Re: [PATCH v2] librdmacm: Make some functions report proper errno
  2020-12-16  9:51 ` Xiao Yang
@ 2020-12-16  9:55   ` Leon Romanovsky
  2020-12-21  1:26     ` Xiao Yang
  0 siblings, 1 reply; 7+ messages in thread
From: Leon Romanovsky @ 2020-12-16  9:55 UTC (permalink / raw)
  To: Xiao Yang; +Cc: linux-rdma

On Wed, Dec 16, 2020 at 05:51:46PM +0800, Xiao Yang wrote:
> Hi Leon,
>
> Thanks for your quick reply. :-)
> I have done the same change on three
> functions(ucma_get_device,ucma_create_cqs, rdma_create_qp_ex).
>
> On 2020/12/16 17:22, Xiao Yang wrote:
> > Some functions reports fixed ENOMEM when getting any failure, so
> > it's hard for user to know which actual error happens on them.
> >
> > Fixes(ucma_get_device):
> > 2ffda7f29913 ("librdmacm: Only allocate verbs resources when needed")
> > 191c9346f335 ("librdmacm: Reference count access to verbs context")
> > Fixes(ucma_create_cqs):
> > f8f1335ad8d8 ("librdmacm: make CQs optional for rdma_create_qp")
> > 9e33488e8e50 ("librdmacm: fix all calls to set errno")
> > Fixes(rdma_create_qp_ex):
> > d2efdede11f7 ("r4019: Add support for userspace RDMA connection management abstraction (CMA)")
> > 4e33a4109a62 ("librdmacm: returns errors from the library consistently")
> > 995eb0c90c1a ("rdmacm: Add support for XRC QPs")
> For every function, I am not sure which one is an exact commit so just
> attach all related commits ids.

No problem, I'll try to sort it out now.

Thanks

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

* Re: [PATCH v2] librdmacm: Make some functions report proper errno
  2020-12-16  9:55   ` Leon Romanovsky
@ 2020-12-21  1:26     ` Xiao Yang
  2020-12-21 11:42       ` Leon Romanovsky
  0 siblings, 1 reply; 7+ messages in thread
From: Xiao Yang @ 2020-12-21  1:26 UTC (permalink / raw)
  To: Leon Romanovsky; +Cc: linux-rdma

On 2020/12/16 17:55, Leon Romanovsky wrote:
> On Wed, Dec 16, 2020 at 05:51:46PM +0800, Xiao Yang wrote:
>> Hi Leon,
>>
>> Thanks for your quick reply. :-)
>> I have done the same change on three
>> functions(ucma_get_device,ucma_create_cqs, rdma_create_qp_ex).
>>
>> On 2020/12/16 17:22, Xiao Yang wrote:
>>> Some functions reports fixed ENOMEM when getting any failure, so
>>> it's hard for user to know which actual error happens on them.
>>>
>>> Fixes(ucma_get_device):
>>> 2ffda7f29913 ("librdmacm: Only allocate verbs resources when needed")
>>> 191c9346f335 ("librdmacm: Reference count access to verbs context")
>>> Fixes(ucma_create_cqs):
>>> f8f1335ad8d8 ("librdmacm: make CQs optional for rdma_create_qp")
>>> 9e33488e8e50 ("librdmacm: fix all calls to set errno")
>>> Fixes(rdma_create_qp_ex):
>>> d2efdede11f7 ("r4019: Add support for userspace RDMA connection management abstraction (CMA)")
>>> 4e33a4109a62 ("librdmacm: returns errors from the library consistently")
>>> 995eb0c90c1a ("rdmacm: Add support for XRC QPs")
>> For every function, I am not sure which one is an exact commit so just
>> attach all related commits ids.
> No problem, I'll try to sort it out now.
Hi Leon,

Sorry to bother you.
Is there anything blocking the patch? :-)

Best Regards,
Xiao Yang
> Thanks
>
>
> .
>




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

* Re: [PATCH v2] librdmacm: Make some functions report proper errno
  2020-12-21  1:26     ` Xiao Yang
@ 2020-12-21 11:42       ` Leon Romanovsky
  2020-12-22  3:40         ` 答复: " Yang, Xiao
  0 siblings, 1 reply; 7+ messages in thread
From: Leon Romanovsky @ 2020-12-21 11:42 UTC (permalink / raw)
  To: Xiao Yang; +Cc: linux-rdma

On Mon, Dec 21, 2020 at 09:26:34AM +0800, Xiao Yang wrote:
> On 2020/12/16 17:55, Leon Romanovsky wrote:
> > On Wed, Dec 16, 2020 at 05:51:46PM +0800, Xiao Yang wrote:
> > > Hi Leon,
> > >
> > > Thanks for your quick reply. :-)
> > > I have done the same change on three
> > > functions(ucma_get_device,ucma_create_cqs, rdma_create_qp_ex).
> > >
> > > On 2020/12/16 17:22, Xiao Yang wrote:
> > > > Some functions reports fixed ENOMEM when getting any failure, so
> > > > it's hard for user to know which actual error happens on them.
> > > >
> > > > Fixes(ucma_get_device):
> > > > 2ffda7f29913 ("librdmacm: Only allocate verbs resources when needed")
> > > > 191c9346f335 ("librdmacm: Reference count access to verbs context")
> > > > Fixes(ucma_create_cqs):
> > > > f8f1335ad8d8 ("librdmacm: make CQs optional for rdma_create_qp")
> > > > 9e33488e8e50 ("librdmacm: fix all calls to set errno")
> > > > Fixes(rdma_create_qp_ex):
> > > > d2efdede11f7 ("r4019: Add support for userspace RDMA connection management abstraction (CMA)")
> > > > 4e33a4109a62 ("librdmacm: returns errors from the library consistently")
> > > > 995eb0c90c1a ("rdmacm: Add support for XRC QPs")
> > > For every function, I am not sure which one is an exact commit so just
> > > attach all related commits ids.
> > No problem, I'll try to sort it out now.
> Hi Leon,
>
> Sorry to bother you.
> Is there anything blocking the patch? :-)

Nothing, we are in the middle of Christmas vacation here,
so everything takes more time than usual.

Thanks

>
> Best Regards,
> Xiao Yang
> > Thanks
> >
> >
> > .
> >
>
>
>

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

* 答复: [PATCH v2] librdmacm: Make some functions report proper errno
  2020-12-21 11:42       ` Leon Romanovsky
@ 2020-12-22  3:40         ` Yang, Xiao
  0 siblings, 0 replies; 7+ messages in thread
From: Yang, Xiao @ 2020-12-22  3:40 UTC (permalink / raw)
  To: Leon Romanovsky; +Cc: linux-rdma



-----邮件原件-----
发件人: Leon Romanovsky <leon@kernel.org> 
发送时间: 2020年12月21日 19:43
收件人: Yang, Xiao/杨 晓 <yangx.jy@cn.fujitsu.com>
抄送: linux-rdma@vger.kernel.org
主题: Re: [PATCH v2] librdmacm: Make some functions report proper errno

On Mon, Dec 21, 2020 at 09:26:34AM +0800, Xiao Yang wrote:
> On 2020/12/16 17:55, Leon Romanovsky wrote:
> > On Wed, Dec 16, 2020 at 05:51:46PM +0800, Xiao Yang wrote:
> > > Hi Leon,
> > >
> > > Thanks for your quick reply. :-)
> > > I have done the same change on three 
> > > functions(ucma_get_device,ucma_create_cqs, rdma_create_qp_ex).
> > >
> > > On 2020/12/16 17:22, Xiao Yang wrote:
> > > > Some functions reports fixed ENOMEM when getting any failure, so 
> > > > it's hard for user to know which actual error happens on them.
> > > >
> > > > Fixes(ucma_get_device):
> > > > 2ffda7f29913 ("librdmacm: Only allocate verbs resources when 
> > > > needed")
> > > > 191c9346f335 ("librdmacm: Reference count access to verbs 
> > > > context")
> > > > Fixes(ucma_create_cqs):
> > > > f8f1335ad8d8 ("librdmacm: make CQs optional for rdma_create_qp")
> > > > 9e33488e8e50 ("librdmacm: fix all calls to set errno")
> > > > Fixes(rdma_create_qp_ex):
> > > > d2efdede11f7 ("r4019: Add support for userspace RDMA connection 
> > > > management abstraction (CMA)")
> > > > 4e33a4109a62 ("librdmacm: returns errors from the library 
> > > > consistently") 995eb0c90c1a ("rdmacm: Add support for XRC QPs")
> > > For every function, I am not sure which one is an exact commit so 
> > > just attach all related commits ids.
> > No problem, I'll try to sort it out now.
> Hi Leon,
>
> Sorry to bother you.
> Is there anything blocking the patch? :-)

Nothing, we are in the middle of Christmas vacation here, so everything takes more time than usual.

Thanks

Hi Leon,

Got it.  Thanks for your reply.

Best Regards,
Xiao Yang

>
> Best Regards,
> Xiao Yang
> > Thanks
> >
> >
> > .
> >
>
>
>





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

* Re: [PATCH v2] librdmacm: Make some functions report proper errno
  2020-12-16  9:22 [PATCH v2] librdmacm: Make some functions report proper errno Xiao Yang
  2020-12-16  9:51 ` Xiao Yang
@ 2020-12-22  8:33 ` Leon Romanovsky
  1 sibling, 0 replies; 7+ messages in thread
From: Leon Romanovsky @ 2020-12-22  8:33 UTC (permalink / raw)
  To: Xiao Yang; +Cc: linux-rdma

On Wed, Dec 16, 2020 at 05:22:52PM +0800, Xiao Yang wrote:
> Some functions reports fixed ENOMEM when getting any failure, so
> it's hard for user to know which actual error happens on them.
>
> Fixes(ucma_get_device):
> 2ffda7f29913 ("librdmacm: Only allocate verbs resources when needed")
> 191c9346f335 ("librdmacm: Reference count access to verbs context")
> Fixes(ucma_create_cqs):
> f8f1335ad8d8 ("librdmacm: make CQs optional for rdma_create_qp")
> 9e33488e8e50 ("librdmacm: fix all calls to set errno")
> Fixes(rdma_create_qp_ex):
> d2efdede11f7 ("r4019: Add support for userspace RDMA connection management abstraction (CMA)")
> 4e33a4109a62 ("librdmacm: returns errors from the library consistently")
> 995eb0c90c1a ("rdmacm: Add support for XRC QPs")
>
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
> ---
>  librdmacm/cma.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>

Thanks, applied.
https://github.com/linux-rdma/rdma-core/pull/908

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

end of thread, other threads:[~2020-12-22  8:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-16  9:22 [PATCH v2] librdmacm: Make some functions report proper errno Xiao Yang
2020-12-16  9:51 ` Xiao Yang
2020-12-16  9:55   ` Leon Romanovsky
2020-12-21  1:26     ` Xiao Yang
2020-12-21 11:42       ` Leon Romanovsky
2020-12-22  3:40         ` 答复: " Yang, Xiao
2020-12-22  8:33 ` Leon Romanovsky

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.