From patchwork Thu Feb 11 19:09:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 8284701 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D7DC39F8AA for ; Thu, 11 Feb 2016 19:11:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DB225201C8 for ; Thu, 11 Feb 2016 19:11:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9F0A8202FE for ; Thu, 11 Feb 2016 19:11:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751186AbcBKTLI (ORCPT ); Thu, 11 Feb 2016 14:11:08 -0500 Received: from mail-wm0-f51.google.com ([74.125.82.51]:35805 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751175AbcBKTLG (ORCPT ); Thu, 11 Feb 2016 14:11:06 -0500 Received: by mail-wm0-f51.google.com with SMTP id c200so87774537wme.0 for ; Thu, 11 Feb 2016 11:11:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leon-nu.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=nZfU6BgIa3zdDFH/OJtvLX+uQsjAKUeyQ6a/OCqI8Ls=; b=XxEAV55C/lpmtN79YlLQET861eyVtdIKkBIMIh6jhGxPdJVBjf7sHVi2mwibhVJcrU qAJNmpFx/PkW/mfJjzM0vK8Zx7RJ/yvHJA90JgxI23Hq+rxaINWsstwiwXmTqZRsnnfQ 8qCXd6pnd14d+TbtA1+FPh97jssTjxrUNfjkdl01fHTqFmLatClsGVpCWpzsQqPfaBsR uXhZmKv2hGUhc4rKWHlLny+rSYysi0Yki0nw9zT5Q6RmkvGnO+koAay9TR3uiRL+rozI A5QTzOZY+kAAhfcEdcqCVahM0w1v03hO4ZcwB7Fwz42k8AMFT3FV8Xx4ehEhGmlHSx3F 2uSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=nZfU6BgIa3zdDFH/OJtvLX+uQsjAKUeyQ6a/OCqI8Ls=; b=Fxguqol40Ww3KiBJuR8m9ZN2UIQmwzQbzzG3dqnsvA2Lr3OiaWaQeq373iidMo6Kii p+qpopZ3cUd+APmGJoBLozGlsiGZStt2gMzPd2jImH2eoRQEbCLuLRBsk7s13Tsp8W8E MM/i5M1dPItiVe+K6PoRX17e6NOukrAETlnV4uadBktsspDQxCBjsCPu4IQ33ubB9tA9 cCBD/v6dCOBFRCsY8ipOsYQI6IPzpYpxiRdSrL+7J+lWt9uUtc/NKOM26z5g6ymzFJYy MlH2g1iuZhXYsVPuK2HLa8IHPmnZWNGOJgfO99e3jX70cjQ3HqCKaDSbn8a17SBScbTj 6mmQ== X-Gm-Message-State: AG10YOQlcbAh+x6m3qE0aCvrqF40laFnlvb/qquPka+5Xqx2+QBr9efyvL5kDgJbUjkzUw== X-Received: by 10.194.118.164 with SMTP id kn4mr56573982wjb.130.1455217865394; Thu, 11 Feb 2016 11:11:05 -0800 (PST) Received: from localhost ([213.57.247.249]) by smtp.gmail.com with ESMTPSA id e9sm8814779wja.25.2016.02.11.11.11.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Feb 2016 11:11:04 -0800 (PST) From: Leon Romanovsky X-Google-Original-From: Leon Romanovsky To: dledford@redhat.com Cc: linux-rdma@vger.kernel.org, Leon Romanovsky , Kamal Heib Subject: [PATCH rdma-rc] IB/mlx5: Fix RC transport send queue overhead computation Date: Thu, 11 Feb 2016 21:09:57 +0200 Message-Id: <1455217797-15635-1-git-send-email-leonro@mellanox.com> X-Mailer: git-send-email 2.1.4 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 the RC QPs send queue overhead computation to take into account two additional segments in the WQE which are needed for registration operations. The ATOMIC and UMR segments can't coexist together, so chose maximum out of them. The commit 9e65dc371b5c ("IB/mlx5: Fix RC transport send queue overhead computation") was intended to update RC transport as commit messages states, but added the code to UC transport. Fixes: 9e65dc371b5c ("IB/mlx5: Fix RC transport send queue overhead computation") Signed-off-by: Kamal Heib Signed-off-by: Leon Romanovsky Reviewed-by: Sagi Grimberg --- drivers/infiniband/hw/mlx5/qp.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c index 9116bc3..34cb8e8 100644 --- a/drivers/infiniband/hw/mlx5/qp.c +++ b/drivers/infiniband/hw/mlx5/qp.c @@ -270,8 +270,10 @@ static int sq_overhead(enum ib_qp_type qp_type) /* fall through */ case IB_QPT_RC: size += sizeof(struct mlx5_wqe_ctrl_seg) + - sizeof(struct mlx5_wqe_atomic_seg) + - sizeof(struct mlx5_wqe_raddr_seg); + max(sizeof(struct mlx5_wqe_atomic_seg) + + sizeof(struct mlx5_wqe_raddr_seg), + sizeof(struct mlx5_wqe_umr_ctrl_seg) + + sizeof(struct mlx5_mkey_seg)); break; case IB_QPT_XRC_TGT: @@ -279,9 +281,9 @@ static int sq_overhead(enum ib_qp_type qp_type) case IB_QPT_UC: size += sizeof(struct mlx5_wqe_ctrl_seg) + - sizeof(struct mlx5_wqe_raddr_seg) + - sizeof(struct mlx5_wqe_umr_ctrl_seg) + - sizeof(struct mlx5_mkey_seg); + max(sizeof(struct mlx5_wqe_raddr_seg), + sizeof(struct mlx5_wqe_umr_ctrl_seg) + + sizeof(struct mlx5_mkey_seg)); break; case IB_QPT_UD: