From patchwork Mon Feb 4 17:50:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Gurtovoy X-Patchwork-Id: 10796247 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 0833E1669 for ; Mon, 4 Feb 2019 17:51:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB3EE2BEE8 for ; Mon, 4 Feb 2019 17:51:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DFE2E2BF0A; Mon, 4 Feb 2019 17:51:01 +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 5A4DC2BEE8 for ; Mon, 4 Feb 2019 17:51:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729010AbfBDRvA (ORCPT ); Mon, 4 Feb 2019 12:51:00 -0500 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:46597 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726634AbfBDRuy (ORCPT ); Mon, 4 Feb 2019 12:50:54 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from maxg@mellanox.com) with ESMTPS (AES256-SHA encrypted); 4 Feb 2019 19:50:46 +0200 Received: from r-vnc08.mtr.labs.mlnx (r-vnc08.mtr.labs.mlnx [10.208.0.121]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x14HokQm024633; Mon, 4 Feb 2019 19:50:46 +0200 From: Max Gurtovoy To: hch@lst.de, linux-rdma@vger.kernel.org, leon@kernel.org, sagi@grimberg.me, jgg@mellanox.com, dledford@redhat.com, bvanassche@acm.org Cc: maxg@mellanox.com, israelr@mellanox.com, idanb@mellanox.com, vladimirk@mellanox.com, shlomin@mellanox.com, oren@mellanox.com Subject: [PATCH 00/17] Introduce new API for T10-PI offload Date: Mon, 4 Feb 2019 19:50:29 +0200 Message-Id: <1549302646-18446-1-git-send-email-maxg@mellanox.com> X-Mailer: git-send-email 1.7.8.2 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 Sagi, Christoph, Bart, Jason, Doug, Leon and Co This patchset adds a new verbs API for T10-PI offload and implementation for iSER initiator (NVMe-oF/RDMA host side was completed and will be sent on a different patchset). This set starts with a few preparation commits to the RDMA/core layer. It continues with introducing a new MR type IB_MR_TYPE_PI. Using this MR all the needed mappings will be done in the low level drivers and not be visible to the ULP. Later patches implement the needed functionality in the mlx5 layer. As suggested by Sagi, in the new API, the mlx5 driver will allocate a single internal memory region for the UMR operation to register both PI and data SG lists and it will look like: data start meta start | | ------------------------- |d1|d2|d3|d4|m1|m2|m3|m4| ------------------------- The sig_mr stride block would be using the same lkey but different offsets in it (offset 0 and offset d1+d2+d3+d4). The verbs layer will use a special mr type that will describe everything and will replace the old API, that enforce using 3 different memory regions (data_mr, protection_mr, sig_mr) and their local invalidations. This will ease the code in the ULP and will improve the abstraction of the HW (see iSER code changes). The patchset ends with iSER initator patches that using this new API. The code was tested vs. LIO iSER target using Mellanox's ConnectX-4/ConnectX-5. This series applies cleanly on top of kernel 5.0-rc3 tag and iser fix ("efa423925cd4 IB/iser: Pass the correct number of entries for dma mapped SGL"). We should aim to push this code during 5.1 merge window. Next steps are: - use new API in iSER LIO target and remove the old API (this will cause changes in RDMA/core layer). - merge NVMe-oF/RDMA host side after merging this patchset - Implement metadata support for NVMe-oF/RDMA target side with new API Israel Rukshin (8): RDMA/core: Introduce IB_MR_TYPE_PI and ib_alloc_mr_integrity API RMDA/core: Introduce ib_scatterlist structure IB/iser: Embed ib_scatterlist into iser_data_buf IB/srp: Embed ib_scatterlist into srp_map_state struct IB/iser: Refactor iscsi_iser_check_protection function IB/iser: Use IB_WR_REG_PI_MR for PI handover IB/iser: Remove unused sig_attrs argument IB/isert: Remove unused sig_attrs argument Max Gurtovoy (9): RDMA/core: Introduce new header file for signature operations RDMA/core: Save the MR type in the ib_mr structure RDMA/core: Introduce ib_map_mr_sg_pi to map data/protection sgl's RDMA/core: Add signature attrs element for ib_mr structure RDMA/mlx5: Implement mlx5_ib_map_mr_sg_pi and mlx5_ib_alloc_mr_integrity RDMA/mlx5: Add attr for max number page list length for PI operation RDMA/mlx5: Pass UMR segment flags instead of boolean RDMA/mlx5: Update set_sig_data_segment attribute for new signature API RDMA/mlx5: Introduce and implement new IB_WR_REG_PI_MR work request drivers/infiniband/core/device.c | 2 + drivers/infiniband/core/rw.c | 6 +- drivers/infiniband/core/uverbs_cmd.c | 2 + drivers/infiniband/core/verbs.c | 127 ++++++++++-- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 5 +- drivers/infiniband/hw/bnxt_re/ib_verbs.h | 3 +- drivers/infiniband/hw/cxgb3/iwch_provider.c | 5 +- drivers/infiniband/hw/cxgb4/iw_cxgb4.h | 3 +- drivers/infiniband/hw/cxgb4/mem.c | 5 +- drivers/infiniband/hw/hns/hns_roce_device.h | 3 +- drivers/infiniband/hw/hns/hns_roce_mr.c | 5 +- drivers/infiniband/hw/i40iw/i40iw_verbs.c | 8 +- drivers/infiniband/hw/mlx4/mlx4_ib.h | 3 +- drivers/infiniband/hw/mlx4/mr.c | 5 +- drivers/infiniband/hw/mlx5/main.c | 4 + drivers/infiniband/hw/mlx5/mlx5_ib.h | 12 +- drivers/infiniband/hw/mlx5/mr.c | 193 ++++++++++++++++--- drivers/infiniband/hw/mlx5/qp.c | 246 +++++++++++++++++++++--- drivers/infiniband/hw/nes/nes_verbs.c | 5 +- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 5 +- drivers/infiniband/hw/ocrdma/ocrdma_verbs.h | 3 +- drivers/infiniband/hw/qedr/verbs.c | 5 +- drivers/infiniband/hw/qedr/verbs.h | 3 +- drivers/infiniband/hw/vmw_pvrdma/pvrdma_mr.c | 5 +- drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.h | 3 +- drivers/infiniband/sw/rdmavt/mr.c | 10 +- drivers/infiniband/sw/rdmavt/mr.h | 3 +- drivers/infiniband/sw/rxe/rxe_verbs.c | 5 +- drivers/infiniband/ulp/iser/iscsi_iser.c | 9 +- drivers/infiniband/ulp/iser/iscsi_iser.h | 48 ++--- drivers/infiniband/ulp/iser/iser_initiator.c | 14 +- drivers/infiniband/ulp/iser/iser_memory.c | 135 +++++-------- drivers/infiniband/ulp/iser/iser_verbs.c | 91 +++------ drivers/infiniband/ulp/isert/ib_isert.c | 11 +- drivers/infiniband/ulp/srp/ib_srp.c | 46 +++-- drivers/infiniband/ulp/srp/ib_srp.h | 2 +- drivers/nvme/host/rdma.c | 6 +- fs/cifs/smbdirect.c | 7 +- include/linux/mlx5/qp.h | 3 +- include/rdma/ib_verbs.h | 163 ++++------------ include/rdma/signature.h | 120 ++++++++++++ net/rds/ib_frmr.c | 9 +- net/smc/smc_ib.c | 9 +- net/sunrpc/xprtrdma/frwr_ops.c | 6 +- 44 files changed, 873 insertions(+), 490 deletions(-) create mode 100644 include/rdma/signature.h