Re: [PATCH rdma-next 1/6] IB/core: Save the device attributes on the device structure

ira.weiny
2015-12-18T05:16:32Z

On Thu, Dec 17, 2015 at 07:31:20PM +0100, Bart Van Assche wrote:
> On 12/17/2015 06:41 PM, Jason Gunthorpe wrote:
> >On Thu, Dec 17, 2015 at 03:44:19PM +0200, Sagi Grimberg wrote:
> >>
> >>>+ ret = ib_query_device(device, &device->attrs);
> >>>+ if (ret) {
> >>>+ printk(KERN_WARNING "Couldn't query the device
> >>>attributes\n");
> >>>+ goto out;
> >>>+ }
> >>>+
> >>
> >>I thought we're all for removing the call altogether aren't we?
> >>
> >>I'd say just call device->query_device() instead.
> >
> >Christoph's patch even got rid of device->query_device(), which, IHMO,
> >I prefer to see over this. It re-enforces that these values are
> >constants and drivers cannot change them on the fly.
>
> I also would like to see the query_device() implementations to be
> removed from the hw drivers.

As do I. More than anything what I hate is all the places that allocate struct
ib_device_attr just to free it after the query call.

We discussed this patch ages ago and decided against it and FWIW It does not
hurt my feelings at all to drop it.

Ira