diff mbox

[RFC,03/16] ib/mad: Add check for jumbo MADs support on a device

Message ID 2807E5FD2F6FDA4886F6618EAC48510E0CBD7A97@CRSMSX101.amr.corp.intel.com (mailing list archive)
State Superseded
Headers show

Commit Message

Ira Weiny Dec. 9, 2014, 10:36 p.m. UTC
> 

> 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

Comments

Or Gerlitz Dec. 10, 2014, 7:52 a.m. UTC | #1
On Wed, Dec 10, 2014 at 12:36 AM, Weiny, Ira <ira.weiny@intel.com> wrote:
>> On Mon, Dec 8, 2014 at 2:23 AM, Weiny, Ira <ira.weiny@intel.com> wrote:

>> 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?

exactly, thanks.

> What are the chances we end up with attributes which are not constant?

I don't see how this can happen.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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 {