From: Himanshu Madhani <himanshu.madhani@oracle.com>
To: Justin Tee <justintee8345@gmail.com>, linux-scsi@vger.kernel.org
Cc: jsmart2021@gmail.com, justin.tee@broadcom.com
Subject: Re: [PATCH 11/17] lpfc: Remove shost_lock protection for fc_host_port shost APIs
Date: Tue, 30 Jan 2024 18:41:13 -0800 [thread overview]
Message-ID: <fac523bf-e05e-4b40-b326-b6183b2323ab@oracle.com> (raw)
In-Reply-To: <20240131003549.147784-12-justintee8345@gmail.com>
On 1/30/24 16:35, Justin Tee wrote:
> Desiring to reduce the amount of unnecessary shost_lock acquisitions in the
> lpfc driver, it has been determined that there is no need for shost_lock
> protection when retrieving fc_host port information because it is only for
> display to user via sysfs.
>
> Signed-off-by: Justin Tee <justin.tee@broadcom.com>
> ---
> drivers/scsi/lpfc/lpfc_attr.c | 16 ----------------
> 1 file changed, 16 deletions(-)
>
> diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
> index d3a5d6ecdf7d..1f9a529e09ff 100644
> --- a/drivers/scsi/lpfc/lpfc_attr.c
> +++ b/drivers/scsi/lpfc/lpfc_attr.c
> @@ -6429,8 +6429,6 @@ lpfc_get_host_port_type(struct Scsi_Host *shost)
> struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
> struct lpfc_hba *phba = vport->phba;
>
> - spin_lock_irq(shost->host_lock);
> -
> if (vport->port_type == LPFC_NPIV_PORT) {
> fc_host_port_type(shost) = FC_PORTTYPE_NPIV;
> } else if (lpfc_is_link_up(phba)) {
> @@ -6447,8 +6445,6 @@ lpfc_get_host_port_type(struct Scsi_Host *shost)
> }
> } else
> fc_host_port_type(shost) = FC_PORTTYPE_UNKNOWN;
> -
> - spin_unlock_irq(shost->host_lock);
> }
>
> /**
> @@ -6461,8 +6457,6 @@ lpfc_get_host_port_state(struct Scsi_Host *shost)
> struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
> struct lpfc_hba *phba = vport->phba;
>
> - spin_lock_irq(shost->host_lock);
> -
> if (vport->fc_flag & FC_OFFLINE_MODE)
> fc_host_port_state(shost) = FC_PORTSTATE_OFFLINE;
> else {
> @@ -6490,8 +6484,6 @@ lpfc_get_host_port_state(struct Scsi_Host *shost)
> break;
> }
> }
> -
> - spin_unlock_irq(shost->host_lock);
> }
>
> /**
> @@ -6504,8 +6496,6 @@ lpfc_get_host_speed(struct Scsi_Host *shost)
> struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;
> struct lpfc_hba *phba = vport->phba;
>
> - spin_lock_irq(shost->host_lock);
> -
> if ((lpfc_is_link_up(phba)) && (!(phba->hba_flag & HBA_FCOE_MODE))) {
> switch(phba->fc_linkspeed) {
> case LPFC_LINK_SPEED_1GHZ:
> @@ -6568,8 +6558,6 @@ lpfc_get_host_speed(struct Scsi_Host *shost)
> }
> } else
> fc_host_speed(shost) = FC_PORTSPEED_UNKNOWN;
> -
> - spin_unlock_irq(shost->host_lock);
> }
>
> /**
> @@ -6583,8 +6571,6 @@ lpfc_get_host_fabric_name (struct Scsi_Host *shost)
> struct lpfc_hba *phba = vport->phba;
> u64 node_name;
>
> - spin_lock_irq(shost->host_lock);
> -
> if ((vport->port_state > LPFC_FLOGI) &&
> ((vport->fc_flag & FC_FABRIC) ||
> ((phba->fc_topology == LPFC_TOPOLOGY_LOOP) &&
> @@ -6594,8 +6580,6 @@ lpfc_get_host_fabric_name (struct Scsi_Host *shost)
> /* fabric is local port if there is no F/FL_Port */
> node_name = 0;
>
> - spin_unlock_irq(shost->host_lock);
> -
> fc_host_fabric_name(shost) = node_name;
> }
>
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
--
Himanshu Madhani Oracle Linux Engineering
next prev parent reply other threads:[~2024-01-31 2:41 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-31 0:35 [PATCH 00/17] lpfc: Update lpfc to revision 14.4.0.0 Justin Tee
2024-01-31 0:35 ` [PATCH 01/17] lpfc: Initialize status local variable in lpfc_sli4_repost_sgl_list Justin Tee
2024-01-31 2:35 ` Himanshu Madhani
2024-01-31 0:35 ` [PATCH 02/17] lpfc: Fix possible memory leak in lpfc_rcv_padisc Justin Tee
2024-01-31 2:35 ` Himanshu Madhani
2024-01-31 0:35 ` [PATCH 03/17] lpfc: Use sg_dma_len API to get struct scatterlist's length Justin Tee
2024-01-31 2:36 ` Himanshu Madhani
2024-01-31 0:35 ` [PATCH 04/17] lpfc: Remove D_ID swap log message from trace event logger Justin Tee
2024-01-31 2:36 ` Himanshu Madhani
2024-01-31 0:35 ` [PATCH 05/17] lpfc: Allow lpfc_plogi_confirm_nport logic to execute for Fabric nodes Justin Tee
2024-01-31 2:36 ` Himanshu Madhani
2024-01-31 0:35 ` [PATCH 06/17] lpfc: Remove NLP_RCV_PLOGI early return during RSCN processing for ndlps Justin Tee
2024-01-31 2:37 ` Himanshu Madhani
2024-01-31 0:35 ` [PATCH 07/17] lpfc: Fix failure to delete vports when discovery is in progress Justin Tee
2024-01-31 2:37 ` Himanshu Madhani
2024-01-31 0:35 ` [PATCH 08/17] lpfc: Add condition to delete ndlp object after sending BLS_RJT to an ABTS Justin Tee
2024-01-31 2:39 ` Himanshu Madhani
2024-01-31 0:35 ` [PATCH 09/17] lpfc: Save FPIN frequency statistics upon receipt of peer cgn notifications Justin Tee
2024-01-31 2:39 ` Himanshu Madhani
2024-01-31 0:35 ` [PATCH 10/17] lpfc: Move handling of reset congestion statistics events Justin Tee
2024-01-31 2:40 ` Himanshu Madhani
2024-01-31 0:35 ` [PATCH 11/17] lpfc: Remove shost_lock protection for fc_host_port shost APIs Justin Tee
2024-01-31 2:41 ` Himanshu Madhani [this message]
2024-01-31 0:35 ` [PATCH 12/17] lpfc: Change nlp state statistic counters into atomic_t Justin Tee
2024-01-31 2:44 ` Himanshu Madhani
2024-01-31 0:35 ` [PATCH 13/17] lpfc: Protect vport fc_nodes list with an explicit spin lock Justin Tee
2024-01-31 2:50 ` Himanshu Madhani
2024-01-31 0:35 ` [PATCH 14/17] lpfc: Change lpfc_vport fc_flag member into a bitmask Justin Tee
2024-01-31 3:35 ` Himanshu Madhani
2024-01-31 18:31 ` Justin Tee
2024-01-31 0:35 ` [PATCH 15/17] lpfc: Change lpfc_vport load_flag " Justin Tee
2024-01-31 0:35 ` [PATCH 16/17] lpfc: Update lpfc version to 14.4.0.0 Justin Tee
2024-01-31 2:33 ` Himanshu Madhani
2024-01-31 0:35 ` [PATCH 17/17] lpfc: Copyright updates for 14.4.0.0 patches Justin Tee
2024-01-31 2:33 ` Himanshu Madhani
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=fac523bf-e05e-4b40-b326-b6183b2323ab@oracle.com \
--to=himanshu.madhani@oracle.com \
--cc=jsmart2021@gmail.com \
--cc=justin.tee@broadcom.com \
--cc=justintee8345@gmail.com \
--cc=linux-scsi@vger.kernel.org \
/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