[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <573a7ab2-93ec-4184-9806-31a7ed99c04b@acm.org>
Date: Wed, 25 Oct 2023 11:19:40 -0700
From: Bart Van Assche <bvanassche@....org>
To: Karan Tilak Kumar <kartilak@...co.com>, sebaddel@...co.com
Cc: arulponn@...co.com, djhawar@...co.com, gcboffa@...co.com,
mkai2@...co.com, satishkh@...co.com, jejb@...ux.ibm.com,
martin.petersen@...cle.com, linux-scsi@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 12/13] scsi: fnic: Add support for multiqueue (MQ) in fnic
driver
On 10/20/23 12:06, Karan Tilak Kumar wrote:
> @@ -405,22 +388,20 @@ static inline int fnic_queue_wq_copy_desc(struct fnic *fnic,
> * Routine to send a scsi cdb
> * Called with host_lock held and interrupts disabled.
> */
This patch removes the DEF_SCSI_QCMD() invocation so the above comment
is now wrong. Please fix it.
> -static int fnic_queuecommand_lck(struct scsi_cmnd *sc)
> +static int fnic_queuecommand_lck(struct scsi_cmnd *sc, uint32_t mqtag, uint16_t hwq)
Because this patch removes the DEF_SCSI_QCMD() invocation, the name of
the fnic_queuecommand_lck() function is now incorrect. Please remove the
_lck() suffix.
> -DEF_SCSI_QCMD(fnic_queuecommand)
> +int fnic_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *sc)
> +{
> + struct request *const rq = scsi_cmd_to_rq(sc);
> + int rc;
> + struct fc_lport *lp = shost_priv(sc->device->host);
> + struct fnic *fnic = lport_priv(lp);
> + uint32_t mqtag = 0;
> + int tag = 0;
> + uint16_t hwq = 0;
> +
> + mqtag = blk_mq_unique_tag(rq);
> + hwq = blk_mq_unique_tag_to_hwq(mqtag);
> + tag = blk_mq_unique_tag_to_tag(mqtag);
> +
> + if (tag >= fnic->fnic_max_tag_id) {
> + FNIC_SCSI_DBG(KERN_ERR, fnic->lport->host,
> + "fnic<%d>: %s: Out of range tag: 0x%x\n",
> + fnic->fnic_num, __func__, tag);
> + sc->result = DID_ERROR << 16;
> + scsi_done(sc);
> + return 0;
> + }
> +
> + rc = fnic_queuecommand_lck(sc, mqtag, hwq);
> + return rc;
> +}
The code guarded by "if (tag >= fnic->fnic_max_tag_id)" should be
removed and instead the driver should ensure that tags never exceed the
fnic->fnic_max_tag_id limit.
Please also remove the local variable 'rc'.
Thanks,
Bart.
Powered by blists - more mailing lists