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>
This commit is contained in:
Sagi Grimberg
2014-12-02 16:57:35 +02:00
کامیت شده توسط Nicholas Bellinger
والد 302cc7c3ca
کامیت 23a548ee65
3فایلهای تغییر یافته به همراه16 افزوده شده و 6 حذف شده

مشاهده پرونده

@@ -64,7 +64,7 @@ struct rdma_cm_id *isert_setup_id(struct isert_np *isert_np);
static inline bool
isert_prot_cmd(struct isert_conn *conn, struct se_cmd *cmd)
{
return (conn->conn_device->pi_capable &&
return (conn->pi_support &&
cmd->prot_op != TARGET_PROT_NORMAL);
}
@@ -2324,8 +2324,16 @@ isert_get_sup_prot_ops(struct iscsi_conn *conn)
struct isert_conn *isert_conn = (struct isert_conn *)conn->context;
struct isert_device *device = isert_conn->conn_device;
if (device->pi_capable)
return TARGET_PROT_ALL;
if (conn->tpg->tpg_attrib.t10_pi) {
if (device->pi_capable) {
pr_info("conn %p PI offload enabled\n", isert_conn);
isert_conn->pi_support = true;
return TARGET_PROT_ALL;
}
}
pr_info("conn %p PI offload disabled\n", isert_conn);
isert_conn->pi_support = false;
return TARGET_PROT_NORMAL;
}

مشاهده پرونده

@@ -128,6 +128,7 @@ struct isert_conn {
atomic_t post_send_buf_count;
u32 responder_resources;
u32 initiator_depth;
bool pi_support;
u32 max_sge;
char *login_buf;
char *login_req_buf;