From 6fc1ed1a6724ffe1f8e7f88efc173e727bbc593a Mon Sep 17 00:00:00 2001 From: Chinmaya Kajagar Date: Tue, 14 Oct 2025 07:01:33 +0200 Subject: [PATCH] zfcpdbf: Print plogi and prli within open port response as payload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Print plogi and prli of each incoming open port response. Additional payload ‘fsf_els’ HBA area to trace and print the new open port response details. Relevant kernel dbf structure changes are done in a separate patch. New fields plogi_len and prli_len (u32 i.e. 4 hex digits at new appended offsets 112 and 120) and payload record(s) are available. The kernel structure with added members, struct zfcp_dbf_hba_res { u64 req_issued; /* 0 8 */ u32 prot_status; /* 8 4 */ u8 prot_status_qual[16]; /* 12 16 */ u32 fsf_status; /* 28 4 */ u8 fsf_status_qual[16]; /* 32 16 */ u32 port_handle; /* 48 4 */ u32 lun_handle; /* 52 4 */ u32 plogi_len; /* 56 4 */ u32 prli_len; /* 60 4 */ }; zfcpdbf partial output for HBA area with relevant kernel code changes displaying PLOGI/ PRLI info log with length for each: PLOGI length : 116 PRLI length : 20 Payload time : 2026-01-29-06:19:15:626629 PLOGI/PRLIinfo : 02000000 00000000 80000800 000a0002 00000000 2002000e 1115c62f 2001000e 1115c62f 00000000 00000000 00000000 00000000 80000000 00000000 00000000 00000000 80000000 00000000 000a0000 00010000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 02100014 08002100 00000000 00000000 00000112 Signed-off-by: Steffen Maier Signed-off-by: Chinmaya Kajagar Signed-off-by: Jan Höppner --- scripts/zfcpdbf | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/scripts/zfcpdbf b/scripts/zfcpdbf index e0b44c83..58305017 100755 --- a/scripts/zfcpdbf +++ b/scripts/zfcpdbf @@ -2,7 +2,7 @@ # # zfcpdbf - Tool to interpret the information from logging/tracing sources # -# Copyright IBM Corp. 2010, 2020 +# Copyright IBM Corp. 2010, 2026 # # s390-tools is free software; you can redistribute it and/or modify # it under the terms of the MIT license. See LICENSE for details. @@ -102,6 +102,7 @@ use POSIX qw(strftime floor difftime mktime); use File::Spec::Functions qw/catfile catdir rel2abs/; use File::Basename; use Getopt::Long; +use List::Util qw(min); use constant TOD_UNIX_EPOCH => 0x7d91048bca000000; use constant STD_DEBUG_DIR => "/sys/kernel/debug/s390dbf/"; @@ -595,6 +596,9 @@ sub _print_hba_id1 my $rec_received = shift(); my $rec_issued; my $pay_rec = $PAYLOAD_RECORDS{$fsf_req_id}{"fsf_res"}; + my $plogi_length = hex(substr($rec, 112, 8)); + my $prli_length = hex(substr($rec, 120, 8)); + my $els_rec = $PAYLOAD_RECORDS{$fsf_req_id}{"fsf_els"}; $rec_issued = stck_to_timeval(substr($rec, 0, 16)); @@ -627,6 +631,19 @@ sub _print_hba_id1 print "QTCB log length: ", $payload_length, "\n" if ($payload_length); print_payload($payload_length, $pay_rec, "QTCB log info") if ($payload_length); + + if ($plogi_length) { + print "PLOGI length : ", $plogi_length, "\n"; + $plogi_length = min($plogi_length, 256); + } + if ($prli_length) { + print "PRLI length : ", $prli_length, "\n"; + $prli_length = min($prli_length, 256 - $plogi_length); + } + if ($plogi_length || $prli_length) { + print_payload($plogi_length + $prli_length, $els_rec, + "PLOGI/PRLIinfo"); + } } sub _print_hba_id2