From: Ming Lei <ming.lei@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>,
Jens Axboe <axboe@fb.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
linux-scsi@vger.kernel.org, linux-block@vger.kernel.org,
Meelis Roos <mroos@linux.ee>, Don Brace <don.brace@microsemi.com>,
Kashyap Desai <kashyap.desai@broadcom.com>,
Laurence Oberman <loberman@redhat.com>,
Mike Snitzer <snitzer@redhat.com>, Hannes Reinecke <hare@suse.de>,
Artem Bityutskiy <artem.bityutskiy@intel.com>
Subject: Re: [PATCH V4 1/4] scsi: hpsa: fix selection of reply queue
Date: Mon, 12 Mar 2018 17:19:10 +0800 [thread overview]
Message-ID: <20180312091908.GC23903@ming.t460p> (raw)
In-Reply-To: <20180312075202.GB5232@lst.de>
On Mon, Mar 12, 2018 at 08:52:02AM +0100, Christoph Hellwig wrote:
> On Sat, Mar 10, 2018 at 11:01:43PM +0800, Ming Lei wrote:
> > > I really dislike this being open coded in drivers. It really should
> > > be helper chared with the blk-mq map building that drivers just use.
> > >
> > > For now just have a low-level blk_pci_map_queues that
> > > blk_mq_pci_map_queues, hpsa and megaraid can share. In the long run
> > > it might make sense to change the blk-mq callout to that low-level
> > > prototype as well.
> >
> > The way for selecting reply queue is needed for non scsi_mq too.
>
> Which still doesn't prevent you from using a common helper.
The only common code is the following part:
+ for (queue = 0; queue < instance->msix_vectors; queue++) {
+ mask = pci_irq_get_affinity(instance->pdev, queue);
+ if (!mask)
+ goto fallback;
+
+ for_each_cpu(cpu, mask)
+ instance->reply_map[cpu] = queue;
+ }
For megraraid_sas, the fallback code need to handle mapping in the
following way for legacy vectors:
for_each_possible_cpu(cpu)
instance->reply_map[cpu] = cpu % instance->msix_vectors;
So not sure if it is worth of a common helper, given there may not be
potential users of the helper.
Thanks,
Ming
next prev parent reply other threads:[~2018-03-12 9:19 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-09 3:32 [PATCH V4 0/4] SCSI: fix selection of reply(hw) queue Ming Lei
2018-03-09 3:32 ` [PATCH V4 1/4] scsi: hpsa: fix selection of reply queue Ming Lei
2018-03-09 22:14 ` Don Brace
2018-03-10 10:09 ` Christoph Hellwig
2018-03-10 15:01 ` Ming Lei
2018-03-12 7:52 ` Christoph Hellwig
2018-03-12 9:19 ` Ming Lei [this message]
2018-03-12 7:37 ` Bityutskiy, Artem
2018-03-12 15:39 ` Don Brace
2018-03-09 3:32 ` [PATCH V4 2/4] scsi: megaraid_sas: " Ming Lei
2018-03-09 11:07 ` Kashyap Desai
2018-03-09 12:03 ` Ming Lei
2018-03-09 14:03 ` Kashyap Desai
2018-03-09 3:32 ` [PATCH V4 3/4] scsi: introduce force_blk_mq Ming Lei
2018-03-10 10:10 ` Christoph Hellwig
2018-03-09 3:32 ` [PATCH V4 4/4] scsi: virtio_scsi: fix IO hang caused by irq vector automatic affinity Ming Lei
2018-03-10 10:15 ` Christoph Hellwig
2018-03-12 9:00 ` Ming Lei
2018-03-09 7:00 ` [PATCH V4 0/4] SCSI: fix selection of reply(hw) queue Hannes Reinecke
2018-03-09 7:39 ` Ming Lei
2018-03-09 14:01 ` Meelis Roos
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180312091908.GC23903@ming.t460p \
--to=ming.lei@redhat.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=artem.bityutskiy@intel.com \
--cc=axboe@fb.com \
--cc=don.brace@microsemi.com \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=kashyap.desai@broadcom.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=loberman@redhat.com \
--cc=martin.petersen@oracle.com \
--cc=mroos@linux.ee \
--cc=snitzer@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.