From: Jack Morgenstein <jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
To: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Cc: roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
Liran Liss <liranl-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH for-next V2 02/22] IB/core: change pkey table lookups to support full and partial membership for the same pkey
Date: Wed, 12 Sep 2012 10:56:00 +0300 [thread overview]
Message-ID: <201209121056.00309.jackm@dev.mellanox.co.il> (raw)
In-Reply-To: <504F6C4F.6050207-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
On Tuesday 11 September 2012 19:52, Doug Ledford wrote:
> On 8/3/2012 4:40 AM, Jack Morgenstein wrote:
> > Enhance the cached and non-cached pkey table lookups to enable limited and full
> > members of the same pkey to co-exist in the pkey table.
> >
> > This is necessary for SRIOV to allow for a scheme where some guests would have the full
> > membership pkey in their virtual pkey table, where other guests on the same hypervisor
> > would have the limited one. In that sense, its an extension of the IBTA model for
> > non virtualized nodes.
>
> OK, maybe I'm not getting something, but I'm curious why we always pick
> the full pkey in preference to the partial pkey.
>
The pkey model that we are working with is the following:
- guests do NOT have both limited and full membership forms of a given pkey;
they have either the limited member or the full member
- The guests will see a virtualized pkey table, where pkeys appearing in that table
are "cherry-picked" by the administrator from the underlying physical (device) pkey
table contents. The slot (or index) occupied by a mapped pkey in the virtual table
is also determined by the administrator.
The Hypervisor (primary phys function or PPF), which sees the physical pkey table used
for the mappings, will therefor have both forms of a given pkey -- with the limited form
mapped to some slot in a guest's pkey table, and the full form mapped to some slot in
a different guest's pkey table.
- The only reason that a pkey table would contain both full and limited membership versions
of a given pkey is to support SRIOV guest pkey paravirtualization. In "native" mode, there
is no reason to have both forms in a given pkey table. (The driver clearly reflects this
in its original implementation of "ib_find_cached_pkey" -- it returns the index of the first
15-bit pkey it finds in the table, and assumes that these 15 bits are unique in the table).
Thus, on guests ib_find_cached_pkey will operate as before, since the 15-bit pkey in the guest
table will be unique.
On the Hypervisor, however, we assume that if both versions of the pkey are in its pkey table,
then for its own infiniband operation (as opposed to performing its pkey virtualizing function),
it should operate with the highest membership type in its table for a given 15-bit pkey.
> Shouldn't we pick the
> pkey that's appropriate for the vHCA sending the message?
We do. When QPs on the guests are created, the modify-qp commands are not executed on the guest,
but rather are passed to the PPF for processing. The PPF replaces the guest-provided virtual pkey-index
value with the appropriate physical pkey-index value. See procedure "update_pkey_index" in file
resource_tracker.c, and all the places it is called (i.e., in the wrapper functions for the various
modify-qp firmware commands).
> Also, given the rule of least surprise, don't you think it would be best
> to rename this function ib_find_cached_full_or_parital_pkey and in your
> next patch instead of naming it ib_find_exact_pkey just call that one
> ib_find_cached_pkey?
The naming of "ib_find_cached_pkey" refers to the 15-bit pkey value. I also
did not want to change all the places that "ib_find_cached_pkey" is used, to
call "ib_find_cached_full_or_partial_pkey" instead.
I also think it is more confusing to use the old name "ib_find_cached_pkey" in
a completely new (and incompatible) way.
Maybe I can change "ib_find_exact_pkey" to "ib_find_16_bit_pkey" ?
In this case, "ib_find_cached_pkey" will be backwards compatible and will find the
appropriate 15-bit pkey of either form (with the proviso that if both forms of the
pkey are in the table, it will return the full membership pkey index).
The ib_find_16_bit_pkey() looks for the exact match, and returns error if it does not find
it (-- specifically, if it is looking for one membership form, and only the other form is in
the table, it will return error).
> > To accomplish this, we need both the limited and full membership pkeys to be present
> > in the master's (hypervisor physical port) pkey table.
> >
> > The algorithm for supporting pkey tables which contain both the limited and the full
> > membership versions of the same pkey works as follows:
> >
> > When scanning the pkey table for a 15 bit pkey:
> >
> > A. If there is a full member version of that pkey anywhere
> > in the table, return its index (even if a limited-member
> > version of the pkey exists earlier in the table).
> >
> > B. If the full member version is not in the table,
> > but the limited-member version is in the table,
> > return the index of the limited pkey.
> >
> > Signed-off-by: Liran Liss <liranl-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> > Signed-off-by: Jack Morgenstein <jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
> > Signed-off-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
--
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:[~2012-09-12 7:56 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-03 8:40 [PATCH for-next V2 00/22] Add SRIOV support for IB interfaces Jack Morgenstein
[not found] ` <1343983258-6268-1-git-send-email-jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2012-08-03 8:40 ` [PATCH for-next V2 01/22] IB/core: Reserve bits in enum ib_qp_create_flags for low-level driver use Jack Morgenstein
[not found] ` <1343983258-6268-2-git-send-email-jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2012-09-05 14:55 ` Doug Ledford
[not found] ` <504767EB.6090004-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-09-06 10:06 ` Jack Morgenstein
2012-09-24 19:34 ` Roland Dreier
[not found] ` <CAL1RGDXrJ+c2tgxYsLMZQVz+os7E3FZROMJ9D7oqPiQbdk1g7w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-09-25 8:28 ` Jack Morgenstein
2012-08-03 8:40 ` [PATCH for-next V2 02/22] IB/core: change pkey table lookups to support full and partial membership for the same pkey Jack Morgenstein
[not found] ` <1343983258-6268-3-git-send-email-jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2012-09-11 16:52 ` Doug Ledford
[not found] ` <504F6C4F.6050207-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-09-12 7:56 ` Jack Morgenstein [this message]
[not found] ` <201209121056.00309.jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2012-09-12 16:48 ` Doug Ledford
[not found] ` <5050BCDD.50106-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-09-13 7:35 ` Jack Morgenstein
[not found] ` <201209131035.15318.jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2012-09-13 8:18 ` Or Gerlitz
2012-09-13 8:20 ` Or Gerlitz
2012-09-13 15:53 ` Or Gerlitz
[not found] ` <50520193.2010304-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2012-09-13 16:00 ` Or Gerlitz
2012-08-03 8:40 ` [PATCH for-next V2 03/22] IB/core: Add ib_find_exact_cached_pkey() to search for 16-bit pkey match Jack Morgenstein
[not found] ` <1343983258-6268-4-git-send-email-jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2012-09-11 16:53 ` Doug Ledford
2012-09-11 17:12 ` Doug Ledford
[not found] ` <504F70FB.6030806-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-09-11 19:07 ` Roland Dreier
[not found] ` <CAL1RGDW6D25s+R8HuxK-DMrsS_wvKDTL+LSp2X-TK8gB8Vm2Fg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-09-11 20:34 ` Doug Ledford
[not found] ` <504FA064.6040002-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-09-11 20:43 ` Roland Dreier
[not found] ` <CAL1RGDXpeK3KjrmzyivQs8FOs2dg5MqSmuVsdRE+bVD5OXe6BA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-09-11 22:51 ` Doug Ledford
2012-08-03 8:40 ` [PATCH for-next V2 04/22] IB/mlx4: SRIOV IB context objects and proxy/tunnel sqp support Jack Morgenstein
[not found] ` <1343983258-6268-5-git-send-email-jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2012-09-11 17:10 ` Doug Ledford
[not found] ` <504F7068.6020606-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2012-09-20 23:15 ` Or Gerlitz
[not found] ` <CAJZOPZ+-1EUpGozrG+XsyPmS0RL791zP0=7OT8JMsmhwgL7QPQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-09-21 7:42 ` Jack Morgenstein
2012-08-03 8:40 ` [PATCH for-next V2 05/22] net/mlx4_core: Add proxy and tunnel QPs to the reserved QP area Jack Morgenstein
2012-08-03 8:40 ` [PATCH for-next V2 06/22] IB/mlx4: Initialize SRIOV IB support for slaves in master context Jack Morgenstein
2012-08-03 8:40 ` [PATCH for-next V2 07/22] {NET,IB}/mlx4: Implement QP paravirtualization and maintain phys_pkey_cache for smp_snoop Jack Morgenstein
2012-08-03 8:40 ` [PATCH for-next V2 08/22] IB/mlx4: SRIOV multiplex and demultiplex MADs Jack Morgenstein
2012-08-03 8:40 ` [PATCH for-next V2 09/22] {NET,IB}/mlx4: MAD_IFC paravirtualization Jack Morgenstein
2012-08-03 8:40 ` [PATCH for-next V2 10/22] IB/mlx4: Added Multicast Groups (MCG) para-virtualization for SRIOV Jack Morgenstein
2012-08-03 8:40 ` [PATCH for-next V2 11/22] IB/mlx4: Add CM paravirtualization Jack Morgenstein
[not found] ` <1343983258-6268-12-git-send-email-jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2012-09-24 19:33 ` Roland Dreier
2012-08-03 8:40 ` [PATCH for-next V2 12/22] net/mlx4_core: Add IB port-state machine, and port mgmt event propagation infrastructure Jack Morgenstein
2012-08-03 8:40 ` [PATCH for-next V2 13/22] {NET,IB}/mlx4: Add alias_guid mechanism Jack Morgenstein
2012-08-03 8:40 ` [PATCH for-next V2 14/22] IB/mlx4: Propagate pkey and guid change port management events to slaves Jack Morgenstein
2012-08-03 8:40 ` [PATCH for-next V2 15/22] IB/mlx4: Add iov directory in sysfs under the ib device Jack Morgenstein
2012-08-03 8:40 ` [PATCH for-next V2 16/22] net/mlx4_core: Adjustments to SET_PORT for SRIOV-IB Jack Morgenstein
2012-08-03 8:40 ` [PATCH for-next V2 17/22] net/mlx4_core: INIT/CLOSE port logic for IB ports in SRIOV mode Jack Morgenstein
2012-08-03 8:40 ` [PATCH for-next V2 18/22] IB/mlx4: Miscellaneous adjustments to SRIOV IB support Jack Morgenstein
2012-08-03 8:40 ` [PATCH for-next V2 19/22] {NET,IB}/mlx4: Activate SRIOV mode for IB Jack Morgenstein
2012-08-03 8:40 ` [PATCH for-next V2 20/22] {NET,IB}/mlx4: Paravirtualize Node Guids for slaves Jack Morgenstein
2012-08-03 8:40 ` [PATCH for-next V2 21/22] {NET,IB}/mlx4: Modify proxy/tunnel QP mechanism so that guests do no calculations Jack Morgenstein
[not found] ` <1343983258-6268-22-git-send-email-jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2012-09-22 10:25 ` Roland Dreier
2012-08-03 8:40 ` [PATCH for-next V2 22/22] IB/mlx4: Create pv contexts for active VFs when PF (master) ib driver initializes Jack Morgenstein
2012-08-03 9:00 ` [PATCH for-next V2 00/22] Add SRIOV support for IB interfaces Tziporet Koren
2012-08-12 9:34 ` Or Gerlitz
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=201209121056.00309.jackm@dev.mellanox.co.il \
--to=jackm-ldsdmyg8hgv8yrgs2mwiifqbs+8scbdb@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=liranl-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=roland-DgEjT+Ai2ygdnm+yROfE0A@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;
as well as URLs for NNTP newsgroup(s).