mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Garry <john.g.garry@oracle.com>
To: Karan Tilak Kumar <kartilak@cisco.com>, sebaddel@cisco.com
Cc: arulponn@cisco.com, djhawar@cisco.com, gcboffa@cisco.com,
	mkai2@cisco.com, satishkh@cisco.com, jejb@linux.ibm.com,
	martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 10/13] scsi: fnic: Add support for multiqueue (MQ) in fnic_main.c
Date: Wed, 8 Nov 2023 13:57:02 +0000	[thread overview]
Message-ID: <7912855c-c661-2b83-f19a-4ec6287ddb4b@oracle.com> (raw)
In-Reply-To: <20231020190629.338623-11-kartilak@cisco.com>


>   static void
> @@ -392,7 +394,7 @@ static int fnic_notify_set(struct fnic *fnic)
>   		err = vnic_dev_notify_set(fnic->vdev, -1);
>   		break;
>   	case VNIC_DEV_INTR_MODE_MSIX:
> -		err = vnic_dev_notify_set(fnic->vdev, FNIC_MSIX_ERR_NOTIFY);
> +		err = vnic_dev_notify_set(fnic->vdev, fnic->wq_copy_count + fnic->cpy_wq_base);
>   		break;
>   	default:
>   		shost_printk(KERN_ERR, fnic->lport->host,
> @@ -565,11 +567,6 @@ static int fnic_scsi_drv_init(struct fnic *fnic)
>   	host->max_cmd_len = FCOE_MAX_CMD_LEN;
>   
>   	host->nr_hw_queues = fnic->wq_copy_count;

Please be aware of comment on nr_hw_queues in scsi_host.h - maybe it is 
relevant to this adapter:

"the total queue depth per host is nr_hw_queues * can_queue"

Also, since you seem to be using blk_mq_unique_tag() as the per-IO tag, 
I assume that you don't need to set shost.host_tagset (for that reason).

> -	if (host->nr_hw_queues > 1)
> -		shost_printk(KERN_ERR, host,
> -				"fnic: blk-mq is not supported");
> -
> -	host->nr_hw_queues = fnic->wq_copy_count = 1;
>   
>   	shost_printk(KERN_INFO, host,
>   			"fnic: can_queue: %d max_lun: %llu",
> @@ -582,15 +579,71 @@ static int fnic_scsi_drv_init(struct fnic *fnic)
>   	return 0;
>   }
>   
> +void fnic_mq_map_queues_cpus(struct Scsi_Host *host)

This function looks to do effectively the same as 
blk_mq_pci_map_queues(), right?

> +{
> +	const struct cpumask *mask;
> +	unsigned int queue, cpu;
> +	int irq_num;
> +	struct fc_lport *lp = shost_priv(host);
> +	struct fnic *fnic = lport_priv(lp);
> +	struct pci_dev *l_pdev = fnic->pdev;
> +	struct blk_mq_tag_set *set = &host->tag_set;
> +	int intr_mode = fnic->config.intr_mode;
> +
> +	if (intr_mode == VNIC_DEV_INTR_MODE_MSI || intr_mode == VNIC_DEV_INTR_MODE_INTX) {
> +		shost_printk(KERN_ERR, fnic->lport->host,
> +			"fnic<%d>: %s: %d: intr_mode is not msix\n",
> +			fnic->fnic_num, __func__, __LINE__);
> +		return;
> +	}
> +
> +	shost_printk(KERN_INFO, fnic->lport->host,
> +			"fnic<%d>: %s: %d: set->nr_hw_queues: %d\n",
> +			fnic->fnic_num, __func__, __LINE__, set->nr_hw_queues);
> +
> +	for (queue = 0; queue < set->nr_hw_queues; queue++) {
> +		if (l_pdev == NULL) {
> +			shost_printk(KERN_ERR, fnic->lport->host,
> +				"fnic<%d>: %s: %d: l_pdev is null\n",
> +				fnic->fnic_num, __func__, __LINE__);
> +			return;
> +		}
> +
> +		irq_num = pci_irq_vector(l_pdev, queue+2);
> +		if (irq_num < 0) {
> +			shost_printk(KERN_ERR, fnic->lport->host,
> +				"fnic<%d>: %s: %d: irq_num less than zero: %d\n",
> +				fnic->fnic_num, __func__, __LINE__, irq_num);
> +			continue;
> +		}
> +
> +		mask = irq_get_effective_affinity_mask(irq_num);
> +		if (!mask) {
> +			shost_printk(KERN_ERR, fnic->lport->host,
> +				"fnic<%d>: %s: %d: failed to get irq_affinity map for queue: %d\n",
> +				fnic->fnic_num, __func__, __LINE__, irq_num);
> +			continue;
> +		}
> +
> +		for_each_cpu(cpu, mask) {
> +			set->map[HCTX_TYPE_DEFAULT].mq_map[cpu] = queue;
> +			shost_printk(KERN_INFO, fnic->lport->host,
> +				"fnic<%d>: %s: %d: cpu: %d <=> queue: %d\n",
> +				fnic->fnic_num, __func__, __LINE__, cpu, irq_num);
> +		}
> +	}
> +}
> +

Thanks,
John


  reply	other threads:[~2023-11-08 13:59 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-20 19:06 [PATCH 00/13] Introduce support for multiqueue (MQ) in Karan Tilak Kumar
2023-10-20 19:06 ` [PATCH 01/13] scsi: fnic: Modify definitions to sync with VIC firmware Karan Tilak Kumar
2023-10-20 19:06 ` [PATCH 02/13] scsi: fnic: Add and use fnic number Karan Tilak Kumar
2023-10-20 19:06 ` [PATCH 03/13] scsi: fnic: Add and improve log messages Karan Tilak Kumar
2023-10-20 19:06 ` [PATCH 04/13] scsi: fnic: Rename wq_copy to hw_copy_wq Karan Tilak Kumar
2023-10-20 19:06 ` [PATCH 05/13] scsi: fnic: Get copy workqueue count and interrupt mode from config Karan Tilak Kumar
2023-10-20 19:06 ` [PATCH 06/13] scsi: fnic: Refactor and redefine fnic.h for multiqueue Karan Tilak Kumar
2023-10-20 19:06 ` [PATCH 07/13] scsi: fnic: Modify ISRs to support multiqueue(MQ) Karan Tilak Kumar
2023-10-25 10:52   ` kernel test robot
2023-10-20 19:06 ` [PATCH 08/13] scsi: fnic: Define stats to track multiqueue (MQ) IOs Karan Tilak Kumar
2023-10-20 19:06 ` [PATCH 09/13] scsi: fnic: Remove usage of host_lock Karan Tilak Kumar
2023-10-20 19:06 ` [PATCH 10/13] scsi: fnic: Add support for multiqueue (MQ) in fnic_main.c Karan Tilak Kumar
2023-11-08 13:57   ` John Garry [this message]
2023-11-09  2:21     ` Karan Tilak Kumar (kartilak)
2023-10-20 19:06 ` [PATCH 11/13] scsi: fnic: Use fnic_lock to protect fnic structures in queuecommand Karan Tilak Kumar
2023-10-20 19:06 ` [PATCH 12/13] scsi: fnic: Add support for multiqueue (MQ) in fnic driver Karan Tilak Kumar
2023-10-25 18:19   ` Bart Van Assche
2023-10-25 21:29     ` Karan Tilak Kumar (kartilak)
2023-10-20 19:06 ` [PATCH 13/13] scsi: fnic: Improve logs and add support for multiqueue (MQ) Karan Tilak Kumar

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=7912855c-c661-2b83-f19a-4ec6287ddb4b@oracle.com \
    --to=john.g.garry@oracle.com \
    --cc=arulponn@cisco.com \
    --cc=djhawar@cisco.com \
    --cc=gcboffa@cisco.com \
    --cc=jejb@linux.ibm.com \
    --cc=kartilak@cisco.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mkai2@cisco.com \
    --cc=satishkh@cisco.com \
    --cc=sebaddel@cisco.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®