From 679f7487db7c837b19e98d2d9e4f4d6d18f70377 Mon Sep 17 00:00:00 2001 From: Yan Burman Date: Sun, 16 Nov 2014 13:22:58 +0000 Subject: [PATCH] isert: Add support for rdma_cm private data as required by Annex A12 of the IB spec Signed-off-by: Yan Burman git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5860 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/isert-scst/iser_hdr.h | 8 ++++++++ iscsi-scst/kernel/isert-scst/iser_rdma.c | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/iscsi-scst/kernel/isert-scst/iser_hdr.h b/iscsi-scst/kernel/isert-scst/iser_hdr.h index bcaf64905..faef0e1f5 100644 --- a/iscsi-scst/kernel/isert-scst/iser_hdr.h +++ b/iscsi-scst/kernel/isert-scst/iser_hdr.h @@ -23,5 +23,13 @@ struct isert_hdr { #define ISER_HDRS_SZ (sizeof(struct isert_hdr) + sizeof(struct iscsi_hdr)) +#define ISER_ZBVA_NOT_SUPPORTED 0x80 +#define ISER_SEND_W_INV_NOT_SUPPORTED 0x40 + +struct isert_cm_hdr { + u8 flags; + u8 rsvd[3]; +} __packed; + #endif diff --git a/iscsi-scst/kernel/isert-scst/iser_rdma.c b/iscsi-scst/kernel/isert-scst/iser_rdma.c index acf693705..1d39b8f7a 100644 --- a/iscsi-scst/kernel/isert-scst/iser_rdma.c +++ b/iscsi-scst/kernel/isert-scst/iser_rdma.c @@ -1187,6 +1187,7 @@ static int isert_cm_conn_req_handler(struct rdma_cm_id *cm_id, struct isert_connection *isert_conn; struct rdma_conn_param *ini_conn_param; struct rdma_conn_param tgt_conn_param; + struct isert_cm_hdr cm_hdr = { 0 }; int err; TRACE_ENTRY(); @@ -1235,6 +1236,10 @@ static int isert_cm_conn_req_handler(struct rdma_cm_id *cm_id, if (tgt_conn_param.initiator_depth > ini_conn_param->initiator_depth) tgt_conn_param.initiator_depth = ini_conn_param->initiator_depth; + tgt_conn_param.private_data_len = sizeof(cm_hdr); + tgt_conn_param.private_data = &cm_hdr; + cm_hdr.flags = ISER_ZBVA_NOT_SUPPORTED | ISER_SEND_W_INV_NOT_SUPPORTED; + err = rdma_accept(cm_id, &tgt_conn_param); if (unlikely(err)) { pr_err("Failed to accept conn request, err:%d\n", err);