All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sagi Grimberg <sagi@grimberg.me>
To: "Kalderon, Michal" <Michal.Kalderon@cavium.com>,
	Ram Amrani <Ram.Amrani@qlogic.com>,
	"dledford@redhat.com" <dledford@redhat.com>,
	"davem@davemloft.net" <davem@davemloft.net>
Cc: "Yuval.Mintz@qlogic.com" <Yuval.Mintz@qlogic.com>,
	"Ariel.Elior@qlogic.com" <Ariel.Elior@qlogic.com>,
	"Michal.Kalderon@qlogic.com" <Michal.Kalderon@qlogic.com>,
	"rajesh.borundia@qlogic.com" <rajesh.borundia@qlogic.com>,
	"linux-rdma@vger.kernel.org" <linux-rdma@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [RFC 07/11] Add support for memory registeration verbs
Date: Wed, 14 Sep 2016 12:25:30 +0300	[thread overview]
Message-ID: <4b392963-c14c-d793-147a-67b08e97ee06@grimberg.me> (raw)
In-Reply-To: <BLUPR0701MB192207820BA5CF59A835181088F10@BLUPR0701MB1922.namprd07.prod.outlook.com>


>>> +struct qedr_mr *__qedr_alloc_mr(struct ib_pd *ibpd, int
>>> +max_page_list_len) {
>>> +	struct qedr_pd *pd = get_qedr_pd(ibpd);
>>> +	struct qedr_dev *dev = get_qedr_dev(ibpd->device);
>>> +	struct qedr_mr *mr;
>>> +	int rc = -ENOMEM;
>>> +
>>> +	DP_VERBOSE(dev, QEDR_MSG_MR,
>>> +		   "qedr_alloc_frmr pd = %d max_page_list_len= %d\n", pd-
>>> pd_id,
>>> +		   max_page_list_len);
>>> +
>>> +	mr = kzalloc(sizeof(*mr), GFP_KERNEL);
>>> +	if (!mr)
>>> +		return ERR_PTR(rc);
>>> +
>>> +	mr->dev = dev;
>>> +	mr->type = QEDR_MR_FRMR;
>>> +
>>> +	rc = init_mr_info(dev, &mr->info, max_page_list_len, 1);
>>> +	if (rc)
>>> +		goto err0;
>>> +
>>> +	rc = dev->ops->rdma_alloc_tid(dev->rdma_ctx, &mr->hw_mr.itid);
>>> +	if (rc) {
>>> +		DP_ERR(dev, "roce alloc tid returned an error %d\n", rc);
>>> +		goto err0;
>>> +	}
>>> +
>>> +	/* Index only, 18 bit long, lkey = itid << 8 | key */
>>> +	mr->hw_mr.tid_type = QED_RDMA_TID_FMR;
>>> +	mr->hw_mr.key = 0;
>>> +	mr->hw_mr.pd = pd->pd_id;
>>
>> Do you have a real MR<->PD association in HW? If so, can you point me to the
>> code that binds it? If not, any reason not to expose the local_dma_lkey?
>>
> Yes, we send the pd id to the FW in function qed_rdma_register_tid.

Right, thanks.

> In any case, if we didn't have the association in HW
> Wouldn't the local_dma_lkey be relevant only to dma_mr ? ( code snippet above refers to FMR)

I was just sticking to a location in the code where you associate
MR<->PD...

The local_dma_lkey is a special key that spans the entire memory space
and unlike the notorious dma_mr, its not associated with a PD.

See the code in ib_alloc_pd(), if the device does not support a single
device local dma lkey, the core allocates a dma mr associated with
the pd. If your device has such a key, you can save a dma mr allocation
for each pd in the system.

  reply	other threads:[~2016-09-14  9:25 UTC|newest]

Thread overview: 78+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-12 16:07 [RFC 00/11] QLogic RDMA Driver (qedr) RFC Ram Amrani
2016-09-12 16:07 ` Ram Amrani
2016-09-12 16:07 ` [RFC 03/11] Add support for RoCE HW init Ram Amrani
2016-09-12 16:07   ` Ram Amrani
     [not found]   ` <1473696465-27986-4-git-send-email-Ram.Amrani-h88ZbnxC6KDQT0dZR+AlfA@public.gmane.org>
2016-09-12 18:57     ` Mark Bloch
2016-09-12 18:57       ` Mark Bloch
2016-09-13  8:30       ` Ram Amrani
2016-09-13 14:38     ` Sagi Grimberg
2016-09-14 10:13       ` Amrani, Ram
2016-09-19  8:45       ` Amrani, Ram
2016-09-12 16:07 ` [RFC 04/11] Add support for user context verbs Ram Amrani
2016-09-12 16:07   ` Ram Amrani
2016-09-12 16:07 ` [RFC 05/11] Add support for PD,PKEY and CQ verbs Ram Amrani
2016-09-12 16:07   ` Ram Amrani
2016-09-12 16:07 ` [RFC 06/11] Add support for QP verbs Ram Amrani
2016-09-12 16:07   ` Ram Amrani
     [not found]   ` <1473696465-27986-7-git-send-email-Ram.Amrani-h88ZbnxC6KDQT0dZR+AlfA@public.gmane.org>
2016-09-15 13:05     ` Leon Romanovsky
     [not found]       ` <20160915130556.GA26069-2ukJVAZIZ/Y@public.gmane.org>
2016-09-19  9:00         ` Amrani, Ram
2016-09-12 16:07 ` [RFC 08/11] Add support for data path Ram Amrani
2016-09-12 16:07   ` Ram Amrani
     [not found]   ` <1473696465-27986-9-git-send-email-Ram.Amrani-h88ZbnxC6KDQT0dZR+AlfA@public.gmane.org>
2016-09-13 14:32     ` Sagi Grimberg
2016-09-14 10:16       ` Amrani, Ram
2016-09-15  7:24     ` Leon Romanovsky
2016-09-12 16:07 ` [RFC 09/11] Add LL2 RoCE interface Ram Amrani
2016-09-12 16:07   ` Ram Amrani
2016-09-15 10:20   ` Leon Romanovsky
     [not found]     ` <20160915102013.GZ26069-2ukJVAZIZ/Y@public.gmane.org>
2016-09-15 12:07       ` Amrani, Ram
2016-09-12 16:07 ` [RFC 10/11] Add GSI support Ram Amrani
2016-09-12 16:07   ` Ram Amrani
2016-09-12 16:07 ` [RFC 11/11] Add events support and register IB device Ram Amrani
2016-09-12 16:07   ` Ram Amrani
     [not found] ` <1473696465-27986-1-git-send-email-Ram.Amrani-h88ZbnxC6KDQT0dZR+AlfA@public.gmane.org>
2016-09-12 16:07   ` [RFC 01/11] qed: Add LL2 Ram Amrani
2016-09-12 16:07     ` Ram Amrani
2016-09-12 16:07   ` [RFC 02/11] Add RoCE driver framework Ram Amrani
2016-09-12 16:07     ` Ram Amrani
     [not found]     ` <1473696465-27986-3-git-send-email-Ram.Amrani-h88ZbnxC6KDQT0dZR+AlfA@public.gmane.org>
2016-09-12 18:44       ` Mark Bloch
2016-09-12 18:44         ` Mark Bloch
     [not found]         ` <516b98c7-477a-4890-0d92-529dc32f2c4e-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2016-09-12 19:17           ` Yuval Mintz
     [not found]             ` <CY4PR11MB1720F9B74BBF82D0779FAC8F97FF0-JNf6+SjKdlG0ooKL/ADlEpPPoyLQLiKMvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2016-09-13  6:38               ` Leon Romanovsky
2016-09-13  7:18                 ` Mintz, Yuval
2016-09-13 10:16                   ` Leon Romanovsky
     [not found]                     ` <20160913101616.GT8812-2ukJVAZIZ/Y@public.gmane.org>
2016-09-14  8:15                       ` Mintz, Yuval
2016-09-14 13:00                         ` Leon Romanovsky
     [not found]                           ` <20160914130032.GB26069-2ukJVAZIZ/Y@public.gmane.org>
2016-09-14 18:25                             ` Mintz, Yuval
     [not found]                               ` <BL2PR07MB23066BBC4A019365A632E2FA8DF10-I6Fv6QFlT9L2NWYWB7JgfuFPX92sqiQdvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2016-09-15  4:37                                 ` Leon Romanovsky
     [not found]                                   ` <20160915043716.GD26069-2ukJVAZIZ/Y@public.gmane.org>
2016-09-15  5:11                                     ` Mintz, Yuval
     [not found]                                       ` <BL2PR07MB23060C776EDAE92B84FCFB768DF00-I6Fv6QFlT9L2NWYWB7JgfuFPX92sqiQdvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2016-09-15  5:42                                         ` Leon Romanovsky
2016-09-20 15:04                                           ` Elior, Ariel
     [not found]                                             ` <CY1PR0701MB13376438A5767BC844EA35C290F70-UpKza+2NMNLi6bjPjkn3FE5OhdzP3rhOnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2016-09-20 17:03                                               ` Leon Romanovsky
2016-09-13  9:22           ` Ram Amrani
     [not found]             ` <DM3PR1101MB1181337A65B7CEFC1A30F353E2FE0-xYdf0wd+uoGW1Nawvih6nR68uu4wjhmwnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2016-09-13 10:22               ` Leon Romanovsky
2016-09-13  6:46     ` Leon Romanovsky
2016-09-13 14:46     ` Steve Wise
2016-09-13 14:46       ` Steve Wise
2016-09-14  7:30       ` Amrani, Ram
2016-09-12 16:07   ` [RFC 07/11] Add support for memory registeration verbs Ram Amrani
2016-09-12 16:07     ` Ram Amrani
     [not found]     ` <1473696465-27986-8-git-send-email-Ram.Amrani-h88ZbnxC6KDQT0dZR+AlfA@public.gmane.org>
2016-09-13 14:26       ` Sagi Grimberg
2016-09-14  8:02         ` Amrani, Ram
2016-09-13 14:44     ` Sagi Grimberg
     [not found]       ` <7fa4a9b8-7cb1-0f83-d6e5-1055ae59bce4-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org>
2016-09-14  8:59         ` Kalderon, Michal
2016-09-14  9:25           ` Sagi Grimberg [this message]
2016-09-14 10:02             ` Kalderon, Michal
2016-09-12 16:39   ` [RFC 00/11] QLogic RDMA Driver (qedr) RFC Leon Romanovsky
     [not found]     ` <20160912163928.GK8812-2ukJVAZIZ/Y@public.gmane.org>
2016-09-12 16:49       ` Parav Pandit
2016-09-12 17:39         ` Yuval Mintz
     [not found]           ` <CY4PR11MB17202A542AC07CBA4A65E93697FF0-JNf6+SjKdlG0ooKL/ADlEpPPoyLQLiKMvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2016-09-13  6:05             ` Leon Romanovsky
     [not found]               ` <20160913060545.GN8812-2ukJVAZIZ/Y@public.gmane.org>
2016-09-13  6:48                 ` Mintz, Yuval
     [not found]                   ` <BL2PR07MB23064356EA2492675AC980A78DFE0-I6Fv6QFlT9L2NWYWB7JgfuFPX92sqiQdvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2016-09-13 10:39                     ` Leon Romanovsky
2016-09-12 18:05   ` Jason Gunthorpe
     [not found]     ` <20160912180508.GI5843-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-09-13  8:44       ` Ram Amrani
     [not found]         ` <DM3PR1101MB1181DF570D4F01A0CEB1CFC7E2FE0-xYdf0wd+uoGW1Nawvih6nR68uu4wjhmwnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2016-09-13 10:19           ` Leon Romanovsky
2016-09-13 15:40           ` Jason Gunthorpe
     [not found]             ` <20160913154000.GA25878-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-09-14 14:44               ` Amrani, Ram
2016-09-14 17:17                 ` Jason Gunthorpe
     [not found]                   ` <20160914171737.GH16014-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-09-15  5:55                     ` Amrani, Ram
2016-09-13 14:23   ` Sagi Grimberg
     [not found]     ` <CY1PR0701MB133732FA8478FC0B5003D97A90F10@CY1PR0701MB1337.namprd07.prod.outlook.com>
     [not found]       ` <CY1PR0701MB133732FA8478FC0B5003D97A90F10-UpKza+2NMNLi6bjPjkn3FE5OhdzP3rhOnBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2016-09-14  8:17         ` Sagi Grimberg

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=4b392963-c14c-d793-147a-67b08e97ee06@grimberg.me \
    --to=sagi@grimberg.me \
    --cc=Ariel.Elior@qlogic.com \
    --cc=Michal.Kalderon@cavium.com \
    --cc=Michal.Kalderon@qlogic.com \
    --cc=Ram.Amrani@qlogic.com \
    --cc=Yuval.Mintz@qlogic.com \
    --cc=davem@davemloft.net \
    --cc=dledford@redhat.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rajesh.borundia@qlogic.com \
    /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.