diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-13 01:38:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-13 01:38:32 -0400 |
commit | ed9ea4ed3a44e8f8e8c7e8a12a05fd73f9ae1fb4 (patch) | |
tree | f7275c1cade0a756d5b456dc23ccb692ff6073d5 /drivers/scsi/qla2xxx | |
parent | c1fdb2d3389c5a1e7c559a37a4967c1d2580e75c (diff) | |
parent | 0ed6e189e3f6ac3a25383ed5cc8b0ac24c9b97b7 (diff) |
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending
Pull SCSI target updates from Nicholas Bellinger:
"The highlights this round include:
- Add support for T10 PI pass-through between vhost-scsi +
virtio-scsi (MST + Paolo + MKP + nab)
- Add support for T10 PI in qla2xxx target mode (Quinn + MKP + hch +
nab, merged through scsi.git)
- Add support for percpu-ida pre-allocation in qla2xxx target code
(Quinn + nab)
- A number of iser-target fixes related to hardening the network
portal shutdown path (Sagi + Slava)
- Fix response length residual handling for a number of control CDBs
(Roland + Christophe V.)
- Various iscsi RFC conformance fixes in the CHAP authentication path
(Tejas and Calsoft folks + nab)
- Return TASK_SET_FULL status for tcm_fc(FCoE) DataIn + Response
failures (Vasu + Jun + nab)
- Fix long-standing ABORT_TASK + session reset hang (nab)
- Convert iser-initiator + iser-target to include T10 bytes into EDTL
(Sagi + Or + MKP + Mike Christie)
- Fix NULL pointer dereference regression related to XCOPY introduced
in v3.15 + CC'ed to v3.12.y (nab)"
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (34 commits)
target: Fix NULL pointer dereference for XCOPY in target_put_sess_cmd
vhost-scsi: Include prot_bytes into expected data transfer length
TARGET/sbc,loopback: Adjust command data length in case pi exists on the wire
libiscsi, iser: Adjust data_length to include protection information
scsi_cmnd: Introduce scsi_transfer_length helper
target: Report correct response length for some commands
target/sbc: Check that the LBA and number of blocks are correct in VERIFY
target/sbc: Remove sbc_check_valid_sectors()
Target/iscsi: Fix sendtargets response pdu for iser transport
Target/iser: Fix a wrong dereference in case discovery session is over iser
iscsi-target: Fix ABORT_TASK + connection reset iscsi_queue_req memory leak
target: Use complete_all for se_cmd->t_transport_stop_comp
target: Set CMD_T_ACTIVE bit for Task Management Requests
target: cleanup some boolean tests
target/spc: Simplify INQUIRY EVPD=0x80
tcm_fc: Generate TASK_SET_FULL status for response failures
tcm_fc: Generate TASK_SET_FULL status for DataIN failures
iscsi-target: Reject mutual authentication with reflected CHAP_C
iscsi-target: Remove no-op from iscsit_tpg_del_portal_group
iscsi-target: Fix CHAP_A parameter list handling
...
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_target.c | 195 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_target.h | 6 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/tcm_qla2xxx.c | 6 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/tcm_qla2xxx.h | 5 |
4 files changed, 147 insertions, 65 deletions
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index b1d10f9935c7..8d85ed8d8917 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c | |||
@@ -104,7 +104,6 @@ static void qlt_reject_free_srr_imm(struct scsi_qla_host *ha, | |||
104 | /* | 104 | /* |
105 | * Global Variables | 105 | * Global Variables |
106 | */ | 106 | */ |
107 | static struct kmem_cache *qla_tgt_cmd_cachep; | ||
108 | static struct kmem_cache *qla_tgt_mgmt_cmd_cachep; | 107 | static struct kmem_cache *qla_tgt_mgmt_cmd_cachep; |
109 | static mempool_t *qla_tgt_mgmt_cmd_mempool; | 108 | static mempool_t *qla_tgt_mgmt_cmd_mempool; |
110 | static struct workqueue_struct *qla_tgt_wq; | 109 | static struct workqueue_struct *qla_tgt_wq; |
@@ -2705,6 +2704,8 @@ done: | |||
2705 | 2704 | ||
2706 | void qlt_free_cmd(struct qla_tgt_cmd *cmd) | 2705 | void qlt_free_cmd(struct qla_tgt_cmd *cmd) |
2707 | { | 2706 | { |
2707 | struct qla_tgt_sess *sess = cmd->sess; | ||
2708 | |||
2708 | ql_dbg(ql_dbg_tgt, cmd->vha, 0xe074, | 2709 | ql_dbg(ql_dbg_tgt, cmd->vha, 0xe074, |
2709 | "%s: se_cmd[%p] ox_id %04x\n", | 2710 | "%s: se_cmd[%p] ox_id %04x\n", |
2710 | __func__, &cmd->se_cmd, | 2711 | __func__, &cmd->se_cmd, |
@@ -2713,7 +2714,12 @@ void qlt_free_cmd(struct qla_tgt_cmd *cmd) | |||
2713 | BUG_ON(cmd->sg_mapped); | 2714 | BUG_ON(cmd->sg_mapped); |
2714 | if (unlikely(cmd->free_sg)) | 2715 | if (unlikely(cmd->free_sg)) |
2715 | kfree(cmd->sg); | 2716 | kfree(cmd->sg); |
2716 | kmem_cache_free(qla_tgt_cmd_cachep, cmd); | 2717 | |
2718 | if (!sess || !sess->se_sess) { | ||
2719 | WARN_ON(1); | ||
2720 | return; | ||
2721 | } | ||
2722 | percpu_ida_free(&sess->se_sess->sess_tag_pool, cmd->se_cmd.map_tag); | ||
2717 | } | 2723 | } |
2718 | EXPORT_SYMBOL(qlt_free_cmd); | 2724 | EXPORT_SYMBOL(qlt_free_cmd); |
2719 | 2725 | ||
@@ -3075,13 +3081,12 @@ static struct qla_tgt_sess *qlt_make_local_sess(struct scsi_qla_host *, | |||
3075 | /* | 3081 | /* |
3076 | * Process context for I/O path into tcm_qla2xxx code | 3082 | * Process context for I/O path into tcm_qla2xxx code |
3077 | */ | 3083 | */ |
3078 | static void qlt_do_work(struct work_struct *work) | 3084 | static void __qlt_do_work(struct qla_tgt_cmd *cmd) |
3079 | { | 3085 | { |
3080 | struct qla_tgt_cmd *cmd = container_of(work, struct qla_tgt_cmd, work); | ||
3081 | scsi_qla_host_t *vha = cmd->vha; | 3086 | scsi_qla_host_t *vha = cmd->vha; |
3082 | struct qla_hw_data *ha = vha->hw; | 3087 | struct qla_hw_data *ha = vha->hw; |
3083 | struct qla_tgt *tgt = vha->vha_tgt.qla_tgt; | 3088 | struct qla_tgt *tgt = vha->vha_tgt.qla_tgt; |
3084 | struct qla_tgt_sess *sess = NULL; | 3089 | struct qla_tgt_sess *sess = cmd->sess; |
3085 | struct atio_from_isp *atio = &cmd->atio; | 3090 | struct atio_from_isp *atio = &cmd->atio; |
3086 | unsigned char *cdb; | 3091 | unsigned char *cdb; |
3087 | unsigned long flags; | 3092 | unsigned long flags; |
@@ -3091,41 +3096,6 @@ static void qlt_do_work(struct work_struct *work) | |||
3091 | if (tgt->tgt_stop) | 3096 | if (tgt->tgt_stop) |
3092 | goto out_term; | 3097 | goto out_term; |
3093 | 3098 | ||
3094 | spin_lock_irqsave(&ha->hardware_lock, flags); | ||
3095 | sess = ha->tgt.tgt_ops->find_sess_by_s_id(vha, | ||
3096 | atio->u.isp24.fcp_hdr.s_id); | ||
3097 | /* Do kref_get() before dropping qla_hw_data->hardware_lock. */ | ||
3098 | if (sess) | ||
3099 | kref_get(&sess->se_sess->sess_kref); | ||
3100 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | ||
3101 | |||
3102 | if (unlikely(!sess)) { | ||
3103 | uint8_t *s_id = atio->u.isp24.fcp_hdr.s_id; | ||
3104 | |||
3105 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf022, | ||
3106 | "qla_target(%d): Unable to find wwn login" | ||
3107 | " (s_id %x:%x:%x), trying to create it manually\n", | ||
3108 | vha->vp_idx, s_id[0], s_id[1], s_id[2]); | ||
3109 | |||
3110 | if (atio->u.raw.entry_count > 1) { | ||
3111 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf023, | ||
3112 | "Dropping multy entry cmd %p\n", cmd); | ||
3113 | goto out_term; | ||
3114 | } | ||
3115 | |||
3116 | mutex_lock(&vha->vha_tgt.tgt_mutex); | ||
3117 | sess = qlt_make_local_sess(vha, s_id); | ||
3118 | /* sess has an extra creation ref. */ | ||
3119 | mutex_unlock(&vha->vha_tgt.tgt_mutex); | ||
3120 | |||
3121 | if (!sess) | ||
3122 | goto out_term; | ||
3123 | } | ||
3124 | |||
3125 | cmd->sess = sess; | ||
3126 | cmd->loop_id = sess->loop_id; | ||
3127 | cmd->conf_compl_supported = sess->conf_compl_supported; | ||
3128 | |||
3129 | cdb = &atio->u.isp24.fcp_cmnd.cdb[0]; | 3099 | cdb = &atio->u.isp24.fcp_cmnd.cdb[0]; |
3130 | cmd->tag = atio->u.isp24.exchange_addr; | 3100 | cmd->tag = atio->u.isp24.exchange_addr; |
3131 | cmd->unpacked_lun = scsilun_to_int( | 3101 | cmd->unpacked_lun = scsilun_to_int( |
@@ -3153,8 +3123,8 @@ static void qlt_do_work(struct work_struct *work) | |||
3153 | cmd, &cmd->se_cmd, cmd->unpacked_lun, cmd->tag, data_length, | 3123 | cmd, &cmd->se_cmd, cmd->unpacked_lun, cmd->tag, data_length, |
3154 | cmd->atio.u.isp24.fcp_hdr.ox_id); | 3124 | cmd->atio.u.isp24.fcp_hdr.ox_id); |
3155 | 3125 | ||
3156 | ret = vha->hw->tgt.tgt_ops->handle_cmd(vha, cmd, cdb, data_length, | 3126 | ret = ha->tgt.tgt_ops->handle_cmd(vha, cmd, cdb, data_length, |
3157 | fcp_task_attr, data_dir, bidi); | 3127 | fcp_task_attr, data_dir, bidi); |
3158 | if (ret != 0) | 3128 | if (ret != 0) |
3159 | goto out_term; | 3129 | goto out_term; |
3160 | /* | 3130 | /* |
@@ -3173,17 +3143,114 @@ out_term: | |||
3173 | */ | 3143 | */ |
3174 | spin_lock_irqsave(&ha->hardware_lock, flags); | 3144 | spin_lock_irqsave(&ha->hardware_lock, flags); |
3175 | qlt_send_term_exchange(vha, NULL, &cmd->atio, 1); | 3145 | qlt_send_term_exchange(vha, NULL, &cmd->atio, 1); |
3176 | kmem_cache_free(qla_tgt_cmd_cachep, cmd); | 3146 | percpu_ida_free(&sess->se_sess->sess_tag_pool, cmd->se_cmd.map_tag); |
3177 | if (sess) | 3147 | ha->tgt.tgt_ops->put_sess(sess); |
3148 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | ||
3149 | } | ||
3150 | |||
3151 | static void qlt_do_work(struct work_struct *work) | ||
3152 | { | ||
3153 | struct qla_tgt_cmd *cmd = container_of(work, struct qla_tgt_cmd, work); | ||
3154 | |||
3155 | __qlt_do_work(cmd); | ||
3156 | } | ||
3157 | |||
3158 | static struct qla_tgt_cmd *qlt_get_tag(scsi_qla_host_t *vha, | ||
3159 | struct qla_tgt_sess *sess, | ||
3160 | struct atio_from_isp *atio) | ||
3161 | { | ||
3162 | struct se_session *se_sess = sess->se_sess; | ||
3163 | struct qla_tgt_cmd *cmd; | ||
3164 | int tag; | ||
3165 | |||
3166 | tag = percpu_ida_alloc(&se_sess->sess_tag_pool, TASK_RUNNING); | ||
3167 | if (tag < 0) | ||
3168 | return NULL; | ||
3169 | |||
3170 | cmd = &((struct qla_tgt_cmd *)se_sess->sess_cmd_map)[tag]; | ||
3171 | memset(cmd, 0, sizeof(struct qla_tgt_cmd)); | ||
3172 | |||
3173 | memcpy(&cmd->atio, atio, sizeof(*atio)); | ||
3174 | cmd->state = QLA_TGT_STATE_NEW; | ||
3175 | cmd->tgt = vha->vha_tgt.qla_tgt; | ||
3176 | cmd->vha = vha; | ||
3177 | cmd->se_cmd.map_tag = tag; | ||
3178 | cmd->sess = sess; | ||
3179 | cmd->loop_id = sess->loop_id; | ||
3180 | cmd->conf_compl_supported = sess->conf_compl_supported; | ||
3181 | |||
3182 | return cmd; | ||
3183 | } | ||
3184 | |||
3185 | static void qlt_send_busy(struct scsi_qla_host *, struct atio_from_isp *, | ||
3186 | uint16_t); | ||
3187 | |||
3188 | static void qlt_create_sess_from_atio(struct work_struct *work) | ||
3189 | { | ||
3190 | struct qla_tgt_sess_op *op = container_of(work, | ||
3191 | struct qla_tgt_sess_op, work); | ||
3192 | scsi_qla_host_t *vha = op->vha; | ||
3193 | struct qla_hw_data *ha = vha->hw; | ||
3194 | struct qla_tgt_sess *sess; | ||
3195 | struct qla_tgt_cmd *cmd; | ||
3196 | unsigned long flags; | ||
3197 | uint8_t *s_id = op->atio.u.isp24.fcp_hdr.s_id; | ||
3198 | |||
3199 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf022, | ||
3200 | "qla_target(%d): Unable to find wwn login" | ||
3201 | " (s_id %x:%x:%x), trying to create it manually\n", | ||
3202 | vha->vp_idx, s_id[0], s_id[1], s_id[2]); | ||
3203 | |||
3204 | if (op->atio.u.raw.entry_count > 1) { | ||
3205 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf023, | ||
3206 | "Dropping multy entry atio %p\n", &op->atio); | ||
3207 | goto out_term; | ||
3208 | } | ||
3209 | |||
3210 | mutex_lock(&vha->vha_tgt.tgt_mutex); | ||
3211 | sess = qlt_make_local_sess(vha, s_id); | ||
3212 | /* sess has an extra creation ref. */ | ||
3213 | mutex_unlock(&vha->vha_tgt.tgt_mutex); | ||
3214 | |||
3215 | if (!sess) | ||
3216 | goto out_term; | ||
3217 | /* | ||
3218 | * Now obtain a pre-allocated session tag using the original op->atio | ||
3219 | * packet header, and dispatch into __qlt_do_work() using the existing | ||
3220 | * process context. | ||
3221 | */ | ||
3222 | cmd = qlt_get_tag(vha, sess, &op->atio); | ||
3223 | if (!cmd) { | ||
3224 | spin_lock_irqsave(&ha->hardware_lock, flags); | ||
3225 | qlt_send_busy(vha, &op->atio, SAM_STAT_BUSY); | ||
3178 | ha->tgt.tgt_ops->put_sess(sess); | 3226 | ha->tgt.tgt_ops->put_sess(sess); |
3227 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | ||
3228 | kfree(op); | ||
3229 | return; | ||
3230 | } | ||
3231 | /* | ||
3232 | * __qlt_do_work() will call ha->tgt.tgt_ops->put_sess() to release | ||
3233 | * the extra reference taken above by qlt_make_local_sess() | ||
3234 | */ | ||
3235 | __qlt_do_work(cmd); | ||
3236 | kfree(op); | ||
3237 | return; | ||
3238 | |||
3239 | out_term: | ||
3240 | spin_lock_irqsave(&ha->hardware_lock, flags); | ||
3241 | qlt_send_term_exchange(vha, NULL, &op->atio, 1); | ||
3179 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 3242 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
3243 | kfree(op); | ||
3244 | |||
3180 | } | 3245 | } |
3181 | 3246 | ||
3182 | /* ha->hardware_lock supposed to be held on entry */ | 3247 | /* ha->hardware_lock supposed to be held on entry */ |
3183 | static int qlt_handle_cmd_for_atio(struct scsi_qla_host *vha, | 3248 | static int qlt_handle_cmd_for_atio(struct scsi_qla_host *vha, |
3184 | struct atio_from_isp *atio) | 3249 | struct atio_from_isp *atio) |
3185 | { | 3250 | { |
3251 | struct qla_hw_data *ha = vha->hw; | ||
3186 | struct qla_tgt *tgt = vha->vha_tgt.qla_tgt; | 3252 | struct qla_tgt *tgt = vha->vha_tgt.qla_tgt; |
3253 | struct qla_tgt_sess *sess; | ||
3187 | struct qla_tgt_cmd *cmd; | 3254 | struct qla_tgt_cmd *cmd; |
3188 | 3255 | ||
3189 | if (unlikely(tgt->tgt_stop)) { | 3256 | if (unlikely(tgt->tgt_stop)) { |
@@ -3192,18 +3259,31 @@ static int qlt_handle_cmd_for_atio(struct scsi_qla_host *vha, | |||
3192 | return -EFAULT; | 3259 | return -EFAULT; |
3193 | } | 3260 | } |
3194 | 3261 | ||
3195 | cmd = kmem_cache_zalloc(qla_tgt_cmd_cachep, GFP_ATOMIC); | 3262 | sess = ha->tgt.tgt_ops->find_sess_by_s_id(vha, atio->u.isp24.fcp_hdr.s_id); |
3263 | if (unlikely(!sess)) { | ||
3264 | struct qla_tgt_sess_op *op = kzalloc(sizeof(struct qla_tgt_sess_op), | ||
3265 | GFP_ATOMIC); | ||
3266 | if (!op) | ||
3267 | return -ENOMEM; | ||
3268 | |||
3269 | memcpy(&op->atio, atio, sizeof(*atio)); | ||
3270 | INIT_WORK(&op->work, qlt_create_sess_from_atio); | ||
3271 | queue_work(qla_tgt_wq, &op->work); | ||
3272 | return 0; | ||
3273 | } | ||
3274 | /* | ||
3275 | * Do kref_get() before returning + dropping qla_hw_data->hardware_lock. | ||
3276 | */ | ||
3277 | kref_get(&sess->se_sess->sess_kref); | ||
3278 | |||
3279 | cmd = qlt_get_tag(vha, sess, atio); | ||
3196 | if (!cmd) { | 3280 | if (!cmd) { |
3197 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf05e, | 3281 | ql_dbg(ql_dbg_tgt_mgt, vha, 0xf05e, |
3198 | "qla_target(%d): Allocation of cmd failed\n", vha->vp_idx); | 3282 | "qla_target(%d): Allocation of cmd failed\n", vha->vp_idx); |
3283 | ha->tgt.tgt_ops->put_sess(sess); | ||
3199 | return -ENOMEM; | 3284 | return -ENOMEM; |
3200 | } | 3285 | } |
3201 | 3286 | ||
3202 | memcpy(&cmd->atio, atio, sizeof(*atio)); | ||
3203 | cmd->state = QLA_TGT_STATE_NEW; | ||
3204 | cmd->tgt = vha->vha_tgt.qla_tgt; | ||
3205 | cmd->vha = vha; | ||
3206 | |||
3207 | INIT_WORK(&cmd->work, qlt_do_work); | 3287 | INIT_WORK(&cmd->work, qlt_do_work); |
3208 | queue_work(qla_tgt_wq, &cmd->work); | 3288 | queue_work(qla_tgt_wq, &cmd->work); |
3209 | return 0; | 3289 | return 0; |
@@ -5501,23 +5581,13 @@ int __init qlt_init(void) | |||
5501 | if (!QLA_TGT_MODE_ENABLED()) | 5581 | if (!QLA_TGT_MODE_ENABLED()) |
5502 | return 0; | 5582 | return 0; |
5503 | 5583 | ||
5504 | qla_tgt_cmd_cachep = kmem_cache_create("qla_tgt_cmd_cachep", | ||
5505 | sizeof(struct qla_tgt_cmd), __alignof__(struct qla_tgt_cmd), 0, | ||
5506 | NULL); | ||
5507 | if (!qla_tgt_cmd_cachep) { | ||
5508 | ql_log(ql_log_fatal, NULL, 0xe06c, | ||
5509 | "kmem_cache_create for qla_tgt_cmd_cachep failed\n"); | ||
5510 | return -ENOMEM; | ||
5511 | } | ||
5512 | |||
5513 | qla_tgt_mgmt_cmd_cachep = kmem_cache_create("qla_tgt_mgmt_cmd_cachep", | 5584 | qla_tgt_mgmt_cmd_cachep = kmem_cache_create("qla_tgt_mgmt_cmd_cachep", |
5514 | sizeof(struct qla_tgt_mgmt_cmd), __alignof__(struct | 5585 | sizeof(struct qla_tgt_mgmt_cmd), __alignof__(struct |
5515 | qla_tgt_mgmt_cmd), 0, NULL); | 5586 | qla_tgt_mgmt_cmd), 0, NULL); |
5516 | if (!qla_tgt_mgmt_cmd_cachep) { | 5587 | if (!qla_tgt_mgmt_cmd_cachep) { |
5517 | ql_log(ql_log_fatal, NULL, 0xe06d, | 5588 | ql_log(ql_log_fatal, NULL, 0xe06d, |
5518 | "kmem_cache_create for qla_tgt_mgmt_cmd_cachep failed\n"); | 5589 | "kmem_cache_create for qla_tgt_mgmt_cmd_cachep failed\n"); |
5519 | ret = -ENOMEM; | 5590 | return -ENOMEM; |
5520 | goto out; | ||
5521 | } | 5591 | } |
5522 | 5592 | ||
5523 | qla_tgt_mgmt_cmd_mempool = mempool_create(25, mempool_alloc_slab, | 5593 | qla_tgt_mgmt_cmd_mempool = mempool_create(25, mempool_alloc_slab, |
@@ -5545,8 +5615,6 @@ out_cmd_mempool: | |||
5545 | mempool_destroy(qla_tgt_mgmt_cmd_mempool); | 5615 | mempool_destroy(qla_tgt_mgmt_cmd_mempool); |
5546 | out_mgmt_cmd_cachep: | 5616 | out_mgmt_cmd_cachep: |
5547 | kmem_cache_destroy(qla_tgt_mgmt_cmd_cachep); | 5617 | kmem_cache_destroy(qla_tgt_mgmt_cmd_cachep); |
5548 | out: | ||
5549 | kmem_cache_destroy(qla_tgt_cmd_cachep); | ||
5550 | return ret; | 5618 | return ret; |
5551 | } | 5619 | } |
5552 | 5620 | ||
@@ -5558,5 +5626,4 @@ void qlt_exit(void) | |||
5558 | destroy_workqueue(qla_tgt_wq); | 5626 | destroy_workqueue(qla_tgt_wq); |
5559 | mempool_destroy(qla_tgt_mgmt_cmd_mempool); | 5627 | mempool_destroy(qla_tgt_mgmt_cmd_mempool); |
5560 | kmem_cache_destroy(qla_tgt_mgmt_cmd_cachep); | 5628 | kmem_cache_destroy(qla_tgt_mgmt_cmd_cachep); |
5561 | kmem_cache_destroy(qla_tgt_cmd_cachep); | ||
5562 | } | 5629 | } |
diff --git a/drivers/scsi/qla2xxx/qla_target.h b/drivers/scsi/qla2xxx/qla_target.h index f873e10451d2..5c9f185a8ebd 100644 --- a/drivers/scsi/qla2xxx/qla_target.h +++ b/drivers/scsi/qla2xxx/qla_target.h | |||
@@ -870,6 +870,12 @@ struct qla_tgt { | |||
870 | struct list_head tgt_list_entry; | 870 | struct list_head tgt_list_entry; |
871 | }; | 871 | }; |
872 | 872 | ||
873 | struct qla_tgt_sess_op { | ||
874 | struct scsi_qla_host *vha; | ||
875 | struct atio_from_isp atio; | ||
876 | struct work_struct work; | ||
877 | }; | ||
878 | |||
873 | /* | 879 | /* |
874 | * Equivilant to IT Nexus (Initiator-Target) | 880 | * Equivilant to IT Nexus (Initiator-Target) |
875 | */ | 881 | */ |
diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c index 896cb23adb77..e2beab962096 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c | |||
@@ -1501,6 +1501,8 @@ static int tcm_qla2xxx_check_initiator_node_acl( | |||
1501 | struct qla_tgt_sess *sess = qla_tgt_sess; | 1501 | struct qla_tgt_sess *sess = qla_tgt_sess; |
1502 | unsigned char port_name[36]; | 1502 | unsigned char port_name[36]; |
1503 | unsigned long flags; | 1503 | unsigned long flags; |
1504 | int num_tags = (ha->fw_xcb_count) ? ha->fw_xcb_count : | ||
1505 | TCM_QLA2XXX_DEFAULT_TAGS; | ||
1504 | 1506 | ||
1505 | lport = vha->vha_tgt.target_lport_ptr; | 1507 | lport = vha->vha_tgt.target_lport_ptr; |
1506 | if (!lport) { | 1508 | if (!lport) { |
@@ -1518,7 +1520,9 @@ static int tcm_qla2xxx_check_initiator_node_acl( | |||
1518 | } | 1520 | } |
1519 | se_tpg = &tpg->se_tpg; | 1521 | se_tpg = &tpg->se_tpg; |
1520 | 1522 | ||
1521 | se_sess = transport_init_session(TARGET_PROT_NORMAL); | 1523 | se_sess = transport_init_session_tags(num_tags, |
1524 | sizeof(struct qla_tgt_cmd), | ||
1525 | TARGET_PROT_NORMAL); | ||
1522 | if (IS_ERR(se_sess)) { | 1526 | if (IS_ERR(se_sess)) { |
1523 | pr_err("Unable to initialize struct se_session\n"); | 1527 | pr_err("Unable to initialize struct se_session\n"); |
1524 | return PTR_ERR(se_sess); | 1528 | return PTR_ERR(se_sess); |
diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.h b/drivers/scsi/qla2xxx/tcm_qla2xxx.h index 33aaac8c7d59..10c002145648 100644 --- a/drivers/scsi/qla2xxx/tcm_qla2xxx.h +++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.h | |||
@@ -4,6 +4,11 @@ | |||
4 | #define TCM_QLA2XXX_VERSION "v0.1" | 4 | #define TCM_QLA2XXX_VERSION "v0.1" |
5 | /* length of ASCII WWPNs including pad */ | 5 | /* length of ASCII WWPNs including pad */ |
6 | #define TCM_QLA2XXX_NAMELEN 32 | 6 | #define TCM_QLA2XXX_NAMELEN 32 |
7 | /* | ||
8 | * Number of pre-allocated per-session tags, based upon the worst-case | ||
9 | * per port number of iocbs | ||
10 | */ | ||
11 | #define TCM_QLA2XXX_DEFAULT_TAGS 2088 | ||
7 | 12 | ||
8 | #include "qla_target.h" | 13 | #include "qla_target.h" |
9 | 14 | ||