From nobody Fri Dec 17 10:37:11 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C80A818FF2D7; Fri, 17 Dec 2021 10:37:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JFlm76XSrz4WWc; Fri, 17 Dec 2021 10:37:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75E131A25D; Fri, 17 Dec 2021 10:37:11 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1BHAbB4K092497; Fri, 17 Dec 2021 10:37:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BHAbBa1092496; Fri, 17 Dec 2021 10:37:11 GMT (envelope-from git) Date: Fri, 17 Dec 2021 10:37:11 GMT Message-Id: <202112171037.1BHAbBa1092496@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ram Kishore Vegesna Subject: git: 661875cecbf6 - stable/13 - ocs_fc: Increase maximum supported SG elements to support larger transfer sizes. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ram X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 661875cecbf6ed5894123cbd7c0ff217bea13370 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639737432; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=b7+XcOiHzaRaoGJC2Uug1PQBqDucx2enKc0VhuVLv7c=; b=Wm+QghODoxxGIC5q7b3T/uVUi/H18U/71RizxYbm+9KTQlEA3EDySL5x7j9W0/wXUwrhYB bCzbQ+Ce3Oydlicebdd4zJ+JyMuuW8IA2drIVoYMfoeZ732Eb1JBwHICRihAyfXJD1ydhW gTnk1EbYtf5QGPl5ilHeU2wCUTe6SA7KTLj8P8ZTW8RWQWZH+cd6+rBaNjTJ3icYJgzaK7 ht9wa3QCMfZ9eM88ZDl/k9rr4DI6wKFx+BdT6wNl4fdIPajUBU5UtLUCGTyiAzq8WO91tw uNuQk2jidizHvaFxWcClcaKFHi7aLkWmtpWjuEmXNxljkJqsi1PcEv/2Jr/b6g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639737432; a=rsa-sha256; cv=none; b=iB1MrarBOyfsIaoR8CAU/yzKaCD5HDfaO5/qiDtAbxCkJ7dqL/wEUUT8Yfe37b9GFZEhcZ 1AOXF4EF3WoBSDaFatK1xBx0sZbgUmbK8c/yZpiCJSUyIucOjx1mhnry0SC08sLQKmLmR5 CPEcPVTOvzJb8mIVOBxZtc0uCX4y8lWarh6nxUGRk6cUjUpXmNvG9ww7yEebSwvuvjgtuJ 9shYwDNql7Ohw4V0aQr99j9hCOGjUfPR0aNKrjSwAO1Y6r1npKNhS/sOdOAeFqwOu4L3FO k3B6LYZpdF2zCYKlLP8FZsMzUeIDyT0jdw3yyIMeVAuBLIg2c2w1s6auLdzHhA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by ram: URL: https://cgit.FreeBSD.org/src/commit/?id=661875cecbf6ed5894123cbd7c0ff217bea13370 commit 661875cecbf6ed5894123cbd7c0ff217bea13370 Author: Ram Kishore Vegesna AuthorDate: 2021-09-24 09:05:03 +0000 Commit: Ram Kishore Vegesna CommitDate: 2021-12-17 10:31:05 +0000 ocs_fc: Increase maximum supported SG elements to support larger transfer sizes. Reported by: ken@kdm.org Reviewed by: mav, ken (cherry picked from commit 322dbb8ce8f63fd6f542309fd38324664ce8dd3f) --- sys/dev/ocs_fc/ocs_cam.c | 14 +++++++++----- sys/dev/ocs_fc/ocs_device.h | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/sys/dev/ocs_fc/ocs_cam.c b/sys/dev/ocs_fc/ocs_cam.c index d3c275920c4b..53b53d1b696d 100644 --- a/sys/dev/ocs_fc/ocs_cam.c +++ b/sys/dev/ocs_fc/ocs_cam.c @@ -1704,7 +1704,7 @@ ocs_target_io(struct ocs_softc *ocs, union ccb *ccb) rc = ocs_scsi_send_resp(io, 0, &resp, ocs_scsi_target_io_cb, ccb); } else if (xferlen != 0) { - ocs_scsi_sgl_t sgl[OCS_FC_MAX_SGL]; + ocs_scsi_sgl_t *sgl; int32_t sgl_count = 0; io->tgt_io.state = OCS_CAM_IO_DATA; @@ -1712,7 +1712,9 @@ ocs_target_io(struct ocs_softc *ocs, union ccb *ccb) if (sendstatus) io->tgt_io.sendresp = 1; - sgl_count = ocs_build_scsi_sgl(ocs, ccb, io, sgl, ARRAY_SIZE(sgl)); + sgl = io->sgl; + + sgl_count = ocs_build_scsi_sgl(ocs, ccb, io, sgl, io->sgl_allocated); if (sgl_count > 0) { if (cam_dir == CAM_DIR_IN) { rc = ocs_scsi_send_rd_data(io, 0, NULL, sgl, @@ -1785,7 +1787,7 @@ ocs_initiator_io(struct ocs_softc *ocs, union ccb *ccb) struct ccb_hdr *ccb_h = &csio->ccb_h; ocs_node_t *node = NULL; ocs_io_t *io = NULL; - ocs_scsi_sgl_t sgl[OCS_FC_MAX_SGL]; + ocs_scsi_sgl_t *sgl; int32_t flags, sgl_count; ocs_fcport *fcp; @@ -1828,8 +1830,9 @@ ocs_initiator_io(struct ocs_softc *ocs, union ccb *ccb) csio->ccb_h.ccb_ocs_ptr = ocs; csio->ccb_h.ccb_io_ptr = io; + sgl = io->sgl; - sgl_count = ocs_build_scsi_sgl(ocs, ccb, io, sgl, ARRAY_SIZE(sgl)); + sgl_count = ocs_build_scsi_sgl(ocs, ccb, io, sgl, io->sgl_allocated); if (sgl_count < 0) { ocs_scsi_io_free(io); device_printf(ocs->dev, "%s: building SGL failed\n", __func__); @@ -2068,7 +2071,8 @@ ocs_action(struct cam_sim *sim, union ccb *ccb) /* Calculate the max IO supported * Worst case would be an OS page per SGL entry */ - cpi->maxio = PAGE_SIZE * + + cpi->maxio = PAGE_SIZE * (ocs_scsi_get_property(ocs, OCS_SCSI_MAX_SGL) - 1); strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); diff --git a/sys/dev/ocs_fc/ocs_device.h b/sys/dev/ocs_fc/ocs_device.h index f4c5baae0c54..b6d3a5d4897f 100644 --- a/sys/dev/ocs_fc/ocs_device.h +++ b/sys/dev/ocs_fc/ocs_device.h @@ -55,7 +55,7 @@ * @brief Defines the number of SGLs allocated on each IO object */ #ifndef OCS_FC_MAX_SGL -#define OCS_FC_MAX_SGL 128 +#define OCS_FC_MAX_SGL 256 #endif /***************************************************************************