Messages in this thread Patch in this message | | | From | "Karan Tilak Kumar (kartilak)" <> | Subject | RE: [PATCH 12/13] scsi: fnic: Add support for multiqueue (MQ) in fnic driver | Date | Wed, 25 Oct 2023 21:29:24 +0000 |
| |
Hi Bart,
Thanks for your review comments. I'll fix the issues.
Regards, Karan
-----Original Message----- From: Bart Van Assche <bvanassche@acm.org> Sent: Wednesday, October 25, 2023 11:20 AM To: Karan Tilak Kumar (kartilak) <kartilak@cisco.com>; Sesidhar Baddela (sebaddel) <sebaddel@cisco.com> Cc: Arulprabhu Ponnusamy (arulponn) <arulponn@cisco.com>; Dhanraj Jhawar (djhawar) <djhawar@cisco.com>; Gian Carlo Boffa (gcboffa) <gcboffa@cisco.com>; Masa Kai (mkai2) <mkai2@cisco.com>; Satish Kharat (satishkh) <satishkh@cisco.com>; jejb@linux.ibm.com; martin.petersen@oracle.com; linux-scsi@vger.kernel.org; linux-kernel@vger.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.
| |