Re: [PATCH v2 07/13] IB/cma: Helper functions to access port space IDRs

Haggai Eran
2015-07-28T08:55:09Z

On 28/07/2015 01:48, Hefty, Sean wrote:
>> Add helper functions to access the IDRs by port-space and port number.
>>
>> Pass around the port-space enum in cma.c instead of using pointers to
>> port-space IDRs.
>
> Why?
>
>> drivers/infiniband/core/cma.c | 81 ++++++++++++++++++++++++++++++++------
>> -----
>> 1 file changed, 60 insertions(+), 21 deletions(-)
>
> This change adds code, and AFAICT makes it less efficient. What purpose does it serve?
>

As I wrote before [1], this change is intended to help reuse the code finding
an IDR for a port space, and it is used by patch 9.

As for efficiency, cma_idr, cma_ps_alloc, and cma_ps_remove are completely inlined by my compiler. cma_ps_find does end up adding a function call, but I doubt it would have a significant effect. cma_select_ib_ps and cma_select_inet_ps were already inlined before the patch.

Regards,
Haggai

[1] https://www.mail-archive.com/linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org/msg25496.html