From patchwork Mon Feb 5 14:24:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagi Grimberg X-Patchwork-Id: 10200467 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 58B2C60247 for ; Mon, 5 Feb 2018 14:25:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4A3C52874F for ; Mon, 5 Feb 2018 14:25:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3ED5228760; Mon, 5 Feb 2018 14:25:29 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 261602875A for ; Mon, 5 Feb 2018 14:25:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753155AbeBEOZ0 (ORCPT ); Mon, 5 Feb 2018 09:25:26 -0500 Received: from bombadil.infradead.org ([65.50.211.133]:56253 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752935AbeBEOZU (ORCPT ); Mon, 5 Feb 2018 09:25:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=gkYK/ccgaRHlyi6ZYbn/1O5HKpme70fWkPO9ESEEV68=; b=mMqqKPqqjpJ6OxVkTylueaxg9 qoclJmhAQHjHbpSkV8JYhwFRvoz70AZV6szSwyap5ml7/Mbs4r7awJxTdasIjWpQAkqjuGfg4W6Rr 1ygyrPfgMQIKHPJ8HH3K1j0qnNLlmKb/nBIO6ALusOBUrmXb9LErRjyNfs8nsmphN6bMS9tc1mdWd zyUoAMWPlBZNn5p5uVDYu7CdnUc8NPYfQ72IunA5B0EA7e8qJ/LyhIfFD9vxCH0xwexHdAD9aOXFC rLDG/Iz89w1M2inA6/XplhXTI9ABh8PETyLalS9sahO5qHhV03b0KPa2xuge6F7+Ny9qVYTX2Hkaf 9CM0YbnIA==; Received: from bzq-219-42-90.isdn.bezeqint.net ([62.219.42.90] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1eihhu-0003ls-2f; Mon, 05 Feb 2018 14:25:18 +0000 From: Sagi Grimberg To: Jason Gunthorpe , Doug Ledford Cc: linux-rdma@vger.kernel.org, linux-nvme@lists.infradead.org, Logan Gunthorpe , Stephen Bates , Saeed Mahameed , Max Gurtuvoy Subject: [PATCH] mlx5: fix mlx5_get_vector_affinity to start from completion vector 0 Date: Mon, 5 Feb 2018 16:24:52 +0200 Message-Id: <20180205142452.7630-1-sagi@grimberg.me> X-Mailer: git-send-email 2.14.1 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 The consumers of this routine expects the affinity map of of vector index relative to the first completion vector. The upper layers are not aware of internal/private completion vectors that mlx5 allocates for its own usage. Hence, return the affinity map of vector index relative to the first completion vector. Fixes: 05e0cc84e00c ("net/mlx5: Fix get vector affinity helper function") Reported-by: Logan Gunthorpe Tested-by: Max Gurtovoy Reviewed-by: Max Gurtovoy Cc: # v4.15 Signed-off-by: Sagi Grimberg --- include/linux/mlx5/driver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index a0610427e168..b82c4ae92411 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h @@ -1238,7 +1238,7 @@ mlx5_get_vector_affinity(struct mlx5_core_dev *dev, int vector) int eqn; int err; - err = mlx5_vector2eqn(dev, vector, &eqn, &irq); + err = mlx5_vector2eqn(dev, MLX5_EQ_VEC_COMP_BASE + vector, &eqn, &irq); if (err) return NULL;