Re: [PATCH] librdmacm: Return errno on create_qp failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Mar 25, 2018 at 11:09:02PM +0300, Yuval Shaia wrote:
> Upon QP creation failure provider's create_qp function sets errno with
> error code and return NULL to caller.
>
> Let's return this errno to caller to reflect the exact reason for the
> error.
>
> Signed-off-by: Yuval Shaia <yuval.shaia@xxxxxxxxxx>
> ---
>  librdmacm/cma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/librdmacm/cma.c b/librdmacm/cma.c
> index fa370650..e92a022c 100644
> --- a/librdmacm/cma.c
> +++ b/librdmacm/cma.c
> @@ -1369,7 +1369,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 = ERR(errno);

It is not always correct, for example
ibv_create_qp_ex -> ibv_create_qp -> pd->context->ops.create_qp ->
mlx5_create_qp -> create_qp -> can return NULL without updating errno.

Thanks

>  		goto err1;
>  	}
>
> --
> 2.14.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux