From patchwork Thu Jan 10 14:23:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gal Pressman X-Patchwork-Id: 10755929 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 15E866C2 for ; Thu, 10 Jan 2019 14:23:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05FBB2998D for ; Thu, 10 Jan 2019 14:23:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 01FAD299B5; Thu, 10 Jan 2019 14:23:46 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 98E372996D for ; Thu, 10 Jan 2019 14:23:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728155AbfAJOXq (ORCPT ); Thu, 10 Jan 2019 09:23:46 -0500 Received: from smtp-fw-2101.amazon.com ([72.21.196.25]:8282 "EHLO smtp-fw-2101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727723AbfAJOXq (ORCPT ); Thu, 10 Jan 2019 09:23:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1547130225; x=1578666225; h=from:to:cc:subject:date:message-id:mime-version; bh=Er8yaPVqKTULwsDUxN5cIJ79TBForGld907xoPPaNfg=; b=J1jTsPHZ4nnNWI+Q7RGlYA1fJ5H0KjmubNmkWAGMg5LhBNEnSVbeERDd WI06RIbhEEFxbuqeiMwJqYrMBetxuNg8TwL2S+UaHZ6DD6U5cj7AT3l7B jtj9A6ZXafdLo64vLaZrNlXateDad4xuROrhp+1ttDJL/qN8UaDnmXsdY s=; X-IronPort-AV: E=Sophos;i="5.56,253,1539648000"; d="scan'208";a="712227786" Received: from iad6-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-1a-67b371d8.us-east-1.amazon.com) ([10.124.125.2]) by smtp-border-fw-out-2101.iad2.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 10 Jan 2019 14:23:43 +0000 Received: from EX13MTAUWC001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan2.iad.amazon.com [10.40.159.162]) by email-inbound-relay-1a-67b371d8.us-east-1.amazon.com (8.14.7/8.14.7) with ESMTP id x0AENeQI020732 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Thu, 10 Jan 2019 14:23:42 GMT Received: from EX13D19UWC002.ant.amazon.com (10.43.162.179) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 10 Jan 2019 14:23:41 +0000 Received: from EX13MTAUWC001.ant.amazon.com (10.43.162.135) by EX13D19UWC002.ant.amazon.com (10.43.162.179) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 10 Jan 2019 14:23:40 +0000 Received: from galpress-VirtualBox.hfa16.amazon.com (10.218.62.29) by mail-relay.amazon.com (10.43.162.232) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Thu, 10 Jan 2019 14:23:37 +0000 From: Gal Pressman To: Jason Gunthorpe , Doug Ledford CC: , Alexander Matushevsky , Yossi Leybovich , Dave Goodell , "Brian Barrett" , Leah Shalev , Sean Hefty , Sagi Grimberg , Leon Romanovsky , Gal Pressman Subject: [PATCH rdma-next v5 0/2] IB device in-kernel API support indication Date: Thu, 10 Jan 2019 16:23:34 +0200 Message-ID: <1547130216-12663-1-git-send-email-galpress@amazon.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 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 Hello all, This patchset marks drivers that do not implement all mandatory verbs for kverbs as non-kverbs providers through a flag in the IB device. Currently, ULPs add the device and fail when trying to make actual use. Instead, in case of missing verbs, mark the device as a non-kverbs provider and allow clients to exit gracefully. This also removes the need for stubs implementation of unsupported verbs, which will no longer fail the device registration but mark the device as non-kverbs provider. A 'no_kverbs_req' flag is added to the ib_clients, which is off by default except for uverbs. This is added in order to identify the uverbs module when registering a new device/client. It can also be done using name comparison but the flag seems better to me. Checks for NULL callbacks were added to functions which are called as part of ib_register_device which previously assumed that the functions must exist. Other flows are either protected by the uverbs layer or only used by kverbs. Patch #1 adds the flag to the IB device and marks devices that do not implement all needed kverbs functions. Patch #2 removes all stub functions from usnic. This patchset is introduced following the discussion over the EFA driver [1], which initially does not provide in-kernel API support. [1] https://patchwork.kernel.org/cover/10711629/ Changelog: v4->v5 * Move the client addition check to add_client_context to prevent code duplication v3->v4 * Typo fixes * Remove unnecessary function pointers NULL checks v2->v3 * Remove warning print when mandatory verb is not implemented * Change comment of no_kverbs_req flag * Add NULL checks for callbacks in unprotected flows v1->v2 * Make core code mark devices instead of having each driver advertise its support * Prevent clients device addition in core code instead of inside the clients Thanks, Gal Gal Pressman (2): RDMA: Add indication for in kernel API support to IB device IB/usnic: Remove stub functions drivers/infiniband/core/device.c | 35 +++++++++++------- drivers/infiniband/core/uverbs_main.c | 1 + drivers/infiniband/hw/usnic/usnic_ib_main.c | 7 ---- drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 53 ---------------------------- drivers/infiniband/hw/usnic/usnic_ib_verbs.h | 15 -------- include/rdma/ib_verbs.h | 5 +++ 6 files changed, 28 insertions(+), 88 deletions(-)