Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1973651ima; Thu, 25 Oct 2018 07:47:41 -0700 (PDT) X-Google-Smtp-Source: AJdET5dSP7Qq3T4Knc28wMzvJ/LFK9g2YkgXkhJhNcsEPj0AJwFRF3OIg6sbtCrW8BsWsB1034mm X-Received: by 2002:a17:902:7202:: with SMTP id ba2-v6mr1801255plb.44.1540478861332; Thu, 25 Oct 2018 07:47:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540478861; cv=none; d=google.com; s=arc-20160816; b=T/Si1jvJRQFqekPjHRLdlvvO1BM5aWkouzFSCXw0r2fyg/I30sTdB92UvlULcDz1sy q/MUsVgPhDwHdZBoT676YBLyP4+t4/8JUW58O9GoSTB2TNwBAL5BvzOi6LvFRKBLA8o4 ayjuS/YbkGeAmTiEK0vwk+F1FwH71gXvlDnNyu+A1STOyxcmgfbHJRcLNeqMmnXqxmau n5YbaF0Cu+4Q8QXB7B/qeOtPLFnXaZlANvAL39y5Tm76HSoAa6tcYfzXVg4IKFxXctgM qmJgZmV7b+s5tH6GzU1JX0j8SmiCYcKUgMQ7BH2VM+RFbiMrp8XpZR42ucY7bxAhMI6Q ByOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=YXgfc4qbBTCBgmLXVZ/Bd1tNJ3M6rpyJFIz/oH3Gudw=; b=vkqAobsQezxRcnWOXfJjSmOQrYQrXYIz7zleGgX4W/a3st2aKMJIuDszdyfQMNUT19 bp/TwNiMM2BcqXEOfx6mpuZGzbHZOzjFPRv3O8J+Fz+nb6Kob8SoGyus8mduIS5c6NbH 5hxoI4kgyPm2pXTHoRHebuLksX2Hya5t916XY+Y1uEQ3D+1VM5FL1Z1f8BjhIEJydoBW lE0/PTrvd3E3+0AoQTKpryybK8mI0SXLJACXMZ17sXAN/bcu5FNRIVRzh7X9KpFKZhs/ EPs0Aoa0vc8XLIG9yMy+rux5eBrYEcPxwMH+ogWkn1Gli0QFyGDFFSOKyLlkyexphoPr lXwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QA4OjXiy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u5-v6si8457012pgm.268.2018.10.25.07.47.24; Thu, 25 Oct 2018 07:47:41 -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; dkim=pass header.i=@kernel.org header.s=default header.b=QA4OjXiy; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727743AbeJYXR4 (ORCPT + 99 others); Thu, 25 Oct 2018 19:17:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:52680 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727950AbeJYWoG (ORCPT ); Thu, 25 Oct 2018 18:44:06 -0400 Received: from sasha-vm.mshome.net (unknown [167.98.65.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 20CB22083E; Thu, 25 Oct 2018 14:11:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540476670; bh=4qo/YMrltvhL4vKdd3OLpzUXkvc6d/exEyH1AAOHmM8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QA4OjXiyxOo7TnaJwlIy8aDxUY4o6mjmznsw7X3/Rn45m4FNE9Lr11mM1gJHd2yjt rJLzxrYkHpdI+joiVd11LVLXQQIsUnmVI4uU/0+sxYfK2Wjmv4e+hH0sV4Ps65Uyfc P/qnSJELsE9ljqAVJLjg3ZY0nkNus/ebsSANrrfg= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Israel Rukshin , Sasha Levin Subject: [PATCH AUTOSEL 4.14 11/46] net/mlx5: Fix mlx5_get_vector_affinity function Date: Thu, 25 Oct 2018 10:10:18 -0400 Message-Id: <20181025141053.213330-11-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181025141053.213330-1-sashal@kernel.org> References: <20181025141053.213330-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Israel Rukshin [ Upstream commit 6082d9c9c94a408d7409b5f2e4e42ac9e8b16d0d ] Adding the vector offset when calling to mlx5_vector2eqn() is wrong. This is because mlx5_vector2eqn() checks if EQ index is equal to vector number and the fact that the internal completion vectors that mlx5 allocates don't get an EQ index. The second problem here is that using effective_affinity_mask gives the same CPU for different vectors. This leads to unmapped queues when calling it from blk_mq_rdma_map_queues(). This doesn't happen when using affinity_hint mask. Fixes: 2572cf57d75a ("mlx5: fix mlx5_get_vector_affinity to start from completion vector 0") Fixes: 05e0cc84e00c ("net/mlx5: Fix get vector affinity helper function") Signed-off-by: Israel Rukshin Reviewed-by: Max Gurtovoy Reviewed-by: Sagi Grimberg Signed-off-by: Sasha Levin --- drivers/infiniband/hw/mlx5/main.c | 2 +- include/linux/mlx5/driver.h | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index ab70194a73db..c3a4f5d92391 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -3911,7 +3911,7 @@ mlx5_ib_get_vector_affinity(struct ib_device *ibdev, int comp_vector) { struct mlx5_ib_dev *dev = to_mdev(ibdev); - return mlx5_get_vector_affinity(dev->mdev, comp_vector); + return mlx5_get_vector_affinity_hint(dev->mdev, comp_vector); } static void *mlx5_ib_add(struct mlx5_core_dev *mdev) diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index c4d19e77fea8..5eff332092bc 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h @@ -1193,25 +1193,19 @@ enum { }; static inline const struct cpumask * -mlx5_get_vector_affinity(struct mlx5_core_dev *dev, int vector) +mlx5_get_vector_affinity_hint(struct mlx5_core_dev *dev, int vector) { - const struct cpumask *mask; struct irq_desc *desc; unsigned int irq; int eqn; int err; - err = mlx5_vector2eqn(dev, MLX5_EQ_VEC_COMP_BASE + vector, &eqn, &irq); + err = mlx5_vector2eqn(dev, vector, &eqn, &irq); if (err) return NULL; desc = irq_to_desc(irq); -#ifdef CONFIG_GENERIC_IRQ_EFFECTIVE_AFF_MASK - mask = irq_data_get_effective_affinity_mask(&desc->irq_data); -#else - mask = desc->irq_common_data.affinity; -#endif - return mask; + return desc->affinity_hint; } #endif /* MLX5_DRIVER_H */ -- 2.17.1