lib/iscsi: Get connection ID closer to location to use for login
cid had been got in iscsi_op_login_rsp_init() but it was not intuitive. Get cid in iscsi_op_login() and pass it simply to iscsi_op_login_phase_none(). Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com> Change-Id: Ief7b865784aa72f7872b6e4a98809dbab49807de Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471471 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Ziye Yang <ziye.yang@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
parent
7015e6b5d5
commit
19687a5525
@ -1786,8 +1786,7 @@ iscsi_op_login_phase_none(struct spdk_iscsi_conn *conn,
|
||||
*/
|
||||
static int
|
||||
iscsi_op_login_rsp_init(struct spdk_iscsi_conn *conn,
|
||||
struct spdk_iscsi_pdu *pdu, struct spdk_iscsi_pdu *rsp_pdu,
|
||||
int *cid)
|
||||
struct spdk_iscsi_pdu *pdu, struct spdk_iscsi_pdu *rsp_pdu)
|
||||
{
|
||||
struct iscsi_bhs_login_req *reqh;
|
||||
struct iscsi_bhs_login_rsp *rsph;
|
||||
@ -1828,7 +1827,6 @@ iscsi_op_login_rsp_init(struct spdk_iscsi_conn *conn,
|
||||
rsph->tsih = reqh->tsih;
|
||||
rsph->itt = reqh->itt;
|
||||
rsp_pdu->cmd_sn = from_be32(&reqh->cmd_sn);
|
||||
*cid = from_be16(&reqh->cid);
|
||||
|
||||
if (rsph->tsih) {
|
||||
rsph->stat_sn = reqh->exp_stat_sn;
|
||||
@ -2174,6 +2172,7 @@ iscsi_op_login(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
|
||||
|
||||
reqh = (struct iscsi_bhs_login_req *)&pdu->bhs;
|
||||
pdu->cmd_sn = from_be32(&reqh->cmd_sn);
|
||||
cid = from_be16(&reqh->cid);
|
||||
|
||||
/* During login processing, use the 8KB default FirstBurstLength as
|
||||
* our maximum data segment length value.
|
||||
@ -2186,7 +2185,7 @@ iscsi_op_login(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
|
||||
if (rsp_pdu == NULL) {
|
||||
return SPDK_ISCSI_CONNECTION_FATAL;
|
||||
}
|
||||
rc = iscsi_op_login_rsp_init(conn, pdu, rsp_pdu, &cid);
|
||||
rc = iscsi_op_login_rsp_init(conn, pdu, rsp_pdu);
|
||||
if (rc < 0) {
|
||||
iscsi_op_login_response(conn, rsp_pdu, NULL);
|
||||
return rc;
|
||||
|
Loading…
Reference in New Issue
Block a user