diff mbox series

[v2,03/13] scsi: fnic: Add and improve log messages

Message ID 20231027180302.418676-4-kartilak@cisco.com
State New
Headers show
Series Introduce support for multiqueue (MQ) in fnic | expand

Commit Message

Karan Tilak Kumar (kartilak) Oct. 27, 2023, 6:02 p.m. UTC
Add link related log messages in fnic_fcs.c,
Improve log message in fnic_fcs.c,
Add log message in vnic_dev.c.

Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com>
Reviewed-by: Arulprabhu Ponnusamy <arulponn@cisco.com>
Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com>
---
 drivers/scsi/fnic/fnic_fcs.c | 36 ++++++++++++++++++++++++------------
 drivers/scsi/fnic/vnic_dev.c |  4 ++++
 2 files changed, 28 insertions(+), 12 deletions(-)

Comments

Hannes Reinecke Nov. 2, 2023, 7:27 a.m. UTC | #1
On 10/27/23 20:02, Karan Tilak Kumar wrote:
> Add link related log messages in fnic_fcs.c,
> Improve log message in fnic_fcs.c,
> Add log message in vnic_dev.c.
> 
> Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com>
> Reviewed-by: Arulprabhu Ponnusamy <arulponn@cisco.com>
> Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com>
> ---
>   drivers/scsi/fnic/fnic_fcs.c | 36 ++++++++++++++++++++++++------------
>   drivers/scsi/fnic/vnic_dev.c |  4 ++++
>   2 files changed, 28 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/scsi/fnic/fnic_fcs.c b/drivers/scsi/fnic/fnic_fcs.c
> index 55632c67a8f2..203ffec625a4 100644
> --- a/drivers/scsi/fnic/fnic_fcs.c
> +++ b/drivers/scsi/fnic/fnic_fcs.c
> @@ -64,8 +64,8 @@ void fnic_handle_link(struct work_struct *work)
>   			new_port_speed);
>   	if (old_port_speed != new_port_speed)
>   		FNIC_MAIN_DBG(KERN_INFO, fnic->lport->host,
> -				"Current vnic speed set to :  %llu\n",
> -				new_port_speed);
> +				"fnic<%d>: %s: %d: Current vnic speed set to: %llu\n",
> +				fnic->fnic_num, __func__, __LINE__, new_port_speed);
>  
Please update FNIC_MAIN_DBG() to use the 'fnic' structure as an 
argument, then you don't have to prefix all messages with 'fnic<%d>'.

Cheers,

Hannes
Karan Tilak Kumar (kartilak) Nov. 6, 2023, 7:55 p.m. UTC | #2
On Thursday, November 2, 2023 12:28 AM, Hannes Reinecke <hare@suse.de> wrote:
>
> On 10/27/23 20:02, Karan Tilak Kumar wrote:
> > Add link related log messages in fnic_fcs.c, Improve log message in
> > fnic_fcs.c, Add log message in vnic_dev.c.
> >
> > Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com>
> > Reviewed-by: Arulprabhu Ponnusamy <arulponn@cisco.com>
> > Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com>
> > ---
> >   drivers/scsi/fnic/fnic_fcs.c | 36 ++++++++++++++++++++++++------------
> >   drivers/scsi/fnic/vnic_dev.c |  4 ++++
> >   2 files changed, 28 insertions(+), 12 deletions(-)
> >
> > diff --git a/drivers/scsi/fnic/fnic_fcs.c
> > b/drivers/scsi/fnic/fnic_fcs.c index 55632c67a8f2..203ffec625a4 100644
> > --- a/drivers/scsi/fnic/fnic_fcs.c
> > +++ b/drivers/scsi/fnic/fnic_fcs.c
> > @@ -64,8 +64,8 @@ void fnic_handle_link(struct work_struct *work)
> >                     new_port_speed);
> >     if (old_port_speed != new_port_speed)
> >             FNIC_MAIN_DBG(KERN_INFO, fnic->lport->host,
> > -                           "Current vnic speed set to :  %llu\n",
> > -                           new_port_speed);
> > +                           "fnic<%d>: %s: %d: Current vnic speed set to: %llu\n",
> > +                           fnic->fnic_num, __func__, __LINE__, new_port_speed);
> >
> Please update FNIC_MAIN_DBG() to use the 'fnic' structure as an argument, then you don't have to prefix all messages with 'fnic<%d>'.
>
> Cheers,
>
> Hannes

Thanks for the review comments, Hannes. I'll make suitable changes in v3.
Please advise whether I'll need to supersede v2 with a "git send-email --in-reply-to" so that your "Reviewed-by" tag for other patches gets preserved.
I'm not exactly sure how the process works. The goal is to reduce the number of re-reviews of patches, if possible.
Any pointers with respect to this will help.

