summaryrefslogtreecommitdiff
path: root/drivers/scsi/lpfc/lpfc_sli.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-08-29 11:55:36 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2026-08-29 11:55:36 -0700
commit08dbfad3f5040f5bdb6c529da20d6d4e81fefd72 (patch)
tree94767b4d009979fd40f7c1deab59bb578c88529b /drivers/scsi/lpfc/lpfc_sli.c
parentcf72cbb39da84b6f02f90c07f33b102fc10b16f0 (diff)
parent12e67eb89eb2b9516685c744d3f7de0a2d1bd701 (diff)
downloadlinux-stable-master.tar.gz
linux-stable-master.zip
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsiHEADmaster
Pull more SCSI updates from Martin Petersen: "Remaining updates for the 7.3 merge window. The only core change is enabling context analysis for the SCSI layer and UFS. The remaining changes are either bug fixes or hardening" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi: (26 commits) scsi: snic: Fix SCSI host leak on workqueue allocation failure scsi: MAINTAINERS: Update my email address scsi: MAINTAINERS: Leave the cumana_1 and oak drivers to the RISCPC maintainers scsi: leapraid: Standardize NCQ priority sysfs attributes scsi: leapraid: Serialize firmware log mmap with teardown scsi: leapraid: Balance host references for firmware log VMAs scsi: lpfc: Remove unnnecessary NULL check scsi: qla2xxx: Fix an loop timeout test scsi: qla2xxx: Fix an error code in qla_get_tmf() scsi: ibmvfc: Fix use of uninitialized rport in ibmvfc_do_work() scsi: core: Enable context analysis for hosts.o scsi: lpfc: Replace strlcat() with sysfs_emit_at() in the sysfs show functions scsi: lpfc: Replace strlcat() with seq_buf in the debugfs dump helpers scsi: lpfc: Replace strlcat() with seq_buf in lpfc_rx_monitor_report() scsi: lpfc: Replace strlcat() with scnprintf() in lpfc_vport_symbolic_node_name() scsi: lpfc: Replace strlcat() with seq_buf in lpfc_info() scsi: core: Enable context analysis scsi: core: Protect host state changes with the host lock scsi: core: Add lock context annotations scsi: core: Pass the SCSI host pointer directly to scanning functions ...
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_sli.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c43
1 files changed, 24 insertions, 19 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index 62a30a92b792..cfa4371169f1 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -25,6 +25,7 @@
#include <linux/pci.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
+#include <linux/seq_buf.h>
#include <linux/slab.h>
#include <linux/lockdep.h>
#include <linux/dmi.h>
@@ -8109,17 +8110,18 @@ u32 lpfc_rx_monitor_report(struct lpfc_hba *phba,
u32 cnt = 0;
char tmp[DBG_LOG_STR_SZ] = {0};
bool log_to_kmsg = (!buf || !buf_len) ? true : false;
+ struct seq_buf s;
if (!log_to_kmsg) {
/* clear the buffer to be sure */
memset(buf, 0, buf_len);
- scnprintf(buf, buf_len, "\t%-16s%-16s%-16s%-16s%-8s%-8s%-8s"
- "%-8s%-8s%-8s%-16s\n",
- "MaxBPI", "Tot_Data_CMF",
- "Tot_Data_Cmd", "Tot_Data_Cmpl",
- "Lat(us)", "Avg_IO", "Max_IO", "Bsy",
- "IO_cnt", "Info", "BWutil(ms)");
+ seq_buf_init(&s, buf, buf_len);
+ seq_buf_printf(&s, "\t%-16s%-16s%-16s%-16s%-8s%-8s%-8s%-8s%-8s%-8s%-16s\n",
+ "MaxBPI", "Tot_Data_CMF",
+ "Tot_Data_Cmd", "Tot_Data_Cmpl",
+ "Lat(us)", "Avg_IO", "Max_IO", "Bsy",
+ "IO_cnt", "Info", "BWutil(ms)");
}
/* Needs to be _irq because record is called from timer interrupt
@@ -8131,24 +8133,27 @@ u32 lpfc_rx_monitor_report(struct lpfc_hba *phba,
/* Read out this entry's data. */
if (!log_to_kmsg) {
- /* If !log_to_kmsg, then store to buf. */
+ /*
+ * Drop a record whole if it does not fit, without
+ * consuming its ring entry.
+ */
scnprintf(tmp, sizeof(tmp),
- "%03d:\t%-16llu%-16llu%-16llu%-16llu%-8llu"
- "%-8llu%-8llu%-8u%-8u%-8u%u(%u)\n",
- *head_idx, entry->max_bytes_per_interval,
- entry->cmf_bytes, entry->total_bytes,
- entry->rcv_bytes, entry->avg_io_latency,
- entry->avg_io_size, entry->max_read_cnt,
+ "%03d:\t%-16llu%-16llu%-16llu%-16llu%-8llu%-8llu%-8llu%-8u%-8u%-8u%u(%u)\n",
+ *head_idx,
+ entry->max_bytes_per_interval,
+ entry->cmf_bytes,
+ entry->total_bytes,
+ entry->rcv_bytes,
+ entry->avg_io_latency,
+ entry->avg_io_size,
+ entry->max_read_cnt,
entry->cmf_busy, entry->io_cnt,
- entry->cmf_info, entry->timer_utilization,
+ entry->cmf_info,
+ entry->timer_utilization,
entry->timer_interval);
- /* Check for buffer overflow */
- if ((strlen(buf) + strlen(tmp)) >= buf_len)
+ if (seq_buf_puts(&s, tmp) < 0)
break;
-
- /* Append entry's data to buffer */
- strlcat(buf, tmp, buf_len);
} else {
lpfc_printf_log(phba, KERN_INFO, LOG_CGN_MGMT,
"4410 %02u: MBPI %llu Xmit %llu "