Re: [PATCH v5 00/27] IB/Verbs: IB Management Helpers
From: Jason Gunthorpe
Date: Wed Apr 22 2015 - 12:41:11 EST
On Wed, Apr 22, 2015 at 11:38:34AM +0000, Liran Liss wrote:
> This is redundant. All IB ports have SMI, so if you know that you
> are using an IB device, you know you have an SMI.
You should really go back and read the whole thread, this has already
been discussed.
The patch set was developed from the 'bottom up' - all the points that
did 'if is iwarp/rocee/ib/foo' were examined, Michael figured out what
*difference* that code actually required and made a dedicated test for it.
It turns out, one of those differences is SMI, !SMI.
The tests are an inventory of all the spec differences the code cares
about. This is the entire point.
Yes, of course, an abstract notion like <link-type, transport,
node-type> can describe the same state space, but then the call sites
loose the insight into *WHY* the code cares, and *WHAT* the difference
is.
This is bad:
if (rdma_standard_ib() || rdma_standard_rocee() ||
rdma_standard_opa())
This is worse:
if (!rdma_standard_iwarp())
This is better:
if (rdma_cap_mad())
Going forward, we are growing more tests, and worse, they are for
standards that are not public. We need to stop open-coding 'is
standard' type code and actually start documenting these differences.
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/