From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x225n3/XWAwpuUEIOo3AnMXRz5IvUwN90Do/JKqEhErqR70X8K2NZxW/pD84Z9imlbEIIqc4v ARC-Seal: i=1; a=rsa-sha256; t=1517256289; cv=none; d=google.com; s=arc-20160816; b=puQw8ZsSqiPfraKaXaLVYkTfbg/hXQnH00tP4J/7K7vcyeKLRt9oa3jtO/D07Wa8yd DWZ2PMASvyBsSH9vsjL7IEKSJ5qgtwoy1/7y6Y3X/Hm8WJM3xWfE2fv68adlBBO0E/M3 uAtHHROTgQxIwK/rqRH0VGxNoEkqOJqogGC7641rfJbkBoeU0MaXxYDtPTbiBuUDaQ6A 9PwdDDVdRUX+jR9Y/DPelxZeyDVnDoGR4az6yi5gR5n/IoapBQKB23Yvd1IVMDdaaqRO 4uWfP+ElyEUf8wX11EUN1WPOK9N/YXxgsbdMj+gDhz4v0U8w4XL7zgRsG+MF7KDP0New 4jkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=lE55ot3Htmb901E9NlahtaCL6bTuFDcOZablqZyYtSA=; b=XX/tMWUgUC85pV6Nl73g/BPCEjy50JiBF9MrGufuU5A+twTCFcYK6EKw5PPuf8wFYw VgCyb8zBDBhNjhTgL7mO2xlVFhLDJa30XV3mmt5xwUaI1nOW2F1lGZieZS5wQ4skkxqa kGK8P+dceS5I7k1EGLAZZjCap5jOSC0nAPasv0XsxM4AoBwSgXi37wLa2xkshjNXW3HH 8jgrY0i8BSzqXzez8FNDVDyVITeVvZa8xjluo4oS3njNbPi1gRO36iPXeJh7kQpUnhqc 3J8zMQR5mPSOmUf8L3KA41ZV6rbd+Yv5CClymOUv0S/75UvQQ6+huY7dcoH9/nyAeaD6 Fw/g== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning gregkh@linuxfoundation.org does not designate 90.92.71.90 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sagi Grimberg , Saeed Mahameed Subject: [PATCH 4.14 41/71] net/mlx5: Fix get vector affinity helper function Date: Mon, 29 Jan 2018 13:57:09 +0100 Message-Id: <20180129123830.004669484@linuxfoundation.org> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180129123827.271171825@linuxfoundation.org> References: <20180129123827.271171825@linuxfoundation.org> User-Agent: quilt/0.65 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-LABELS: =?utf-8?b?IlxcU2VudCI=?= X-GMAIL-THRID: =?utf-8?q?1590958531819881541?= X-GMAIL-MSGID: =?utf-8?q?1590958531819881541?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Saeed Mahameed [ Upstream commit 05e0cc84e00c54fb152d1f4b86bc211823a83d0c ] mlx5_get_vector_affinity used to call pci_irq_get_affinity and after reverting the patch that sets the device affinity via PCI_IRQ_AFFINITY API, calling pci_irq_get_affinity becomes useless and it breaks RDMA mlx5 users. To fix this, this patch provides an alternative way to retrieve IRQ vector affinity using legacy IRQ API, following smp_affinity read procfs implementation. Fixes: 231243c82793 ("Revert mlx5: move affinity hints assignments to generic code") Fixes: a435393acafb ("mlx5: move affinity hints assignments to generic code") Cc: Sagi Grimberg Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- include/linux/mlx5/driver.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -1194,7 +1195,23 @@ enum { static inline const struct cpumask * mlx5_get_vector_affinity(struct mlx5_core_dev *dev, int vector) { - return pci_irq_get_affinity(dev->pdev, MLX5_EQ_VEC_COMP_BASE + vector); + const struct cpumask *mask; + struct irq_desc *desc; + unsigned int irq; + int eqn; + int err; + + 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; } #endif /* MLX5_DRIVER_H */