Skip to content

Commit 56d23ed

Browse files
steffen-maiermartinkpetersen
authored andcommitted
scsi: zfcp: do not trace pure benign residual HBA responses at default level
Since quite a while, Linux issues enough SCSI commands per scsi_device which successfully return with FCP_RESID_UNDER, FSF_FCP_RSP_AVAILABLE, and SAM_STAT_GOOD. This floods the HBA trace area and we cannot see other and important HBA trace records long enough. Therefore, do not trace HBA response errors for pure benign residual under counts at the default trace level. This excludes benign residual under count combined with other validity bits set in FCP_RSP_IU, such as FCP_SNS_LEN_VAL. For all those other cases, we still do want to see both the HBA record and the corresponding SCSI record by default. Signed-off-by: Steffen Maier <[email protected]> Fixes: a54ca0f ("[SCSI] zfcp: Redesign of the debug tracing for HBA records.") Cc: <[email protected]> #2.6.37+ Reviewed-by: Benjamin Block <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent dac37e1 commit 56d23ed

File tree

2 files changed

+30
-3
lines changed

2 files changed

+30
-3
lines changed

drivers/s390/scsi/zfcp_dbf.h

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* zfcp device driver
33
* debug feature declarations
44
*
5-
* Copyright IBM Corp. 2008, 2015
5+
* Copyright IBM Corp. 2008, 2016
66
*/
77

88
#ifndef ZFCP_DBF_H
@@ -283,6 +283,30 @@ struct zfcp_dbf {
283283
struct zfcp_dbf_scsi scsi_buf;
284284
};
285285

286+
/**
287+
* zfcp_dbf_hba_fsf_resp_suppress - true if we should not trace by default
288+
* @req: request that has been completed
289+
*
290+
* Returns true if FCP response with only benign residual under count.
291+
*/
292+
static inline
293+
bool zfcp_dbf_hba_fsf_resp_suppress(struct zfcp_fsf_req *req)
294+
{
295+
struct fsf_qtcb *qtcb = req->qtcb;
296+
u32 fsf_stat = qtcb->header.fsf_status;
297+
struct fcp_resp *fcp_rsp;
298+
u8 rsp_flags, fr_status;
299+
300+
if (qtcb->prefix.qtcb_type != FSF_IO_COMMAND)
301+
return false; /* not an FCP response */
302+
fcp_rsp = (struct fcp_resp *)&qtcb->bottom.io.fcp_rsp;
303+
rsp_flags = fcp_rsp->fr_flags;
304+
fr_status = fcp_rsp->fr_status;
305+
return (fsf_stat == FSF_FCP_RSP_AVAILABLE) &&
306+
(rsp_flags == FCP_RESID_UNDER) &&
307+
(fr_status == SAM_STAT_GOOD);
308+
}
309+
286310
static inline
287311
void zfcp_dbf_hba_fsf_resp(char *tag, int level, struct zfcp_fsf_req *req)
288312
{
@@ -304,7 +328,9 @@ void zfcp_dbf_hba_fsf_response(struct zfcp_fsf_req *req)
304328
zfcp_dbf_hba_fsf_resp("fs_perr", 1, req);
305329

306330
} else if (qtcb->header.fsf_status != FSF_GOOD) {
307-
zfcp_dbf_hba_fsf_resp("fs_ferr", 1, req);
331+
zfcp_dbf_hba_fsf_resp("fs_ferr",
332+
zfcp_dbf_hba_fsf_resp_suppress(req)
333+
? 5 : 1, req);
308334

309335
} else if ((req->fsf_command == FSF_QTCB_OPEN_PORT_WITH_DID) ||
310336
(req->fsf_command == FSF_QTCB_OPEN_LUN)) {

drivers/s390/scsi/zfcp_fsf.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Interface to the FSF support functions.
55
*
6-
* Copyright IBM Corp. 2002, 2015
6+
* Copyright IBM Corp. 2002, 2016
77
*/
88

99
#ifndef FSF_H
@@ -78,6 +78,7 @@
7878
#define FSF_APP_TAG_CHECK_FAILURE 0x00000082
7979
#define FSF_REF_TAG_CHECK_FAILURE 0x00000083
8080
#define FSF_ADAPTER_STATUS_AVAILABLE 0x000000AD
81+
#define FSF_FCP_RSP_AVAILABLE 0x000000AF
8182
#define FSF_UNKNOWN_COMMAND 0x000000E2
8283
#define FSF_UNKNOWN_OP_SUBTYPE 0x000000E3
8384
#define FSF_INVALID_COMMAND_OPTION 0x000000E5

0 commit comments

Comments
 (0)