]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
iscsi: Handle large Text responses.
authorJohn Baldwin <jhb@FreeBSD.org>
Wed, 29 Dec 2021 22:36:04 +0000 (14:36 -0800)
committerJohn Baldwin <jhb@FreeBSD.org>
Fri, 29 Apr 2022 21:17:43 +0000 (14:17 -0700)
commit1d290d36d82fbc937c153c533fa6151a0f836f13
treee35e70a725717df7d68688e44dacea8b883e6d18
parent06a67a1f05a7f52fbae21acd03d0a39147fb1d71
iscsi: Handle large Text responses.

Text requests and responses can span multiple PDUs.  In that case, the
sender sets the Continue bit in non-final PDUs and the Final bit in
the last PDU.  The receiver responds to non-final PDUs with an empty
text PDU.

To support this, add a more abstract API in libiscsi which accepts and
receives key sets rather than PDUs.  These routines internally send or
receive one or more PDUs.  Use these new functions to replace the
handling of TextRequest and TextResponse PDUs in discovery sessions in
both ctld and iscsid.

Note that there is not currently a use case for large Text requests
and those are still always sent as a single PDU.  However, discovery
sessions can return a text response listing targets that spans
multiple PDUs, so the new API supports sending and receiving multi-PDU
responses.

Reported by: Jithesh Arakkan @ Chelsio
Reviewed by: mav
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D33548

(cherry picked from commit b406897911ea6c18c401907a076c4642dac46127)
lib/libiscsiutil/Makefile
lib/libiscsiutil/libiscsiutil.h
lib/libiscsiutil/text.c [new file with mode: 0644]
usr.sbin/ctld/discovery.c
usr.sbin/iscsid/discovery.c