Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B47DBC433E0 for ; Tue, 23 Jun 2020 14:55:52 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8274220723 for ; Tue, 23 Jun 2020 14:55:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fI+8W34s" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8274220723 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mellanox.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7kXrMsKiTvMiC8JeLdOJ0LkxCXRC0MwdevSKVfvEQNY=; b=fI+8W34snIAsbt4tBsBDVDLhv 2MZYZdv/Gre2Xy+oQxCK1yGaOJH2XadyKXQKRX85PW/z76U4bfup+JNiA6cvcovlj4WD5yY/0KxfV 719qLP3xub0+0N/KuMTVB6QNIWBtuWT0QeiEjc6S/zG9zLkoGy5KZ413LGnYESHk94QhDa/OTnNPy jNcv48aF9hQa8pSA/NqfR+LcjXSmtDP+KUGox6AZRKE/lxa44KWwzx65ZOmzdCCfM1qVQQYHrFS4y N/iKL6ABrsyILbY3EsfRSjZz9y1NKnyRgVTl3xSH/lm1VzYprzh5SwLsgx4TaHEaCiBri6RSX4s1U EJvK6su6w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnkKw-00031D-JH; Tue, 23 Jun 2020 14:55:46 +0000 Received: from mail-il-dmz.mellanox.com ([193.47.165.129] helo=mellanox.co.il) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnkKk-0002z6-Lb for linux-nvme@lists.infradead.org; Tue, 23 Jun 2020 14:55:36 +0000 Received: from Internal Mail-Server by MTLPINE1 (envelope-from maxg@mellanox.com) with SMTP; 23 Jun 2020 17:55:26 +0300 Received: from mtr-vdi-031.wap.labs.mlnx. (mtr-vdi-031.wap.labs.mlnx [10.209.102.136]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 05NEtP7j026949; Tue, 23 Jun 2020 17:55:26 +0300 From: Max Gurtovoy To: sagi@grimberg.me, linux-nvme@lists.infradead.org, kbusch@kernel.org, hch@lst.de Subject: [PATCH 3/3] nvme-rdma: assign completion vector correctly Date: Tue, 23 Jun 2020 17:55:25 +0300 Message-Id: <20200623145525.1586-4-maxg@mellanox.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200623145525.1586-1-maxg@mellanox.com> References: <20200623145525.1586-1-maxg@mellanox.com> MIME-Version: 1.0 X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yaminf@mellanox.com, idanb@mellanox.com, israelr@mellanox.com, shlomin@mellanox.com, jgg@nvidia.com, Max Gurtovoy , ogerlitz@mellanox.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org The completion vector index that is given during CQ creation can't exceed the number of support vectors by the underlying RDMA device. This violation currently can accure, for example, in case one will try to connect with N regular read/write queues and M poll queues and the sum of N + M > num_supported_vectors. This will lead to failure in establish a connection to remote target. Instead, in that case, share a completion vector between queues. Signed-off-by: Max Gurtovoy --- drivers/nvme/host/rdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index f5d6a57..981adbd 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c @@ -469,7 +469,7 @@ static int nvme_rdma_create_cq(struct ib_device *ibdev, * Spread I/O queues completion vectors according their queue index. * Admin queues can always go on completion vector 0. */ - comp_vector = idx == 0 ? idx : idx - 1; + comp_vector = (idx == 0 ? idx : idx - 1) % ibdev->num_comp_vectors; /* Polling queues need direct cq polling context */ if (nvme_rdma_poll_queue(queue)) { -- 1.8.3.1 _______________________________________________ Linux-nvme mailing list Linux-nvme@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-nvme