Message ID | 2807E5FD2F6FDA4886F6618EAC48510E0CBD7A97@CRSMSX101.amr.corp.intel.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
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 --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 {