On Sat, Mar 10, 2018 at 11:09:59AM +0100, Christoph Hellwig wrote: > > +static void hpsa_setup_reply_map(struct ctlr_info *h) > > +{ > > + const struct cpumask *mask; > > + unsigned int queue, cpu; > > + > > + for (queue = 0; queue < h->msix_vectors; queue++) { > > + mask = pci_irq_get_affinity(h->pdev, queue); > > + if (!mask) > > + goto fallback; > > + > > + for_each_cpu(cpu, mask) > > + h->reply_map[cpu] = queue; > > + } > > + return; > > + > > +fallback: > > + for_each_possible_cpu(cpu) > > + h->reply_map[cpu] = 0; > > +} > > > + h->reply_map = kzalloc(sizeof(*h->reply_map) * nr_cpu_ids, GFP_KERNEL); > > + if (!h->reply_map) { > > + kfree(h); > > + return NULL; > > + } > > + return h; > > 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. Thanks, Ming