From patchwork Sun Jan 6 09:23:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gal Pressman X-Patchwork-Id: 10749483 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 DBBBE14E5 for ; Sun, 6 Jan 2019 09:23:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC4B8288BC for ; Sun, 6 Jan 2019 09:23:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AFD98288D0; Sun, 6 Jan 2019 09:23:45 +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 32351288CF for ; Sun, 6 Jan 2019 09:23:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726405AbfAFJXo (ORCPT ); Sun, 6 Jan 2019 04:23:44 -0500 Received: from smtp-fw-6001.amazon.com ([52.95.48.154]:35439 "EHLO smtp-fw-6001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726395AbfAFJXo (ORCPT ); Sun, 6 Jan 2019 04:23:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1546766622; x=1578302622; h=from:to:cc:subject:date:message-id:mime-version; bh=y5GTZCpgFfc76AOt5fPZqW6qxQRGha8u2txJvNM+Fzg=; b=IqQNXylOAcpeAIDBccnyf40n0G4CvTsPLz6NXxPZitRkyQqaHdx5hX9X dvceQig4nn06Dar0FaAVwSHm2MolX90soUIn/n08kcpXp0Wq0mQZ8zZ57 bsrpgghvlwTuNWAhbWmTRfcFS1FEwtxDWevMTuW+NNPVTK7WR6yWgu8sm c=; X-IronPort-AV: E=Sophos;i="5.56,253,1539648000"; d="scan'208";a="375074277" Received: from iad6-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1a-67b371d8.us-east-1.amazon.com) ([10.124.125.6]) by smtp-border-fw-out-6001.iad6.amazon.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 06 Jan 2019 09:23:41 +0000 Received: from EX13MTAUWB001.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 x069NcLn063904 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Sun, 6 Jan 2019 09:23:39 GMT Received: from EX13D04UWB002.ant.amazon.com (10.43.161.133) by EX13MTAUWB001.ant.amazon.com (10.43.161.207) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Sun, 6 Jan 2019 09:23:38 +0000 Received: from EX13MTAUWB001.ant.amazon.com (10.43.161.207) by EX13D04UWB002.ant.amazon.com (10.43.161.133) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Sun, 6 Jan 2019 09:23:38 +0000 Received: from galpress-VirtualBox.amazon.com (10.218.62.26) by mail-relay.amazon.com (10.43.161.249) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Sun, 6 Jan 2019 09:23: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 RFC v2 0/2] IB device in-kernel API support indication Date: Sun, 6 Jan 2019 11:23:01 +0200 Message-ID: <1546766583-27979-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 RFC marks drivers that do not implement all mandatory verbs for kverbs as non-kverbs providers though 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 RFC 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: 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 | 12 ++++--- 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, 14 insertions(+), 79 deletions(-)