diff options
-rw-r--r-- | drivers/infiniband/ulp/isert/ib_isert.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index b0e58f196d90..618c81576b05 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c | |||
@@ -61,6 +61,14 @@ static int | |||
61 | isert_rdma_accept(struct isert_conn *isert_conn); | 61 | isert_rdma_accept(struct isert_conn *isert_conn); |
62 | struct rdma_cm_id *isert_setup_id(struct isert_np *isert_np); | 62 | struct rdma_cm_id *isert_setup_id(struct isert_np *isert_np); |
63 | 63 | ||
64 | static inline bool | ||
65 | isert_prot_cmd(struct isert_conn *conn, struct se_cmd *cmd) | ||
66 | { | ||
67 | return (conn->conn_device->pi_capable && | ||
68 | cmd->prot_op != TARGET_PROT_NORMAL); | ||
69 | } | ||
70 | |||
71 | |||
64 | static void | 72 | static void |
65 | isert_qp_event_callback(struct ib_event *e, void *context) | 73 | isert_qp_event_callback(struct ib_event *e, void *context) |
66 | { | 74 | { |
@@ -2919,8 +2927,7 @@ isert_reg_rdma(struct iscsi_conn *conn, struct iscsi_cmd *cmd, | |||
2919 | if (ret) | 2927 | if (ret) |
2920 | return ret; | 2928 | return ret; |
2921 | 2929 | ||
2922 | if (wr->data.dma_nents != 1 || | 2930 | if (wr->data.dma_nents != 1 || isert_prot_cmd(isert_conn, se_cmd)) { |
2923 | se_cmd->prot_op != TARGET_PROT_NORMAL) { | ||
2924 | spin_lock_irqsave(&isert_conn->conn_lock, flags); | 2931 | spin_lock_irqsave(&isert_conn->conn_lock, flags); |
2925 | fr_desc = list_first_entry(&isert_conn->conn_fr_pool, | 2932 | fr_desc = list_first_entry(&isert_conn->conn_fr_pool, |
2926 | struct fast_reg_descriptor, list); | 2933 | struct fast_reg_descriptor, list); |
@@ -2934,7 +2941,7 @@ isert_reg_rdma(struct iscsi_conn *conn, struct iscsi_cmd *cmd, | |||
2934 | if (ret) | 2941 | if (ret) |
2935 | goto unmap_cmd; | 2942 | goto unmap_cmd; |
2936 | 2943 | ||
2937 | if (se_cmd->prot_op != TARGET_PROT_NORMAL) { | 2944 | if (isert_prot_cmd(isert_conn, se_cmd)) { |
2938 | ret = isert_handle_prot_cmd(isert_conn, isert_cmd, wr); | 2945 | ret = isert_handle_prot_cmd(isert_conn, isert_cmd, wr); |
2939 | if (ret) | 2946 | if (ret) |
2940 | goto unmap_cmd; | 2947 | goto unmap_cmd; |
@@ -2959,7 +2966,7 @@ isert_reg_rdma(struct iscsi_conn *conn, struct iscsi_cmd *cmd, | |||
2959 | send_wr->opcode = IB_WR_RDMA_WRITE; | 2966 | send_wr->opcode = IB_WR_RDMA_WRITE; |
2960 | send_wr->wr.rdma.remote_addr = isert_cmd->read_va; | 2967 | send_wr->wr.rdma.remote_addr = isert_cmd->read_va; |
2961 | send_wr->wr.rdma.rkey = isert_cmd->read_stag; | 2968 | send_wr->wr.rdma.rkey = isert_cmd->read_stag; |
2962 | send_wr->send_flags = se_cmd->prot_op == TARGET_PROT_NORMAL ? | 2969 | send_wr->send_flags = !isert_prot_cmd(isert_conn, se_cmd) ? |
2963 | 0 : IB_SEND_SIGNALED; | 2970 | 0 : IB_SEND_SIGNALED; |
2964 | } else { | 2971 | } else { |
2965 | send_wr->opcode = IB_WR_RDMA_READ; | 2972 | send_wr->opcode = IB_WR_RDMA_READ; |
@@ -3001,7 +3008,7 @@ isert_put_datain(struct iscsi_conn *conn, struct iscsi_cmd *cmd) | |||
3001 | return rc; | 3008 | return rc; |
3002 | } | 3009 | } |
3003 | 3010 | ||
3004 | if (se_cmd->prot_op == TARGET_PROT_NORMAL) { | 3011 | if (!isert_prot_cmd(isert_conn, se_cmd)) { |
3005 | /* | 3012 | /* |
3006 | * Build isert_conn->tx_desc for iSCSI response PDU and attach | 3013 | * Build isert_conn->tx_desc for iSCSI response PDU and attach |
3007 | */ | 3014 | */ |
@@ -3024,7 +3031,7 @@ isert_put_datain(struct iscsi_conn *conn, struct iscsi_cmd *cmd) | |||
3024 | atomic_sub(wr->send_wr_num, &isert_conn->post_send_buf_count); | 3031 | atomic_sub(wr->send_wr_num, &isert_conn->post_send_buf_count); |
3025 | } | 3032 | } |
3026 | 3033 | ||
3027 | if (se_cmd->prot_op == TARGET_PROT_NORMAL) | 3034 | if (!isert_prot_cmd(isert_conn, se_cmd)) |
3028 | pr_debug("Cmd: %p posted RDMA_WRITE + Response for iSER Data " | 3035 | pr_debug("Cmd: %p posted RDMA_WRITE + Response for iSER Data " |
3029 | "READ\n", isert_cmd); | 3036 | "READ\n", isert_cmd); |
3030 | else | 3037 | else |