From patchwork Thu Jan 10 09:36:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gal Pressman X-Patchwork-Id: 10755429 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 993C11399 for ; Thu, 10 Jan 2019 09:36:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8BAD3292A2 for ; Thu, 10 Jan 2019 09:36:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7F57F292D3; Thu, 10 Jan 2019 09:36:39 +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 11997292A2 for ; Thu, 10 Jan 2019 09:36:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727906AbfAJJgi (ORCPT ); Thu, 10 Jan 2019 04:36:38 -0500 Received: from smtp-fw-6001.amazon.com ([52.95.48.154]:26959 "EHLO smtp-fw-6001.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727780AbfAJJgi (ORCPT ); Thu, 10 Jan 2019 04:36:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1547112997; x=1578648997; h=from:to:cc:subject:date:message-id:mime-version; bh=JglubzV+G5fKp1I1Mhx43JKX2vqVqRI8zlAqViv8NfY=; b=g91PTlR/QM9ITW3GvDk1/035sIPuV4PDJvUSrq5E8AozErL7TkFXoGZR zpg2stPOx1zX7Pw3zqrPTgXGGWZ3cuIuS2X5Ps0E6hKlaZY7CmyKgqxTP WHG37s3363JpfWb8oFljn0x7e/7slAEi0o1ZamIdx/2SdrsZl0/lgKfwO 8=; X-IronPort-AV: E=Sophos;i="5.56,253,1539648000"; d="scan'208";a="375705872" Received: from iad6-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-1d-474bcd9f.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; 10 Jan 2019 09:36:36 +0000 Received: from EX13MTAUWC001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1d-474bcd9f.us-east-1.amazon.com (8.14.7/8.14.7) with ESMTP id x0A9aWqE023886 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Thu, 10 Jan 2019 09:36:34 GMT Received: from EX13D19UWC004.ant.amazon.com (10.43.162.56) by EX13MTAUWC001.ant.amazon.com (10.43.162.135) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 10 Jan 2019 09:36:33 +0000 Received: from EX13MTAUWC001.ant.amazon.com (10.43.162.135) by EX13D19UWC004.ant.amazon.com (10.43.162.56) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Thu, 10 Jan 2019 09:36:33 +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 09:36:30 +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 v4 0/2] IB device in-kernel API support indication Date: Thu, 10 Jan 2019 11:36:26 +0200 Message-ID: <1547112988-7089-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: 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 | 38 ++++++++++++-------- 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, 29 insertions(+), 90 deletions(-)