From: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Jack Morgenstein
<jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
Cc: roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org
Subject: Re: [PATCH for-next V2 03/22] IB/core: Add ib_find_exact_cached_pkey() to search for 16-bit pkey match
Date: Tue, 11 Sep 2012 12:53:42 -0400 [thread overview]
Message-ID: <504F6C96.7050700@redhat.com> (raw)
In-Reply-To: <1343983258-6268-4-git-send-email-jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 3840 bytes --]
On 8/3/2012 4:40 AM, Jack Morgenstein wrote:
> When port pkey table potentially contains both full and partial
> membership copies for the same pkey, we need a function to find
> the exact (16-bit) pkey index.
The code on this patch is fine, just see my previous email about the
function naming...
> This is particularly necessary when the master forwards QP1 MADS
> sent by guests. If the guest has sent the MAD with a limited
> membership pkey, we wish to forward the MAD using the same limited
> membership pkey. Since master may have both the limited and
> the full member pkeys in its table, we must make sure to retrieve
> the limited membership pkey in this case.
>
> This requires the 16-bit pkey lookup function (which includes the
> membership bit).
>
> Signed-off-by: Jack Morgenstein <jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
> Signed-off-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
> drivers/infiniband/core/cache.c | 32 ++++++++++++++++++++++++++++++++
> include/rdma/ib_cache.h | 16 ++++++++++++++++
> 2 files changed, 48 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c
> index 0f2f2b7..d8a8c83 100644
> --- a/drivers/infiniband/core/cache.c
> +++ b/drivers/infiniband/core/cache.c
> @@ -198,6 +198,38 @@ int ib_find_cached_pkey(struct ib_device *device,
> }
> EXPORT_SYMBOL(ib_find_cached_pkey);
>
> +int ib_find_exact_cached_pkey(struct ib_device *device,
> + u8 port_num,
> + u16 pkey,
> + u16 *index)
> +{
> + struct ib_pkey_cache *cache;
> + unsigned long flags;
> + int i;
> + int ret = -ENOENT;
> +
> + if (port_num < start_port(device) || port_num > end_port(device))
> + return -EINVAL;
> +
> + read_lock_irqsave(&device->cache.lock, flags);
> +
> + cache = device->cache.pkey_cache[port_num - start_port(device)];
> +
> + *index = -1;
> +
> + for (i = 0; i < cache->table_len; ++i)
> + if (cache->table[i] == pkey) {
> + *index = i;
> + ret = 0;
> + break;
> + }
> +
> + read_unlock_irqrestore(&device->cache.lock, flags);
> +
> + return ret;
> +}
> +EXPORT_SYMBOL(ib_find_exact_cached_pkey);
> +
> int ib_get_cached_lmc(struct ib_device *device,
> u8 port_num,
> u8 *lmc)
> diff --git a/include/rdma/ib_cache.h b/include/rdma/ib_cache.h
> index 00a2b8e..ad9a3c2 100644
> --- a/include/rdma/ib_cache.h
> +++ b/include/rdma/ib_cache.h
> @@ -101,6 +101,22 @@ int ib_find_cached_pkey(struct ib_device *device,
> u16 *index);
>
> /**
> + * ib_find_exact_cached_pkey - Returns the PKey table index where a specified
> + * PKey value occurs. Comparison uses the FULL 16 bits (incl membership bit)
> + * @device: The device to query.
> + * @port_num: The port number of the device to search for the PKey.
> + * @pkey: The PKey value to search for.
> + * @index: The index into the cached PKey table where the PKey was found.
> + *
> + * ib_find_exact_cached_pkey() searches the specified PKey table in
> + * the local software cache.
> + */
> +int ib_find_exact_cached_pkey(struct ib_device *device,
> + u8 port_num,
> + u16 pkey,
> + u16 *index);
> +
> +/**
> * ib_get_cached_lmc - Returns a cached lmc table entry
> * @device: The device to query.
> * @port_num: The port number of the device to query.
>
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG KeyID: 0E572FDD
http://people.redhat.com/dledford
Infiniband specific RPMs available at
http://people.redhat.com/dledford/Infiniband
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 895 bytes --]
next prev parent reply other threads:[~2012-09-11 16:53 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
[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 [this message]
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=504F6C96.7050700@redhat.com \
--to=dledford-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@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 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.