scsi: lpfc: reduce locking when updating statistics
authorJames Smart <jsmart2021@gmail.com>
Mon, 10 Sep 2018 17:30:49 +0000 (10:30 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 12 Sep 2018 00:37:33 +0000 (20:37 -0400)
commit18027a8ccca5b9189f49be0d8b84dbc717084a26
treeaa4dbf9ac409f149884c6df5b1d2a1950f7e427b
parent2879265f514b1f4154288243c91438ddbedb3ed4
scsi: lpfc: reduce locking when updating statistics

Currently, on each io completion, the stats update routine indiscriminately
holds a lock. While holding the adapter-wide lock, checks are made to check
whether status are being tracked. When disabled (the default), the locking
wasted a lot of cycles.

Check for stats enablement before taking the lock.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/lpfc/lpfc_scsi.c