Re: [RFC PATCH 1/5] IB/core: Add Core Capability flags to ib_device

Jason Gunthorpe
2015-05-04T21:07:41Z

On Mon, May 04, 2015 at 03:40:25PM -0400, Doug Ledford wrote:

> So if we were to actually be forward thinking about this, then the
> link layer is the important bit you need to capture on a per port
> basis, not the transport technology. We would have to modify lots
> of the stack to support per QP or per AH transport settings though.

We are going to have to do this, at least in the kernel side, the idea
that the port can imply the one and only address family of the QP is
certainly antiquated now. I think the roceev2 patches will require
this work.

As far as this patch series goes, I actually don't think the bits
matter one bit - the intent is to optimize the cap tests, so a one
cap test-one-bit method is fine. Don't add extra we don't need right
now.

As an optimization, be aware of some of the restrictions, it is
actually pretty expensive on some arch's to load large 32 or 64 bit
numbers, smaller numbers are better, single bit test is better.

If this is combined with my thought to use a #define for all the
common driver cases then we can trivially rework the bit-field to
future needs. No reason to over architect something here.

Jason