All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Weiny, Ira" <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: Or Gerlitz <gerlitz.or-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	"roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
	<roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: RE: [RFC PATCH 03/16] ib/mad: Add check for jumbo MADs support on a device
Date: Tue, 9 Dec 2014 22:36:06 +0000	[thread overview]
Message-ID: <2807E5FD2F6FDA4886F6618EAC48510E0CBD7A97@CRSMSX101.amr.corp.intel.com> (raw)
In-Reply-To: <CAJ3xEMj-0_0F+VoGZDes92ShFRTbt9Et4WWPt=viY5gx_P-oNg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

> 
> On Mon, Dec 8, 2014 at 2:23 AM, Weiny, Ira <ira.weiny@intel.com> wrote:
> 
> >> I find it very annoying that upper level drivers replicate in
> >> different ways elements from the IB device attributes returned by
> >> ib_query_device. I met that in multiple drivers and upcoming designs
> >> for which I do code review. Are you up to come up with a patch that
> >> caches the device attributes on the device structure?
> 
> > I don't follow what you are asking for.  Could you give more details?
> 
> 1. add a struct ib_device_attr field to struct ib_device
> 
> 2. when the device registers itself with the IB core, go and run the
> query_device verb with the param being pointer to that field

I see where you are going.  Then the MAD stack does not have to cache a "max_mad_size" value but rather looks in the ib_device structure "on the fly"...

So, something like the diff below?  What are the chances we end up with attributes which are not constant?

If Roland would like to go this way I can rework my series based on the attributes being cached.

-- Ira


17:15:59 > git di
diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index 18c1ece..db18795 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -322,6 +322,8 @@ int ib_register_device(struct ib_device *device,
                                client->add(device);
        }
 
+       device->query_device(device, &device->attributes);
+
  out:
        mutex_unlock(&device_mutex);
        return ret;
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 470a011..241a882 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -1630,6 +1630,7 @@ struct ib_device {
        u32                          local_dma_lkey;
        u8                           node_type;
        u8                           phys_port_cnt;
+       struct ib_device_attr        attributes;
 };
 
 struct ib_client {

  parent reply	other threads:[~2014-12-09 22:36 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-13 19:54 [RFC PATCH 00/16] ib_mad: Add support for Intel Omni-Path Architecture (OPA) MAD processing ira.weiny-ral2JQCrhuEAvxtiuMwx3w
     [not found] ` <1415908465-24392-1-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-11-13 19:54   ` [RFC PATCH 01/16] ib/mad: rename is_data_mad to is_rmpp_data_mad ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2014-11-13 19:54   ` [RFC PATCH 02/16] ib/core: add IB_DEVICE_JUMBO_MAD_SUPPORT device cap flag ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2014-11-13 19:54   ` [RFC PATCH 03/16] ib/mad: Add check for jumbo MADs support on a device ira.weiny-ral2JQCrhuEAvxtiuMwx3w
     [not found]     ` <1415908465-24392-4-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-11-27 11:47       ` Or Gerlitz
     [not found]         ` <54770F44.2090909-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2014-11-27 13:51           ` Sagi Grimberg
     [not found]             ` <54772C70.8060602-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2014-11-27 14:59               ` Or Gerlitz
     [not found]                 ` <54773C59.6080505-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-01-07 16:32                   ` Weiny, Ira
     [not found]                     ` <2807E5FD2F6FDA4886F6618EAC48510E0CBEE86E-8k97q/ur5Z2krb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-01-08 11:41                       ` Or Gerlitz
2014-12-08  0:23           ` Weiny, Ira
     [not found]             ` <2807E5FD2F6FDA4886F6618EAC48510E0CBD4F23-8k97q/ur5Z2krb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-12-08  0:47               ` Roland Dreier
     [not found]                 ` <CAG4TOxNt+0p+i1a6oN1xx+K_OZEuZhPJ5e=44KScnaGVA4E0SA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-12-09 23:23                   ` Weiny, Ira
2014-12-08 11:29               ` Or Gerlitz
     [not found]                 ` <CAJ3xEMj-0_0F+VoGZDes92ShFRTbt9Et4WWPt=viY5gx_P-oNg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-12-09 22:36                   ` Weiny, Ira [this message]
     [not found]                     ` <2807E5FD2F6FDA4886F6618EAC48510E0CBD7A97-8k97q/ur5Z2krb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-12-10  7:52                       ` Or Gerlitz
2014-11-13 19:54   ` [RFC PATCH 04/16] ib/mad: add base version parameter to ib_create_send_mad ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2014-11-13 19:54   ` [RFC PATCH 05/16] ib/mad: Add MAD size parameters to process_mad ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2014-11-13 19:54   ` [RFC PATCH 06/16] ib/mad: Create jumbo_mad data structures ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2014-11-13 19:54   ` [RFC PATCH 07/16] ib/mad: create a jumbo MAD kmem_cache ira.weiny-ral2JQCrhuEAvxtiuMwx3w
     [not found]     ` <1415908465-24392-8-git-send-email-ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-11-27 11:50       ` Or Gerlitz
     [not found]         ` <54770FF4.3070807-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2014-12-05 21:25           ` Weiny, Ira
2014-11-13 19:54   ` [RFC PATCH 08/16] ib/mad: Add Intel Omni-Path Architecture defines ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2014-11-13 19:54   ` [RFC PATCH 09/16] ib/mad: Implement support for Intel Omni-Path Architecture base version MADs in ib_create_send_mad ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2014-11-13 19:54   ` [RFC PATCH 10/16] ib/mad: Add registration check for Intel Omni-Path Architecture MADs ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2014-11-13 19:54   ` [RFC PATCH 11/16] ib/mad: create helper function for smi_handle_dr_smp_send ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2014-11-13 19:54   ` [RFC PATCH 12/16] ib/mad: create helper function for smi_handle_dr_smp_recv ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2014-11-13 19:54   ` [RFC PATCH 13/16] ib/mad: create helper function for smi_check_forward_dr_smp ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2014-11-13 19:54   ` [RFC PATCH 14/16] ib/mad: Create helper function for SMI processing ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2014-11-13 19:54   ` [RFC PATCH 15/16] ib/mad: Implement Intel Omni-Path Architecture SMP processing ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2014-11-13 19:54   ` [RFC PATCH 16/16] ib/mad: Implement Intel Omni-Path Architecture General MAD processing ira.weiny-ral2JQCrhuEAvxtiuMwx3w
2014-11-18 22:16   ` [RFC PATCH 00/16] ib_mad: Add support for Intel Omni-Path Architecture (OPA) " Or Gerlitz
     [not found]     ` <CAJ3xEMhtm99dRdcEvhK9s961mDr7YSU3pkv-WK=sESKe_K4kYw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-25 21:52       ` Weiny, Ira
     [not found]         ` <2807E5FD2F6FDA4886F6618EAC48510E0CBC6B23-8k97q/ur5Z2krb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-11-27 10:02           ` Or Gerlitz
     [not found]             ` <5476F6BB.1020200-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2014-12-01 22:18               ` Weiny, Ira
2014-11-25 23:16   ` Hal Rosenstock
     [not found]     ` <54750DCF.90308-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2014-12-01 22:33       ` Weiny, Ira

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=2807E5FD2F6FDA4886F6618EAC48510E0CBD7A97@CRSMSX101.amr.corp.intel.com \
    --to=ira.weiny-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=gerlitz.or-Re5JQEeQqe8AvxtiuMwx3w@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.