[openib-general] Re: [PATCH] [RFC] group devices by type

Sean Hefty mshefty at ichips.intel.com
Thu Jan 26 09:55:27 PST 2006


Michael S. Tsirkin wrote:
> Wouldnt a simple helper function be sufficient?

I thought about this, but it seemed like there should be a better approach.

>> enum ib_node_type {
> 
> Flags as enums, hmm.

We can drop the name on the enum.

> I think this changes the ABI, so its somewhat problematic.
> A way to do the same without breaking ABI below.

Good point.  argh...  Another way to accomplish this is to break the node_type 
into 2 pieces (similar to what my patch was doing anyway):

bits 7:4 - transport type (IB type would be 0)
bits 3:0 - defined by transport

This keeps the IB definitions exactly the same.

> How about we have
> 
> IB_NODE_CA 	= 1,
> IB_NODE_SWITCH,
> IB_NODE_ROUTER
> IB_NODE_MAX

So, as Roland pointed out, one problem that we have is that these values map to 
the IB specific values.  Now I'm not so sure that extending this enum to support 
  non-IB devices is the right approach.  The node_type is even defined as a u8 
to map directly to a NodeInfo.

To be clear on the motivation behind this, I want to replace checks like:

if (device->node_type == IB_NODE_RNIC)
	return;

with

if (device->node_type != some_IB_check)
	return;

See Tom's CMA patch for an example.

- Sean



More information about the general mailing list