[openib-general] [PATCH] change SMI/GSI QP types to match QP index values
Michael S. Tsirkin
mst at mellanox.co.il
Mon Sep 27 08:05:43 PDT 2004
Hello!
Quoting r. Roland Dreier (roland at topspin.com) "Re: [openib-general] [PATCH] change SMI/GSI QP types to match QP index values":
> Michael> I think you really want:
>
> Michael> enum ib_qp_type { IB_QPT_SMI=0, IB_QPT_GSI=1
But it would be easier to spot than what we have now.
> Michael> to stress the fact that you really want to assign
> Michael> specific values to IB_QPT_SMI/IB_QPT_GSI or the code
> Michael> would not work correctly.
>
> Hmm, this seems even more dangerous -- what happens if someone adds
> another type like below?
>
> enum ib_qp_type {
> IB_QPT_RD,
> IB_QPT_SMI=0,
> IB_QPT_GSI=1
>
> In fact I don't like this abuse of enum ib_qp_type at all -- it looks
> to me like we're introducing a very brittle overloading of the enum
> for a quite minimal gain.
>
> - Roland
I agree, the proper way is to have an inline function to get QP number by type.
More information about the general
mailing list