Re: [RFC WIP 1/2] RDMA/Core: add RDMA_NLDEV_CMD_NEWLINK/DELLLINK support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 25, 2018 at 01:00:47PM -0500, Steve Wise wrote:
>
>
> On 9/25/2018 12:55 PM, Leon Romanovsky wrote:
> > On Thu, Sep 13, 2018 at 12:16:20PM -0700, Steve Wise wrote:
> >> Add support for new LINK messages to allow adding and deleting rdma
> >> interfaces.  This will be used initially for soft rdma drivers which
> >> instantiate device instances dynamically by the admin specifying a netdev
> >> device to use.  The rdma_rxe module will be the first user of these
> >> messages.
> >>
> >> The design is modeled after RTNL_NEWLINK/DELLINK:  rdma drivers
> >> register with the rdma core if they provide link add/delete functions.
> >> Each driver registers with a unique "type" string, that is used to
> >> dispatch messages coming from user space.  A new RDMA_NLDEV_ATTR is
> >> defined for the "type" string.  User mode will pass 3 attributes in a
> >> NEWLINK message: RDMA_NLDEV_ATTR_IBDEV_NAME for the desired rdma device
> >> name to be created, RDMA_NLDEV_ATTR_LINK_TYPE for the "type" of link
> >> being added, and RDMA_NLDEV_ATTR_NDEV_NAME for the net_device interface
> >> to use for this link. The DELLINK message will contain the IBDEV_NAME
> >> and LINK_TYPE attributes.
> >>
> >> Signed-off-by: Steve Wise <swise@xxxxxxxxxxxxxxxxxxxxx>
> >> ---
> > <...>
> >> +	RDMA_NLDEV_CMD_NEWLINK,
> >> +
> >> +	RDMA_NLDEV_CMD_DELLINK,
> >> +
> >>  	RDMA_NLDEV_NUM_OPS
> >>  };
> >>
> >> @@ -427,6 +431,11 @@ enum rdma_nldev_attr {
> >>  	RDMA_NLDEV_ATTR_DRIVER_U64,		/* u64 */
> >>
> >>  	/*
> >> +	 * Identifies the rdma driver. eg: "rxe" or "siw"
> >> +	 */
> >> +	RDMA_NLDEV_ATTR_LINK_TYPE,		/* string */
> > I'll review it more deeply tomorrow, but two things caught my attention:
> > 1. You need RDMA_NL_ADMIN_PERM for your netlink commands
>
> Yes.  Thanks.
>
> > 2. LINK_TYPE should be index and not string, because it is why we are
> > using using netlink :)
>
> Hey Leon,
>
> Using a string allows the rdma tool to not have to map a string to some
> enum value, allows adding new drivers w/o updating rdmatool...

Most probably, you won't find real system with old userspace and new kernel.

>
> This was at Jason's suggestion.
>
> Steve.
>

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux