From: Christoph Hellwig <hch@lst.de>
To: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Christoph Hellwig <hch@lst.de>,
"dledford@redhat.com" <dledford@redhat.com>,
"sagig@mellanox.com" <sagig@mellanox.com>,
"swise@opengridcomputing.com" <swise@opengridcomputing.com>,
"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
"target-devel@vger.kernel.org" <target-devel@vger.kernel.org>
Subject: Re: [PATCH v4 7/9] IB/core: generic RDMA READ/WRITE API
Date: Fri, 11 Mar 2016 10:22:58 +0100 [thread overview]
Message-ID: <20160311092258.GD28498@lst.de> (raw)
In-Reply-To: <56E21EBB.6060205@sandisk.com>
On Thu, Mar 10, 2016 at 05:26:19PM -0800, Bart Van Assche wrote:
> On 03/09/2016 07:54 AM, Christoph Hellwig wrote:
>> + if (i + 1 != ctx->nr_ops)
>> + rdma_wr->wr.next = &ctx->map.wrs[i + 1].wr;
>
> Not that this really matters, but my own preference is to write such a
> comparison as i + 1 < ctx->nr_ops.
Sure, not problem.
>> @@ -787,6 +799,16 @@ struct ib_qp *ib_create_qp(struct ib_pd *pd,
>>
>> atomic_inc(&pd->usecnt);
>> atomic_inc(&qp_init_attr->send_cq->usecnt);
>> +
>> + if (qp_init_attr->cap.max_rdma_ctxs) {
>> + ret = rdma_rw_init_mrs(qp, qp_init_attr);
>> + if (ret) {
>> + pr_err("failed to init MR pool ret= %d\n", ret);
>> + ib_destroy_qp(qp);
>> + qp = ERR_PTR(ret);
>> + }
>> + }
>
> ib_destroy_qp() can fail and if it fails it does not decrement pd->usecnt.
> Does this have to be handled or reported in some way?
There is no way to handle this properly, and we really should remove
the return value better sooner than later in the destroy_qp API [1].
[1] and various other verbs APIs that return errors on the destroy APIs,
whoever created these was on crack apparently.
next prev parent reply other threads:[~2016-03-11 9:22 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-08 18:16 generic RDMA READ/WRITE API V4 Christoph Hellwig
2016-03-08 18:16 ` [PATCH v4 1/9] IB/cma: pass the port number to ib_create_qp Christoph Hellwig
2016-03-08 19:25 ` Bart Van Assche
2016-03-08 19:27 ` Leon Romanovsky
[not found] ` <20160308192709.GJ13396-2ukJVAZIZ/Y@public.gmane.org>
2016-03-08 19:38 ` Steve Wise
2016-03-08 19:55 ` Leon Romanovsky
2016-03-09 13:58 ` 'Christoph Hellwig'
[not found] ` <20160309135804.GA32315-jcswGhMUV9g@public.gmane.org>
2016-03-09 14:43 ` Leon Romanovsky
2016-03-09 15:51 ` Steve Wise
2016-03-09 15:52 ` 'Christoph Hellwig'
2016-03-08 18:16 ` [PATCH v4 2/9] IB/core: allow passing mapping an offset into the SG in ib_map_mr_sg Christoph Hellwig
2016-03-08 19:27 ` Bart Van Assche
2016-03-08 18:16 ` [PATCH v4 3/9] IB/core: add a helper to check for READ WITH INVALIDATE support Christoph Hellwig
2016-03-08 18:16 ` [PATCH v4 4/9] IB/core: refactor ib_create_qp Christoph Hellwig
2016-03-08 19:33 ` Bart Van Assche
[not found] ` <56DF2917.309-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-03-09 12:55 ` Christoph Hellwig
2016-03-08 18:16 ` [PATCH v4 5/9] IB/core: add a simple MR pool Christoph Hellwig
[not found] ` <1457461000-24088-6-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2016-03-08 19:37 ` Bart Van Assche
2016-03-09 12:56 ` Christoph Hellwig
[not found] ` <1457461000-24088-1-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2016-03-08 18:16 ` [PATCH v4 6/9] IB/core: add a need_inval flag to struct ib_mr Christoph Hellwig
2016-03-08 19:41 ` Bart Van Assche
2016-03-08 18:16 ` [PATCH v4 7/9] IB/core: generic RDMA READ/WRITE API Christoph Hellwig
2016-03-08 21:32 ` Bart Van Assche
2016-03-09 13:07 ` Christoph Hellwig
2016-03-09 15:54 ` Christoph Hellwig
2016-03-09 18:55 ` Bart Van Assche
2016-03-10 7:57 ` Christoph Hellwig
2016-03-10 15:30 ` Bart Van Assche
[not found] ` <56E1931C.1040206-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-03-10 16:21 ` Christoph Hellwig
[not found] ` <20160310162150.GA9544-jcswGhMUV9g@public.gmane.org>
2016-03-10 17:00 ` Bart Van Assche
[not found] ` <56E1A810.1080001-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-03-10 17:01 ` Christoph Hellwig
2016-03-11 22:39 ` Bart Van Assche
[not found] ` <56E34914.2020108-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-03-12 6:12 ` Christoph Hellwig
[not found] ` <20160312061232.GA15236-jcswGhMUV9g@public.gmane.org>
2016-03-14 1:04 ` Bart Van Assche
[not found] ` <56E60E0F.7060900-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-03-15 8:45 ` Christoph Hellwig
[not found] ` <20160309155457.GA1898-jcswGhMUV9g@public.gmane.org>
2016-03-11 1:26 ` Bart Van Assche
2016-03-11 9:22 ` Christoph Hellwig [this message]
2016-03-08 18:16 ` [PATCH v4 8/9] target: enhance and export target_alloc_sgl/target_free_sgl Christoph Hellwig
2016-03-08 21:37 ` Bart Van Assche
2016-03-08 18:16 ` [PATCH v4 9/9] IB/srpt: convert to the generic RDMA READ/WRITE API Christoph Hellwig
2016-03-08 20:13 ` Leon Romanovsky
2016-03-09 12:59 ` Christoph Hellwig
2016-03-10 22:08 ` Bart Van Assche
2016-03-11 9:09 ` Christoph Hellwig
[not found] ` <1457461000-24088-10-git-send-email-hch-jcswGhMUV9g@public.gmane.org>
2016-03-10 22:40 ` Bart Van Assche
[not found] ` <56E1F7C8.9000101-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2016-03-11 9:14 ` Christoph Hellwig
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=20160311092258.GD28498@lst.de \
--to=hch@lst.de \
--cc=bart.vanassche@sandisk.com \
--cc=dledford@redhat.com \
--cc=linux-rdma@vger.kernel.org \
--cc=sagig@mellanox.com \
--cc=swise@opengridcomputing.com \
--cc=target-devel@vger.kernel.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 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.