* Incorrect Return Type for rdma_destroy_qp
@ 2021-08-04 17:30 Omar Navarro Leija
2021-08-05 6:40 ` Leon Romanovsky
0 siblings, 1 reply; 2+ messages in thread
From: Omar Navarro Leija @ 2021-08-04 17:30 UTC (permalink / raw)
To: linux-rdma
Hello!
The man page has rdma_destroy_qp as:
#include <rdma/rdma_cma.h>
void rdma_destroy_qp (struct rdma_cm_id *id);
Note the void return type. Yet the return value section states:
Return Value
Returns 0 on success, or -1 on error. If an error occurs, errno will
be set to indicate the failure reason. Indeed the implementation is
written as:
void rdma_destroy_qp(struct rdma_cm_id *id)
{
ibv_destroy_qp(id->qp);
id->qp = NULL;
ucma_destroy_cqs(id);
}
I believe rdma_destroy_qp should return an int which propagates the
return value of calling ibv_destroy_qp. As a workaround, I just call
ibv_destroy_qp directly.
Omar
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Incorrect Return Type for rdma_destroy_qp
2021-08-04 17:30 Incorrect Return Type for rdma_destroy_qp Omar Navarro Leija
@ 2021-08-05 6:40 ` Leon Romanovsky
0 siblings, 0 replies; 2+ messages in thread
From: Leon Romanovsky @ 2021-08-05 6:40 UTC (permalink / raw)
To: Omar Navarro Leija; +Cc: linux-rdma
On Wed, Aug 04, 2021 at 01:30:54PM -0400, Omar Navarro Leija wrote:
> Hello!
>
> The man page has rdma_destroy_qp as:
>
> #include <rdma/rdma_cma.h>
> void rdma_destroy_qp (struct rdma_cm_id *id);
>
>
> Note the void return type. Yet the return value section states:
>
> Return Value
> Returns 0 on success, or -1 on error. If an error occurs, errno will
> be set to indicate the failure reason. Indeed the implementation is
> written as:
>
> void rdma_destroy_qp(struct rdma_cm_id *id)
> {
> ibv_destroy_qp(id->qp);
> id->qp = NULL;
> ucma_destroy_cqs(id);
> }
>
> I believe rdma_destroy_qp should return an int which propagates the
> return value of calling ibv_destroy_qp. As a workaround, I just call
> ibv_destroy_qp directly.
It is worth to fix man pages.
Thanks
>
> Omar
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-08-05 6:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-04 17:30 Incorrect Return Type for rdma_destroy_qp Omar Navarro Leija
2021-08-05 6:40 ` 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.