diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-31 18:31:23 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-31 18:31:23 -0500 |
| commit | 4e13c5d0212f25d69a97606b9d5a85edb52a7737 (patch) | |
| tree | 002f59b9151f42a6388656762f0e7963d08b89ef | |
| parent | deb2a1d29bf0168ff2575e714e5c1f156be663fb (diff) | |
| parent | 5259a06ef97068b710f45d092a587e8d740f750f (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 SCSI Referrals (Hannes)
- add support for T10 DIF into target core (nab + mkp)
- add support for T10 DIF emulation in FILEIO + RAMDISK backends (Sagi + nab)
- add support for T10 DIF -> bio_integrity passthrough in IBLOCK backend (nab)
- prep changes to iser-target for >= v3.15 T10 DIF support (Sagi)
- add support for qla2xxx N_Port ID Virtualization - NPIV (Saurav + Quinn)
- allow percpu_ida_alloc() to receive task state bitmask (Kent)
- fix >= v3.12 iscsi-target session reset hung task regression (nab)
- fix >= v3.13 percpu_ref se_lun->lun_ref_active race (nab)
- fix a long-standing network portal creation race (Andy)"
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (51 commits)
target: Fix percpu_ref_put race in transport_lun_remove_cmd
target/iscsi: Fix network portal creation race
target: Report bad sector in sense data for DIF errors
iscsi-target: Convert gfp_t parameter to task state bitmask
iscsi-target: Fix connection reset hang with percpu_ida_alloc
percpu_ida: Make percpu_ida_alloc + callers accept task state bitmask
iscsi-target: Pre-allocate more tags to avoid ack starvation
qla2xxx: Configure NPIV fc_vport via tcm_qla2xxx_npiv_make_lport
qla2xxx: Enhancements to enable NPIV support for QLOGIC ISPs with TCM/LIO.
qla2xxx: Fix scsi_host leak on qlt_lport_register callback failure
IB/isert: pass scatterlist instead of cmd to fast_reg_mr routine
IB/isert: Move fastreg descriptor creation to a function
IB/isert: Avoid frwr notation, user fastreg
IB/isert: seperate connection protection domains and dma MRs
tcm_loop: Enable DIF/DIX modes in SCSI host LLD
target/rd: Add DIF protection into rd_execute_rw
target/rd: Add support for protection SGL setup + release
target/rd: Refactor rd_build_device_space + rd_release_device_space
target/file: Add DIF protection support to fd_execute_rw
target/file: Add DIF protection init/format support
...
43 files changed, 2300 insertions, 505 deletions
diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index d64a02fb1f73..5d70edc9855f 100644 --- a/block/blk-mq-tag.c +++ b/block/blk-mq-tag.c | |||
| @@ -36,7 +36,8 @@ static unsigned int __blk_mq_get_tag(struct blk_mq_tags *tags, gfp_t gfp) | |||
| 36 | { | 36 | { |
| 37 | int tag; | 37 | int tag; |
| 38 | 38 | ||
| 39 | tag = percpu_ida_alloc(&tags->free_tags, gfp); | 39 | tag = percpu_ida_alloc(&tags->free_tags, (gfp & __GFP_WAIT) ? |
| 40 | TASK_UNINTERRUPTIBLE : TASK_RUNNING); | ||
| 40 | if (tag < 0) | 41 | if (tag < 0) |
| 41 | return BLK_MQ_TAG_FAIL; | 42 | return BLK_MQ_TAG_FAIL; |
| 42 | return tag + tags->nr_reserved_tags; | 43 | return tag + tags->nr_reserved_tags; |
| @@ -52,7 +53,8 @@ static unsigned int __blk_mq_get_reserved_tag(struct blk_mq_tags *tags, | |||
| 52 | return BLK_MQ_TAG_FAIL; | 53 | return BLK_MQ_TAG_FAIL; |
| 53 | } | 54 | } |
| 54 | 55 | ||
| 55 | tag = percpu_ida_alloc(&tags->reserved_tags, gfp); | 56 | tag = percpu_ida_alloc(&tags->reserved_tags, (gfp & __GFP_WAIT) ? |
| 57 | TASK_UNINTERRUPTIBLE : TASK_RUNNING); | ||
| 56 | if (tag < 0) | 58 | if (tag < 0) |
| 57 | return BLK_MQ_TAG_FAIL; | 59 | return BLK_MQ_TAG_FAIL; |
| 58 | return tag; | 60 | return tag; |
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index 9804fca6bf06..2b161be3c1a3 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c | |||
| @@ -47,10 +47,10 @@ static int | |||
| 47 | isert_map_rdma(struct iscsi_conn *conn, struct iscsi_cmd *cmd, | 47 | isert_map_rdma(struct iscsi_conn *conn, struct iscsi_cmd *cmd, |
| 48 | struct isert_rdma_wr *wr); | 48 | struct isert_rdma_wr *wr); |
| 49 | static void | 49 | static void |
| 50 | isert_unreg_rdma_frwr(struct isert_cmd *isert_cmd, struct isert_conn *isert_conn); | 50 | isert_unreg_rdma(struct isert_cmd *isert_cmd, struct isert_conn *isert_conn); |
| 51 | static int | 51 | static int |
| 52 | isert_reg_rdma_frwr(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 | 54 | ||
| 55 | static void | 55 | static void |
| 56 | isert_qp_event_callback(struct ib_event *e, void *context) | 56 | isert_qp_event_callback(struct ib_event *e, void *context) |
| @@ -227,11 +227,11 @@ isert_create_device_ib_res(struct isert_device *device) | |||
| 227 | 227 | ||
| 228 | /* asign function handlers */ | 228 | /* asign function handlers */ |
| 229 | if (dev_attr->device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS) { | 229 | if (dev_attr->device_cap_flags & IB_DEVICE_MEM_MGT_EXTENSIONS) { |
| 230 | device->use_frwr = 1; | 230 | device->use_fastreg = 1; |
| 231 | device->reg_rdma_mem = isert_reg_rdma_frwr; | 231 | device->reg_rdma_mem = isert_reg_rdma; |
| 232 | device->unreg_rdma_mem = isert_unreg_rdma_frwr; | 232 | device->unreg_rdma_mem = isert_unreg_rdma; |
| 233 | } else { | 233 | } else { |
| 234 | device->use_frwr = 0; | 234 | device->use_fastreg = 0; |
| 235 | device->reg_rdma_mem = isert_map_rdma; | 235 | device->reg_rdma_mem = isert_map_rdma; |
| 236 | device->unreg_rdma_mem = isert_unmap_cmd; | 236 | device->unreg_rdma_mem = isert_unmap_cmd; |
| 237 | } | 237 | } |
| @@ -239,9 +239,10 @@ isert_create_device_ib_res(struct isert_device *device) | |||
| 239 | device->cqs_used = min_t(int, num_online_cpus(), | 239 | device->cqs_used = min_t(int, num_online_cpus(), |
| 240 | device->ib_device->num_comp_vectors); | 240 | device->ib_device->num_comp_vectors); |
| 241 | device->cqs_used = min(ISERT_MAX_CQ, device->cqs_used); | 241 | device->cqs_used = min(ISERT_MAX_CQ, device->cqs_used); |
| 242 | pr_debug("Using %d CQs, device %s supports %d vectors support FRWR %d\n", | 242 | pr_debug("Using %d CQs, device %s supports %d vectors support " |
| 243 | "Fast registration %d\n", | ||
| 243 | device->cqs_used, device->ib_device->name, | 244 | device->cqs_used, device->ib_device->name, |
| 244 | device->ib_device->num_comp_vectors, device->use_frwr); | 245 | device->ib_device->num_comp_vectors, device->use_fastreg); |
| 245 | device->cq_desc = kzalloc(sizeof(struct isert_cq_desc) * | 246 | device->cq_desc = kzalloc(sizeof(struct isert_cq_desc) * |
| 246 | device->cqs_used, GFP_KERNEL); | 247 | device->cqs_used, GFP_KERNEL); |
| 247 | if (!device->cq_desc) { | 248 | if (!device->cq_desc) { |
| @@ -250,13 +251,6 @@ isert_create_device_ib_res(struct isert_device *device) | |||
| 250 | } | 251 | } |
| 251 | cq_desc = device->cq_desc; | 252 | cq_desc = device->cq_desc; |
| 252 | 253 | ||
| 253 | device->dev_pd = ib_alloc_pd(ib_dev); | ||
| 254 | if (IS_ERR(device->dev_pd)) { | ||
| 255 | ret = PTR_ERR(device->dev_pd); | ||
| 256 | pr_err("ib_alloc_pd failed for dev_pd: %d\n", ret); | ||
| 257 | goto out_cq_desc; | ||
| 258 | } | ||
| 259 | |||
| 260 | for (i = 0; i < device->cqs_used; i++) { | 254 | for (i = 0; i < device->cqs_used; i++) { |
| 261 | cq_desc[i].device = device; | 255 | cq_desc[i].device = device; |
| 262 | cq_desc[i].cq_index = i; | 256 | cq_desc[i].cq_index = i; |
| @@ -294,13 +288,6 @@ isert_create_device_ib_res(struct isert_device *device) | |||
| 294 | goto out_cq; | 288 | goto out_cq; |
| 295 | } | 289 | } |
| 296 | 290 | ||
| 297 | device->dev_mr = ib_get_dma_mr(device->dev_pd, IB_ACCESS_LOCAL_WRITE); | ||
| 298 | if (IS_ERR(device->dev_mr)) { | ||
| 299 | ret = PTR_ERR(device->dev_mr); | ||
| 300 | pr_err("ib_get_dma_mr failed for dev_mr: %d\n", ret); | ||
| 301 | goto out_cq; | ||
| 302 | } | ||
| 303 | |||
| 304 | return 0; | 291 | return 0; |
| 305 | 292 | ||
| 306 | out_cq: | 293 | |
