diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-12 19:51:08 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-12 19:51:08 -0400 |
| commit | 141eaccd018ef0476e94b180026d973db35460fd (patch) | |
| tree | a1c8f5215bd4e5545dee6c56e8bb9b454c818b33 | |
| parent | 93094449060ae00213ba30ad9eaa485b448fe94b (diff) | |
| parent | b076808051f2c80d38e03fb2f1294f525c7a446d (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:
"Here are the target pending updates for v3.15-rc1. Apologies in
advance for waiting until the second to last day of the merge window
to send these out.
The highlights this round include:
- iser-target support for T10 PI (DIF) offloads (Sagi + Or)
- Fix Task Aborted Status (TAS) handling in target-core (Alex Leung)
- Pass in transport supported PI at session initialization (Sagi + MKP + nab)
- Add WRITE_INSERT + READ_STRIP T10 PI support in target-core (nab + Sagi)
- Fix iscsi-target ERL=2 ASYNC_EVENT connection pointer bug (nab)
- Fix tcm_fc use-after-free of ft_tpg (Andy Grover)
- Use correct ib_sg_dma primitives in ib_isert (Mike Marciniszyn)
Also, note the virtio-scsi + vhost-scsi changes to expose T10 PI
metadata into KVM guest have been left-out for now, as there where a
few comments from MST + Paolo that where not able to be addressed in
time for v3.15. Please expect this feature for v3.16-rc1"
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (43 commits)
ib_srpt: Use correct ib_sg_dma primitives
target/tcm_fc: Rename ft_tport_create to ft_tport_get
target/tcm_fc: Rename ft_{add,del}_lport to {add,del}_wwn
target/tcm_fc: Rename structs and list members for clarity
target/tcm_fc: Limit to 1 TPG per wwn
target/tcm_fc: Don't export ft_lport_list
target/tcm_fc: Fix use-after-free of ft_tpg
target: Add check to prevent Abort Task from aborting itself
target: Enable READ_STRIP emulation in target_complete_ok_work
target/sbc: Add sbc_dif_read_strip software emulation
target: Enable WRITE_INSERT emulation in target_execute_cmd
target/sbc: Add sbc_dif_generate software emulation
target/sbc: Only expose PI read_cap16 bits when supported by fabric
target/spc: Only expose PI mode page bits when supported by fabric
target/spc: Only expose PI inquiry bits when supported by fabric
target: Pass in transport supported PI at session initialization
target/iblock: Fix double bioset_integrity_free bug
Target/sbc: Initialize COMPARE_AND_WRITE write_sg scatterlist
target/rd: T10-Dif: RAM disk is allocating more space than required.
iscsi-target: Fix ERL=2 ASYNC_EVENT connection pointer bug
...
33 files changed, 1241 insertions, 437 deletions
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index 8ee228e9ab5a..c98fdb185931 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c | |||
| @@ -51,6 +51,8 @@ isert_unreg_rdma(struct isert_cmd *isert_cmd, struct isert_conn *isert_conn); | |||
| 51 | static int | 51 | static int |
| 52 | isert_reg_rdma(struct iscsi_conn *conn, struct iscsi_cmd *cmd, | 52 | isert_reg_rdma(struct iscsi_conn *conn, struct iscsi_cmd *cmd, |
| 53 | struct isert_rdma_wr *wr); | 53 | struct isert_rdma_wr *wr); |
| 54 | static int | ||
| 55 | isert_put_response(struct iscsi_conn *conn, struct iscsi_cmd *cmd); | ||
| 54 | 56 | ||
| 55 | static void | 57 | static void |
| 56 | isert_qp_event_callback(struct ib_event *e, void *context) | 58 | isert_qp_event_callback(struct ib_event *e, void *context) |
| @@ -87,7 +89,8 @@ isert_query_device(struct ib_device *ib_dev, struct ib_device_attr *devattr) | |||
| 87 | } | 89 | } |
| 88 | 90 | ||
| 89 | static int | 91 | static int |
| 90 | isert_conn_setup_qp(struct isert_conn *isert_conn, struct rdma_cm_id *cma_id) | 92 | isert_conn_setup_qp(struct isert_conn *isert_conn, struct rdma_cm_id *cma_id, |
| 93 | u8 protection) | ||
| 91 | { | 94 | { |
| 92 | struct isert_device *device = isert_conn->conn_device; | 95 | struct isert_device *device = isert_conn->conn_device; |
| 93 | struct ib_qp_init_attr attr; | 96 | struct ib_qp_init_attr attr; |
| @@ -119,6 +122,8 @@ isert_conn_setup_qp(struct isert_conn *isert_conn, struct rdma_cm_id *cma_id) | |||
| 119 | attr.cap.max_recv_sge = 1; | 122 | attr.cap.max_recv_sge = 1; |
| 120 | attr.sq_sig_type = IB_SIGNAL_REQ_WR; | 123 | attr.sq_sig_type = IB_SIGNAL_REQ_WR; |
| 121 | attr.qp_type = IB_QPT_RC; | 124 | attr.qp_type = IB_QPT_RC; |
| 125 | if (protection) | ||
| 126 | attr.create_flags |= IB_QP_CREATE_SIGNATURE_EN; | ||
| 122 | 127 | ||
| 123 | pr_debug("isert_conn_setup_qp cma_id->device: %p\n", | 128 | pr_debug("isert_conn_setup_qp cma_id->device: %p\n", |
| 124 | cma_id->device); | 129 | cma_id->device); |
| @@ -226,7 +231,8 @@ isert_create_device_ib_res(struct isert_device *device) | |||
| 226 | return ret; | 231 | return ret; |
| 227 | 232 | ||
| 228 | /* asign function handlers */ | 233 | /* asign function handlers */ |
| 229 | if (dev_attr->device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS) { | 234 | if (dev_attr->device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS && |
| 235 | dev_attr->device_cap_flags & IB_DEVICE_SIGNATURE_HANDOVER) { | ||
| 230 | device->use_fastreg = 1; | 236 | device->use_fastreg = 1; |
| 231 | device->reg_rdma_mem = isert_reg_rdma; | 237 | device->reg_rdma_mem = isert_reg_rdma; |
| 232 | device->unreg_rdma_mem = isert_unreg_rdma; | 238 | device->unreg_rdma_mem = isert_unreg_rdma; |
| @@ -236,13 +242,18 @@ isert_create_device_ib_res(struct isert_device *device) | |||
| 236 | device->unreg_rdma_mem = isert_unmap_cmd; | 242 | device->unreg_rdma_mem = isert_unmap_cmd; |
| 237 | } | 243 | } |
| 238 | 244 | ||
| 245 | /* Check signature cap */ | ||
| 246 | device->pi_capable = dev_attr->device_cap_flags & | ||
| 247 | IB_DEVICE_SIGNATURE_HANDOVER ? true : false; | ||
| 248 | |||
| 239 | device->cqs_used = min_t(int, num_online_cpus(), | 249 | device->cqs_used = min_t(int, num_online_cpus(), |
| 240 | device->ib_device->num_comp_vectors); | 250 | device->ib_device->num_comp_vectors); |
| 241 | device->cqs_used = min(ISERT_MAX_CQ, device->cqs_used); | 251 | device->cqs_used = min(ISERT_MAX_CQ, device->cqs_used); |
| 242 | pr_debug("Using %d CQs, device %s supports %d vectors support " | 252 | pr_debug("Using %d CQs, device %s supports %d vectors support " |
| 243 | "Fast registration %d\n", | 253 | "Fast registration %d pi_capable %d\n", |
| 244 | device->cqs_used, device->ib_device->name, | 254 | device->cqs_used, device->ib_device->name, |
| 245 | device->ib_device->num_comp_vectors, device->use_fastreg); | 255 | device->ib_device->num_comp_vectors, device->use_fastreg, |
| 256 | device->pi_capable); | ||
| 246 | device->cq_desc = kzalloc(sizeof(struct isert_cq_desc) * | 257 | device->cq_desc = kzalloc(sizeof(struct isert_cq_desc) * |
| 247 | device->cqs_used, GFP_KERNEL); | 258 | device->cqs_used, GFP_KERNEL); |
| 248 | if (!device->cq_desc) { | 259 | if (!device->cq_desc) { |
| @@ -395,6 +406,12 @@ isert_conn_free_fastreg_pool(struct isert_conn *isert_conn) | |||
| 395 | list_del(&fr_desc->list); | 406 | list_del(&fr_desc->list); |
| 396 | ib_free_fast_reg_page_list(fr_desc->data_frpl); | 407 | ib_free_fast_reg_page_list(fr_desc->data_frpl); |
| 397 | ib_dereg_mr(fr_desc->data_mr); | 408 | ib_dereg_mr(fr_desc->data_mr); |
| 409 | if (fr_desc->pi_ctx) { | ||
| 410 | ib_free_fast_reg_page_list(fr_desc->pi_ctx->prot_frpl); | ||
| 411 | ib_dereg_mr(fr_desc->pi_ctx->prot_mr); | ||
| 412 | ib_destroy_mr(fr_desc->pi_ctx->sig_mr); | ||
| 413 | kfree(fr_desc->pi_ctx); | ||
| 414 | } | ||
| 398 | kfree(fr_desc); | 415 | kfree(fr_desc); |
| 399 | ++i; | 416 | ++i; |
| 400 | } | 417 | } |
| @@ -406,8 +423,10 @@ isert_conn_free_fastreg_pool(struct isert_conn *isert_conn) | |||
| 406 | 423 | ||
| 407 | static int | 424 | static int |
| 408 | isert_create_fr_desc(struct ib_device *ib_device, struct ib_pd *pd, | 425 | isert_create_fr_desc(struct ib_device *ib_device, struct ib_pd *pd, |
| 409 | struct fast_reg_descriptor *fr_desc) | 426 | struct fast_reg_descriptor *fr_desc, u8 protection) |
| 410 | { | 427 | { |
| 428 | int ret; | ||
| 429 | |||
| 411 | fr_desc->data_frpl = ib_alloc_fast_reg_page_list(ib_device, | 430 | fr_desc->data_frpl = ib_alloc_fast_reg_page_list(ib_device, |
| 412 | ISCSI_ISER_SG_TABLESIZE); | 431 | ISCSI_ISER_SG_TABLESIZE); |
| 413 | if (IS_ERR(fr_desc->data_frpl)) { | 432 | if (IS_ERR(fr_desc->data_frpl)) { |
| @@ -420,27 +439,88 @@ isert_create_fr_desc(struct ib_device *ib_device, struct ib_pd *pd, | |||
| 420 | if (IS_ERR(fr_desc->data_mr)) { | 439 | if (IS_ERR(fr_desc->data_mr)) { |
| 421 | pr_err("Failed to allocate data frmr err=%ld\n", | 440 | pr_err("Failed to allocate data frmr err=%ld\n", |
| 422 | PTR_ERR(fr_desc->data_mr)); | 441 | PTR_ERR(fr_desc->data_mr)); |
| 423 | ib_free_fast_reg_page_list(fr_desc->data_frpl); | 442 | ret = PTR_ERR(fr_desc->data_mr); |
| 424 | return PTR_ERR(fr_desc->data_mr); | 443 | goto err_data_frpl; |
| 425 | } | 444 | } |
| 426 | pr_debug("Create fr_desc %p page_list %p\n", | 445 | pr_debug("Create fr_desc %p page_list %p\n", |
| 427 | fr_desc, fr_desc->data_frpl->page_list); | 446 | fr_desc, fr_desc->data_frpl->page_list); |
