aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/be2iscsi
diff options
context:
space:
mode:
authorJohn Soni Jose <sony.john-n@emulex.com>2012-10-19 19:11:45 -0400
committerJames Bottomley <JBottomley@Parallels.com>2012-11-26 23:59:35 -0500
commit6763daae8fcf4d7581238385aa326f3dbe8f16c5 (patch)
tree1b85223834bf5d1d128dd4b8de6ccd1fe8be49a9 /drivers/scsi/be2iscsi
parent1d8bc70a5efdad928435c1d88ada1e63ef91b025 (diff)
[SCSI] be2iscsi: Display Completion Event string instead of Opcode
Display the event string along with the opcode and CID on which an event has occured. Signed-off-by: John Soni Jose <sony.john-n@emulex.com> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/be2iscsi')
-rw-r--r--drivers/scsi/be2iscsi/be_cmds.h2
-rw-r--r--drivers/scsi/be2iscsi/be_main.c88
2 files changed, 64 insertions, 26 deletions
diff --git a/drivers/scsi/be2iscsi/be_cmds.h b/drivers/scsi/be2iscsi/be_cmds.h
index 2c8f98df1287..897086b255e6 100644
--- a/drivers/scsi/be2iscsi/be_cmds.h
+++ b/drivers/scsi/be2iscsi/be_cmds.h
@@ -992,8 +992,6 @@ struct be_cmd_get_all_if_id_req {
992#define CONNECTION_UPLOAD_ABORT_WITH_SEQ 4 /* Abortive upload with reset, 992#define CONNECTION_UPLOAD_ABORT_WITH_SEQ 4 /* Abortive upload with reset,
993 * sequence number by driver */ 993 * sequence number by driver */
994 994
995/* Returns byte size of given field with a structure. */
996
997/* Returns the number of items in the field array. */ 995/* Returns the number of items in the field array. */
998#define BE_NUMBER_OF_FIELD(_type_, _field_) \ 996#define BE_NUMBER_OF_FIELD(_type_, _field_) \
999 (FIELD_SIZEOF(_type_, _field_)/sizeof((((_type_ *)0)->_field_[0])))\ 997 (FIELD_SIZEOF(_type_, _field_)/sizeof((((_type_ *)0)->_field_[0])))\
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index ff73f9500b01..b52c5c0a4fd0 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -158,6 +158,45 @@ struct device_attribute *beiscsi_attrs[] = {
158 NULL, 158 NULL,
159}; 159};
160 160
161static char const *cqe_desc[] = {
162 "RESERVED_DESC",
163 "SOL_CMD_COMPLETE",
164 "SOL_CMD_KILLED_DATA_DIGEST_ERR",
165 "CXN_KILLED_PDU_SIZE_EXCEEDS_DSL",
166 "CXN_KILLED_BURST_LEN_MISMATCH",
167 "CXN_KILLED_AHS_RCVD",
168 "CXN_KILLED_HDR_DIGEST_ERR",
169 "CXN_KILLED_UNKNOWN_HDR",
170 "CXN_KILLED_STALE_ITT_TTT_RCVD",
171 "CXN_KILLED_INVALID_ITT_TTT_RCVD",
172 "CXN_KILLED_RST_RCVD",
173 "CXN_KILLED_TIMED_OUT",
174 "CXN_KILLED_RST_SENT",
175 "CXN_KILLED_FIN_RCVD",
176 "CXN_KILLED_BAD_UNSOL_PDU_RCVD",
177 "CXN_KILLED_BAD_WRB_INDEX_ERROR",
178 "CXN_KILLED_OVER_RUN_RESIDUAL",
179 "CXN_KILLED_UNDER_RUN_RESIDUAL",
180 "CMD_KILLED_INVALID_STATSN_RCVD",
181 "CMD_KILLED_INVALID_R2T_RCVD",
182 "CMD_CXN_KILLED_LUN_INVALID",
183 "CMD_CXN_KILLED_ICD_INVALID",
184 "CMD_CXN_KILLED_ITT_INVALID",
185 "CMD_CXN_KILLED_SEQ_OUTOFORDER",
186 "CMD_CXN_KILLED_INVALID_DATASN_RCVD",
187 "CXN_INVALIDATE_NOTIFY",
188 "CXN_INVALIDATE_INDEX_NOTIFY",
189 "CMD_INVALIDATED_NOTIFY",
190 "UNSOL_HDR_NOTIFY",
191 "UNSOL_DATA_NOTIFY",
192 "UNSOL_DATA_DIGEST_ERROR_NOTIFY",
193 "DRIVERMSG_NOTIFY",
194 "CXN_KILLED_CMND_DATA_NOT_ON_SAME_CONN",
195 "SOL_CMD_KILLED_DIF_ERR",
196 "CXN_KILLED_SYN_RCVD",
197 "CXN_KILLED_IMM_DATA_RCVD"
198};
199
161static int beiscsi_slave_configure(struct scsi_device *sdev) 200static int beiscsi_slave_configure(struct scsi_device *sdev)
162{ 201{
163 blk_queue_max_segment_size(sdev->request_queue, 65536); 202 blk_queue_max_segment_size(sdev->request_queue, 65536);
@@ -1914,6 +1953,13 @@ static void beiscsi_process_mcc_isr(struct beiscsi_hba *phba)
1914 1953
1915} 1954}
1916 1955
1956/**
1957 * beiscsi_process_cq()- Process the Completion Queue
1958 * @pbe_eq: Event Q on which the Completion has come
1959 *
1960 * return
1961 * Number of Completion Entries processed.
1962 **/
1917static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq) 1963static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq)
1918{ 1964{
1919 struct be_queue_info *cq; 1965 struct be_queue_info *cq;
@@ -1958,7 +2004,8 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq)
1958 case DRIVERMSG_NOTIFY: 2004 case DRIVERMSG_NOTIFY:
1959 beiscsi_log(phba, KERN_INFO, 2005 beiscsi_log(phba, KERN_INFO,
1960 BEISCSI_LOG_IO | BEISCSI_LOG_CONFIG, 2006 BEISCSI_LOG_IO | BEISCSI_LOG_CONFIG,
1961 "BM_%d : Received DRIVERMSG_NOTIFY\n"); 2007 "BM_%d : Received %s[%d] on CID : %d\n",
2008 cqe_desc[code], code, cid);
1962 2009
1963 dmsg = (struct dmsg_cqe *)sol; 2010 dmsg = (struct dmsg_cqe *)sol;
1964 hwi_complete_drvr_msgs(beiscsi_conn, phba, sol); 2011 hwi_complete_drvr_msgs(beiscsi_conn, phba, sol);
@@ -1966,7 +2013,8 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq)
1966 case UNSOL_HDR_NOTIFY: 2013 case UNSOL_HDR_NOTIFY:
1967 beiscsi_log(phba, KERN_INFO, 2014 beiscsi_log(phba, KERN_INFO,
1968 BEISCSI_LOG_IO | BEISCSI_LOG_CONFIG, 2015 BEISCSI_LOG_IO | BEISCSI_LOG_CONFIG,
1969 "BM_%d : Received UNSOL_HDR_ NOTIFY\n"); 2016 "BM_%d : Received %s[%d] on CID : %d\n",
2017 cqe_desc[code], code, cid);
1970 2018
1971 hwi_process_default_pdu_ring(beiscsi_conn, phba, 2019 hwi_process_default_pdu_ring(beiscsi_conn, phba,
1972 (struct i_t_dpdu_cqe *)sol); 2020 (struct i_t_dpdu_cqe *)sol);
@@ -1974,7 +2022,8 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq)
1974 case UNSOL_DATA_NOTIFY: 2022 case UNSOL_DATA_NOTIFY:
1975 beiscsi_log(phba, KERN_INFO, 2023 beiscsi_log(phba, KERN_INFO,
1976 BEISCSI_LOG_CONFIG | BEISCSI_LOG_IO, 2024 BEISCSI_LOG_CONFIG | BEISCSI_LOG_IO,
1977 "BM_%d : Received UNSOL_DATA_NOTIFY\n"); 2025 "BM_%d : Received %s[%d] on CID : %d\n",
2026 cqe_desc[code], code, cid);
1978 2027
1979 hwi_process_default_pdu_ring(beiscsi_conn, phba, 2028 hwi_process_default_pdu_ring(beiscsi_conn, phba,
1980 (struct i_t_dpdu_cqe *)sol); 2029 (struct i_t_dpdu_cqe *)sol);
@@ -1984,8 +2033,8 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq)
1984 case CXN_INVALIDATE_NOTIFY: 2033 case CXN_INVALIDATE_NOTIFY:
1985 beiscsi_log(phba, KERN_ERR, 2034 beiscsi_log(phba, KERN_ERR,
1986 BEISCSI_LOG_IO | BEISCSI_LOG_CONFIG, 2035 BEISCSI_LOG_IO | BEISCSI_LOG_CONFIG,
1987 "BM_%d : Ignoring CQ Error notification for" 2036 "BM_%d : Ignoring %s[%d] on CID : %d\n",
1988 " cmd/cxn invalidate\n"); 2037 cqe_desc[code], code, cid);
1989 break; 2038 break;
1990 case SOL_CMD_KILLED_DATA_DIGEST_ERR: 2039 case SOL_CMD_KILLED_DATA_DIGEST_ERR:
1991 case CMD_KILLED_INVALID_STATSN_RCVD: 2040 case CMD_KILLED_INVALID_STATSN_RCVD:
@@ -1997,14 +2046,14 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq)
1997 case CMD_CXN_KILLED_INVALID_DATASN_RCVD: 2046 case CMD_CXN_KILLED_INVALID_DATASN_RCVD:
1998 beiscsi_log(phba, KERN_ERR, 2047 beiscsi_log(phba, KERN_ERR,
1999 BEISCSI_LOG_CONFIG | BEISCSI_LOG_IO, 2048 BEISCSI_LOG_CONFIG | BEISCSI_LOG_IO,
2000 "BM_%d : CQ Error notification for cmd.. " 2049 "BM_%d : Cmd Notification %s[%d] on CID : %d\n",
2001 "code %d cid 0x%x\n", code, cid); 2050 cqe_desc[code], code, cid);
2002 break; 2051 break;
2003 case UNSOL_DATA_DIGEST_ERROR_NOTIFY: 2052 case UNSOL_DATA_DIGEST_ERROR_NOTIFY:
2004 beiscsi_log(phba, KERN_ERR, 2053 beiscsi_log(phba, KERN_ERR,
2005 BEISCSI_LOG_IO | BEISCSI_LOG_CONFIG, 2054 BEISCSI_LOG_IO | BEISCSI_LOG_CONFIG,
2006 "BM_%d : Digest error on def pdu ring," 2055 "BM_%d : Dropping %s[%d] on DPDU ring on CID : %d\n",
2007 " dropping..\n"); 2056 cqe_desc[code], code, cid);
2008 hwi_flush_default_pdu_buffer(phba, beiscsi_conn, 2057 hwi_flush_default_pdu_buffer(phba, beiscsi_conn,
2009 (struct i_t_dpdu_cqe *) sol); 2058 (struct i_t_dpdu_cqe *) sol);
2010 break; 2059 break;
@@ -2017,6 +2066,8 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq)
2017 case CXN_KILLED_INVALID_ITT_TTT_RCVD: 2066 case CXN_KILLED_INVALID_ITT_TTT_RCVD:
2018 case CXN_KILLED_TIMED_OUT: 2067 case CXN_KILLED_TIMED_OUT:
2019 case CXN_KILLED_FIN_RCVD: 2068 case CXN_KILLED_FIN_RCVD:
2069 case CXN_KILLED_RST_SENT:
2070 case CXN_KILLED_RST_RCVD:
2020 case CXN_KILLED_BAD_UNSOL_PDU_RCVD: 2071 case CXN_KILLED_BAD_UNSOL_PDU_RCVD:
2021 case CXN_KILLED_BAD_WRB_INDEX_ERROR: 2072 case CXN_KILLED_BAD_WRB_INDEX_ERROR:
2022 case CXN_KILLED_OVER_RUN_RESIDUAL: 2073 case CXN_KILLED_OVER_RUN_RESIDUAL:
@@ -2024,19 +2075,8 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq)
2024 case CXN_KILLED_CMND_DATA_NOT_ON_SAME_CONN: 2075 case CXN_KILLED_CMND_DATA_NOT_ON_SAME_CONN:
2025 beiscsi_log(phba, KERN_ERR, 2076 beiscsi_log(phba, KERN_ERR,
2026 BEISCSI_LOG_IO | BEISCSI_LOG_CONFIG, 2077 BEISCSI_LOG_IO | BEISCSI_LOG_CONFIG,
2027 "BM_%d : CQ Error %d, reset CID 0x%x...\n", 2078 "BM_%d : Event %s[%d] received on CID : %d\n",
2028 code, cid); 2079 cqe_desc[code], code, cid);
2029 if (beiscsi_conn)
2030 iscsi_conn_failure(beiscsi_conn->conn,
2031 ISCSI_ERR_CONN_FAILED);
2032 break;
2033 case CXN_KILLED_RST_SENT:
2034 case CXN_KILLED_RST_RCVD:
2035 beiscsi_log(phba, KERN_ERR,
2036 BEISCSI_LOG_IO | BEISCSI_LOG_CONFIG,
2037 "BM_%d : CQ Error %d, reset"
2038 "received/sent on CID 0x%x...\n",
2039 code, cid);
2040 if (beiscsi_conn) 2080 if (beiscsi_conn)
2041 iscsi_conn_failure(beiscsi_conn->conn, 2081 iscsi_conn_failure(beiscsi_conn->conn,
2042 ISCSI_ERR_CONN_FAILED); 2082 ISCSI_ERR_CONN_FAILED);
@@ -2044,8 +2084,8 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq)
2044 default: 2084 default:
2045 beiscsi_log(phba, KERN_ERR, 2085 beiscsi_log(phba, KERN_ERR,
2046 BEISCSI_LOG_IO | BEISCSI_LOG_CONFIG, 2086 BEISCSI_LOG_IO | BEISCSI_LOG_CONFIG,
2047 "BM_%d : CQ Error Invalid code= %d " 2087 "BM_%d : Invalid CQE Event Received Code : %d"
2048 "received on CID 0x%x...\n", 2088 "CID 0x%x...\n",
2049 code, cid); 2089 code, cid);
2050 break; 2090 break;
2051 } 2091 }