Re: [PATCH rdma-next 2/7] IB/mlx5: Return error for unsupported signature type

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

 



On Wed, Jan 18, 2017 at 02:10:31PM +0200, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@xxxxxxxxxxxx>
> 
> In case of unsupported singature, we returned positive
> value, while the better approach is to return -EINVAL.
> 
> In addition, in this change, the error print is enriched
> to provide an actual supplied signature type.

What's the reason for the empty warnings i see in callers of this function?
("mlx5_ib_warn(dev, "\n");".

Can we remove these while we are here?

> 
> Fixes: e6631814fb3a ("IB/mlx5: Support IB_WR_REG_SIG_MR")
> Cc: Sagi Grimberg <sagi@xxxxxxxxxxx>
> Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx>
> Signed-off-by: Leon Romanovsky <leon@xxxxxxxxxx>
> ---
>  drivers/infiniband/hw/mlx5/qp.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
> index 6a83fb3..9021074 100644
> --- a/drivers/infiniband/hw/mlx5/qp.c
> +++ b/drivers/infiniband/hw/mlx5/qp.c
> @@ -3637,8 +3637,9 @@ static int set_psv_wr(struct ib_sig_domain *domain,
>  		psv_seg->ref_tag = cpu_to_be32(domain->sig.dif.ref_tag);
>  		break;
>  	default:
> -		pr_err("Bad signature type given.\n");
> -		return 1;
> +		pr_err("Bad signature type (%d) is given.\n",
> +		       domain->sig_type);
> +		return -EINVAL;
>  	}
>  
>  	*seg += sizeof(*psv_seg);
> -- 
> 2.10.2
> 
> --
> 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
--
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



[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