diff options
Diffstat (limited to 'drivers/infiniband/ulp')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/Kconfig | 3 | ||||
-rw-r--r-- | drivers/infiniband/ulp/iser/iscsi_iser.c | 22 | ||||
-rw-r--r-- | drivers/infiniband/ulp/srp/ib_srp.c | 19 |
3 files changed, 20 insertions, 24 deletions
diff --git a/drivers/infiniband/ulp/ipoib/Kconfig b/drivers/infiniband/ulp/ipoib/Kconfig index 13d6d01c72c0..d74653d7de1c 100644 --- a/drivers/infiniband/ulp/ipoib/Kconfig +++ b/drivers/infiniband/ulp/ipoib/Kconfig | |||
@@ -6,8 +6,7 @@ config INFINIBAND_IPOIB | |||
6 | transports IP packets over InfiniBand so you can use your IB | 6 | transports IP packets over InfiniBand so you can use your IB |
7 | device as a fancy NIC. | 7 | device as a fancy NIC. |
8 | 8 | ||
9 | The IPoIB protocol is defined by the IETF ipoib working | 9 | See Documentation/infiniband/ipoib.txt for more information |
10 | group: <http://www.ietf.org/html.charters/ipoib-charter.html>. | ||
11 | 10 | ||
12 | config INFINIBAND_IPOIB_DEBUG | 11 | config INFINIBAND_IPOIB_DEBUG |
13 | bool "IP-over-InfiniBand debugging" if EMBEDDED | 12 | bool "IP-over-InfiniBand debugging" if EMBEDDED |
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c index 34b0da5cfa0a..1437d7ee3b19 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.c +++ b/drivers/infiniband/ulp/iser/iscsi_iser.c | |||
@@ -378,21 +378,6 @@ iscsi_iser_conn_start(struct iscsi_cls_conn *cls_conn) | |||
378 | return iser_conn_set_full_featured_mode(conn); | 378 | return iser_conn_set_full_featured_mode(conn); |
379 | } | 379 | } |
380 | 380 | ||
381 | static void | ||
382 | iscsi_iser_conn_terminate(struct iscsi_conn *conn) | ||
383 | { | ||
384 | struct iscsi_iser_conn *iser_conn = conn->dd_data; | ||
385 | struct iser_conn *ib_conn = iser_conn->ib_conn; | ||
386 | |||
387 | BUG_ON(!ib_conn); | ||
388 | /* starts conn teardown process, waits until all previously * | ||
389 | * posted buffers get flushed, deallocates all conn resources */ | ||
390 | iser_conn_terminate(ib_conn); | ||
391 | iser_conn->ib_conn = NULL; | ||
392 | conn->recv_lock = NULL; | ||
393 | } | ||
394 | |||
395 | |||
396 | static struct iscsi_transport iscsi_iser_transport; | 381 | static struct iscsi_transport iscsi_iser_transport; |
397 | 382 | ||
398 | static struct iscsi_cls_session * | 383 | static struct iscsi_cls_session * |
@@ -555,13 +540,13 @@ iscsi_iser_ep_poll(__u64 ep_handle, int timeout_ms) | |||
555 | static void | 540 | static void |
556 | iscsi_iser_ep_disconnect(__u64 ep_handle) | 541 | iscsi_iser_ep_disconnect(__u64 ep_handle) |
557 | { | 542 | { |
558 | struct iser_conn *ib_conn = iscsi_iser_ib_conn_lookup(ep_handle); | 543 | struct iser_conn *ib_conn; |
559 | 544 | ||
545 | ib_conn = iscsi_iser_ib_conn_lookup(ep_handle); | ||
560 | if (!ib_conn) | 546 | if (!ib_conn) |
561 | return; | 547 | return; |
562 | 548 | ||
563 | iser_err("ib conn %p state %d\n",ib_conn, ib_conn->state); | 549 | iser_err("ib conn %p state %d\n",ib_conn, ib_conn->state); |
564 | |||
565 | iser_conn_terminate(ib_conn); | 550 | iser_conn_terminate(ib_conn); |
566 | } | 551 | } |
567 | 552 | ||
@@ -614,9 +599,6 @@ static struct iscsi_transport iscsi_iser_transport = { | |||
614 | .get_session_param = iscsi_session_get_param, | 599 | .get_session_param = iscsi_session_get_param, |
615 | .start_conn = iscsi_iser_conn_start, | 600 | .start_conn = iscsi_iser_conn_start, |
616 | .stop_conn = iscsi_conn_stop, | 601 | .stop_conn = iscsi_conn_stop, |
617 | /* these are called as part of conn recovery */ | ||
618 | .suspend_conn_recv = NULL, /* FIXME is/how this relvant to iser? */ | ||
619 | .terminate_conn = iscsi_iser_conn_terminate, | ||
620 | /* IO */ | 602 | /* IO */ |
621 | .send_pdu = iscsi_conn_send_pdu, | 603 | .send_pdu = iscsi_conn_send_pdu, |
622 | .get_stats = iscsi_iser_conn_get_stats, | 604 | .get_stats = iscsi_iser_conn_get_stats, |
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 8f472e7113b4..8257d5a2c8f8 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c | |||
@@ -77,6 +77,14 @@ MODULE_PARM_DESC(topspin_workarounds, | |||
77 | 77 | ||
78 | static const u8 topspin_oui[3] = { 0x00, 0x05, 0xad }; | 78 | static const u8 topspin_oui[3] = { 0x00, 0x05, 0xad }; |
79 | 79 | ||
80 | static int mellanox_workarounds = 1; | ||
81 | |||
82 | module_param(mellanox_workarounds, int, 0444); | ||
83 | MODULE_PARM_DESC(mellanox_workarounds, | ||
84 | "Enable workarounds for Mellanox SRP target bugs if != 0"); | ||
85 | |||
86 | static const u8 mellanox_oui[3] = { 0x00, 0x02, 0xc9 }; | ||
87 | |||
80 | static void srp_add_one(struct ib_device *device); | 88 | static void srp_add_one(struct ib_device *device); |
81 | static void srp_remove_one(struct ib_device *device); | 89 | static void srp_remove_one(struct ib_device *device); |
82 | static void srp_completion(struct ib_cq *cq, void *target_ptr); | 90 | static void srp_completion(struct ib_cq *cq, void *target_ptr); |
@@ -526,8 +534,10 @@ static int srp_reconnect_target(struct srp_target_port *target) | |||
526 | while (ib_poll_cq(target->cq, 1, &wc) > 0) | 534 | while (ib_poll_cq(target->cq, 1, &wc) > 0) |
527 | ; /* nothing */ | 535 | ; /* nothing */ |
528 | 536 | ||
537 | spin_lock_irq(target->scsi_host->host_lock); | ||
529 | list_for_each_entry_safe(req, tmp, &target->req_queue, list) | 538 | list_for_each_entry_safe(req, tmp, &target->req_queue, list) |
530 | srp_reset_req(target, req); | 539 | srp_reset_req(target, req); |
540 | spin_unlock_irq(target->scsi_host->host_lock); | ||
531 | 541 | ||
532 | target->rx_head = 0; | 542 | target->rx_head = 0; |
533 | target->tx_head = 0; | 543 | target->tx_head = 0; |
@@ -567,7 +577,7 @@ err: | |||
567 | return ret; | 577 | return ret; |
568 | } | 578 | } |
569 | 579 | ||
570 | static int srp_map_fmr(struct srp_device *dev, struct scatterlist *scat, | 580 | static int srp_map_fmr(struct srp_target_port *target, struct scatterlist *scat, |
571 | int sg_cnt, struct srp_request *req, | 581 | int sg_cnt, struct srp_request *req, |
572 | struct srp_direct_buf *buf) | 582 | struct srp_direct_buf *buf) |
573 | { | 583 | { |
@@ -577,10 +587,15 @@ static int srp_map_fmr(struct srp_device *dev, struct scatterlist *scat, | |||
577 | int page_cnt; | 587 | int page_cnt; |
578 | int i, j; | 588 | int i, j; |
579 | int ret; | 589 | int ret; |
590 | struct srp_device *dev = target->srp_host->dev; | ||
580 | 591 | ||
581 | if (!dev->fmr_pool) | 592 | if (!dev->fmr_pool) |
582 | return -ENODEV; | 593 | return -ENODEV; |
583 | 594 | ||
595 | if ((sg_dma_address(&scat[0]) & ~dev->fmr_page_mask) && | ||
596 | mellanox_workarounds && !memcmp(&target->ioc_guid, mellanox_oui, 3)) | ||
597 | return -EINVAL; | ||
598 | |||
584 | len = page_cnt = 0; | 599 | len = page_cnt = 0; |
585 | for (i = 0; i < sg_cnt; ++i) { | 600 | for (i = 0; i < sg_cnt; ++i) { |
586 | if (sg_dma_address(&scat[i]) & ~dev->fmr_page_mask) { | 601 | if (sg_dma_address(&scat[i]) & ~dev->fmr_page_mask) { |
@@ -683,7 +698,7 @@ static int srp_map_data(struct scsi_cmnd *scmnd, struct srp_target_port *target, | |||
683 | buf->va = cpu_to_be64(sg_dma_address(scat)); | 698 | buf->va = cpu_to_be64(sg_dma_address(scat)); |
684 | buf->key = cpu_to_be32(target->srp_host->dev->mr->rkey); | 699 | buf->key = cpu_to_be32(target->srp_host->dev->mr->rkey); |
685 | buf->len = cpu_to_be32(sg_dma_len(scat)); | 700 | buf->len = cpu_to_be32(sg_dma_len(scat)); |
686 | } else if (srp_map_fmr(target->srp_host->dev, scat, count, req, | 701 | } else if (srp_map_fmr(target, scat, count, req, |
687 | (void *) cmd->add_data)) { | 702 | (void *) cmd->add_data)) { |
688 | /* | 703 | /* |
689 | * FMR mapping failed, and the scatterlist has more | 704 | * FMR mapping failed, and the scatterlist has more |