From nobody Fri Dec 17 10:03:50 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 8152518F7903; Fri, 17 Dec 2021 10:03:52 +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 4JFl1g4yFkz3shT; Fri, 17 Dec 2021 10:03:51 +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 035B119F1E; Fri, 17 Dec 2021 10:03:51 +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 1BHA3ovY051989; Fri, 17 Dec 2021 10:03:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BHA3oQ1051988; Fri, 17 Dec 2021 10:03:50 GMT (envelope-from git) Date: Fri, 17 Dec 2021 10:03:50 GMT Message-Id: <202112171003.1BHA3oQ1051988@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: fefb98000ee0 - stable/12 - 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/12 X-Git-Reftype: branch X-Git-Commit: fefb98000ee05615900cb0fa0ac0e16bfba630ee Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1639735432; 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=rJKecINIqIBHBPkolHPyODdGYPA+ycKDBWXAMOnCG70=; b=SqXHr4oZoX88lr5qjPcUIGVzy4HXk4GzRV7g3v1IQYUFFD4FdftRtzGG9i3zkF32mQWChp 6tqUouCUHDJ/yMhgMWGkUUEth0w2msIDPm1K8Md1ifjU9sOHPkikjKUAAe6zRWHt8C/kIj 8uGpww4u5+zBHDGG1Ki7hQL5EnP9V1P4Ybmm7MHd4CKQpJC2KmgQVbyiNIg8jWSY914AFW AoLg0Yq1By5nbC+Lw1o9PmYTSs4eS8XSJdAEZEh7lJh5u5vaS6IucFZIljG3I+BaQZtOYM tlgLgPoHAbfARhd+8cjguGFQUZeL9x9ks2P2J2xLuF1OhACtZ112vG5fi8isIA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1639735432; a=rsa-sha256; cv=none; b=v8WIEMDC1j6giu1lcnghFTNSK8+8fodmfP5+/+bNxeppDQGrWVRjG5LnW9hrSlqBowLIW9 hTjJsoUjoM8QNV1FOr1atP6ubLGM0FTL/yNlHY/8p35mQakYVCdARkDKwPG2wjvJHpay9D UOQ774e8m5EwFTyVdOqapCHbMwGQhU2U405o8zLjLBUKrmh6iuwTWbDNlFtuQWg5UyBNcK QndwFMs7NLAoBZQsJWmP+MdFuITRyX0F4OuYZUuXm2F1WM/bZyxI5im43Z1HgQY5H+klqE xjsTG/UzOVuQqFS0LvK4Y/b2LJSg65FV8dfq7ZnGcvEGC1UlVaeSw4a/ZXOFsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by ram: URL: https://cgit.FreeBSD.org/src/commit/?id=fefb98000ee05615900cb0fa0ac0e16bfba630ee commit fefb98000ee05615900cb0fa0ac0e16bfba630ee Author: Ram Kishore Vegesna AuthorDate: 2021-09-24 09:05:03 +0000 Commit: Ram Kishore Vegesna CommitDate: 2021-12-17 09:57:49 +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 9f7b44dc2128..5f0d282477c9 100644 --- a/sys/dev/ocs_fc/ocs_cam.c +++ b/sys/dev/ocs_fc/ocs_cam.c @@ -1701,7 +1701,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; @@ -1709,7 +1709,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, @@ -1783,7 +1785,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 = NULL; @@ -1830,8 +1832,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__); @@ -2070,7 +2073,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 337737aeb944..906b8432bb36 100644 --- a/sys/dev/ocs_fc/ocs_device.h +++ b/sys/dev/ocs_fc/ocs_device.h @@ -56,7 +56,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