diff options
author | Justin Tee <justin.tee@broadcom.com> | 2024-12-12 15:33:05 -0800 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2025-01-02 15:01:22 -0500 |
commit | 3f8f9f16f844a1124da2f3ce674deaf08921fb3a (patch) | |
tree | b054893784d5f3d44ec5f4a01befc7240d103333 /drivers/scsi/lpfc/lpfc_ct.c | |
parent | 06dbe31e8950b1effb2e0ff98d1162416c406e95 (diff) | |
download | lwn-3f8f9f16f844a1124da2f3ce674deaf08921fb3a.tar.gz lwn-3f8f9f16f844a1124da2f3ce674deaf08921fb3a.zip |
scsi: lpfc: Change lpfc_nodelist save_flags member into a bitmask
In attempt to reduce the amount of unnecessary ndlp->lock acquisitions in
the lpfc driver, change save_flags into an unsigned long bitmask and use
clear_bit/test_bit bitwise atomic APIs instead of reliance on ndlp->lock
for synchronization.
Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Link: https://lore.kernel.org/r/20241212233309.71356-7-justintee8345@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_ct.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_ct.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index 30891ad17e2a..12c67cdd7c19 100644 --- a/drivers/scsi/lpfc/lpfc_ct.c +++ b/drivers/scsi/lpfc/lpfc_ct.c @@ -1646,14 +1646,12 @@ out: /* If the caller wanted a synchronous DA_ID completion, signal the * wait obj and clear flag to reset the vport. */ - if (ndlp->save_flags & NLP_WAIT_FOR_DA_ID) { + if (test_bit(NLP_WAIT_FOR_DA_ID, &ndlp->save_flags)) { if (ndlp->da_id_waitq) wake_up(ndlp->da_id_waitq); } - spin_lock_irq(&ndlp->lock); - ndlp->save_flags &= ~NLP_WAIT_FOR_DA_ID; - spin_unlock_irq(&ndlp->lock); + clear_bit(NLP_WAIT_FOR_DA_ID, &ndlp->save_flags); lpfc_ct_free_iocb(phba, cmdiocb); lpfc_nlp_put(ndlp); |