Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending

Pull SCSI target fixes from Nicholas Bellinger:
"This includes fixes from HCH for -rc1 configfs default_groups
conversion changes that ended up breaking some iscsi-target
default_groups, along with Sagi's ib_drain_qp() conversion for
iser-target to use the common caller now available to RDMA kernel
consumers in v4.6+ code"

* git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending:
target: add a new add_wwn_groups fabrics method
target: initialize the nacl base CIT begfore init_nodeacl
target: remove ->fabric_cleanup_nodeacl
iser-target: Use ib_drain_qp

+29 -66
+4 -35
drivers/infiniband/ulp/isert/ib_isert.c
··· 63 63 struct rdma_cm_id *isert_setup_id(struct isert_np *isert_np); 64 64 65 65 static void isert_release_work(struct work_struct *work); 66 - static void isert_wait4flush(struct isert_conn *isert_conn); 67 66 static void isert_recv_done(struct ib_cq *cq, struct ib_wc *wc); 68 67 static void isert_send_done(struct ib_cq *cq, struct ib_wc *wc); 69 68 static void isert_login_recv_done(struct ib_cq *cq, struct ib_wc *wc); ··· 140 141 attr.qp_context = isert_conn; 141 142 attr.send_cq = comp->cq; 142 143 attr.recv_cq = comp->cq; 143 - attr.cap.max_send_wr = ISERT_QP_MAX_REQ_DTOS; 144 + attr.cap.max_send_wr = ISERT_QP_MAX_REQ_DTOS + 1; 144 145 attr.cap.max_recv_wr = ISERT_QP_MAX_RECV_DTOS + 1; 145 146 attr.cap.max_send_sge = device->ib_device->attrs.max_sge; 146 147 isert_conn->max_sge = min(device->ib_device->attrs.max_sge, ··· 886 887 break; 887 888 case ISER_CONN_UP: 888 889 isert_conn_terminate(isert_conn); 889 - isert_wait4flush(isert_conn); 890 + ib_drain_qp(isert_conn->qp); 890 891 isert_handle_unbound_conn(isert_conn); 891 892 break; 892 893 case ISER_CONN_BOUND: ··· 3212 3213 } 3213 3214 } 3214 3215 3215 - static void 3216 - isert_beacon_done(struct ib_cq *cq, struct ib_wc *wc) 3217 - { 3218 - struct isert_conn *isert_conn = wc->qp->qp_context; 3219 - 3220 - isert_print_wc(wc, "beacon"); 3221 - 3222 - isert_info("conn %p completing wait_comp_err\n", isert_conn); 3223 - complete(&isert_conn->wait_comp_err); 3224 - } 3225 - 3226 - static void 3227 - isert_wait4flush(struct isert_conn *isert_conn) 3228 - { 3229 - struct ib_recv_wr *bad_wr; 3230 - static struct ib_cqe cqe = { .done = isert_beacon_done }; 3231 - 3232 - isert_info("conn %p\n", isert_conn); 3233 - 3234 - init_completion(&isert_conn->wait_comp_err); 3235 - isert_conn->beacon.wr_cqe = &cqe; 3236 - /* post an indication that all flush errors were consumed */ 3237 - if (ib_post_recv(isert_conn->qp, &isert_conn->beacon, &bad_wr)) { 3238 - isert_err("conn %p failed to post beacon", isert_conn); 3239 - return; 3240 - } 3241 - 3242 - wait_for_completion(&isert_conn->wait_comp_err); 3243 - } 3244 - 3245 3216 /** 3246 3217 * isert_put_unsol_pending_cmds() - Drop commands waiting for 3247 3218 * unsolicitate dataout ··· 3257 3288 isert_conn_terminate(isert_conn); 3258 3289 mutex_unlock(&isert_conn->mutex); 3259 3290 3260 - isert_wait4flush(isert_conn); 3291 + ib_drain_qp(isert_conn->qp); 3261 3292 isert_put_unsol_pending_cmds(conn); 3262 3293 isert_wait4cmds(conn); 3263 3294 isert_wait4logout(isert_conn); ··· 3269 3300 { 3270 3301 struct isert_conn *isert_conn = conn->context; 3271 3302 3272 - isert_wait4flush(isert_conn); 3303 + ib_drain_qp(isert_conn->qp); 3273 3304 isert_put_conn(isert_conn); 3274 3305 } 3275 3306
-2
drivers/infiniband/ulp/isert/ib_isert.h
··· 209 209 struct ib_qp *qp; 210 210 struct isert_device *device; 211 211 struct mutex mutex; 212 - struct completion wait_comp_err; 213 212 struct kref kref; 214 213 struct list_head fr_pool; 215 214 int fr_pool_size; 216 215 /* lock to protect fastreg pool */ 217 216 spinlock_t pool_lock; 218 217 struct work_struct release_work; 219 - struct ib_recv_wr beacon; 220 218 bool logout_posted; 221 219 bool snd_w_inv; 222 220 };
+11 -17
drivers/target/iscsi/iscsi_target_configfs.c
··· 779 779 return 0; 780 780 } 781 781 782 - static void lio_target_cleanup_nodeacl( struct se_node_acl *se_nacl) 783 - { 784 - struct iscsi_node_acl *acl = container_of(se_nacl, 785 - struct iscsi_node_acl, se_node_acl); 786 - 787 - configfs_remove_default_groups(&acl->se_node_acl.acl_fabric_stat_group); 788 - } 789 - 790 782 /* End items for lio_target_acl_cit */ 791 783 792 784 /* Start items for lio_target_tpg_attrib_cit */ ··· 1239 1247 if (IS_ERR(tiqn)) 1240 1248 return ERR_CAST(tiqn); 1241 1249 1250 + pr_debug("LIO_Target_ConfigFS: REGISTER -> %s\n", tiqn->tiqn); 1251 + pr_debug("LIO_Target_ConfigFS: REGISTER -> Allocated Node:" 1252 + " %s\n", name); 1253 + return &tiqn->tiqn_wwn; 1254 + } 1255 + 1256 + static void lio_target_add_wwn_groups(struct se_wwn *wwn) 1257 + { 1258 + struct iscsi_tiqn *tiqn = container_of(wwn, struct iscsi_tiqn, tiqn_wwn); 1259 + 1242 1260 config_group_init_type_name(&tiqn->tiqn_stat_grps.iscsi_instance_group, 1243 1261 "iscsi_instance", &iscsi_stat_instance_cit); 1244 1262 configfs_add_default_group(&tiqn->tiqn_stat_grps.iscsi_instance_group, ··· 1273 1271 "iscsi_logout_stats", &iscsi_stat_logout_cit); 1274 1272 configfs_add_default_group(&tiqn->tiqn_stat_grps.iscsi_logout_stats_group, 1275 1273 &tiqn->tiqn_wwn.fabric_stat_group); 1276 - 1277 - 1278 - pr_debug("LIO_Target_ConfigFS: REGISTER -> %s\n", tiqn->tiqn); 1279 - pr_debug("LIO_Target_ConfigFS: REGISTER -> Allocated Node:" 1280 - " %s\n", name); 1281 - return &tiqn->tiqn_wwn; 1282 1274 } 1283 1275 1284 1276 static void lio_target_call_coredeltiqn( 1285 1277 struct se_wwn *wwn) 1286 1278 { 1287 1279 struct iscsi_tiqn *tiqn = container_of(wwn, struct iscsi_tiqn, tiqn_wwn); 1288 - 1289 - configfs_remove_default_groups(&tiqn->tiqn_wwn.fabric_stat_group); 1290 1280 1291 1281 pr_debug("LIO_Target_ConfigFS: DEREGISTER -> %s\n", 1292 1282 tiqn->tiqn); ··· 1654 1660 .aborted_task = lio_aborted_task, 1655 1661 .fabric_make_wwn = lio_target_call_coreaddtiqn, 1656 1662 .fabric_drop_wwn = lio_target_call_coredeltiqn, 1663 + .add_wwn_groups = lio_target_add_wwn_groups, 1657 1664 .fabric_make_tpg = lio_target_tiqn_addtpg, 1658 1665 .fabric_drop_tpg = lio_target_tiqn_deltpg, 1659 1666 .fabric_make_np = lio_target_call_addnptotpg, 1660 1667 .fabric_drop_np = lio_target_call_delnpfromtpg, 1661 1668 .fabric_init_nodeacl = lio_target_init_nodeacl, 1662 - .fabric_cleanup_nodeacl = lio_target_cleanup_nodeacl, 1663 1669 1664 1670 .tfc_discovery_attrs = lio_target_discovery_auth_attrs, 1665 1671 .tfc_wwn_attrs = lio_target_wwn_attrs,
+13 -11
drivers/target/target_core_fabric_configfs.c
··· 338 338 { 339 339 struct se_node_acl *se_nacl = container_of(to_config_group(item), 340 340 struct se_node_acl, acl_group); 341 - struct target_fabric_configfs *tf = se_nacl->se_tpg->se_tpg_wwn->wwn_tf; 342 341 343 - if (tf->tf_ops->fabric_cleanup_nodeacl) 344 - tf->tf_ops->fabric_cleanup_nodeacl(se_nacl); 342 + configfs_remove_default_groups(&se_nacl->acl_fabric_stat_group); 345 343 core_tpg_del_initiator_node_acl(se_nacl); 346 344 } 347 345 ··· 381 383 if (IS_ERR(se_nacl)) 382 384 return ERR_CAST(se_nacl); 383 385 384 - if (tf->tf_ops->fabric_init_nodeacl) { 385 - int ret = tf->tf_ops->fabric_init_nodeacl(se_nacl, name); 386 - if (ret) { 387 - core_tpg_del_initiator_node_acl(se_nacl); 388 - return ERR_PTR(ret); 389 - } 390 - } 391 - 392 386 config_group_init_type_name(&se_nacl->acl_group, name, 393 387 &tf->tf_tpg_nacl_base_cit); 394 388 ··· 403 413 "fabric_statistics", &tf->tf_tpg_nacl_stat_cit); 404 414 configfs_add_default_group(&se_nacl->acl_fabric_stat_group, 405 415 &se_nacl->acl_group); 416 + 417 + if (tf->tf_ops->fabric_init_nodeacl) { 418 + int ret = tf->tf_ops->fabric_init_nodeacl(se_nacl, name); 419 + if (ret) { 420 + configfs_remove_default_groups(&se_nacl->acl_fabric_stat_group); 421 + core_tpg_del_initiator_node_acl(se_nacl); 422 + return ERR_PTR(ret); 423 + } 424 + } 406 425 407 426 return &se_nacl->acl_group; 408 427 } ··· 891 892 struct se_wwn, wwn_group); 892 893 struct target_fabric_configfs *tf = wwn->wwn_tf; 893 894 895 + configfs_remove_default_groups(&wwn->fabric_stat_group); 894 896 tf->tf_ops->fabric_drop_wwn(wwn); 895 897 } 896 898 ··· 945 945 &tf->tf_wwn_fabric_stats_cit); 946 946 configfs_add_default_group(&wwn->fabric_stat_group, &wwn->wwn_group); 947 947 948 + if (tf->tf_ops->add_wwn_groups) 949 + tf->tf_ops->add_wwn_groups(wwn); 948 950 return &wwn->wwn_group; 949 951 } 950 952
+1 -1
include/target/target_core_fabric.h
··· 76 76 struct se_wwn *(*fabric_make_wwn)(struct target_fabric_configfs *, 77 77 struct config_group *, const char *); 78 78 void (*fabric_drop_wwn)(struct se_wwn *); 79 + void (*add_wwn_groups)(struct se_wwn *); 79 80 struct se_portal_group *(*fabric_make_tpg)(struct se_wwn *, 80 81 struct config_group *, const char *); 81 82 void (*fabric_drop_tpg)(struct se_portal_group *); ··· 88 87 struct config_group *, const char *); 89 88 void (*fabric_drop_np)(struct se_tpg_np *); 90 89 int (*fabric_init_nodeacl)(struct se_node_acl *, const char *); 91 - void (*fabric_cleanup_nodeacl)(struct se_node_acl *); 92 90 93 91 struct configfs_attribute **tfc_discovery_attrs; 94 92 struct configfs_attribute **tfc_wwn_attrs;