fujita.tomonori at lab.ntt.co.jp wrote on Thu, 15 Nov 2007 11:24 +0900: > On Tue, 16 Oct 2007 11:21:24 -0400 > Pete Wyckoff <pw at osc.edu> wrote: > > diff --git a/usr/iscsi/target.c b/usr/iscsi/target.c > > index ab0685f..d7c1d57 100644 > > --- a/usr/iscsi/target.c > > +++ b/usr/iscsi/target.c > > @@ -283,6 +283,14 @@ int iscsi_target_create(struct target *t) > > [ISCSI_PARAM_OFMARKINT] = {0, 2048}, > > [ISCSI_PARAM_IFMARKINT] = {0, 2048}, > > [ISCSI_PARAM_MAXCONNECTIONS] = {0, 1}, > > +#ifdef ISCSI_RDMA > > + [ISCSI_PARAM_RDMA_EXTENSIONS] = {0, 1}, > > +#else > > + [ISCSI_PARAM_RDMA_EXTENSIONS] = {0, 0}, > > +#endif > > + [ISCSI_PARAM_TARGET_RDSL] = {0, 262144}, > > + [ISCSI_PARAM_INITIATOR_RDSL] = {0, 262144}, > > + [ISCSI_PARAM_MAX_OUTST_PDU] = {0, 0}, /* not in open-iscsi */ > > }; > > Can we avoid adding another #ifdef? > > I really like to remove the existing #ifdef. Yes, turns out this ifdef is no longer needed due to the chunk here: > > diff --git a/usr/iscsi/iscsid.c b/usr/iscsi/iscsid.c > > static void text_scan_login(struct iscsi_connection *conn) > > { [..] > > @@ -289,6 +289,9 @@ static void text_scan_login(struct iscsi_connection *conn) > > if (idx == ISCSI_PARAM_MAX_RECV_DLENGTH) > > idx = ISCSI_PARAM_MAX_XMIT_DLENGTH; > > > > + if (idx == ISCSI_PARAM_RDMA_EXTENSIONS) > > + is_rdma = 1; > > + > > if (param_str_to_val(session_keys, idx, value, &val) < 0) { > > if (conn->session_param[idx].state > > == KEY_STATE_START) { > > @@ -335,6 +338,15 @@ static void text_scan_login(struct iscsi_connection *conn) > > text_key_add(conn, key, "NotUnderstood"); > > } > > > > + if (is_rdma) { > > + /* do not try to do digests, not supported in iser */ > > + conn->session_param[ISCSI_PARAM_HDRDGST_EN].val = DIGEST_NONE; > > + conn->session_param[ISCSI_PARAM_DATADGST_EN].val = DIGEST_NONE; > > + } else { > > + /* do not offer RDMA, initiator must explicitly request */ > > + conn->session_param[ISCSI_PARAM_RDMA_EXTENSIONS].val = 0; > > + } > > + > > out: > > return; > > } Now patch is always "= { 0, 1 }". But the code in text_scan_login ensures that the target will never offer RDMAExtension unless it sees the initiator offer it first. This perhaps isn't exactly right, as the spec seems to allow the target to offer it during Operational Parameter Negotiation phase. But doing so would confuse initiators that do not recognize the key, so I think it wise to wait for the initiator to ask. -- Pete |