Regards,
Karan
Hannes Reinecke Nov. 7, 2023, 7:20 a.m. UTC | #3
On 11/6/23 20:55, Karan Tilak Kumar (kartilak) wrote:
> On Thursday, November 2, 2023 12:28 AM, Hannes Reinecke <hare@suse.de> wrote:
>>
>> On 10/27/23 20:02, Karan Tilak Kumar wrote:
>>> Add link related log messages in fnic_fcs.c, Improve log message in
>>> fnic_fcs.c, Add log message in vnic_dev.c.
>>>
>>> Reviewed-by: Sesidhar Baddela <sebaddel@cisco.com>
>>> Reviewed-by: Arulprabhu Ponnusamy <arulponn@cisco.com>
>>> Signed-off-by: Karan Tilak Kumar <kartilak@cisco.com>
>>> ---
>>>    drivers/scsi/fnic/fnic_fcs.c | 36 ++++++++++++++++++++++++------------
>>>    drivers/scsi/fnic/vnic_dev.c |  4 ++++
>>>    2 files changed, 28 insertions(+), 12 deletions(-)
>>>
>>> diff --git a/drivers/scsi/fnic/fnic_fcs.c
>>> b/drivers/scsi/fnic/fnic_fcs.c index 55632c67a8f2..203ffec625a4 100644
>>> --- a/drivers/scsi/fnic/fnic_fcs.c
>>> +++ b/drivers/scsi/fnic/fnic_fcs.c
>>> @@ -64,8 +64,8 @@ void fnic_handle_link(struct work_struct *work)
>>>                      new_port_speed);
>>>      if (old_port_speed != new_port_speed)
>>>              FNIC_MAIN_DBG(KERN_INFO, fnic->lport->host,
>>> -                           "Current vnic speed set to :  %llu\n",
>>> -                           new_port_speed);
>>> +                           "fnic<%d>: %s: %d: Current vnic speed set to: %llu\n",
>>> +                           fnic->fnic_num, __func__, __LINE__, new_port_speed);
>>>
>> Please update FNIC_MAIN_DBG() to use the 'fnic' structure as an argument, then you don't have to prefix all messages with 'fnic<%d>'.
>>
>> Cheers,
>>
>> Hannes
> 
> Thanks for the review comments, Hannes. I'll make suitable changes in v3.
> Please advise whether I'll need to supersede v2 with a "git send-email --in-reply-to" so that your
> "Reviewed-by" tag for other patches gets preserved.
> I'm not exactly sure how the process works. The goal is to reduce the number of re-reviews of patches, if possible.
> Any pointers with respect to this will help.
> 
Please add the 'Reviewed-by' tags for the next submission; that will 
indicated to reviewers which of these patches already have been reviewed
and which need further attention.
Hint: there is the 'b4' tool, which will scrape the patches from the 
mailing list _and_ add the 'Reviewed-by' tags. Maybe give it a go.

Cheers,

Hannes
Karan Tilak Kumar (kartilak) Nov. 7, 2023, 7:54 p.m. UTC | #4
On Monday, November 6, 2023 11:21 PM, Hannes Reinecke <hare@suse.de> wrote:
> > Thanks for the review comments, Hannes. I'll make suitable changes in v3.
> > Please advise whether I'll need to supersede v2 with a "git send-email
> > --in-reply-to" so that your "Reviewed-by" tag for other patches gets preserved.
> > I'm not exactly sure how the process works. The goal is to reduce the number of re-reviews of patches, if possible.
> > Any pointers with respect to this will help.
> >
> Please add the 'Reviewed-by' tags for the next submission; that will indicated to reviewers which of these patches already have been reviewed and which need further attention.
> Hint: there is the 'b4' tool, which will scrape the patches from the mailing list _and_ add the 'Reviewed-by' tags. Maybe give it a go.
>
Thanks for this suggestion.
I'm using this tool and preparing patches for v3.

Regards,
Karan
diff mbox series

Patch

diff --git a/drivers/scsi/fnic/fnic_fcs.c b/drivers/scsi/fnic/fnic_fcs.c
index 55632c67a8f2..203ffec625a4 100644
--- a/drivers/scsi/fnic/fnic_fcs.c
+++ b/drivers/scsi/fnic/fnic_fcs.c
@@ -64,8 +64,8 @@  void fnic_handle_link(struct work_struct *work)
 			new_port_speed);
 	if (old_port_speed != new_port_speed)
 		FNIC_MAIN_DBG(KERN_INFO, fnic->lport->host,
-				"Current vnic speed set to :  %llu\n",
-				new_port_speed);
+				"fnic<%d>: %s: %d: Current vnic speed set to: %llu\n",
+				fnic->fnic_num, __func__, __LINE__, new_port_speed);
 
 	switch (vnic_dev_port_speed(fnic->vdev)) {
 	case DCEM_PORTSPEED_10G:
@@ -102,6 +102,9 @@  void fnic_handle_link(struct work_struct *work)
 			fnic_fc_trace_set_data(fnic->lport->host->host_no,
 				FNIC_FC_LE, "Link Status: DOWN->DOWN",
 				strlen("Link Status: DOWN->DOWN"));
+			FNIC_MAIN_DBG(KERN_INFO, fnic->lport->host,
+					"fnic<%d>: %s: %d: down->down\n",
+					fnic->fnic_num, __func__, __LINE__);
 		} else {
 			if (old_link_down_cnt != fnic->link_down_cnt) {
 				/* UP -> DOWN -> UP */
@@ -128,8 +131,9 @@  void fnic_handle_link(struct work_struct *work)
 					fnic_fcoe_send_vlan_req(fnic);
 					return;
 				}
-				FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host,
-					     "link up\n");
+				FNIC_MAIN_DBG(KERN_INFO, fnic->lport->host,
+						"fnic<%d>: %s: %d: up->down->up: Link up\n",
+						fnic->fnic_num, __func__, __LINE__);
 				fcoe_ctlr_link_up(&fnic->ctlr);
 			} else {
 				/* UP -> UP */
@@ -138,6 +142,9 @@  void fnic_handle_link(struct work_struct *work)
 					fnic->lport->host->host_no, FNIC_FC_LE,
 					"Link Status: UP_UP",
 					strlen("Link Status: UP_UP"));
