diff options
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/aha152x.c | 4 | ||||
-rw-r--r-- | drivers/scsi/aha1542.c | 2 | ||||
-rw-r--r-- | drivers/scsi/bnx2fc/bnx2fc.h | 4 | ||||
-rw-r--r-- | drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 44 | ||||
-rw-r--r-- | drivers/scsi/bnx2i/57xx_iscsi_hsi.h | 16 | ||||
-rw-r--r-- | drivers/scsi/bnx2i/bnx2i.h | 58 | ||||
-rw-r--r-- | drivers/scsi/bnx2i/bnx2i_hwi.c | 35 | ||||
-rw-r--r-- | drivers/scsi/bnx2i/bnx2i_init.c | 40 | ||||
-rw-r--r-- | drivers/scsi/bnx2i/bnx2i_iscsi.c | 11 | ||||
-rw-r--r-- | drivers/scsi/cxgbi/cxgb3i/cxgb3i.c | 3 | ||||
-rw-r--r-- | drivers/scsi/cxgbi/cxgb4i/cxgb4i.c | 5 | ||||
-rw-r--r-- | drivers/scsi/cxgbi/libcxgbi.c | 12 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_target.c | 16 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_target.h | 3 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/tcm_qla2xxx.c | 55 | ||||
-rw-r--r-- | drivers/scsi/scsi_netlink.c | 7 | ||||
-rw-r--r-- | drivers/scsi/scsi_transport_iscsi.c | 9 |
17 files changed, 246 insertions, 78 deletions
diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index 19a36945e6fd..dd4547bf6881 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c | |||
@@ -2984,8 +2984,8 @@ static int get_command(char *pos, Scsi_Cmnd * ptr) | |||
2984 | char *start = pos; | 2984 | char *start = pos; |
2985 | int i; | 2985 | int i; |
2986 | 2986 | ||
2987 | SPRINTF("0x%08x: target=%d; lun=%d; cmnd=( ", | 2987 | SPRINTF("%p: target=%d; lun=%d; cmnd=( ", |
2988 | (unsigned int) ptr, ptr->device->id, ptr->device->lun); | 2988 | ptr, ptr->device->id, ptr->device->lun); |
2989 | 2989 | ||
2990 | for (i = 0; i < COMMAND_SIZE(ptr->cmnd[0]); i++) | 2990 | for (i = 0; i < COMMAND_SIZE(ptr->cmnd[0]); i++) |
2991 | SPRINTF("0x%02x ", ptr->cmnd[i]); | 2991 | SPRINTF("0x%02x ", ptr->cmnd[i]); |
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c index f79c8f9e33a4..770c48ddbe5e 100644 --- a/drivers/scsi/aha1542.c +++ b/drivers/scsi/aha1542.c | |||
@@ -49,7 +49,7 @@ | |||
49 | #define SCSI_BUF_PA(address) isa_virt_to_bus(address) | 49 | #define SCSI_BUF_PA(address) isa_virt_to_bus(address) |
50 | #define SCSI_SG_PA(sgent) (isa_page_to_bus(sg_page((sgent))) + (sgent)->offset) | 50 | #define SCSI_SG_PA(sgent) (isa_page_to_bus(sg_page((sgent))) + (sgent)->offset) |
51 | 51 | ||
52 | #include<linux/stat.h> | 52 | #include <linux/stat.h> |
53 | 53 | ||
54 | #ifdef DEBUG | 54 | #ifdef DEBUG |
55 | #define DEB(x) x | 55 | #define DEB(x) x |
diff --git a/drivers/scsi/bnx2fc/bnx2fc.h b/drivers/scsi/bnx2fc/bnx2fc.h index 514747562f53..3486845ba301 100644 --- a/drivers/scsi/bnx2fc/bnx2fc.h +++ b/drivers/scsi/bnx2fc/bnx2fc.h | |||
@@ -60,6 +60,7 @@ | |||
60 | 60 | ||
61 | #include "57xx_hsi_bnx2fc.h" | 61 | #include "57xx_hsi_bnx2fc.h" |
62 | #include "../../net/ethernet/broadcom/cnic_if.h" | 62 | #include "../../net/ethernet/broadcom/cnic_if.h" |
63 | #include "../../net/ethernet/broadcom/bnx2x/bnx2x_mfw_req.h" | ||
63 | #include "bnx2fc_constants.h" | 64 | #include "bnx2fc_constants.h" |
64 | 65 | ||
65 | #define BNX2FC_NAME "bnx2fc" | 66 | #define BNX2FC_NAME "bnx2fc" |
@@ -85,6 +86,8 @@ | |||
85 | #define BNX2FC_NUM_MAX_SESS 1024 | 86 | #define BNX2FC_NUM_MAX_SESS 1024 |
86 | #define BNX2FC_NUM_MAX_SESS_LOG (ilog2(BNX2FC_NUM_MAX_SESS)) | 87 | #define BNX2FC_NUM_MAX_SESS_LOG (ilog2(BNX2FC_NUM_MAX_SESS)) |
87 | 88 | ||
89 | #define BNX2FC_MAX_NPIV 256 | ||
90 | |||
88 | #define BNX2FC_MAX_OUTSTANDING_CMNDS 2048 | 91 | #define BNX2FC_MAX_OUTSTANDING_CMNDS 2048 |
89 | #define BNX2FC_CAN_QUEUE BNX2FC_MAX_OUTSTANDING_CMNDS | 92 | #define BNX2FC_CAN_QUEUE BNX2FC_MAX_OUTSTANDING_CMNDS |
90 | #define BNX2FC_ELSTM_XIDS BNX2FC_CAN_QUEUE | 93 | #define BNX2FC_ELSTM_XIDS BNX2FC_CAN_QUEUE |
@@ -207,6 +210,7 @@ struct bnx2fc_hba { | |||
207 | struct fcoe_statistics_params *stats_buffer; | 210 | struct fcoe_statistics_params *stats_buffer; |
208 | dma_addr_t stats_buf_dma; | 211 | dma_addr_t stats_buf_dma; |
209 | struct completion stat_req_done; | 212 | struct completion stat_req_done; |
213 | struct fcoe_capabilities fcoe_cap; | ||
210 | 214 | ||
211 | /*destroy handling */ | 215 | /*destroy handling */ |
212 | struct timer_list destroy_timer; | 216 | struct timer_list destroy_timer; |
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c index 72a82c5af760..ae1cb7639d99 100644 --- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c | |||
@@ -1326,6 +1326,7 @@ static void bnx2fc_hba_destroy(struct bnx2fc_hba *hba) | |||
1326 | static struct bnx2fc_hba *bnx2fc_hba_create(struct cnic_dev *cnic) | 1326 | static struct bnx2fc_hba *bnx2fc_hba_create(struct cnic_dev *cnic) |
1327 | { | 1327 | { |
1328 | struct bnx2fc_hba *hba; | 1328 | struct bnx2fc_hba *hba; |
1329 | struct fcoe_capabilities *fcoe_cap; | ||
1329 | int rc; | 1330 | int rc; |
1330 | 1331 | ||
1331 | hba = kzalloc(sizeof(*hba), GFP_KERNEL); | 1332 | hba = kzalloc(sizeof(*hba), GFP_KERNEL); |
@@ -1361,6 +1362,21 @@ static struct bnx2fc_hba *bnx2fc_hba_create(struct cnic_dev *cnic) | |||
1361 | printk(KERN_ERR PFX "em_config:bnx2fc_cmd_mgr_alloc failed\n"); | 1362 | printk(KERN_ERR PFX "em_config:bnx2fc_cmd_mgr_alloc failed\n"); |
1362 | goto cmgr_err; | 1363 | goto cmgr_err; |
1363 | } | 1364 | } |
1365 | fcoe_cap = &hba->fcoe_cap; | ||
1366 | |||
1367 | fcoe_cap->capability1 = BNX2FC_TM_MAX_SQES << | ||
1368 | FCOE_IOS_PER_CONNECTION_SHIFT; | ||
1369 | fcoe_cap->capability1 |= BNX2FC_NUM_MAX_SESS << | ||
1370 | FCOE_LOGINS_PER_PORT_SHIFT; | ||
1371 | fcoe_cap->capability2 = BNX2FC_MAX_OUTSTANDING_CMNDS << | ||
1372 | FCOE_NUMBER_OF_EXCHANGES_SHIFT; | ||
1373 | fcoe_cap->capability2 |= BNX2FC_MAX_NPIV << | ||
1374 | FCOE_NPIV_WWN_PER_PORT_SHIFT; | ||
1375 | fcoe_cap->capability3 = BNX2FC_NUM_MAX_SESS << | ||
1376 | FCOE_TARGETS_SUPPORTED_SHIFT; | ||
1377 | fcoe_cap->capability3 |= BNX2FC_MAX_OUTSTANDING_CMNDS << | ||
1378 | FCOE_OUTSTANDING_COMMANDS_SHIFT; | ||
1379 | fcoe_cap->capability4 = FCOE_CAPABILITY4_STATEFUL; | ||
1364 | 1380 | ||
1365 | init_waitqueue_head(&hba->shutdown_wait); | 1381 | init_waitqueue_head(&hba->shutdown_wait); |
1366 | init_waitqueue_head(&hba->destroy_wait); | 1382 | init_waitqueue_head(&hba->destroy_wait); |
@@ -1691,6 +1707,32 @@ static void bnx2fc_unbind_pcidev(struct bnx2fc_hba *hba) | |||
1691 | hba->pcidev = NULL; | 1707 | hba->pcidev = NULL; |
1692 | } | 1708 | } |
1693 | 1709 | ||
1710 | /** | ||
1711 | * bnx2fc_ulp_get_stats - cnic callback to populate FCoE stats | ||
1712 | * | ||
1713 | * @handle: transport handle pointing to adapter struture | ||
1714 | */ | ||
1715 | static int bnx2fc_ulp_get_stats(void *handle) | ||
1716 | { | ||
1717 | struct bnx2fc_hba *hba = handle; | ||
1718 | struct cnic_dev *cnic; | ||
1719 | struct fcoe_stats_info *stats_addr; | ||
1720 | |||
1721 | if (!hba) | ||
1722 | return -EINVAL; | ||
1723 | |||
1724 | cnic = hba->cnic; | ||
1725 | stats_addr = &cnic->stats_addr->fcoe_stat; | ||
1726 | if (!stats_addr) | ||
1727 | return -EINVAL; | ||
1728 | |||
1729 | strncpy(stats_addr->version, BNX2FC_VERSION, | ||
1730 | sizeof(stats_addr->version)); | ||
1731 | stats_addr->txq_size = BNX2FC_SQ_WQES_MAX; | ||
1732 | stats_addr->rxq_size = BNX2FC_CQ_WQES_MAX; | ||
1733 | |||
1734 | return 0; | ||
1735 | } | ||
1694 | 1736 | ||
1695 | 1737 | ||
1696 | /** | 1738 | /** |
@@ -1944,6 +1986,7 @@ static void bnx2fc_ulp_init(struct cnic_dev *dev) | |||
1944 | adapter_count++; | 1986 | adapter_count++; |
1945 | mutex_unlock(&bnx2fc_dev_lock); | 1987 | mutex_unlock(&bnx2fc_dev_lock); |
1946 | 1988 | ||
1989 | dev->fcoe_cap = &hba->fcoe_cap; | ||
1947 | clear_bit(BNX2FC_CNIC_REGISTERED, &hba->reg_with_cnic); | 1990 | clear_bit(BNX2FC_CNIC_REGISTERED, &hba->reg_with_cnic); |
1948 | rc = dev->register_device(dev, CNIC_ULP_FCOE, | 1991 | rc = dev->register_device(dev, CNIC_ULP_FCOE, |
1949 | (void *) hba); | 1992 | (void *) hba); |
@@ -2641,4 +2684,5 @@ static struct cnic_ulp_ops bnx2fc_cnic_cb = { | |||
2641 | .cnic_stop = bnx2fc_ulp_stop, | 2684 | .cnic_stop = bnx2fc_ulp_stop, |
2642 | .indicate_kcqes = bnx2fc_indicate_kcqe, | 2685 | .indicate_kcqes = bnx2fc_indicate_kcqe, |
2643 | .indicate_netevent = bnx2fc_indicate_netevent, | 2686 | .indicate_netevent = bnx2fc_indicate_netevent, |
2687 | .cnic_get_stats = bnx2fc_ulp_get_stats, | ||
2644 | }; | 2688 | }; |
diff --git a/drivers/scsi/bnx2i/57xx_iscsi_hsi.h b/drivers/scsi/bnx2i/57xx_iscsi_hsi.h index dc0a08e69c82..f2db5fe7bdc2 100644 --- a/drivers/scsi/bnx2i/57xx_iscsi_hsi.h +++ b/drivers/scsi/bnx2i/57xx_iscsi_hsi.h | |||
@@ -267,7 +267,13 @@ struct bnx2i_cmd_request { | |||
267 | * task statistics for write response | 267 | * task statistics for write response |
268 | */ | 268 | */ |
269 | struct bnx2i_write_resp_task_stat { | 269 | struct bnx2i_write_resp_task_stat { |
270 | u32 num_data_ins; | 270 | #if defined(__BIG_ENDIAN) |
271 | u16 num_r2ts; | ||
272 | u16 num_data_outs; | ||
273 | #elif defined(__LITTLE_ENDIAN) | ||
274 | u16 num_data_outs; | ||
275 | u16 num_r2ts; | ||
276 | #endif | ||
271 | }; | 277 | }; |
272 | 278 | ||
273 | /* | 279 | /* |
@@ -275,11 +281,11 @@ struct bnx2i_write_resp_task_stat { | |||
275 | */ | 281 | */ |
276 | struct bnx2i_read_resp_task_stat { | 282 | struct bnx2i_read_resp_task_stat { |
277 | #if defined(__BIG_ENDIAN) | 283 | #if defined(__BIG_ENDIAN) |
278 | u16 num_data_outs; | 284 | u16 reserved; |
279 | u16 num_r2ts; | 285 | u16 num_data_ins; |
280 | #elif defined(__LITTLE_ENDIAN) | 286 | #elif defined(__LITTLE_ENDIAN) |
281 | u16 num_r2ts; | 287 | u16 num_data_ins; |
282 | u16 num_data_outs; | 288 | u16 reserved; |
283 | #endif | 289 | #endif |
284 | }; | 290 | }; |
285 | 291 | ||
diff --git a/drivers/scsi/bnx2i/bnx2i.h b/drivers/scsi/bnx2i/bnx2i.h index 7e77cf620291..3f9e7061258e 100644 --- a/drivers/scsi/bnx2i/bnx2i.h +++ b/drivers/scsi/bnx2i/bnx2i.h | |||
@@ -44,6 +44,8 @@ | |||
44 | #include "57xx_iscsi_hsi.h" | 44 | #include "57xx_iscsi_hsi.h" |
45 | #include "57xx_iscsi_constants.h" | 45 | #include "57xx_iscsi_constants.h" |
46 | 46 | ||
47 | #include "../../net/ethernet/broadcom/bnx2x/bnx2x_mfw_req.h" | ||
48 | |||
47 | #define BNX2_ISCSI_DRIVER_NAME "bnx2i" | 49 | #define BNX2_ISCSI_DRIVER_NAME "bnx2i" |
48 | 50 | ||
49 | #define BNX2I_MAX_ADAPTERS 8 | 51 | #define BNX2I_MAX_ADAPTERS 8 |
@@ -126,6 +128,43 @@ | |||
126 | #define REG_WR(__hba, offset, val) \ | 128 | #define REG_WR(__hba, offset, val) \ |
127 | writel(val, __hba->regview + offset) | 129 | writel(val, __hba->regview + offset) |
128 | 130 | ||
131 | #ifdef CONFIG_32BIT | ||
132 | #define GET_STATS_64(__hba, dst, field) \ | ||
133 | do { \ | ||
134 | spin_lock_bh(&__hba->stat_lock); \ | ||
135 | dst->field##_lo = __hba->stats.field##_lo; \ | ||
136 | dst->field##_hi = __hba->stats.field##_hi; \ | ||
137 | spin_unlock_bh(&__hba->stat_lock); \ | ||
138 | } while (0) | ||
139 | |||
140 | #define ADD_STATS_64(__hba, field, len) \ | ||
141 | do { \ | ||
142 | if (spin_trylock(&__hba->stat_lock)) { \ | ||
143 | if (__hba->stats.field##_lo + len < \ | ||
144 | __hba->stats.field##_lo) \ | ||
145 | __hba->stats.field##_hi++; \ | ||
146 | __hba->stats.field##_lo += len; \ | ||
147 | spin_unlock(&__hba->stat_lock); \ | ||
148 | } \ | ||
149 | } while (0) | ||
150 | |||
151 | #else | ||
152 | #define GET_STATS_64(__hba, dst, field) \ | ||
153 | do { \ | ||
154 | u64 val, *out; \ | ||
155 | \ | ||
156 | val = __hba->bnx2i_stats.field; \ | ||
157 | out = (u64 *)&__hba->stats.field##_lo; \ | ||
158 | *out = cpu_to_le64(val); \ | ||
159 | out = (u64 *)&dst->field##_lo; \ | ||
160 | *out = cpu_to_le64(val); \ | ||
161 | } while (0) | ||
162 | |||
163 | #define ADD_STATS_64(__hba, field, len) \ | ||
164 | do { \ | ||
165 | __hba->bnx2i_stats.field += len; \ | ||
166 | } while (0) | ||
167 | #endif | ||
129 | 168 | ||
130 | /** | 169 | /** |
131 | * struct generic_pdu_resc - login pdu resource structure | 170 | * struct generic_pdu_resc - login pdu resource structure |
@@ -288,6 +327,15 @@ struct iscsi_cid_queue { | |||
288 | struct bnx2i_conn **conn_cid_tbl; | 327 | struct bnx2i_conn **conn_cid_tbl; |
289 | }; | 328 | }; |
290 | 329 | ||
330 | |||
331 | struct bnx2i_stats_info { | ||
332 | u64 rx_pdus; | ||
333 | u64 rx_bytes; | ||
334 | u64 tx_pdus; | ||
335 | u64 tx_bytes; | ||
336 | }; | ||
337 | |||
338 | |||
291 | /** | 339 | /** |
292 | * struct bnx2i_hba - bnx2i adapter structure | 340 | * struct bnx2i_hba - bnx2i adapter structure |
293 | * | 341 | * |
@@ -341,6 +389,8 @@ struct iscsi_cid_queue { | |||
341 | * @ctx_ccell_tasks: captures number of ccells and tasks supported by | 389 | * @ctx_ccell_tasks: captures number of ccells and tasks supported by |
342 | * currently offloaded connection, used to decode | 390 | * currently offloaded connection, used to decode |
343 | * context memory | 391 | * context memory |
392 | * @stat_lock: spin lock used by the statistic collector (32 bit) | ||
393 | * @stats: local iSCSI statistic collection place holder | ||
344 | * | 394 | * |
345 | * Adapter Data Structure | 395 | * Adapter Data Structure |
346 | */ | 396 | */ |
@@ -427,6 +477,12 @@ struct bnx2i_hba { | |||
427 | u32 num_sess_opened; | 477 | u32 num_sess_opened; |
428 | u32 num_conn_opened; | 478 | u32 num_conn_opened; |
429 | unsigned int ctx_ccell_tasks; | 479 | unsigned int ctx_ccell_tasks; |
480 | |||
481 | #ifdef CONFIG_32BIT | ||
482 | spinlock_t stat_lock; | ||
483 | #endif | ||
484 | struct bnx2i_stats_info bnx2i_stats; | ||
485 | struct iscsi_stats_info stats; | ||
430 | }; | 486 | }; |
431 | 487 | ||
432 | 488 | ||
@@ -750,6 +806,8 @@ extern void bnx2i_ulp_init(struct cnic_dev *dev); | |||
750 | extern void bnx2i_ulp_exit(struct cnic_dev *dev); | 806 | extern void bnx2i_ulp_exit(struct cnic_dev *dev); |
751 | extern void bnx2i_start(void *handle); | 807 | extern void bnx2i_start(void *handle); |
752 | extern void bnx2i_stop(void *handle); | 808 | extern void bnx2i_stop(void *handle); |
809 | extern int bnx2i_get_stats(void *handle); | ||
810 | |||
753 | extern struct bnx2i_hba *get_adapter_list_head(void); | 811 | extern struct bnx2i_hba *get_adapter_list_head(void); |
754 | 812 | ||
755 | struct bnx2i_conn *bnx2i_get_conn_from_id(struct bnx2i_hba *hba, | 813 | struct bnx2i_conn *bnx2i_get_conn_from_id(struct bnx2i_hba *hba, |
diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c index 86a12b48e477..33d6630529de 100644 --- a/drivers/scsi/bnx2i/bnx2i_hwi.c +++ b/drivers/scsi/bnx2i/bnx2i_hwi.c | |||
@@ -1350,6 +1350,7 @@ int bnx2i_process_scsi_cmd_resp(struct iscsi_session *session, | |||
1350 | struct cqe *cqe) | 1350 | struct cqe *cqe) |
1351 | { | 1351 | { |
1352 | struct iscsi_conn *conn = bnx2i_conn->cls_conn->dd_data; | 1352 | struct iscsi_conn *conn = bnx2i_conn->cls_conn->dd_data; |
1353 | struct bnx2i_hba *hba = bnx2i_conn->hba; | ||
1353 | struct bnx2i_cmd_response *resp_cqe; | 1354 | struct bnx2i_cmd_response *resp_cqe; |
1354 | struct bnx2i_cmd *bnx2i_cmd; | 1355 | struct bnx2i_cmd *bnx2i_cmd; |
1355 | struct iscsi_task *task; | 1356 | struct iscsi_task *task; |
@@ -1367,16 +1368,26 @@ int bnx2i_process_scsi_cmd_resp(struct iscsi_session *session, | |||
1367 | 1368 | ||
1368 | if (bnx2i_cmd->req.op_attr & ISCSI_CMD_REQUEST_READ) { | 1369 | if (bnx2i_cmd->req.op_attr & ISCSI_CMD_REQUEST_READ) { |
1369 | conn->datain_pdus_cnt += | 1370 | conn->datain_pdus_cnt += |
1370 | resp_cqe->task_stat.read_stat.num_data_outs; | 1371 | resp_cqe->task_stat.read_stat.num_data_ins; |
1371 | conn->rxdata_octets += | 1372 | conn->rxdata_octets += |
1372 | bnx2i_cmd->req.total_data_transfer_length; | 1373 | bnx2i_cmd->req.total_data_transfer_length; |
1374 | ADD_STATS_64(hba, rx_pdus, | ||
1375 | resp_cqe->task_stat.read_stat.num_data_ins); | ||
1376 | ADD_STATS_64(hba, rx_bytes, | ||
1377 | bnx2i_cmd->req.total_data_transfer_length); | ||
1373 | } else { | 1378 | } else { |
1374 | conn->dataout_pdus_cnt += | 1379 | conn->dataout_pdus_cnt += |
1375 | resp_cqe->task_stat.read_stat.num_data_outs; | 1380 | resp_cqe->task_stat.write_stat.num_data_outs; |
1376 | conn->r2t_pdus_cnt += | 1381 | conn->r2t_pdus_cnt += |
1377 | resp_cqe->task_stat.read_stat.num_r2ts; | 1382 | resp_cqe->task_stat.write_stat.num_r2ts; |
1378 | conn->txdata_octets += | 1383 | conn->txdata_octets += |
1379 | bnx2i_cmd->req.total_data_transfer_length; | 1384 | bnx2i_cmd->req.total_data_transfer_length; |
1385 | ADD_STATS_64(hba, tx_pdus, | ||
1386 | resp_cqe->task_stat.write_stat.num_data_outs); | ||
1387 | ADD_STATS_64(hba, tx_bytes, | ||
1388 | bnx2i_cmd->req.total_data_transfer_length); | ||
1389 | ADD_STATS_64(hba, rx_pdus, | ||
1390 | resp_cqe->task_stat.write_stat.num_r2ts); | ||
1380 | } | 1391 | } |
1381 | bnx2i_iscsi_unmap_sg_list(bnx2i_cmd); | 1392 | bnx2i_iscsi_unmap_sg_list(bnx2i_cmd); |
1382 | 1393 | ||
@@ -1961,6 +1972,7 @@ static int bnx2i_process_new_cqes(struct bnx2i_conn *bnx2i_conn) | |||
1961 | { | 1972 | { |
1962 | struct iscsi_conn *conn = bnx2i_conn->cls_conn->dd_data; | 1973 | struct iscsi_conn *conn = bnx2i_conn->cls_conn->dd_data; |
1963 | struct iscsi_session *session = conn->session; | 1974 | struct iscsi_session *session = conn->session; |
1975 | struct bnx2i_hba *hba = bnx2i_conn->hba; | ||
1964 | struct qp_info *qp; | 1976 | struct qp_info *qp; |
1965 | struct bnx2i_nop_in_msg *nopin; | 1977 | struct bnx2i_nop_in_msg *nopin; |
1966 | int tgt_async_msg; | 1978 | int tgt_async_msg; |
@@ -1973,7 +1985,7 @@ static int bnx2i_process_new_cqes(struct bnx2i_conn *bnx2i_conn) | |||
1973 | 1985 | ||
1974 | if (!qp->cq_virt) { | 1986 | if (!qp->cq_virt) { |
1975 | printk(KERN_ALERT "bnx2i (%s): cq resr freed in bh execution!", | 1987 | printk(KERN_ALERT "bnx2i (%s): cq resr freed in bh execution!", |
1976 | bnx2i_conn->hba->netdev->name); | 1988 | hba->netdev->name); |
1977 | goto out; | 1989 | goto out; |
1978 | } | 1990 | } |
1979 | while (1) { | 1991 | while (1) { |
@@ -1985,9 +1997,9 @@ static int bnx2i_process_new_cqes(struct bnx2i_conn *bnx2i_conn) | |||
1985 | if (nopin->op_code == ISCSI_OP_NOOP_IN && | 1997 | if (nopin->op_code == ISCSI_OP_NOOP_IN && |
1986 | nopin->itt == (u16) RESERVED_ITT) { | 1998 | nopin->itt == (u16) RESERVED_ITT) { |
1987 | printk(KERN_ALERT "bnx2i: Unsolicited " | 1999 | printk(KERN_ALERT "bnx2i: Unsolicited " |
1988 | "NOP-In detected for suspended " | 2000 | "NOP-In detected for suspended " |
1989 | "connection dev=%s!\n", | 2001 | "connection dev=%s!\n", |
1990 | bnx2i_conn->hba->netdev->name); | 2002 | hba->netdev->name); |
1991 | bnx2i_unsol_pdu_adjust_rq(bnx2i_conn); | 2003 | bnx2i_unsol_pdu_adjust_rq(bnx2i_conn); |
1992 | goto cqe_out; | 2004 | goto cqe_out; |
1993 | } | 2005 | } |
@@ -2001,7 +2013,7 @@ static int bnx2i_process_new_cqes(struct bnx2i_conn *bnx2i_conn) | |||
2001 | /* Run the kthread engine only for data cmds | 2013 | /* Run the kthread engine only for data cmds |
2002 | All other cmds will be completed in this bh! */ | 2014 | All other cmds will be completed in this bh! */ |
2003 | bnx2i_queue_scsi_cmd_resp(session, bnx2i_conn, nopin); | 2015 | bnx2i_queue_scsi_cmd_resp(session, bnx2i_conn, nopin); |
2004 | break; | 2016 | goto done; |
2005 | case ISCSI_OP_LOGIN_RSP: | 2017 | case ISCSI_OP_LOGIN_RSP: |
2006 | bnx2i_process_login_resp(session, bnx2i_conn, | 2018 | bnx2i_process_login_resp(session, bnx2i_conn, |
2007 | qp->cq_cons_qe); | 2019 | qp->cq_cons_qe); |
@@ -2044,11 +2056,15 @@ static int bnx2i_process_new_cqes(struct bnx2i_conn *bnx2i_conn) | |||
2044 | printk(KERN_ALERT "bnx2i: unknown opcode 0x%x\n", | 2056 | printk(KERN_ALERT "bnx2i: unknown opcode 0x%x\n", |
2045 | nopin->op_code); | 2057 | nopin->op_code); |
2046 | } | 2058 | } |
2059 | |||
2060 | ADD_STATS_64(hba, rx_pdus, 1); | ||
2061 | ADD_STATS_64(hba, rx_bytes, nopin->data_length); | ||
2062 | done: | ||
2047 | if (!tgt_async_msg) { | 2063 | if (!tgt_async_msg) { |
2048 | if (!atomic_read(&bnx2i_conn->ep->num_active_cmds)) | 2064 | if (!atomic_read(&bnx2i_conn->ep->num_active_cmds)) |
2049 | printk(KERN_ALERT "bnx2i (%s): no active cmd! " | 2065 | printk(KERN_ALERT "bnx2i (%s): no active cmd! " |
2050 | "op 0x%x\n", | 2066 | "op 0x%x\n", |
2051 | bnx2i_conn->hba->netdev->name, | 2067 | hba->netdev->name, |
2052 | nopin->op_code); | 2068 | nopin->op_code); |
2053 | else | 2069 | else |
2054 | atomic_dec(&bnx2i_conn->ep->num_active_cmds); | 2070 | atomic_dec(&bnx2i_conn->ep->num_active_cmds); |
@@ -2692,6 +2708,7 @@ struct cnic_ulp_ops bnx2i_cnic_cb = { | |||
2692 | .cm_remote_close = bnx2i_cm_remote_close, | 2708 | .cm_remote_close = bnx2i_cm_remote_close, |
2693 | .cm_remote_abort = bnx2i_cm_remote_abort, | 2709 | .cm_remote_abort = bnx2i_cm_remote_abort, |
2694 | .iscsi_nl_send_msg = bnx2i_send_nl_mesg, | 2710 | .iscsi_nl_send_msg = bnx2i_send_nl_mesg, |
2711 | .cnic_get_stats = bnx2i_get_stats, | ||
2695 | .owner = THIS_MODULE | 2712 | .owner = THIS_MODULE |
2696 | }; | 2713 | }; |
2697 | 2714 | ||
diff --git a/drivers/scsi/bnx2i/bnx2i_init.c b/drivers/scsi/bnx2i/bnx2i_init.c index 8b6816706ee5..b17637aab9a7 100644 --- a/drivers/scsi/bnx2i/bnx2i_init.c +++ b/drivers/scsi/bnx2i/bnx2i_init.c | |||
@@ -381,6 +381,46 @@ void bnx2i_ulp_exit(struct cnic_dev *dev) | |||
381 | 381 | ||
382 | 382 | ||
383 | /** | 383 | /** |
384 | * bnx2i_get_stats - Retrieve various statistic from iSCSI offload | ||
385 | * @handle: bnx2i_hba | ||
386 | * | ||
387 | * function callback exported via bnx2i - cnic driver interface to | ||
388 | * retrieve various iSCSI offload related statistics. | ||
389 | */ | ||
390 | int bnx2i_get_stats(void *handle) | ||
391 | { | ||
392 | struct bnx2i_hba *hba = handle; | ||
393 | struct iscsi_stats_info *stats; | ||
394 | |||
395 | if (!hba) | ||
396 | return -EINVAL; | ||
397 | |||
398 | stats = (struct iscsi_stats_info *)hba->cnic->stats_addr; | ||
399 | |||
400 | if (!stats) | ||
401 | return -ENOMEM; | ||
402 | |||
403 | strlcpy(stats->version, DRV_MODULE_VERSION, sizeof(stats->version)); | ||
404 | memcpy(stats->mac_add1 + 2, hba->cnic->mac_addr, ETH_ALEN); | ||
405 | |||
406 | stats->max_frame_size = hba->netdev->mtu; | ||
407 | stats->txq_size = hba->max_sqes; | ||
408 | stats->rxq_size = hba->max_cqes; | ||
409 | |||
410 | stats->txq_avg_depth = 0; | ||
411 | stats->rxq_avg_depth = 0; | ||
412 | |||
413 | GET_STATS_64(hba, stats, rx_pdus); | ||
414 | GET_STATS_64(hba, stats, rx_bytes); | ||
415 | |||
416 | GET_STATS_64(hba, stats, tx_pdus); | ||
417 | GET_STATS_64(hba, stats, tx_bytes); | ||
418 | |||
419 | return 0; | ||
420 | } | ||
421 | |||
422 | |||
423 | /** | ||
384 | * bnx2i_percpu_thread_create - Create a receive thread for an | 424 | * bnx2i_percpu_thread_create - Create a receive thread for an |
385 | * online CPU | 425 | * online CPU |
386 | * | 426 | * |
diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c index 621538b8b544..3b34c13e2f02 100644 --- a/drivers/scsi/bnx2i/bnx2i_iscsi.c +++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c | |||
@@ -874,6 +874,11 @@ struct bnx2i_hba *bnx2i_alloc_hba(struct cnic_dev *cnic) | |||
874 | hba->conn_ctx_destroy_tmo = 2 * HZ; | 874 | hba->conn_ctx_destroy_tmo = 2 * HZ; |
875 | } | 875 | } |
876 | 876 | ||
877 | #ifdef CONFIG_32BIT | ||
878 | spin_lock_init(&hba->stat_lock); | ||
879 | #endif | ||
880 | memset(&hba->stats, 0, sizeof(struct iscsi_stats_info)); | ||
881 | |||
877 | if (iscsi_host_add(shost, &hba->pcidev->dev)) | 882 | if (iscsi_host_add(shost, &hba->pcidev->dev)) |
878 | goto free_dump_mem; | 883 | goto free_dump_mem; |
879 | return hba; | 884 | return hba; |
@@ -1181,12 +1186,18 @@ static int | |||
1181 | bnx2i_mtask_xmit(struct iscsi_conn *conn, struct iscsi_task *task) | 1186 | bnx2i_mtask_xmit(struct iscsi_conn *conn, struct iscsi_task *task) |
1182 | { | 1187 | { |
1183 | struct bnx2i_conn *bnx2i_conn = conn->dd_data; | 1188 | struct bnx2i_conn *bnx2i_conn = conn->dd_data; |
1189 | struct bnx2i_hba *hba = bnx2i_conn->hba; | ||
1184 | struct bnx2i_cmd *cmd = task->dd_data; | 1190 | struct bnx2i_cmd *cmd = task->dd_data; |
1185 | 1191 | ||
1186 | memset(bnx2i_conn->gen_pdu.req_buf, 0, ISCSI_DEF_MAX_RECV_SEG_LEN); | 1192 | memset(bnx2i_conn->gen_pdu.req_buf, 0, ISCSI_DEF_MAX_RECV_SEG_LEN); |
1187 | 1193 | ||
1188 | bnx2i_setup_cmd_wqe_template(cmd); | 1194 | bnx2i_setup_cmd_wqe_template(cmd); |
1189 | bnx2i_conn->gen_pdu.req_buf_size = task->data_count; | 1195 | bnx2i_conn->gen_pdu.req_buf_size = task->data_count; |
1196 | |||
1197 | /* Tx PDU/data length count */ | ||
1198 | ADD_STATS_64(hba, tx_pdus, 1); | ||
1199 | ADD_STATS_64(hba, tx_bytes, task->data_count); | ||
1200 | |||
1190 | if (task->data_count) { | 1201 | if (task->data_count) { |
1191 | memcpy(bnx2i_conn->gen_pdu.req_buf, task->data, | 1202 | memcpy(bnx2i_conn->gen_pdu.req_buf, task->data, |
1192 | task->data_count); | 1203 | task->data_count); |
diff --git a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c index 36739da8bc15..49692a1ac44a 100644 --- a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c +++ b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c | |||
@@ -966,7 +966,8 @@ static int init_act_open(struct cxgbi_sock *csk) | |||
966 | csk->saddr.sin_addr.s_addr = chba->ipv4addr; | 966 | csk->saddr.sin_addr.s_addr = chba->ipv4addr; |
967 | 967 | ||
968 | csk->rss_qid = 0; | 968 | csk->rss_qid = 0; |
969 | csk->l2t = t3_l2t_get(t3dev, dst, ndev); | 969 | csk->l2t = t3_l2t_get(t3dev, dst, ndev, |
970 | &csk->daddr.sin_addr.s_addr); | ||
970 | if (!csk->l2t) { | 971 | if (!csk->l2t) { |
971 | pr_err("NO l2t available.\n"); | 972 | pr_err("NO l2t available.\n"); |
972 | return -EINVAL; | 973 | return -EINVAL; |
diff --git a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c index a12a1fe9cda4..f924b3c3720e 100644 --- a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c +++ b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c | |||
@@ -1142,7 +1142,7 @@ static int init_act_open(struct cxgbi_sock *csk) | |||
1142 | cxgbi_sock_set_flag(csk, CTPF_HAS_ATID); | 1142 | cxgbi_sock_set_flag(csk, CTPF_HAS_ATID); |
1143 | cxgbi_sock_get(csk); | 1143 | cxgbi_sock_get(csk); |
1144 | 1144 | ||
1145 | n = dst_get_neighbour_noref(csk->dst); | 1145 | n = dst_neigh_lookup(csk->dst, &csk->daddr.sin_addr.s_addr); |
1146 | if (!n) { | 1146 | if (!n) { |
1147 | pr_err("%s, can't get neighbour of csk->dst.\n", ndev->name); | 1147 | pr_err("%s, can't get neighbour of csk->dst.\n", ndev->name); |
1148 | goto rel_resource; | 1148 | goto rel_resource; |
@@ -1182,9 +1182,12 @@ static int init_act_open(struct cxgbi_sock *csk) | |||
1182 | 1182 | ||
1183 | cxgbi_sock_set_state(csk, CTP_ACTIVE_OPEN); | 1183 | cxgbi_sock_set_state(csk, CTP_ACTIVE_OPEN); |
1184 | send_act_open_req(csk, skb, csk->l2t); | 1184 | send_act_open_req(csk, skb, csk->l2t); |
1185 | neigh_release(n); | ||
1185 | return 0; | 1186 | return 0; |
1186 | 1187 | ||
1187 | rel_resource: | 1188 | rel_resource: |
1189 | if (n) | ||
1190 | neigh_release(n); | ||
1188 | if (skb) | 1191 | if (skb) |
1189 | __kfree_skb(skb); | 1192 | __kfree_skb(skb); |
1190 | return -EINVAL; | 1193 | return -EINVAL; |
diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c index d9253db1d0e2..b44c1cff3114 100644 --- a/drivers/scsi/cxgbi/libcxgbi.c +++ b/drivers/scsi/cxgbi/libcxgbi.c | |||
@@ -494,7 +494,7 @@ static struct cxgbi_sock *cxgbi_check_route(struct sockaddr *dst_addr) | |||
494 | goto err_out; | 494 | goto err_out; |
495 | } | 495 | } |
496 | dst = &rt->dst; | 496 | dst = &rt->dst; |
497 | n = dst_get_neighbour_noref(dst); | 497 | n = dst_neigh_lookup(dst, &daddr->sin_addr.s_addr); |
498 | if (!n) { | 498 | if (!n) { |
499 | err = -ENODEV; | 499 | err = -ENODEV; |
500 | goto rel_rt; | 500 | goto rel_rt; |
@@ -506,7 +506,7 @@ static struct cxgbi_sock *cxgbi_check_route(struct sockaddr *dst_addr) | |||
506 | &daddr->sin_addr.s_addr, ntohs(daddr->sin_port), | 506 | &daddr->sin_addr.s_addr, ntohs(daddr->sin_port), |
507 | ndev->name); | 507 | ndev->name); |
508 | err = -ENETUNREACH; | 508 | err = -ENETUNREACH; |
509 | goto rel_rt; | 509 | goto rel_neigh; |
510 | } | 510 | } |
511 | 511 | ||
512 | if (ndev->flags & IFF_LOOPBACK) { | 512 | if (ndev->flags & IFF_LOOPBACK) { |
@@ -521,7 +521,7 @@ static struct cxgbi_sock *cxgbi_check_route(struct sockaddr *dst_addr) | |||
521 | pr_info("dst %pI4, %s, NOT cxgbi device.\n", | 521 | pr_info("dst %pI4, %s, NOT cxgbi device.\n", |
522 | &daddr->sin_addr.s_addr, ndev->name); | 522 | &daddr->sin_addr.s_addr, ndev->name); |
523 | err = -ENETUNREACH; | 523 | err = -ENETUNREACH; |
524 | goto rel_rt; | 524 | goto rel_neigh; |
525 | } | 525 | } |
526 | log_debug(1 << CXGBI_DBG_SOCK, | 526 | log_debug(1 << CXGBI_DBG_SOCK, |
527 | "route to %pI4 :%u, ndev p#%d,%s, cdev 0x%p.\n", | 527 | "route to %pI4 :%u, ndev p#%d,%s, cdev 0x%p.\n", |
@@ -531,7 +531,7 @@ static struct cxgbi_sock *cxgbi_check_route(struct sockaddr *dst_addr) | |||
531 | csk = cxgbi_sock_create(cdev); | 531 | csk = cxgbi_sock_create(cdev); |
532 | if (!csk) { | 532 | if (!csk) { |
533 | err = -ENOMEM; | 533 | err = -ENOMEM; |
534 | goto rel_rt; | 534 | goto rel_neigh; |
535 | } | 535 | } |
536 | csk->cdev = cdev; | 536 | csk->cdev = cdev; |
537 | csk->port_id = port; | 537 | csk->port_id = port; |
@@ -541,9 +541,13 @@ static struct cxgbi_sock *cxgbi_check_route(struct sockaddr *dst_addr) | |||
541 | csk->daddr.sin_port = daddr->sin_port; | 541 | csk->daddr.sin_port = daddr->sin_port; |
542 | csk->daddr.sin_family = daddr->sin_family; | 542 | csk->daddr.sin_family = daddr->sin_family; |
543 | csk->saddr.sin_addr.s_addr = fl4.saddr; | 543 | csk->saddr.sin_addr.s_addr = fl4.saddr; |
544 | neigh_release(n); | ||
544 | 545 | ||
545 | return csk; | 546 | return csk; |
546 | 547 | ||
548 | rel_neigh: | ||
549 | neigh_release(n); | ||
550 | |||
547 | rel_rt: | 551 | rel_rt: |
548 | ip_rt_put(rt); | 552 | ip_rt_put(rt); |
549 | if (csk) | 553 | if (csk) |
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 77759c78cc21..5b30132960c7 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c | |||
@@ -2643,19 +2643,9 @@ static void qlt_do_work(struct work_struct *work) | |||
2643 | spin_lock_irqsave(&ha->hardware_lock, flags); | 2643 | spin_lock_irqsave(&ha->hardware_lock, flags); |
2644 | sess = ha->tgt.tgt_ops->find_sess_by_s_id(vha, | 2644 | sess = ha->tgt.tgt_ops->find_sess_by_s_id(vha, |
2645 | atio->u.isp24.fcp_hdr.s_id); | 2645 | atio->u.isp24.fcp_hdr.s_id); |
2646 | if (sess) { | 2646 | /* Do kref_get() before dropping qla_hw_data->hardware_lock. */ |
2647 | if (unlikely(sess->tearing_down)) { | 2647 | if (sess) |
2648 | sess = NULL; | 2648 | kref_get(&sess->se_sess->sess_kref); |
2649 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | ||
2650 | goto out_term; | ||
2651 | } else { | ||
2652 | /* | ||
2653 | * Do the extra kref_get() before dropping | ||
2654 | * qla_hw_data->hardware_lock. | ||
2655 | */ | ||
2656 | kref_get(&sess->se_sess->sess_kref); | ||
2657 | } | ||
2658 | } | ||
2659 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 2649 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
2660 | 2650 | ||
2661 | if (unlikely(!sess)) { | 2651 | if (unlikely(!sess)) { |
diff --git a/drivers/scsi/qla2xxx/qla_target.h b/drivers/scsi/qla2xxx/qla_target.h index 9f9ef1644fd9..170af1571214 100644 --- a/drivers/scsi/qla2xxx/qla_target.h +++ b/drivers/scsi/qla2xxx/qla_target.h | |||
@@ -639,7 +639,7 @@ struct qla_tgt_func_tmpl { | |||
639 | 639 | ||
640 | int (*handle_cmd)(struct scsi_qla_host *, struct qla_tgt_cmd *, | 640 | int (*handle_cmd)(struct scsi_qla_host *, struct qla_tgt_cmd *, |
641 | unsigned char *, uint32_t, int, int, int); | 641 | unsigned char *, uint32_t, int, int, int); |
642 | int (*handle_data)(struct qla_tgt_cmd *); | 642 | void (*handle_data)(struct qla_tgt_cmd *); |
643 | int (*handle_tmr)(struct qla_tgt_mgmt_cmd *, uint32_t, uint8_t, | 643 | int (*handle_tmr)(struct qla_tgt_mgmt_cmd *, uint32_t, uint8_t, |
644 | uint32_t); | 644 | uint32_t); |
645 | void (*free_cmd)(struct qla_tgt_cmd *); | 645 | void (*free_cmd)(struct qla_tgt_cmd *); |
@@ -813,7 +813,6 @@ struct qla_tgt_sess { | |||
813 | unsigned int conf_compl_supported:1; | 813 | unsigned int conf_compl_supported:1; |
814 | unsigned int deleted:1; | 814 | unsigned int deleted:1; |
815 | unsigned int local:1; | 815 | unsigned int local:1; |
816 | unsigned int tearing_down:1; | ||
817 | 816 | ||
818 | struct se_session *se_sess; | 817 | struct se_session *se_sess; |
819 | struct scsi_qla_host *vha; | 818 | struct scsi_qla_host *vha; |
diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index 6e64314dbbb3..4752f65a9272 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c | |||
@@ -38,8 +38,6 @@ | |||
38 | #include <linux/string.h> | 38 | #include <linux/string.h> |
39 | #include <linux/configfs.h> | 39 | #include <linux/configfs.h> |
40 | #include <linux/ctype.h> | 40 | #include <linux/ctype.h> |
41 | #include <linux/string.h> | ||
42 | #include <linux/ctype.h> | ||
43 | #include <asm/unaligned.h> | 41 | #include <asm/unaligned.h> |
44 | #include <scsi/scsi.h> | 42 | #include <scsi/scsi.h> |
45 | #include <scsi/scsi_host.h> | 43 | #include <scsi/scsi_host.h> |
@@ -466,8 +464,7 @@ static int tcm_qla2xxx_shutdown_session(struct se_session *se_sess) | |||
466 | vha = sess->vha; | 464 | vha = sess->vha; |
467 | 465 | ||
468 | spin_lock_irqsave(&vha->hw->hardware_lock, flags); | 466 | spin_lock_irqsave(&vha->hw->hardware_lock, flags); |
469 | sess->tearing_down = 1; | 467 | target_sess_cmd_list_set_waiting(se_sess); |
470 | target_splice_sess_cmd_list(se_sess); | ||
471 | spin_unlock_irqrestore(&vha->hw->hardware_lock, flags); | 468 | spin_unlock_irqrestore(&vha->hw->hardware_lock, flags); |
472 | 469 | ||
473 | return 1; | 470 | return 1; |
@@ -600,28 +597,15 @@ static int tcm_qla2xxx_handle_cmd(scsi_qla_host_t *vha, struct qla_tgt_cmd *cmd, | |||
600 | return -EINVAL; | 597 | return -EINVAL; |
601 | } | 598 | } |
602 | 599 | ||
603 | target_submit_cmd(se_cmd, se_sess, cdb, &cmd->sense_buffer[0], | 600 | return target_submit_cmd(se_cmd, se_sess, cdb, &cmd->sense_buffer[0], |
604 | cmd->unpacked_lun, data_length, fcp_task_attr, | 601 | cmd->unpacked_lun, data_length, fcp_task_attr, |
605 | data_dir, flags); | 602 | data_dir, flags); |
606 | return 0; | ||
607 | } | 603 | } |
608 | 604 | ||
609 | static void tcm_qla2xxx_do_rsp(struct work_struct *work) | 605 | static void tcm_qla2xxx_handle_data_work(struct work_struct *work) |
610 | { | 606 | { |
611 | struct qla_tgt_cmd *cmd = container_of(work, struct qla_tgt_cmd, work); | 607 | struct qla_tgt_cmd *cmd = container_of(work, struct qla_tgt_cmd, work); |
612 | /* | ||
613 | * Dispatch ->queue_status from workqueue process context | ||
614 | */ | ||
615 | transport_generic_request_failure(&cmd->se_cmd); | ||
616 | } | ||
617 | 608 | ||
618 | /* | ||
619 | * Called from qla_target.c:qlt_do_ctio_completion() | ||
620 | */ | ||
621 | static int tcm_qla2xxx_handle_data(struct qla_tgt_cmd *cmd) | ||
622 | { | ||
623 | struct se_cmd *se_cmd = &cmd->se_cmd; | ||
624 | unsigned long flags; | ||
625 | /* | 609 | /* |
626 | * Ensure that the complete FCP WRITE payload has been received. | 610 | * Ensure that the complete FCP WRITE payload has been received. |
627 | * Otherwise return an exception via CHECK_CONDITION status. | 611 | * Otherwise return an exception via CHECK_CONDITION status. |
@@ -631,24 +615,26 @@ static int tcm_qla2xxx_handle_data(struct qla_tgt_cmd *cmd) | |||
631 | * Check if se_cmd has already been aborted via LUN_RESET, and | 615 | * Check if se_cmd has already been aborted via LUN_RESET, and |
632 | * waiting upon completion in tcm_qla2xxx_write_pending_status() | 616 | * waiting upon completion in tcm_qla2xxx_write_pending_status() |
633 | */ | 617 | */ |
634 | spin_lock_irqsave(&se_cmd->t_state_lock, flags); | 618 | if (cmd->se_cmd.transport_state & CMD_T_ABORTED) { |
635 | if (se_cmd->transport_state & CMD_T_ABORTED) { | 619 | complete(&cmd->se_cmd.t_transport_stop_comp); |
636 | spin_unlock_irqrestore(&se_cmd->t_state_lock, flags); | 620 | return; |
637 | complete(&se_cmd->t_transport_stop_comp); | ||
638 | return 0; | ||
639 | } | 621 | } |
640 | spin_unlock_irqrestore(&se_cmd->t_state_lock, flags); | ||
641 | 622 | ||
642 | se_cmd->scsi_sense_reason = TCM_CHECK_CONDITION_ABORT_CMD; | 623 | cmd->se_cmd.scsi_sense_reason = TCM_CHECK_CONDITION_ABORT_CMD; |
643 | INIT_WORK(&cmd->work, tcm_qla2xxx_do_rsp); | 624 | transport_generic_request_failure(&cmd->se_cmd); |
644 | queue_work(tcm_qla2xxx_free_wq, &cmd->work); | 625 | return; |
645 | return 0; | ||
646 | } | 626 | } |
647 | /* | 627 | |
648 | * We now tell TCM to queue this WRITE CDB with TRANSPORT_PROCESS_WRITE | 628 | return target_execute_cmd(&cmd->se_cmd); |
649 | * status to the backstore processing thread. | 629 | } |
650 | */ | 630 | |
651 | return transport_generic_handle_data(&cmd->se_cmd); | 631 | /* |
632 | * Called from qla_target.c:qlt_do_ctio_completion() | ||
633 | */ | ||
634 | static void tcm_qla2xxx_handle_data(struct qla_tgt_cmd *cmd) | ||
635 | { | ||
636 | INIT_WORK(&cmd->work, tcm_qla2xxx_handle_data_work); | ||
637 | queue_work(tcm_qla2xxx_free_wq, &cmd->work); | ||
652 | } | 638 | } |
653 | 639 | ||
654 | /* | 640 | /* |
@@ -1690,7 +1676,6 @@ static struct target_core_fabric_ops tcm_qla2xxx_ops = { | |||
1690 | .tpg_alloc_fabric_acl = tcm_qla2xxx_alloc_fabric_acl, | 1676 | .tpg_alloc_fabric_acl = tcm_qla2xxx_alloc_fabric_acl, |
1691 | .tpg_release_fabric_acl = tcm_qla2xxx_release_fabric_acl, | 1677 | .tpg_release_fabric_acl = tcm_qla2xxx_release_fabric_acl, |
1692 | .tpg_get_inst_index = tcm_qla2xxx_tpg_get_inst_index, | 1678 | .tpg_get_inst_index = tcm_qla2xxx_tpg_get_inst_index, |
1693 | .new_cmd_map = NULL, | ||
1694 | .check_stop_free = tcm_qla2xxx_check_stop_free, | 1679 | .check_stop_free = tcm_qla2xxx_check_stop_free, |
1695 | .release_cmd = tcm_qla2xxx_release_cmd, | 1680 | .release_cmd = tcm_qla2xxx_release_cmd, |
1696 | .put_session = tcm_qla2xxx_put_session, | 1681 | .put_session = tcm_qla2xxx_put_session, |
diff --git a/drivers/scsi/scsi_netlink.c b/drivers/scsi/scsi_netlink.c index c77628afbf9f..8818dd681c19 100644 --- a/drivers/scsi/scsi_netlink.c +++ b/drivers/scsi/scsi_netlink.c | |||
@@ -486,6 +486,10 @@ void | |||
486 | scsi_netlink_init(void) | 486 | scsi_netlink_init(void) |
487 | { | 487 | { |
488 | int error; | 488 | int error; |
489 | struct netlink_kernel_cfg cfg = { | ||
490 | .input = scsi_nl_rcv_msg, | ||
491 | .groups = SCSI_NL_GRP_CNT, | ||
492 | }; | ||
489 | 493 | ||
490 | INIT_LIST_HEAD(&scsi_nl_drivers); | 494 | INIT_LIST_HEAD(&scsi_nl_drivers); |
491 | 495 | ||
@@ -497,8 +501,7 @@ scsi_netlink_init(void) | |||
497 | } | 501 | } |
498 | 502 | ||
499 | scsi_nl_sock = netlink_kernel_create(&init_net, NETLINK_SCSITRANSPORT, | 503 | scsi_nl_sock = netlink_kernel_create(&init_net, NETLINK_SCSITRANSPORT, |
500 | SCSI_NL_GRP_CNT, scsi_nl_rcv_msg, NULL, | 504 | THIS_MODULE, &cfg); |
501 | THIS_MODULE); | ||
502 | if (!scsi_nl_sock) { | 505 | if (!scsi_nl_sock) { |
503 | printk(KERN_ERR "%s: register of receive handler failed\n", | 506 | printk(KERN_ERR "%s: register of receive handler failed\n", |
504 | __func__); | 507 | __func__); |
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index 96ec21a959e9..09809d06eccb 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c | |||
@@ -2936,7 +2936,10 @@ EXPORT_SYMBOL_GPL(iscsi_unregister_transport); | |||
2936 | static __init int iscsi_transport_init(void) | 2936 | static __init int iscsi_transport_init(void) |
2937 | { | 2937 | { |
2938 | int err; | 2938 | int err; |
2939 | 2939 | struct netlink_kernel_cfg cfg = { | |
2940 | .groups = 1, | ||
2941 | .input = iscsi_if_rx, | ||
2942 | }; | ||
2940 | printk(KERN_INFO "Loading iSCSI transport class v%s.\n", | 2943 | printk(KERN_INFO "Loading iSCSI transport class v%s.\n", |
2941 | ISCSI_TRANSPORT_VERSION); | 2944 | ISCSI_TRANSPORT_VERSION); |
2942 | 2945 | ||
@@ -2966,8 +2969,8 @@ static __init int iscsi_transport_init(void) | |||
2966 | if (err) | 2969 | if (err) |
2967 | goto unregister_conn_class; | 2970 | goto unregister_conn_class; |
2968 | 2971 | ||
2969 | nls = netlink_kernel_create(&init_net, NETLINK_ISCSI, 1, iscsi_if_rx, | 2972 | nls = netlink_kernel_create(&init_net, NETLINK_ISCSI, |
2970 | NULL, THIS_MODULE); | 2973 | THIS_MODULE, &cfg); |
2971 | if (!nls) { | 2974 | if (!nls) { |
2972 | err = -ENOBUFS; | 2975 | err = -ENOBUFS; |
2973 | goto unregister_session_class; | 2976 | goto unregister_session_class; |