On Mon, Jul 16, 2018 at 02:07:57PM -0500, Steve Wise wrote: > > > On 3/1/2018 11:18 AM, Jason Gunthorpe wrote: > > On Thu, Mar 01, 2018 at 10:28:00AM -0600, Steve Wise wrote: > >>> On Thu, Mar 01, 2018 at 09:29:04AM -0600, Steve Wise wrote: > >>> > >>>> Maybe to add a network interface to a soft-rdma device like rxe, we > >> could > >>> create a syntax like this: > >>>> rdma link set rxe_eth0 dev eth0 > >>> More like: > >>> > >>> rdma link add rxe_eth0 type rxe dev eth0 > >>> > >>> 'type rxe' triggers the kernel to dispatch to the rxe or siw driver to > >>> create the interface. > >> Type doesn't sound right though. in the current rdma synax, it would be > >> 'dev'. Maybe: > >> > >> rdma link add rxe_eth0 dev rxe netdev eth0 > > Type is the consistent tag with 'ip link add'. > > Hey guys, > > I'm starting to think about how to implement 'rdma link add/delete' for > rxe. Does it make sense to add new members to the rdma_nldev_command > enum in include/uapi/rdma/rdma_netlink.h for adding and deleting > soft-rdma links to netdev interfaces? Something like > RDMA_NLDEV_CMD_LINK_ADD and RDMA_NLDEV_CMD_LINK_DEL? Then add handlers > to the nldev_cb_table array in drivers/infiniband/core/nldev.c. Can > we assume there is only one soft-rdma driver for each rdma transport? > That would enable a simple core->driver dispatch via an array of > driver-specific handler functions that are indexed by the soft-rdma > transport type. Or do we need something more general? > > Just thinking out loud here. What do you all think? You may as well follow the pattern ip link add uses.. See struct rtnl_link_ops ipoib_link_ops This way we can keep rxe as a module without creating a link time dependency on the core module. Core code should match the 'type' tag with the '.kind' string member just as ip does, and should pas a netlink attrs bundle in to the callback like ip, see ipoib_new_child_link() The result should return the rdma id and name of the newly created interface. Jason -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html