Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1111669imm; Wed, 1 Aug 2018 10:22:06 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd9qIZnouf+K9SCfBaX0xnkMXXkED+dZTcxfGyzLqBNiDye/EZlju+hJi4feYQP76iD/RC5 X-Received: by 2002:a17:902:b693:: with SMTP id c19-v6mr25656263pls.114.1533144126604; Wed, 01 Aug 2018 10:22:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533144126; cv=none; d=google.com; s=arc-20160816; b=sImvG71QjjpMXBYJMfSrf3R2HvInaZ+1TA4KLgCH0szCf9Q5bSUyydZi44qz9H3kbj OO8SrLKS5brnv9zkfPtixNsuXI1LYuIDnSrDginDCKapANz5NGHF6SeRywRG8eOdZCzS XwHMI7NGR0qBpIMQ4Nb0FuoQ0qZ7r2Rw3q19Akgid4A1bb2T7vBwzChUxUaiHICn4Czs oqwSGyGJwbuF/1m512EO0gmxgLp22ZORVUawqrV/392u+w/7I9fUqy6gVUW4x4MKUMuU x+uPcXzi0PhJWHN86h+B5m8flviPdv9wFgbtiOCU5UrvklZv+1/mtDL7mmFqoI/ne4sd Ya2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=nWpWuAVjkpZqLseeZUzfrbIi17imlXe3sx5fZ0eJj+Y=; b=u+YMGLPNyzrRHq28MmMOq0WW0UYmpJKr77QRi6b+XUoPliMjSh4PG1wVjGFPNzjsbs BYuyOilXufBPW0HoTePfya8CpFQE68OFazNhEmFut3trt8ePdHH+9qfrvuRwtGvQNzlF afrM8bne5smKT3l0bKiR6ixVMWhgwxJAeMGzuuOrh48GOciAPIN1QD0lV6eTuw3OJ2ty frWlJOkFQmIEOvwo2nlNc0D/Sd7VpsMBfSwLGxTmG5ClFTAkqSWsunWcaAzWGqGoN26d ciHAuCs4y8JqVL24TVQGUddzuRHj0iouh3+sV/D0dioi7NRQXZMiD9yPMSTQw27n7CtO yEBQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si16488092pgb.107.2018.08.01.10.21.51; Wed, 01 Aug 2018 10:22:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405320AbeHATGs (ORCPT + 99 others); Wed, 1 Aug 2018 15:06:48 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49042 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403967AbeHATGr (ORCPT ); Wed, 1 Aug 2018 15:06:47 -0400 Received: from localhost (D57E6652.static.ziggozakelijk.nl [213.126.102.82]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C77FED38; Wed, 1 Aug 2018 17:20:05 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Doug Oucharek , Andrew Perepechko , Dmitry Eremin , James Simmons , Oleg Drokin , Doug Oucharek , Sasha Levin Subject: [PATCH 4.14 166/246] staging: lustre: o2iblnd: Fix FastReg map/unmap for MLX5 Date: Wed, 1 Aug 2018 18:51:16 +0200 Message-Id: <20180801165019.688313360@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801165011.700991984@linuxfoundation.org> References: <20180801165011.700991984@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Doug Oucharek [ Upstream commit 24d4b7c8de007cff9c7d83c06ae76099fdcce008 ] The FastReg support in ko2iblnd was not unmapping pool items causing the items to leak. In addition, the mapping code is not growing the pool like we do with FMR. This patch makes sure we are unmapping FastReg pool elements when we are done with them. It also makes sure the pool will grow when we depleat the pool. Signed-off-by: Doug Oucharek Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-9472 Reviewed-on: https://review.whamcloud.com/27015 Reviewed-by: Andrew Perepechko Reviewed-by: Dmitry Eremin Reviewed-by: James Simmons Reviewed-by: Oleg Drokin Signed-off-by: Doug Oucharek Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c | 2 +- drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c @@ -1710,7 +1710,7 @@ int kiblnd_fmr_pool_map(struct kib_fmr_p return 0; } spin_unlock(&fps->fps_lock); - rc = -EBUSY; + rc = -EAGAIN; } spin_lock(&fps->fps_lock); --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c @@ -47,7 +47,7 @@ static int kiblnd_init_rdma(struct kib_c __u64 dstcookie); static void kiblnd_queue_tx_locked(struct kib_tx *tx, struct kib_conn *conn); static void kiblnd_queue_tx(struct kib_tx *tx, struct kib_conn *conn); -static void kiblnd_unmap_tx(struct lnet_ni *ni, struct kib_tx *tx); +static void kiblnd_unmap_tx(struct kib_tx *tx); static void kiblnd_check_sends_locked(struct kib_conn *conn); static void @@ -65,7 +65,7 @@ kiblnd_tx_done(struct lnet_ni *ni, struc LASSERT(!tx->tx_waiting); /* mustn't be awaiting peer response */ LASSERT(tx->tx_pool); - kiblnd_unmap_tx(ni, tx); + kiblnd_unmap_tx(tx); /* tx may have up to 2 lnet msgs to finalise */ lntmsg[0] = tx->tx_lntmsg[0]; tx->tx_lntmsg[0] = NULL; @@ -590,13 +590,9 @@ kiblnd_fmr_map_tx(struct kib_net *net, s return 0; } -static void kiblnd_unmap_tx(struct lnet_ni *ni, struct kib_tx *tx) +static void kiblnd_unmap_tx(struct kib_tx *tx) { - struct kib_net *net = ni->ni_data; - - LASSERT(net); - - if (net->ibn_fmr_ps) + if (tx->fmr.fmr_pfmr || tx->fmr.fmr_frd) kiblnd_fmr_pool_unmap(&tx->fmr, tx->tx_status); if (tx->tx_nfrags) {