On 2022/5/14 16:31, liuyixing (A) wrote:
>
> 在 2022/5/14 16:11, Chengchang Tang 写道:
>> Use the new verbs logging API to allow for easier debugging of
>> application failures.
>>
>> Signed-off-by: Chengchang Tang <tangchengchang(a)huawei.com>
>> ---
>> providers/hns/hns_roce_u.c | 4 +-
>> providers/hns/hns_roce_u_db.c | 7 +-
>> providers/hns/hns_roce_u_verbs.c | 207 +++++++++++++++++++++++++------
>> 3 files changed, 178 insertions(+), 40 deletions(-)
>>
>> diff --git a/providers/hns/hns_roce_u.c b/providers/hns/hns_roce_u.c
>> index a46ceb9d..3d1f493b 100644
>> --- a/providers/hns/hns_roce_u.c
>> +++ b/providers/hns/hns_roce_u.c
>> @@ -114,8 +114,10 @@ static struct verbs_context
>> *hns_roce_alloc_context(struct ibv_device *ibdev,
>> return NULL;
>> if (ibv_cmd_get_context(&context->ibv_ctx, &cmd, sizeof(cmd),
>> - &resp.ibv_resp, sizeof(resp)))
>> + &resp.ibv_resp, sizeof(resp))) {
>> + verbs_err(&context->ibv_ctx, "ibv_cmd_get_context failed\n");
>> goto err_free;
>> + }
>>
>> return ret;
>> + }
>> hns_roce_clear_srq(ctx, srq->srqn);
>> }
>> @@ -1426,8 +1554,11 @@ int hns_roce_u_destroy_ah(struct ibv_ah *ah)
>> int ret;
>> ret = ibv_cmd_destroy_ah(ah);
>> - if (ret)
>> + if (ret) {
>> + verbs_err(verbs_get_ctx(ah->context),
>> + "Failed to create AH, ret = %d\n", ret);
>> return ret;
>> + }
>> free(to_hr_ah(ah));
>
> .
Any comments?