RE: [PATCH v2 2/4] megaraid_sas: iouring iopoll support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> >   static int megasas_map_queues(struct Scsi_Host *shost)
> >   {
> >   	struct megasas_instance *instance;
> > +	int i, qoff, offset;
> >
> >   	instance = (struct megasas_instance *)shost->hostdata;
> >
> >   	if (shost->nr_hw_queues == 1)
> >   		return 0;
> >
> > -	return blk_mq_pci_map_queues(&shost-
> >tag_set.map[HCTX_TYPE_DEFAULT],
> > -			instance->pdev, instance->low_latency_index_start);
> > +	offset = instance->low_latency_index_start;
> > +
> > +	for (i = 0, qoff = 0; i < HCTX_MAX_TYPES; i++) {
> > +		struct blk_mq_queue_map *map = &shost->tag_set.map[i];
> > +
> > +		map->nr_queues  = 0;
> > +
> > +		if (i == HCTX_TYPE_DEFAULT)
> > +			map->nr_queues = instance->msix_vectors - offset;
> > +		else if (i == HCTX_TYPE_POLL)
> > +			map->nr_queues = instance->iopoll_q_count;
> > +
> > +		if (!map->nr_queues) {
> > +			BUG_ON(i == HCTX_TYPE_DEFAULT);
> > +			continue;
> > +		}
> > +
> > +		/*
> > +		 * The poll queue(s) doesn't have an IRQ (and hence IRQ
> > +		 * affinity), so use the regular blk-mq cpu mapping
> > +		 */
> > +		map->queue_offset = qoff;
> > +		if (i != HCTX_TYPE_POLL)
> > +			blk_mq_pci_map_queues(map, instance->pdev,
> offset);
> > +		else
> > +			blk_mq_map_queues(map);
> > +
> > +		qoff += map->nr_queues;
> > +		offset += map->nr_queues;
> > +	}
> > +
> Seeing that you only ever use HCTX_TYPE_DEFAULT and HCTX_TYPE_POLL
> that loop is a bit non-obvious; maybe it's better to unroll it and assigne
> the
> values manually.

Hannes- I have taken care this in V3 series. Please review.

> >   /**
> >    * megasas_enable_irq_poll() - enable irqpoll
> >    * @instance:			Adapter soft state
>
> Double newline

Taken care in V3.

>
> > @@ -4164,6 +4203,8 @@ void  megasas_reset_reply_desc(struct
> > megasas_instance *instance)
> >
> >   	fusion = instance->ctrl_context;
> >   	count = instance->msix_vectors > 0 ? instance->msix_vectors : 1;
> > +	count += instance->iopoll_q_count;
> > +
> >   	for (i = 0 ; i < count ; i++) {
> >   		fusion->last_reply_idx[i] = 0;
> >   		reply_desc = fusion->reply_frames_desc[i]; diff --git
> > a/drivers/scsi/megaraid/megaraid_sas_fusion.h
> > b/drivers/scsi/megaraid/megaraid_sas_fusion.h
> > index 30de4b01f703..242ff58a3404 100644
> > --- a/drivers/scsi/megaraid/megaraid_sas_fusion.h
> > +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.h
> > @@ -1303,6 +1303,9 @@ struct fusion_context {
> >   	u8 *sense;
> >   	dma_addr_t sense_phys_addr;
> >
> > +	atomic_t   busy_mq_poll[MAX_MSIX_QUEUES_FUSION];
> > +
> > +
> >   	dma_addr_t reply_frames_desc_phys[MAX_MSIX_QUEUES_FUSION];
> >   	union MPI2_REPLY_DESCRIPTORS_UNION
> *reply_frames_desc[MAX_MSIX_QUEUES_FUSION];
> >   	struct rdpq_alloc_detail rdpq_tracker[RDPQ_MAX_CHUNK_COUNT];
> >
> Same here.

Taken care in V3.
>
> Cheers,
>
> Hannes
> --
> Dr. Hannes Reinecke                Kernel Storage Architect
> hare@xxxxxxx                              +49 911 74053 688
> SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809
> (AG Nürnberg), Geschäftsführer: Felix Imendörffer

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux