Received: by 10.223.176.5 with SMTP id f5csp3442608wra; Mon, 29 Jan 2018 13:14:50 -0800 (PST) X-Google-Smtp-Source: AH8x225UShDiuan3uPV29vM2pk8HN7XY4pQR/KUlllKFzZ7dqwdDhplzuAXw2cU4lCw8rfYcvAne X-Received: by 10.101.96.44 with SMTP id p12mr21703319pgu.390.1517260490438; Mon, 29 Jan 2018 13:14:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517260490; cv=none; d=google.com; s=arc-20160816; b=lvAsuYIm9L0j1nX/5WV/Yq8qXpGzPj5rInwgp3sKvZIaMNVg7BS1BLksM5X9s1SsaY Nu61HRwTKu7LUm2ubDiAQEaJHRsIVnfptkNKbtAKrEp/aVaKrlZx1EthQvnDBbqvVOjE 4Hd/Bt0HanSfDykJrUh05Arze+mB5u3BgFSU7URiMisZj8WOZ6kY/Rr/VLB4XrwGJPHR pHU0E5ZSP+QGUSmvd3gNyfAUo/1fRFdJl4R0+Lv6/0HTyCi/R/XTcFSynJy1ExuVlwev ftRFiZbpJCCk0Ab09r2xGeADQb+oB76/NsGqIS0k6aHXadaFafvTowJln9rbAmVdHHYJ CD4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=lE55ot3Htmb901E9NlahtaCL6bTuFDcOZablqZyYtSA=; b=QIMi/a0XE+jBO9N98vjv1Srn28IUBWrphbdfslsU/emzifmfGlSCKxv+UeeDMZ+nRN C+AkRlvR0jsvDbNI/auZHg4DrU/vnrm9VGvlnrIakfMl/xP6OjT0w0VTk8HKbvYWxVbG GoxcoiWrYfk05HEl+xmZUa6sAW27iwj38uEMrGJ9BFDpoZKKiUU1hcGIZIm3RoSpram/ PTRu1Uk0oEDl2b57hDlwuFGLgPBcvzhvY36tx+Wo+G5tPu/KKAtChxKs/rsWK5JsEsFB b42f/BqbPRmb16hbxj1RmJy4KXfuu6jUnp53x9gKHl7DThW/j6oQuFyq153Nqfvtf2tO iaSg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a33-v6si686265plc.237.2018.01.29.13.14.35; Mon, 29 Jan 2018 13:14:50 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752503AbeA2VOO (ORCPT + 99 others); Mon, 29 Jan 2018 16:14:14 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:43902 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752401AbeA2UEs (ORCPT ); Mon, 29 Jan 2018 15:04:48 -0500 Received: from localhost (LFbn-1-12258-90.w90-92.abo.wanadoo.fr [90.92.71.90]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 5DF9A300B; Mon, 29 Jan 2018 13:09:21 +0000 (UTC) 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 */