From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Lijun Ou <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linuxarm-hv44wF8Li93QT0dZR+AlfA@public.gmane.org
Subject: Re: [PATCH v2 rdma-core 3/7] libhns: Add verbs of pd and mr support
Date: Wed, 9 Nov 2016 09:34:26 +0200 [thread overview]
Message-ID: <20161109073426.GL27883@leon.nu> (raw)
In-Reply-To: <1477731826-10787-4-git-send-email-oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1271 bytes --]
On Sat, Oct 29, 2016 at 05:03:42PM +0800, Lijun Ou wrote:
> This patch mainly introduces the verbs with pd and mr,
> included alloc_pd, dealloc_pd, reg_mr and dereg_mr.
>
> Signed-off-by: Lijun Ou <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Wei Hu <xavier.huwei-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> ---
> v2:
> - No change over v1
>
> v1:
> - The initial submit
> ---
> providers/hns/hns_roce_u.c | 4 ++
> providers/hns/hns_roce_u.h | 18 +++++++++
> providers/hns/hns_roce_u_abi.h | 6 +++
> providers/hns/hns_roce_u_verbs.c | 79 ++++++++++++++++++++++++++++++++++++++++
> 4 files changed, 107 insertions(+)
<....>
> +struct ibv_mr *hns_roce_u_reg_mr(struct ibv_pd *pd, void *addr, size_t length,
> + int access)
> +{
> + int ret;
> + struct ibv_mr *mr;
> + struct ibv_reg_mr cmd;
> + struct ibv_reg_mr_resp resp;
> +
> + if (addr == NULL) {
It can be great if you use one style for all your code e.g. if(!addr) ....
> + fprintf(stderr, "2nd parm addr is NULL!\n");
> + return NULL;
> + }
> +
> + if (length == 0) {
> + fprintf(stderr, "3st parm length is 0!\n");
> + return NULL;
> + }
> +
> + mr = malloc(sizeof(*mr));
> + if (mr)
> + return NULL;
It looks like bug and you wanted if(!mr) and not if(mr).
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-11-09 7:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-29 9:03 [PATCH v2 rdma-core 0/7] libhns: userspace library for hns Lijun Ou
[not found] ` <1477731826-10787-1-git-send-email-oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2016-10-29 9:03 ` [PATCH v2 rdma-core 1/7] libhns: Add initial main frame Lijun Ou
2016-10-29 9:03 ` [PATCH v2 rdma-core 2/7] libhns: Add verbs of querying device and querying port Lijun Ou
2016-10-29 9:03 ` [PATCH v2 rdma-core 3/7] libhns: Add verbs of pd and mr support Lijun Ou
[not found] ` <1477731826-10787-4-git-send-email-oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2016-11-09 7:34 ` Leon Romanovsky [this message]
[not found] ` <20161109073426.GL27883-2ukJVAZIZ/Y@public.gmane.org>
2016-11-09 8:01 ` oulijun
2016-10-29 9:03 ` [PATCH v2 rdma-core 4/7] libhns: Add verbs of cq support Lijun Ou
2016-10-29 9:03 ` [PATCH v2 rdma-core 5/7] libhns: Add verbs of qp support Lijun Ou
2016-10-29 9:03 ` [PATCH v2 rdma-core 6/7] libhns: Add verbs of post_send and post_recv support Lijun Ou
2016-10-29 9:03 ` [PATCH v2 rdma-core 7/7] libhns: Add consolidated repo for userspace library of hns Lijun Ou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161109073426.GL27883@leon.nu \
--to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linuxarm-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
--cc=oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox