From patchwork Thu Aug 2 16:13:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yishai Hadas X-Patchwork-Id: 10553939 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 06AB513B4 for ; Thu, 2 Aug 2018 16:14:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBA5E2C2F4 for ; Thu, 2 Aug 2018 16:14:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DFA432C308; Thu, 2 Aug 2018 16:14:37 +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,UNPARSEABLE_RELAY 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 4BEC32C2F7 for ; Thu, 2 Aug 2018 16:14:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726580AbeHBSGZ (ORCPT ); Thu, 2 Aug 2018 14:06:25 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:48787 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726654AbeHBSGZ (ORCPT ); Thu, 2 Aug 2018 14:06:25 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yishaih@mellanox.com) with ESMTPS (AES256-SHA encrypted); 2 Aug 2018 19:17:58 +0300 Received: from vnc17.mtl.labs.mlnx (vnc17.mtl.labs.mlnx [10.7.2.17]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id w72GEXrj029942; Thu, 2 Aug 2018 19:14:33 +0300 Received: from vnc17.mtl.labs.mlnx (vnc17.mtl.labs.mlnx [127.0.0.1]) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8) with ESMTP id w72GEXqB019379; Thu, 2 Aug 2018 19:14:33 +0300 Received: (from yishaih@localhost) by vnc17.mtl.labs.mlnx (8.13.8/8.13.8/Submit) id w72GEU66019353; Thu, 2 Aug 2018 19:14:30 +0300 From: Yishai Hadas To: linux-rdma@vger.kernel.org Cc: yishaih@mellanox.com, jgg@mellanox.com, majd@mellanox.com Subject: [PATCH rdma-core 0/6] verbs: Allow destroy after device disassociation Date: Thu, 2 Aug 2018 19:13:30 +0300 Message-Id: <1533226416-19122-1-git-send-email-yishaih@mellanox.com> X-Mailer: git-send-email 1.8.2.3 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 allows destroy commands to succeed after device disassociation, this comes to prevent memory leakage in the user space area. Setting the environment variable RDMAV_ALLOW_DISASSOC_DESTROY tells the library to relate an EIO from destroy commands as a success as the kernel resources were already released. Applications using this flag cannot call ibv_get_cq_event or ibv_get_async_event concurrently with any call to an object destruction function. PR was sent: https://github.com/linux-rdma/rdma-core/pull/366 Jason Gunthorpe (2): verbs: Use the new kabi macros with the write fallback system verbs: Convert write path callers to use DECLARE_LEGACY_CORE_BUFS Yishai Hadas (4): verbs: Introduce ENV to control EIO upon destroy commands verbs: Consider EIO upon write destroy commands mlx4: Move to use verbs_allow_disassociate_destroy Consider EIO upon ioctl destroy commands libibverbs/cmd.c | 218 ++++++++++++++++++++------------------- libibverbs/cmd_counters.c | 8 +- libibverbs/cmd_cq.c | 18 ++-- libibverbs/cmd_dm.c | 7 +- libibverbs/cmd_fallback.c | 54 ++++++---- libibverbs/cmd_flow_action.c | 8 +- libibverbs/cmd_write.h | 193 +++++++++++++++++----------------- libibverbs/driver.h | 3 +- libibverbs/init.c | 10 ++ libibverbs/libibverbs.map.in | 1 + libibverbs/man/ibv_open_device.3 | 8 ++ providers/mlx4/mlx4.c | 12 --- providers/mlx4/mlx4.h | 6 -- providers/mlx4/srq.c | 2 +- providers/mlx4/verbs.c | 25 +++-- providers/mlx5/verbs.c | 5 +- 16 files changed, 305 insertions(+), 273 deletions(-)