diff options
| -rw-r--r-- | drivers/infiniband/ulp/iser/iscsi_iser.c | 8 | ||||
| -rw-r--r-- | drivers/infiniband/ulp/iser/iscsi_iser.h | 3 | ||||
| -rw-r--r-- | drivers/infiniband/ulp/iser/iser_verbs.c | 13 |
3 files changed, 24 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c index dd03cfe596d6..cfa952e9ac90 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.c +++ b/drivers/infiniband/ulp/iser/iscsi_iser.c | |||
| @@ -82,6 +82,8 @@ static unsigned int iscsi_max_lun = 512; | |||
| 82 | module_param_named(max_lun, iscsi_max_lun, uint, S_IRUGO); | 82 | module_param_named(max_lun, iscsi_max_lun, uint, S_IRUGO); |
| 83 | 83 | ||
| 84 | int iser_debug_level = 0; | 84 | int iser_debug_level = 0; |
| 85 | bool iser_pi_enable = false; | ||
| 86 | int iser_pi_guard = 0; | ||
| 85 | 87 | ||
| 86 | MODULE_DESCRIPTION("iSER (iSCSI Extensions for RDMA) Datamover"); | 88 | MODULE_DESCRIPTION("iSER (iSCSI Extensions for RDMA) Datamover"); |
| 87 | MODULE_LICENSE("Dual BSD/GPL"); | 89 | MODULE_LICENSE("Dual BSD/GPL"); |
| @@ -91,6 +93,12 @@ MODULE_VERSION(DRV_VER); | |||
| 91 | module_param_named(debug_level, iser_debug_level, int, 0644); | 93 | module_param_named(debug_level, iser_debug_level, int, 0644); |
| 92 | MODULE_PARM_DESC(debug_level, "Enable debug tracing if > 0 (default:disabled)"); | 94 | MODULE_PARM_DESC(debug_level, "Enable debug tracing if > 0 (default:disabled)"); |
| 93 | 95 | ||
| 96 | module_param_named(pi_enable, iser_pi_enable, bool, 0644); | ||
| 97 | MODULE_PARM_DESC(pi_enable, "Enable T10-PI offload support (default:disabled)"); | ||
| 98 | |||
| 99 | module_param_named(pi_guard, iser_pi_guard, int, 0644); | ||
| 100 | MODULE_PARM_DESC(pi_guard, "T10-PI guard_type, 0:CRC|1:IP_CSUM (default:CRC)"); | ||
| 101 | |||
| 94 | struct iser_global ig; | 102 | struct iser_global ig; |
| 95 | 103 | ||
| 96 | void | 104 | void |
diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h index 623defa187b2..011003f04253 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.h +++ b/drivers/infiniband/ulp/iser/iscsi_iser.h | |||
| @@ -317,6 +317,7 @@ struct iser_conn { | |||
| 317 | unsigned int rx_desc_head; | 317 | unsigned int rx_desc_head; |
| 318 | struct iser_rx_desc *rx_descs; | 318 | struct iser_rx_desc *rx_descs; |
| 319 | struct ib_recv_wr rx_wr[ISER_MIN_POSTED_RX]; | 319 | struct ib_recv_wr rx_wr[ISER_MIN_POSTED_RX]; |
| 320 | bool pi_support; | ||
| 320 | 321 | ||
| 321 | /* Connection memory registration pool */ | 322 | /* Connection memory registration pool */ |
| 322 | union { | 323 | union { |
| @@ -371,6 +372,8 @@ struct iser_global { | |||
| 371 | 372 | ||
| 372 | extern struct iser_global ig; | 373 | extern struct iser_global ig; |
| 373 | extern int iser_debug_level; | 374 | extern int iser_debug_level; |
| 375 | extern bool iser_pi_enable; | ||
| 376 | extern int iser_pi_guard; | ||
| 374 | 377 | ||
| 375 | /* allocate connection resources needed for rdma functionality */ | 378 | /* allocate connection resources needed for rdma functionality */ |
| 376 | int iser_conn_set_full_featured_mode(struct iscsi_conn *conn); | 379 | int iser_conn_set_full_featured_mode(struct iscsi_conn *conn); |
diff --git a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c index 6a5f4245182a..4c27f553df39 100644 --- a/drivers/infiniband/ulp/iser/iser_verbs.c +++ b/drivers/infiniband/ulp/iser/iser_verbs.c | |||
| @@ -607,6 +607,19 @@ static int iser_addr_handler(struct rdma_cm_id *cma_id) | |||
| 607 | ib_conn = (struct iser_conn *)cma_id->context; | 607 | ib_conn = (struct iser_conn *)cma_id->context; |
| 608 | ib_conn->device = device; | 608 | ib_conn->device = device; |
| 609 | 609 | ||
| 610 | /* connection T10-PI support */ | ||
| 611 | if (iser_pi_enable) { | ||
| 612 | if (!(device->dev_attr.device_cap_flags & | ||
| 613 | IB_DEVICE_SIGNATURE_HANDOVER)) { | ||
| 614 | iser_warn("T10-PI requested but not supported on %s, " | ||
| 615 | "continue without T10-PI\n", | ||
| 616 | ib_conn->device->ib_device->name); | ||
| 617 | ib_conn->pi_support = false; | ||
| 618 | } else { | ||
| 619 | ib_conn->pi_support = true; | ||
| 620 | } | ||
| 621 | } | ||
| 622 | |||
| 610 | ret = rdma_resolve_route(cma_id, 1000); | 623 | ret = rdma_resolve_route(cma_id, 1000); |
| 611 | if (ret) { | 624 | if (ret) { |
| 612 | iser_err("resolve route failed: %d\n", ret); | 625 | iser_err("resolve route failed: %d\n", ret); |
