lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <038a3990-6ca2-4260-a36e-b5f0c16d8f76@oracle.com>
Date: Mon, 12 Aug 2024 16:31:32 +0100
From: John Garry <john.g.garry@...cle.com>
To: Daniel Wagner <dwagner@...e.de>, Jens Axboe <axboe@...nel.dk>,
        Keith Busch <kbusch@...nel.org>, Sagi Grimberg <sagi@...mberg.me>,
        Thomas Gleixner <tglx@...utronix.de>, Christoph Hellwig <hch@....de>,
        "Martin K. Petersen" <martin.petersen@...cle.com>,
        "Michael S. Tsirkin" <mst@...hat.com>,
        Jason Wang <jasowang@...hat.com>,
        Kashyap Desai <kashyap.desai@...adcom.com>,
        Sumit Saxena <sumit.saxena@...adcom.com>,
        Shivasharan S <shivasharan.srikanteshwara@...adcom.com>,
        Chandrakanth patil <chandrakanth.patil@...adcom.com>,
        Sathya Prakash Veerichetty <sathya.prakash@...adcom.com>,
        Suganath Prabu Subramani <suganath-prabu.subramani@...adcom.com>,
        Nilesh Javali <njavali@...vell.com>,
        GR-QLogic-Storage-Upstream@...vell.com,
        Jonathan Corbet <corbet@....net>
Cc: Frederic Weisbecker <frederic@...nel.org>, Mel Gorman <mgorman@...e.de>,
        Hannes Reinecke <hare@...e.de>,
        Sridhar Balaraman <sbalaraman@...allelwireless.com>,
        "brookxu.cn" <brookxu.cn@...il.com>, Ming Lei <ming.lei@...hat.com>,
        linux-kernel@...r.kernel.org, linux-block@...r.kernel.org,
        linux-nvme@...ts.infradead.org, linux-scsi@...r.kernel.org,
        virtualization@...ts.linux.dev, megaraidlinux.pdl@...adcom.com,
        mpi3mr-linuxdrv.pdl@...adcom.com, MPT-FusionLinux.pdl@...adcom.com,
        storagedev@...rochip.com, linux-doc@...r.kernel.org
Subject: Re: [PATCH v3 04/15] scsi: replace blk_mq_pci_map_queues with
 blk_mq_dev_map_queues

On 06/08/2024 13:06, Daniel Wagner wrote:
> Replace all users of blk_mq_pci_map_queues with the more generic
> blk_mq_dev_map_queues. This in preparation to retire
> blk_mq_pci_map_queues.

nit: About blk_mq_dev_map_queues(), from the name it gives the 
impression that we deal in struct device, which is not the case.

> 
> Signed-off-by: Daniel Wagner <dwagner@...e.de>
> ---
>   drivers/scsi/fnic/fnic_main.c             |  3 ++-
>   drivers/scsi/hisi_sas/hisi_sas.h          |  1 -
>   drivers/scsi/hisi_sas/hisi_sas_v2_hw.c    | 20 ++++++++++----------
>   drivers/scsi/hisi_sas/hisi_sas_v3_hw.c    |  5 +++--
>   drivers/scsi/megaraid/megaraid_sas_base.c |  3 ++-
>   drivers/scsi/mpi3mr/mpi3mr_os.c           |  3 ++-
>   drivers/scsi/mpt3sas/mpt3sas_scsih.c      |  3 ++-
>   drivers/scsi/pm8001/pm8001_init.c         |  3 ++-
>   drivers/scsi/qla2xxx/qla_nvme.c           |  3 ++-
>   drivers/scsi/qla2xxx/qla_os.c             |  3 ++-
>   drivers/scsi/smartpqi/smartpqi_init.c     |  7 ++++---
>   11 files changed, 31 insertions(+), 23 deletions(-)
> 
> diff --git a/drivers/scsi/fnic/fnic_main.c b/drivers/scsi/fnic/fnic_main.c
> index 29eead383eb9..dee7f241c38a 100644
> --- a/drivers/scsi/fnic/fnic_main.c
> +++ b/drivers/scsi/fnic/fnic_main.c
> @@ -601,7 +601,8 @@ void fnic_mq_map_queues_cpus(struct Scsi_Host *host)
>   		return;
>   	}
>   
> -	blk_mq_pci_map_queues(qmap, l_pdev, FNIC_PCI_OFFSET);
> +	blk_mq_dev_map_queues(qmap, l_pdev, FNIC_PCI_OFFSET,
> +			      blk_mq_pci_get_queue_affinity);
>   }
>   
>   static int fnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
> diff --git a/drivers/scsi/hisi_sas/hisi_sas.h b/drivers/scsi/hisi_sas/hisi_sas.h
> index d223f482488f..010479a354ee 100644
> --- a/drivers/scsi/hisi_sas/hisi_sas.h
> +++ b/drivers/scsi/hisi_sas/hisi_sas.h
> @@ -9,7 +9,6 @@
>   
>   #include <linux/acpi.h>
>   #include <linux/blk-mq.h>
> -#include <linux/blk-mq-pci.h>
>   #include <linux/clk.h>
>   #include <linux/debugfs.h>
>   #include <linux/dmapool.h>
> diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
> index 342d75f12051..91daf57f328c 100644
> --- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
> +++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
> @@ -3549,21 +3549,21 @@ static const struct attribute_group *sdev_groups_v2_hw[] = {
>   	NULL
>   };
>   
> +static const struct cpumask *hisi_hba_get_queue_affinity(void *dev_data,
> +							 int offset, int idx)

personally I think that name "queue" would be better than "idx"

> +{
> +	struct hisi_hba *hba = dev_data;
> +
> +	return irq_get_affinity_mask(hba->irq_map[offset + idx]);
> +}
> +
>   static void map_queues_v2_hw(struct Scsi_Host *shost)
>   {
>   	struct hisi_hba *hisi_hba = shost_priv(shost);
>   	struct blk_mq_queue_map *qmap = &shost->tag_set.map[HCTX_TYPE_DEFAULT];
> -	const struct cpumask *mask;
> -	unsigned int queue, cpu;
>   
> -	for (queue = 0; queue < qmap->nr_queues; queue++) {
> -		mask = irq_get_affinity_mask(hisi_hba->irq_map[96 + queue]);
> -		if (!mask)
> -			continue;
> -
> -		for_each_cpu(cpu, mask)
> -			qmap->mq_map[cpu] = qmap->queue_offset + queue;
> -	}
> +	return blk_mq_dev_map_queues(qmap, hisi_hba, 96,

blk_mq_dev_map_queues() returns void, and so we should not return the 
value (which is void).

And I know that the current code is like this, but using CQ0_IRQ_INDEX 
instead of 96 would be nicer.

> +				     hisi_hba_get_queue_affinity);
>   }
>   
>   static const struct scsi_host_template sht_v2_hw = {
> diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
> index feda9b54b443..0b3c7b49813a 100644
> --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
> +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
> @@ -3322,8 +3322,9 @@ static void hisi_sas_map_queues(struct Scsi_Host *shost)
>   		if (i == HCTX_TYPE_POLL)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