+				FNIC_MAIN_DBG(KERN_INFO, fnic->lport->host,
+						"fnic<%d>: %s: %d: up->up\n",
+						fnic->fnic_num, __func__, __LINE__);
 			}
 		}
 	} else if (fnic->link_status) {
@@ -153,7 +160,9 @@  void fnic_handle_link(struct work_struct *work)
 			return;
 		}
 
-		FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host, "link up\n");
+		FNIC_MAIN_DBG(KERN_INFO, fnic->lport->host,
+				"fnic<%d>: %s: %d: down->up: Link up\n",
+				fnic->fnic_num, __func__, __LINE__);
 		fnic_fc_trace_set_data(fnic->lport->host->host_no, FNIC_FC_LE,
 				       "Link Status: DOWN_UP", strlen("Link Status: DOWN_UP"));
 		fcoe_ctlr_link_up(&fnic->ctlr);
@@ -161,7 +170,9 @@  void fnic_handle_link(struct work_struct *work)
 		/* UP -> DOWN */
 		fnic->lport->host_stats.link_failure_count++;
 		spin_unlock_irqrestore(&fnic->fnic_lock, flags);
-		FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host, "link down\n");
+		FNIC_MAIN_DBG(KERN_INFO, fnic->lport->host,
+				"fnic<%d>: %s: %d: up->down: Link down\n",
+				fnic->fnic_num, __func__, __LINE__);
 		fnic_fc_trace_set_data(
 			fnic->lport->host->host_no, FNIC_FC_LE,
 			"Link Status: UP_DOWN",
@@ -763,8 +774,9 @@  void fnic_set_port_id(struct fc_lport *lport, u32 port_id, struct fc_frame *fp)
 	u8 *mac;
 	int ret;
 
-	FNIC_FCS_DBG(KERN_DEBUG, lport->host, "set port_id %x fp %p\n",
-		     port_id, fp);
+	FNIC_FCS_DBG(KERN_DEBUG, lport->host,
+			"fnic<%d>: %s: %d: set port_id 0x%x fp 0x%p\n",
+			fnic->fnic_num, __func__, __LINE__, port_id, fp);
 
 	/*
 	 * If we're clearing the FC_ID, change to use the ctl_src_addr.
@@ -790,10 +802,10 @@  void fnic_set_port_id(struct fc_lport *lport, u32 port_id, struct fc_frame *fp)
 	if (fnic->state == FNIC_IN_ETH_MODE || fnic->state == FNIC_IN_FC_MODE)
 		fnic->state = FNIC_IN_ETH_TRANS_FC_MODE;
 	else {
-		FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host,
-			     "Unexpected fnic state %s while"
-			     " processing flogi resp\n",
-			     fnic_state_to_str(fnic->state));
+		FNIC_FCS_DBG(KERN_ERR, fnic->lport->host,
+			     "fnic<%d>: %s: %d: Unexpected fnic state: %s processing FLOGI response",
+			     fnic->fnic_num, __func__, __LINE__,
+				 fnic_state_to_str(fnic->state));
 		spin_unlock_irq(&fnic->fnic_lock);
 		return;
 	}
diff --git a/drivers/scsi/fnic/vnic_dev.c b/drivers/scsi/fnic/vnic_dev.c
index 3e5b437c0492..e0b173cc9d5f 100644
--- a/drivers/scsi/fnic/vnic_dev.c
+++ b/drivers/scsi/fnic/vnic_dev.c
@@ -143,6 +143,10 @@  static int vnic_dev_discover_res(struct vnic_dev *vdev,
 		vdev->res[type].vaddr = (char __iomem *)bar->vaddr + bar_offset;
 	}
 
+	pr_info("res_type_wq: %d res_type_rq: %d res_type_cq: %d res_type_intr_ctrl: %d\n",
+		vdev->res[RES_TYPE_WQ].count, vdev->res[RES_TYPE_RQ].count,
+		vdev->res[RES_TYPE_CQ].count, vdev->res[RES_TYPE_INTR_CTRL].count);
+
 	return 0;
 }