From: Jason Gunthorpe <jgg-uk2M96/98Pc@public.gmane.org>
To: Yishai Hadas <yishaih-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
Cc: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
Alexr-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
Subject: Re: [PATCH RFC rdma-core 4/5] mlx5: Add support for ibv_parent domain and its related verbs
Date: Tue, 14 Nov 2017 12:15:08 -0700 [thread overview]
Message-ID: <20171114191508.GH4263@ziepe.ca> (raw)
In-Reply-To: <4232d248-8fb3-1d64-e117-6034d9240a05-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
On Tue, Nov 14, 2017 at 12:29:14PM +0200, Yishai Hadas wrote:
> It's not enough, there might be cases that protection_domain is NULL but
> still the object is a parent domain as of in the CQ case where td may be
> applicable but not the protection_domain. Better having here clear
> indication which is set upon the creation API rather than some semantic.
Ugh, the idea of a ibv_pd without a ibv_pd is a ugly. That is a whole
bunch more checking and failure scenarios.
I think I'd rather have the CQ receive a PD it doesn't need than do
that..
> >>+struct ibv_pd *mlx5_alloc_parent_domain(struct ibv_context *context,
> >>+ struct ibv_parent_domain_init_attr *attr)
> >>+ pd->protection_domain= attr->pd;
> >
> >Don't we need some kind of ref counting here?
> >
>
> We thought about it as well, however reference counting can't prevent race
> conditions when more than one thread uses the API.
Not really concerned about races. More concerned about helping the
user use it properly..
> Similar behavior exists also in current code which puts the responsibility
> on the application to correctly use the API instead of using some reference
> counting /locks inside the libraries.
We have refcounts in the kernel side for many things and generate
errors if the user does stuff in the wrong order.
> >What is the intention for the final version of this patch?
>
> The next patch of this RFC around QP creation introduces the
> expected usage.
Well, this transformation would have to ultimately be done in this
patch or before.
Looking more, this isn't good enough, at the very least I think you
need to memcpy the struct ibv_pd portion so context and handle are
set, as those are public ABIs.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-11-14 19:15 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-12 21:41 [PATCH RFC rdma-core 0/5] Add thread domain support Yishai Hadas
[not found] ` <1510522903-6838-1-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-11-12 21:41 ` [PATCH RFC rdma-core 1/5] verbs: Introduce thread domain and its related verbs Yishai Hadas
[not found] ` <1510522903-6838-2-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-11-13 19:58 ` Jason Gunthorpe
[not found] ` <20171113195822.GD22610-uk2M96/98Pc@public.gmane.org>
2017-11-14 8:26 ` Yishai Hadas
[not found] ` <3719edfc-282a-db5b-2474-3cf1355fb301-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2017-11-14 19:17 ` Jason Gunthorpe
[not found] ` <20171114191754.GI4263-uk2M96/98Pc@public.gmane.org>
2017-11-15 9:34 ` Yishai Hadas
[not found] ` <774e2f74-8361-6941-a015-27a2014d8cc9-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2017-11-17 18:42 ` Jason Gunthorpe
[not found] ` <20171117184248.GN4276-uk2M96/98Pc@public.gmane.org>
2017-11-19 6:43 ` Alex Rosenbaum
[not found] ` <CAFgAxU_m=i9kG1h2Rbqe+YtVYpea8-Ez5qvm6dQU4tZPgOUqhA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-19 15:32 ` Jason Gunthorpe
[not found] ` <20171119153219.GZ4276-uk2M96/98Pc@public.gmane.org>
2017-11-20 14:05 ` Alex Rosenbaum
2017-11-12 21:41 ` [PATCH RFC rdma-core 2/5] verbs: Introduce parent " Yishai Hadas
[not found] ` <1510522903-6838-3-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-11-13 19:53 ` Jason Gunthorpe
[not found] ` <20171113195331.GC22610-uk2M96/98Pc@public.gmane.org>
2017-11-13 20:37 ` Alex Rosenbaum
2017-11-14 8:34 ` Yishai Hadas
[not found] ` <4c8448c2-373a-bbc1-73be-f792599b8b0a-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2017-11-14 19:08 ` Jason Gunthorpe
2017-11-12 21:41 ` [PATCH RFC rdma-core 3/5] mlx5: Add support for ibv_td object " Yishai Hadas
2017-11-12 21:41 ` [PATCH RFC rdma-core 4/5] mlx5: Add support for ibv_parent domain " Yishai Hadas
[not found] ` <1510522903-6838-5-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-11-13 20:03 ` Jason Gunthorpe
[not found] ` <20171113200320.GE22610-uk2M96/98Pc@public.gmane.org>
2017-11-14 10:29 ` Yishai Hadas
[not found] ` <4232d248-8fb3-1d64-e117-6034d9240a05-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2017-11-14 19:15 ` Jason Gunthorpe [this message]
2017-11-12 21:41 ` [PATCH RFC rdma-core 5/5] mlx5: Handles QP creation with a given parent domain Yishai Hadas
[not found] ` <1510522903-6838-6-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-11-13 20:05 ` Jason Gunthorpe
[not found] ` <20171113200518.GF22610-uk2M96/98Pc@public.gmane.org>
2017-11-13 20:24 ` Alex Rosenbaum
[not found] ` <CAFgAxU_ZPcB-oZ6DrDtHdVeOpT5S_CTvYxn4VUcU3t7S4PCJHQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-11-14 11:23 ` Yishai Hadas
2017-11-13 20:06 ` [PATCH RFC rdma-core 0/5] Add thread domain support Jason Gunthorpe
[not found] ` <20171113200651.GG22610-uk2M96/98Pc@public.gmane.org>
2017-11-14 12:09 ` Yishai Hadas
[not found] ` <ef4ab602-694d-f3be-9473-3fca4d97f6f2-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2017-11-14 19:18 ` Jason Gunthorpe
[not found] ` <CAFgAxU9Svu8jKBMzY91cOUFF9wngowbFZd+yKUBz9M60rcWfkg@mail.gmail.com>
[not found] ` <20171114025745.GO22610@ziepe.ca>
[not found] ` <20171114025745.GO22610-uk2M96/98Pc@public.gmane.org>
2017-11-14 20:14 ` Alex Rosenbaum
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=20171114191508.GH4263@ziepe.ca \
--to=jgg-uk2m96/98pc@public.gmane.org \
--cc=Alexr-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=yishaih-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
--cc=yishaih-VPRAkNaXOzVWk0Htik3J/w@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 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.