[openib-general] Re: [PATCH] extend ib_device node_type to include iWarp

Sean Hefty mshefty at ichips.intel.com
Mon Jan 30 13:37:39 PST 2006


Roland Dreier wrote:
> The changes like this in ipoib, srp, sa_query, etc:
> 
>  > -	if (device->node_type == IB_NODE_SWITCH) {
>  > +	if ((device->node_type & IB_NODE_SWITCH) == IB_NODE_SWITCH) {
> 
> seem rather silly.  We've already checked that the device is an IB
> device, so the change is pure obfuscation.

As long as IB_NODE_IB remains 0, we can eliminate this change.  Or we could go 
with something like:

if (device->node_type == IB_NODE_IB | IB_NODE_SWITCH)

> Also, why do
> 
>  > -	enum ib_node_type dev_type;
>  > +	u8 dev_type;
> 
> it seems better to leave the field as an enum for better
> documentation.

The value being returned is no longer a member of the enum, but rather a value 
such as:

IB_NODE_IB | IB_NODE_CA or IB_NODE_IWARP | IB_NODE_CA.

I have no strong preferences with either of the changes that you mentioned.  Is 
there a precedence that we can follow?

- Sean



More information about the general mailing list