From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 8 Mar 2018 08:50:35 +0100 From: Christoph Hellwig To: Ming Lei Cc: Jens Axboe , linux-block@vger.kernel.org, Christoph Hellwig , Mike Snitzer , linux-scsi@vger.kernel.org, Hannes Reinecke , Arun Easi , Omar Sandoval , "Martin K . Petersen" , James Bottomley , Christoph Hellwig , Don Brace , Kashyap Desai , Peter Rivera , Laurence Oberman , Meelis Roos Subject: Re: [PATCH V3 1/8] scsi: hpsa: fix selection of reply queue Message-ID: <20180308075035.GE15748@lst.de> References: <20180227100750.32299-1-ming.lei@redhat.com> <20180227100750.32299-2-ming.lei@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20180227100750.32299-2-ming.lei@redhat.com> List-ID: > +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; > +} It seems a little annoying that we have to duplicate this in the driver. Wouldn't this be solved by your force_blk_mq flag and relying on the hw_ctx id?