diff options
author | Justin Tee <justin.tee@broadcom.com> | 2024-01-31 10:51:07 -0800 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2024-02-05 20:51:35 -0500 |
commit | 0dfd9cbc187c4bb7e35decacae9a131027ea50a3 (patch) | |
tree | e90447c7bbf9f005d4c46c0f20a71fb2306487bc /drivers/scsi/lpfc/lpfc_attr.c | |
parent | 4be4ad6cd2371ffca86e4446feae3d8373e4b02a (diff) |
scsi: lpfc: Change nlp state statistic counters into atomic_t
There is no reason to use the shost_lock to synchronize an LLDD statistics
counter. Convert all the nlp state statistic counters into atomic_t.
Corresponding zeroing, increments, and reads are converted to atomic
versions.
Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Link: https://lore.kernel.org/r/20240131185112.149731-13-justintee8345@gmail.com
Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_attr.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_attr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 1f9a529e09ff..142c90eb210f 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c @@ -1260,7 +1260,8 @@ lpfc_num_discovered_ports_show(struct device *dev, struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; return scnprintf(buf, PAGE_SIZE, "%d\n", - vport->fc_map_cnt + vport->fc_unmap_cnt); + atomic_read(&vport->fc_map_cnt) + + atomic_read(&vport->fc_unmap_cnt)); } /** |