Date: Tue, 15 Jul 2014 17:07:07 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r268684 - in stable/10: sys/cam/ctl usr.sbin/ctld Message-ID: <201407151707.s6FH77hh084113@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Tue Jul 15 17:07:07 2014 New Revision: 268684 URL: http://svnweb.freebsd.org/changeset/base/268684 Log: MFC r268302: Pass through iSCSI session ISID from LOGIN request to the CTL frontend. ISID is an important part of initiator transport ID for iSCSI. It is not used now, but should be to properly implement persistent reservation. Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.h stable/10/sys/cam/ctl/ctl_ioctl.h stable/10/usr.sbin/ctld/ctld.h stable/10/usr.sbin/ctld/kernel.c stable/10/usr.sbin/ctld/login.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 17:06:10 2014 (r268683) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Tue Jul 15 17:07:07 2014 (r268684) @@ -1511,6 +1511,13 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * cihp->initiator_addr, sizeof(cs->cs_initiator_addr)); strlcpy(cs->cs_initiator_alias, cihp->initiator_alias, sizeof(cs->cs_initiator_alias)); + memcpy(cs->cs_initiator_isid, + cihp->initiator_isid, sizeof(cs->cs_initiator_isid)); + snprintf(cs->cs_initiator_id, sizeof(cs->cs_initiator_id), + "%s,i,0x%02x%02x%02x%02x%02x%02x", cs->cs_initiator_name, + cihp->initiator_isid[0], cihp->initiator_isid[1], + cihp->initiator_isid[2], cihp->initiator_isid[3], + cihp->initiator_isid[4], cihp->initiator_isid[5]); #ifdef ICL_KERNEL_PROXY if (cihp->socket > 0) { Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Tue Jul 15 17:06:10 2014 (r268683) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Tue Jul 15 17:07:07 2014 (r268684) @@ -86,6 +86,8 @@ struct cfiscsi_session { char cs_initiator_name[CTL_ISCSI_NAME_LEN]; char cs_initiator_addr[CTL_ISCSI_ADDR_LEN]; char cs_initiator_alias[CTL_ISCSI_ALIAS_LEN]; + char cs_initiator_isid[6]; + char cs_initiator_id[CTL_ISCSI_NAME_LEN + 5 + 6 + 1]; unsigned int cs_id; int cs_ctl_initid; #ifdef ICL_KERNEL_PROXY Modified: stable/10/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_ioctl.h Tue Jul 15 17:06:10 2014 (r268683) +++ stable/10/sys/cam/ctl/ctl_ioctl.h Tue Jul 15 17:07:07 2014 (r268684) @@ -681,6 +681,7 @@ struct ctl_iscsi_handoff_params { char initiator_name[CTL_ISCSI_NAME_LEN]; char initiator_addr[CTL_ISCSI_ADDR_LEN]; char initiator_alias[CTL_ISCSI_ALIAS_LEN]; + uint8_t initiator_isid[6]; char target_name[CTL_ISCSI_NAME_LEN]; int socket; int portal_group_tag; Modified: stable/10/usr.sbin/ctld/ctld.h ============================================================================== --- stable/10/usr.sbin/ctld/ctld.h Tue Jul 15 17:06:10 2014 (r268683) +++ stable/10/usr.sbin/ctld/ctld.h Tue Jul 15 17:07:07 2014 (r268684) @@ -178,6 +178,7 @@ struct connection { char *conn_initiator_name; char *conn_initiator_addr; char *conn_initiator_alias; + uint8_t conn_initiator_isid[6]; uint32_t conn_cmdsn; uint32_t conn_statsn; size_t conn_max_data_segment_length; Modified: stable/10/usr.sbin/ctld/kernel.c ============================================================================== --- stable/10/usr.sbin/ctld/kernel.c Tue Jul 15 17:06:10 2014 (r268683) +++ stable/10/usr.sbin/ctld/kernel.c Tue Jul 15 17:07:07 2014 (r268684) @@ -787,6 +787,8 @@ kernel_handoff(struct connection *conn) strlcpy(req.data.handoff.initiator_alias, conn->conn_initiator_alias, sizeof(req.data.handoff.initiator_alias)); } + memcpy(req.data.handoff.initiator_isid, conn->conn_initiator_isid, + sizeof(req.data.handoff.initiator_isid)); strlcpy(req.data.handoff.target_name, conn->conn_target->t_name, sizeof(req.data.handoff.target_name)); #ifdef ICL_KERNEL_PROXY Modified: stable/10/usr.sbin/ctld/login.c ============================================================================== --- stable/10/usr.sbin/ctld/login.c Tue Jul 15 17:06:10 2014 (r268683) +++ stable/10/usr.sbin/ctld/login.c Tue Jul 15 17:07:07 2014 (r268684) @@ -850,6 +850,9 @@ login(struct connection *conn) log_errx(1, "received Login PDU with non-zero TSIH"); } + memcpy(conn->conn_initiator_isid, bhslr->bhslr_isid, + sizeof(conn->conn_initiator_isid)); + /* * XXX: Implement the C flag some day. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407151707.s6FH77hh084113>