Received: by 2002:a9a:4c47:0:b029:116:c383:538 with SMTP id u7csp977311lko; Tue, 13 Jul 2021 14:18:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzw67Kokltqmf0omLqD1WS4M4NiUh4NF+Ht/Ow7kwSpPDHaSA02Biv4Ee8LBXWVBJkBaTvS X-Received: by 2002:a17:906:4784:: with SMTP id cw4mr8007601ejc.160.1626211105042; Tue, 13 Jul 2021 14:18:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626211105; cv=none; d=google.com; s=arc-20160816; b=CaZao5+6c/6NvdfSmUZKVwhxjlLj6VOrspJdVOlUQPHLCbJdMiacU0UeotVjSf8jW7 h9Xr7ACvnOq2ixisBXMOtuh3gBzMU2U5gtBs/0LanPS31uCZMvwRhJdOGFxt7tVKGMm0 5pqyCnbDLp/LHtARKa8LVVEUo6SjjvuZKrEH8R7p/KaeeQhuQ+hRYKEpkp+/8gQ8UMwO N5tS8AawDAuOO44GpswiCwjStTyEkAnwcJHV7SRevCPxalCLg9ZAS1jQnWf7pJdLOV3E HBM9swREiEQJsepsoLN0MsJS6cHQSGaZD/fNQUTbnF9WEBdJpdvOfmzp5a0xF/FbPZ0x +wjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=tDrUtUc2aE0pRbBZzR884Ce25w6F59XVVpHlm8q8sCM=; b=MdKSjlP6Zs+Fluw9MKntssYV3RAZAeIgMZoLKK+TY6jKUNpYZrvVMDnMylc/8Qzn0v l2JDzyHi9DYQwTETuTeZMabWA97bB0VeKMDmoQuPtiqqctR/TITH4g8ztpvs5FA6PsWG xh63XlVtJB+BzodCgSGOcPeL8LqKc0hUB8WaO1AB/9BIW6qqToJVNdTT8Gf7OsVgLv9v DhiJ3d2A0hqPDM41aSkYNgdfMHbw5iHFF5++0U66jHQGkB9woHbkKZRppPO8tBb+4STO 5/LP+zqGE/RvKj0AvFlfmuWqdITJJ+1RbCFgdkJekHLqDrYskOV2F+N2ZqY8wM2qjE/b Uv/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Z/nBqRw5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dq22si24895236ejc.661.2021.07.13.14.17.58; Tue, 13 Jul 2021 14:18:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Z/nBqRw5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236466AbhGMVTE (ORCPT + 99 others); Tue, 13 Jul 2021 17:19:04 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:51210 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236333AbhGMVSz (ORCPT ); Tue, 13 Jul 2021 17:18:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626210964; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tDrUtUc2aE0pRbBZzR884Ce25w6F59XVVpHlm8q8sCM=; b=Z/nBqRw5/ywbzWUTPG4guelkJ2g+zlF5gFesjWjg5Q9Mp1yhrwjafoVJTuPegvmyXlDhOj EhjKVyELY3wUP7D9kV/Z3KulafwtIEjyqVEvOl2hzzg7TmVfkJ6GmyvWBsLEx4arvyld1z kf770b6q9eMmelIl3zR2Y8DmzIsuH5c= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-58-sqT3LDfJPZycxOFdvp8i3Q-1; Tue, 13 Jul 2021 17:16:03 -0400 X-MC-Unique: sqT3LDfJPZycxOFdvp8i3Q-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3F76D8015C6; Tue, 13 Jul 2021 21:15:58 +0000 (UTC) Received: from virtlab719.virt.lab.eng.bos.redhat.com (virtlab719.virt.lab.eng.bos.redhat.com [10.19.153.15]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5DD005D9DD; Tue, 13 Jul 2021 21:15:54 +0000 (UTC) From: Nitesh Narayan Lal To: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-api@vger.kernel.org, linux-pci@vger.kernel.org, tglx@linutronix.de, jesse.brandeburg@intel.com, robin.murphy@arm.com, mtosatti@redhat.com, mingo@kernel.org, jbrandeb@kernel.org, frederic@kernel.org, juri.lelli@redhat.com, abelits@marvell.com, bhelgaas@google.com, rostedt@goodmis.org, peterz@infradead.org, davem@davemloft.net, akpm@linux-foundation.org, sfr@canb.auug.org.au, stephen@networkplumber.org, rppt@linux.vnet.ibm.com, chris.friesen@windriver.com, maz@kernel.org, nhorman@tuxdriver.com, pjwaskiewicz@gmail.com, sassmann@redhat.com, thenzl@redhat.com, kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, shivasharan.srikanteshwara@broadcom.com, sathya.prakash@broadcom.com, sreekanth.reddy@broadcom.com, suganath-prabu.subramani@broadcom.com, james.smart@broadcom.com, dick.kennedy@broadcom.com, jkc@redhat.com, faisal.latif@intel.com, shiraz.saleem@intel.com, tariqt@nvidia.com, ahleihel@redhat.com, kheib@redhat.com, borisp@nvidia.com, saeedm@nvidia.com, benve@cisco.com, govind@gmx.com, jassisinghbrar@gmail.com, ajit.khaparde@broadcom.com, sriharsha.basavapatna@broadcom.com, somnath.kotur@broadcom.com, nilal@redhat.com, tatyana.e.nikolova@intel.com, mustafa.ismail@intel.com, ahs3@redhat.com, leonro@nvidia.com, chandrakanth.patil@broadcom.com Subject: [PATCH v3 05/14] scsi: mpt3sas: Use irq_set_affinity_and_hint Date: Tue, 13 Jul 2021 17:14:53 -0400 Message-Id: <20210713211502.464259-6-nitesh@redhat.com> In-Reply-To: <20210713211502.464259-1-nitesh@redhat.com> References: <20210713211502.464259-1-nitesh@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The driver uses irq_set_affinity_hint() specifically for the high IOPS queue interrupts for two purposes: - To set the affinity_hint which is consumed by the userspace for distributing the interrupts - To apply an affinity that it provides The driver enforces its own affinity to bind the high IOPS queue interrupts to the local NUMA node. However, irq_set_affinity_hint() applying the provided cpumask as an affinity (if not NULL) for the interrupt is an undocumented side effect. To remove this side effect irq_set_affinity_hint() has been marked as deprecated and new interfaces have been introduced. Hence, replace the irq_set_affinity_hint() with the new interface irq_set_affinity_and_hint() where the provided mask needs to be applied as the affinity and affinity_hint pointer needs to be set and replace with irq_update_affinity_hint() where only affinity_hint needs to be updated. Signed-off-by: Nitesh Narayan Lal --- drivers/scsi/mpt3sas/mpt3sas_base.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index c39955239d1c..c1a11962f227 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -2991,6 +2991,7 @@ _base_check_enable_msix(struct MPT3SAS_ADAPTER *ioc) static void _base_free_irq(struct MPT3SAS_ADAPTER *ioc) { + unsigned int irq; struct adapter_reply_queue *reply_q, *next; if (list_empty(&ioc->reply_queue_list)) @@ -2998,9 +2999,10 @@ _base_free_irq(struct MPT3SAS_ADAPTER *ioc) list_for_each_entry_safe(reply_q, next, &ioc->reply_queue_list, list) { list_del(&reply_q->list); - if (ioc->smp_affinity_enable) - irq_set_affinity_hint(pci_irq_vector(ioc->pdev, - reply_q->msix_index), NULL); + if (ioc->smp_affinity_enable) { + irq = pci_irq_vector(ioc->pdev, reply_q->msix_index); + irq_update_affinity_hint(irq, NULL); + } free_irq(pci_irq_vector(ioc->pdev, reply_q->msix_index), reply_q); kfree(reply_q); @@ -3056,16 +3058,13 @@ _base_request_irq(struct MPT3SAS_ADAPTER *ioc, u8 index) * @ioc: per adapter object * * The enduser would need to set the affinity via /proc/irq/#/smp_affinity - * - * It would nice if we could call irq_set_affinity, however it is not - * an exported symbol */ static void _base_assign_reply_queues(struct MPT3SAS_ADAPTER *ioc) { - unsigned int cpu, nr_cpus, nr_msix, index = 0; + unsigned int cpu, nr_cpus, nr_msix, index = 0, irq; struct adapter_reply_queue *reply_q; - int local_numa_node; + const struct cpumask *mask; if (!_base_is_controller_msix_enabled(ioc)) return; @@ -3088,11 +3087,11 @@ _base_assign_reply_queues(struct MPT3SAS_ADAPTER *ioc) * corresponding to high iops queues. */ if (ioc->high_iops_queues) { - local_numa_node = dev_to_node(&ioc->pdev->dev); + mask = cpumask_of_node(dev_to_node(&ioc->pdev->dev)); for (index = 0; index < ioc->high_iops_queues; index++) { - irq_set_affinity_hint(pci_irq_vector(ioc->pdev, - index), cpumask_of_node(local_numa_node)); + irq = pci_irq_vector(ioc->pdev, index); + irq_set_affinity_and_hint(irq, mask); } } -- 2.27.0