diff options
| author | Sagi Grimberg <sagig@mellanox.com> | 2014-12-02 09:57:35 -0500 |
|---|---|---|
| committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2014-12-13 02:32:26 -0500 |
| commit | 23a548ee656c8ba6da8cb2412070edcd62e2ac5d (patch) | |
| tree | 9aaedc8d899f08a2363293c420919b5bfae04076 /drivers/infiniband | |
| parent | 302cc7c3ca14d21ccdffdebdb61c4fe028f2d5ad (diff) | |
iscsi,iser-target: Expose supported protection ops according to t10_pi
iSER will report supported protection operations based on
the tpg attribute t10_pi settings and HCA PI offload capabilities.
If the HCA does not support PI offload or tpg attribute t10_pi is
not set, we fall to SW PI mode.
In order to do that, we move iscsit_get_sup_prot_ops after connection
tpg assignment.
Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
Cc: <stable@vger.kernel.org> # v3.14+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/infiniband')
| -rw-r--r-- | drivers/infiniband/ulp/isert/ib_isert.c | 14 | ||||
| -rw-r--r-- | drivers/infiniband/ulp/isert/ib_isert.h | 1 |
2 files changed, 12 insertions, 3 deletions
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index 618c81576b05..a6daabc70425 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c | |||
| @@ -64,7 +64,7 @@ struct rdma_cm_id *isert_setup_id(struct isert_np *isert_np); | |||
| 64 | static inline bool | 64 | static inline bool |
| 65 | isert_prot_cmd(struct isert_conn *conn, struct se_cmd *cmd) | 65 | isert_prot_cmd(struct isert_conn *conn, struct se_cmd *cmd) |
| 66 | { | 66 | { |
| 67 | return (conn->conn_device->pi_capable && | 67 | return (conn->pi_support && |
| 68 | cmd->prot_op != TARGET_PROT_NORMAL); | 68 | cmd->prot_op != TARGET_PROT_NORMAL); |
| 69 | } | 69 | } |
| 70 | 70 | ||
| @@ -2324,8 +2324,16 @@ isert_get_sup_prot_ops(struct iscsi_conn *conn) | |||
| 2324 | struct isert_conn *isert_conn = (struct isert_conn *)conn->context; | 2324 | struct isert_conn *isert_conn = (struct isert_conn *)conn->context; |
| 2325 | struct isert_device *device = isert_conn->conn_device; | 2325 | struct isert_device *device = isert_conn->conn_device; |
| 2326 | 2326 | ||
| 2327 | if (device->pi_capable) | 2327 | if (conn->tpg->tpg_attrib.t10_pi) { |
| 2328 | return TARGET_PROT_ALL; | 2328 | if (device->pi_capable) { |
| 2329 | pr_info("conn %p PI offload enabled\n", isert_conn); | ||
| 2330 | isert_conn->pi_support = true; | ||
| 2331 | return TARGET_PROT_ALL; | ||
| 2332 | } | ||
| 2333 | } | ||
| 2334 | |||
| 2335 | pr_info("conn %p PI offload disabled\n", isert_conn); | ||
| 2336 | isert_conn->pi_support = false; | ||
| 2329 | 2337 | ||
| 2330 | return TARGET_PROT_NORMAL; | 2338 | return TARGET_PROT_NORMAL; |
| 2331 | } | 2339 | } |
diff --git a/drivers/infiniband/ulp/isert/ib_isert.h b/drivers/infiniband/ulp/isert/ib_isert.h index 2e7868c5ad14..141905f446dd 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.h +++ b/drivers/infiniband/ulp/isert/ib_isert.h | |||
| @@ -128,6 +128,7 @@ struct isert_conn { | |||
| 128 | atomic_t post_send_buf_count; | 128 | atomic_t post_send_buf_count; |
| 129 | u32 responder_resources; | 129 | u32 responder_resources; |
| 130 | u32 initiator_depth; | 130 | u32 initiator_depth; |
| 131 | bool pi_support; | ||
| 131 | u32 max_sge; | 132 | u32 max_sge; |
| 132 | char *login_buf; | 133 | char *login_buf; |
| 133 | char *login_req_buf; | 134 | char *login_req_buf; |
