From patchwork Mon Jul 16 08:30:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leon Romanovsky X-Patchwork-Id: 10526167 X-Patchwork-Delegate: jgg@ziepe.ca 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 797C3601D2 for ; Mon, 16 Jul 2018 08:30:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6832A28AF9 for ; Mon, 16 Jul 2018 08:30:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6654328AEC; Mon, 16 Jul 2018 08:30:23 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, 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 0AE2428AE7 for ; Mon, 16 Jul 2018 08:30:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728833AbeGPI4e (ORCPT ); Mon, 16 Jul 2018 04:56:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:43666 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728707AbeGPI4d (ORCPT ); Mon, 16 Jul 2018 04:56:33 -0400 Received: from localhost (unknown [213.57.183.250]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 30A4520779; Mon, 16 Jul 2018 08:30:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1531729817; bh=g76NSVootGZpoDinLV/2dLwxiP03UF0LmQOeD+bzoEo=; h=From:To:Cc:Subject:Date:From; b=YElW3EcwNhI1KeORxV91Pr1SBOWJJAtV4770vRM+/f0fbNmMVYHm3iU6+PC9ooRHY 0uboUXrH01309HpaO2VSdV9PBimoVa9tE6q+VaQzRmk1F0JV0n8R09fi+VnX7P+c4z P8RnPUh8um2RIm3kawLObyFOFmmt28E7Wu96Vz3c= From: Leon Romanovsky To: Doug Ledford , Jason Gunthorpe Cc: Leon Romanovsky , RDMA mailing list , Saeed Mahameed , Steve Wise , linux-netdev Subject: [PATCH mlx5-next] RDMA/mlx5: Don't use cached IRQ affinity mask Date: Mon, 16 Jul 2018 11:30:12 +0300 Message-Id: <20180716083012.15410-1-leon@kernel.org> X-Mailer: git-send-email 2.17.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 From: Leon Romanovsky The IRQ affinity mask is managed by mlx5_core, however any user triggered updates through /proc/irq//smp_affinity were not reflected in mlx5_ib_get_vector_affinity(). Drop the attempt to use cached version of affinity mask in favour of managed by PCI core value. Fixes: e3ca34880652 ("net/mlx5: Fix build break when CONFIG_SMP=n") Reported-by: Steve Wise Reviewed-by: Saeed Mahameed Signed-off-by: Leon Romanovsky --- drivers/infiniband/hw/mlx5/main.c | 4 +++- include/linux/mlx5/driver.h | 7 ------- 2 files changed, 3 insertions(+), 8 deletions(-) -- 2.14.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index d0834525afe3..1c3584024acb 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -5304,8 +5304,10 @@ static const struct cpumask * mlx5_ib_get_vector_affinity(struct ib_device *ibdev, int comp_vector) { struct mlx5_ib_dev *dev = to_mdev(ibdev); + int irq = pci_irq_vector(dev->mdev->pdev, + MLX5_EQ_VEC_COMP_BASE + comp_vector); - return mlx5_get_vector_affinity_hint(dev->mdev, comp_vector); + return irq_get_affinity_mask(irq); } /* The mlx5_ib_multiport_mutex should be held when calling this function */ diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index 0b7daa4a8f84..d3581cd5d517 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h @@ -1287,11 +1287,4 @@ static inline int mlx5_core_native_port_num(struct mlx5_core_dev *dev) enum { MLX5_TRIGGERED_CMD_COMP = (u64)1 << 32, }; - -static inline const struct cpumask * -mlx5_get_vector_affinity_hint(struct mlx5_core_dev *dev, int vector) -{ - return dev->priv.irq_info[vector].mask; -} - #endif /* MLX5_DRIVER_H */