From patchwork Fri Dec 14 22:21:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Wise X-Patchwork-Id: 10731819 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 18E52924 for ; Fri, 14 Dec 2018 23:37:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B14402D55F for ; Fri, 14 Dec 2018 23:37:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A52222D59F; Fri, 14 Dec 2018 23:37:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2773D2D55F for ; Fri, 14 Dec 2018 23:37:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727757AbeLNXhY (ORCPT ); Fri, 14 Dec 2018 18:37:24 -0500 Received: from opengridcomputing.com ([72.48.214.68]:47290 "EHLO smtp.opengridcomputing.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726423AbeLNXhY (ORCPT ); Fri, 14 Dec 2018 18:37:24 -0500 Received: by smtp.opengridcomputing.com (Postfix, from userid 503) id 13443227A9; Fri, 14 Dec 2018 17:37:24 -0600 (CST) Message-Id: From: Steve Wise Date: Fri, 14 Dec 2018 14:21:19 -0800 Subject: [PATCH v7 0/5] Dynamic rdma link creation MIME-Version: 1.0 To: dledford@redhat.com, jgg@mellanox.com Cc: linux-rdma@vger.kernel.org, BMT@zurich.ibm.com, leon@kernel.org, markb@mellanox.com, yanjun.zhu@oracle.com Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This series enables creating soft rdma links dynamically using netlink messages. The user 'rdma' command [1] will be enhanced to send these new messages. Note there is at least one outstanding issue: the rdma-core requires RXE links to be named "rxe*" or it fails to associate an rxe uverbs driver with the rxe provider. This, however, can be addressed in a subsequent series. [1] rdma tool support (work-in-progress): https://github.com/larrystevenwise/iproute2/tree/wip/newlink Changes since V6: - added Jason's patch to refactor device unregisteration and rxe reference cleanup. - added Yuval's patch as a dependency. - remove dellink() rdma_link_ops method replaced with IB_DEVICE_ALLOW_USER_UNREG device caps flag. If set, then the core will unregister the device in nldev_dellink() for the driver using the new ib_unregister_device_and_put(). - add r-b tags. Changes since V4/V5: - fixed device remove races in rxe - fixed deadlock in NETDEV_UNREGISTER induced rxe device removal - removed redundant string checks in nldev_newlink() - added reviewed-by tag Changes since V3: - link_ops mutex replaced with rwsem - save link_ops pointer in ib_device struct to be used when deleting a link - only require the device index from userland for DELLINK operations - pass struct ib_device pointer to drivers for dellink() Changes since V2: - removed unneeded enum value assignment - removed gotos where there was no unwind logic - protect get and use of link_ops with mutex Changes since V1: - rebased on for-next branch of linux-rdma repo - removed 2 pr_debug()s - validate string lengths in nldev_newlink()/nldev_dellink() - don't allow '%' in ibdev names - make all string parameters const char * in rdma_link_ops - simplified the request_module logic in nldev_newlink() - add leon's reviewed-by tag. Changes since RFC: - rebased on top of leon's and jason's device name work - request module load if the link ops aren't found - detect duplicate link ops adds - const char * changes - use the RDMA_NLDEV open enum values Jason Gunthorpe (1): verbs/rxe: Use core services to keep track of RXE things Steve Wise (3): rdma_rxe: schedule ib_unregister_device_and_put() RDMA/Core: add RDMA_NLDEV_CMD_NEWLINK/DELLINK support rdma_rxe: use netlink messages to add/delete links Yuval Shaia (1): IB/rxe: Reuse code which sets port state drivers/infiniband/core/core_priv.h | 1 - drivers/infiniband/core/device.c | 213 ++++++++++++++++++++++++++++++++-- drivers/infiniband/core/nldev.c | 122 +++++++++++++++++++ drivers/infiniband/sw/rxe/rxe.c | 68 ++++++----- drivers/infiniband/sw/rxe/rxe.h | 17 +-- drivers/infiniband/sw/rxe/rxe_loc.h | 2 +- drivers/infiniband/sw/rxe/rxe_net.c | 108 ++++++----------- drivers/infiniband/sw/rxe/rxe_net.h | 3 +- drivers/infiniband/sw/rxe/rxe_param.h | 3 +- drivers/infiniband/sw/rxe/rxe_pool.c | 4 - drivers/infiniband/sw/rxe/rxe_sysfs.c | 53 +++------ drivers/infiniband/sw/rxe/rxe_verbs.c | 11 +- drivers/infiniband/sw/rxe/rxe_verbs.h | 6 +- include/rdma/ib_verbs.h | 13 +++ include/rdma/rdma_netlink.h | 11 ++ include/uapi/rdma/rdma_netlink.h | 11 +- 16 files changed, 470 insertions(+), 176 deletions(-)