[openib-general] [PATCH] change SMI/GSI QP types to match QP index values

Roland Dreier roland at topspin.com
Mon Sep 27 07:55:28 PDT 2004


    Michael> I think you really want:

    Michael> enum ib_qp_type { IB_QPT_SMI=0, IB_QPT_GSI=1
		
    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



More information about the general mailing list