On 6/22/2015 4:20 PM, Jason Gunthorpe wrote: > On Thu, Jun 18, 2015 at 07:25:32PM -0400, Hal Rosenstock wrote: >> Persuant to Liran's comments on node_type on linux-rdma >> mailing list: >> >> In an effort to reform the RDMA core and ULPs to minimize use of >> node_type in struct ib_device, an additional bit is added to >> struct ib_device for is_switch (IB switch). This is needed >> to be initialized by any IB switch device driver. This is a >> NEW requirement on such device drivers which are all >> "out of tree". >> >> In addition, an ib_switch helper was added to ib_verbs.h >> based on the is_switch device bit rather than node_type >> (although those should be consistent). >> >> The RDMA core (MAD, SMI, agent, sa_query, multicast, sysfs) >> as well as (IPoIB and SRP) ULPs are updated where >> appropriate to use this new helper. In some cases, >> the helper is now used under the covers of using >> rdma_[start end]_port rather than the open coding >> previously used. >> >> Signed-off-by: Hal Rosenstock <hal@xxxxxxxxxxxx> > > Looks pretty good now. > > Reviewed-By: Jason Gunthorpe <jgunthorpe@xxxxxxxxxxxxxxxxxxxx> > > Although a bitfield isn't my preference: > >> index 986fddb..b0f898e 100644 >> +++ b/include/rdma/ib_verbs.h >> @@ -1745,6 +1745,7 @@ struct ib_device { >> char node_desc[64]; >> __be64 node_guid; >> u32 local_dma_lkey; >> + u16 is_switch:1; >> u8 node_type; >> u8 phys_port_cnt; What would be better/what would be your preference ? Note that there still remain a couple of node type checks in the kernel that we may want to remove. There's an IB CA check in cma.c:rdma_notify as well as in rds/ib.c:rds_ib_add_one and rds_ib_laddr_check and an RNIC check in rds/iw.c:rds_iw_add_one and rds_iw_laddr_check. Should these be changed not to use node type ? -- Hal > Jason > -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in