From patchwork Tue Jan 22 08:08:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gal Pressman X-Patchwork-Id: 10775039 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 4F97413B5 for ; Tue, 22 Jan 2019 08:09:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F32B2A543 for ; Tue, 22 Jan 2019 08:09:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2EFFC2AA6E; Tue, 22 Jan 2019 08:09:44 +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 C5B332A543 for ; Tue, 22 Jan 2019 08:09:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727531AbfAVIJn (ORCPT ); Tue, 22 Jan 2019 03:09:43 -0500 Received: from smtp-fw-33001.amazon.com ([207.171.190.10]:62437 "EHLO smtp-fw-33001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727402AbfAVIJn (ORCPT ); Tue, 22 Jan 2019 03:09:43 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1548144582; x=1579680582; h=from:to:cc:subject:date:message-id:mime-version; bh=jPM93OIPim9lLLAJFdudVfM/TUTa1cg4oIR8Lru08iI=; b=GGSlpLnszT8Rlr7BrPLr+tLxbeaYJGxOZW81uOEwAlSMj3FDD2mBJ4P7 tDplLYj3fFguN+uygiVBnUmAV+uio+6gXCQWbCILUfwIJ4vhEsokqFZdX 2lnUjwtYKuFNK8t5IjxhHqyhjX82IED2blek4pveQDNZOYwyM/Mu37uEr 4=; X-IronPort-AV: E=Sophos;i="5.56,253,1539648000"; d="scan'208";a="777810514" Received: from sea3-co-svc-lb6-vlan2.sea.amazon.com (HELO email-inbound-relay-1d-f273de60.us-east-1.amazon.com) ([10.47.22.34]) by smtp-border-fw-out-33001.sea14.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Jan 2019 08:08:49 +0000 Received: from EX13MTAUEA001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1d-f273de60.us-east-1.amazon.com (8.14.7/8.14.7) with ESMTP id x0M88dD9056894 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Tue, 22 Jan 2019 08:08:40 GMT Received: from EX13D02EUC004.ant.amazon.com (10.43.164.117) by EX13MTAUEA001.ant.amazon.com (10.43.61.243) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 22 Jan 2019 08:08:39 +0000 Received: from EX13MTAUEE001.ant.amazon.com (10.43.62.200) by EX13D02EUC004.ant.amazon.com (10.43.164.117) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 22 Jan 2019 08:08:38 +0000 Received: from galpress-VirtualBox.hfa16.amazon.com (10.218.62.29) by mail-relay.amazon.com (10.43.62.226) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Tue, 22 Jan 2019 08:08:35 +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 v6 0/2] IB device in-kernel API support indication Date: Tue, 22 Jan 2019 10:08:21 +0200 Message-ID: <1548144503-13454-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. 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: v5->v6 * Drop NULL checks from device registration * Change kverbs_provider flag to u16 (was u8) 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 | 10 +++--- 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, 12 insertions(+), 79 deletions(-)