From patchwork Wed Apr 15 10:50:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagi Grimberg X-Patchwork-Id: 6219901 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1ED9BBF4A6 for ; Wed, 15 Apr 2015 10:50:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3DF97201FA for ; Wed, 15 Apr 2015 10:50:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 54E39201F4 for ; Wed, 15 Apr 2015 10:50:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754425AbbDOKun (ORCPT ); Wed, 15 Apr 2015 06:50:43 -0400 Received: from ns1327.ztomy.com ([193.47.165.129]:54199 "EHLO mellanox.co.il" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1754334AbbDOKuk (ORCPT ); Wed, 15 Apr 2015 06:50:40 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from sagig@mellanox.com) with ESMTPS (AES256-SHA encrypted); 15 Apr 2015 13:50:15 +0300 Received: from r-vnc05.mtr.labs.mlnx (r-vnc05.mtr.labs.mlnx [10.208.0.115]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id t3FAoFAM007879; Wed, 15 Apr 2015 13:50:15 +0300 Received: from r-vnc05.mtr.labs.mlnx (localhost [127.0.0.1]) by r-vnc05.mtr.labs.mlnx (8.14.4/8.14.4) with ESMTP id t3FAoF09021829; Wed, 15 Apr 2015 13:50:15 +0300 Received: (from sagig@localhost) by r-vnc05.mtr.labs.mlnx (8.14.4/8.14.4/Submit) id t3FAoEeD021827; Wed, 15 Apr 2015 13:50:14 +0300 From: Sagi Grimberg To: Roland Dreier Cc: linux-rdma@vger.kernel.org Subject: [PATCH] IB/iser: Fix regression in DIX mode fast registration flow Date: Wed, 15 Apr 2015 13:50:14 +0300 Message-Id: <1429095014-21789-1-git-send-email-sagig@mellanox.com> X-Mailer: git-send-email 1.8.4.3 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix a wrong setting for a single DMA entry. This is menifested only in DIX mode where the protection information buffer reg info overrides the data buffer reg info. Fixes: 6e19ed0dba03 ("IB/iser: Pass struct iser_mem_reg to [...]") Signed-off-by: Sagi Grimberg --- Roland, This patch is incremental to "iser patches for kernel 4.1 [v2]" so just in case you have [v2] applied and it's easier for you to apply this instead (although the fixed commit-id needs to be altered). drivers/infiniband/ulp/iser/iser_memory.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/ulp/iser/iser_memory.c b/drivers/infiniband/ulp/iser/iser_memory.c index f90d6de..f0cdc96 100644 --- a/drivers/infiniband/ulp/iser/iser_memory.c +++ b/drivers/infiniband/ulp/iser/iser_memory.c @@ -710,12 +710,11 @@ err: } static int iser_fast_reg_mr(struct iscsi_iser_task *iser_task, - struct iser_mem_reg *mem_reg, struct iser_data_buf *mem, + struct fast_reg_descriptor *desc, enum iser_reg_indicator ind, struct iser_mem_reg *reg) { - struct fast_reg_descriptor *desc = mem_reg->mem_h; struct ib_conn *ib_conn = &iser_task->iser_conn->ib_conn; struct iser_device *device = ib_conn->device; struct ib_mr *mr; @@ -726,7 +725,7 @@ static int iser_fast_reg_mr(struct iscsi_iser_task *iser_task, /* if there a single dma entry, dma mr suffices */ if (mem->dma_nents == 1) - return iser_reg_dma(device, mem, mem_reg); + return iser_reg_dma(device, mem, reg); if (ind == ISER_DATA_KEY_VALID) { mr = desc->data_mr; @@ -815,7 +814,7 @@ int iser_reg_rdma_mem_fastreg(struct iscsi_iser_task *iser_task, mem_reg->mem_h = desc; } - err = iser_fast_reg_mr(iser_task, mem_reg, mem, + err = iser_fast_reg_mr(iser_task, mem, desc, ISER_DATA_KEY_VALID, mem_reg); if (err) goto err_reg; @@ -836,7 +835,7 @@ int iser_reg_rdma_mem_fastreg(struct iscsi_iser_task *iser_task, } } - err = iser_fast_reg_mr(iser_task, mem_reg, mem, + err = iser_fast_reg_mr(iser_task, mem, desc, ISER_PROT_KEY_VALID, &prot_reg); if (err) goto err_reg;