> > I agree that the node type enum isn't particularly useful and should be > retired. > > Are you referring to kernel space or user space or both ?
Short term, kernel space. User space needs to keep something around for backwards compatibility. But the in tree code will never expose this value up. > > But even if we do, I'm not sure this is the correct approach. I don't > know this for a fact, > > but it seems more likely that someone would embed Linux on an IB switch > than they would plug an IB switch > > into a Linux based system. The code is designed around the latter. > Making this a system wide setting might simplify the code and optimize the > code paths. > > I think we need to discuss how user space would be addressed. This is an issue with out of tree drivers. We're having to guess what things might be doing. Are all devices being exposed up as a 'switch', or is there ever a case where there's a 'switch' device and an HCA device being reported together, or (highly unlikely) a switch device and an RNIC? If the real use case is to embed Linux on a switch, then we could look at making that a system wide setting, rather than per device. This could clean up the kernel without impacting the uABI.