From owner-svn-src-stable-11@freebsd.org Thu Feb 1 19:13:20 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54B85EE66CA; Thu, 1 Feb 2018 19:13:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 045CB7EDB9; Thu, 1 Feb 2018 19:13:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9F9211284; Thu, 1 Feb 2018 19:13:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w11JDJkL013561; Thu, 1 Feb 2018 19:13:19 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w11JDJ6H013560; Thu, 1 Feb 2018 19:13:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201802011913.w11JDJ6H013560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 1 Feb 2018 19:13:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r328704 - stable/11/sys/cam/nvme X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cam/nvme X-SVN-Commit-Revision: 328704 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Feb 2018 19:13:20 -0000 Author: mav Date: Thu Feb 1 19:13:19 2018 New Revision: 328704 URL: https://svnweb.freebsd.org/changeset/base/328704 Log: MFC r324632 (by imp): Be nicer on the dump stack by allocating only a ccb_nvmeio rather than a full ccb. This saves a few hundre bytes, which might be important during a crash dump... Modified: stable/11/sys/cam/nvme/nvme_da.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/nvme/nvme_da.c ============================================================================== --- stable/11/sys/cam/nvme/nvme_da.c Thu Feb 1 19:07:21 2018 (r328703) +++ stable/11/sys/cam/nvme/nvme_da.c Thu Feb 1 19:13:19 2018 (r328704) @@ -379,7 +379,7 @@ ndadump(void *arg, void *virtual, vm_offset_t physical struct cam_periph *periph; struct nda_softc *softc; u_int secsize; - union ccb ccb; + struct ccb_nvmeio nvmeio; struct disk *dp; uint64_t lba; uint32_t count; @@ -401,15 +401,15 @@ ndadump(void *arg, void *virtual, vm_offset_t physical /* xpt_get_ccb returns a zero'd allocation for the ccb, mimic that here */ memset(&nvmeio, 0, sizeof(nvmeio)); if (length > 0) { - xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - ccb.ccb_h.ccb_state = NDA_CCB_DUMP; - nda_nvme_write(softc, &ccb.nvmeio, virtual, lba, length, count); - xpt_polled_action(&ccb); + xpt_setup_ccb(&nvmeio.ccb_h, periph->path, CAM_PRIORITY_NORMAL); + nvmeio.ccb_h.ccb_state = NDA_CCB_DUMP; + nda_nvme_write(softc, &nvmeio, virtual, lba, length, count); + xpt_polled_action((union ccb *)&nvmeio); - error = cam_periph_error(&ccb, + error = cam_periph_error((union ccb *)&nvmeio, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); - if ((ccb.ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb.ccb_h.path, /*relsim_flags*/0, + if ((nvmeio.ccb_h.status & CAM_DEV_QFRZN) != 0) + cam_release_devq(nvmeio.ccb_h.path, /*relsim_flags*/0, /*reduction*/0, /*timeout*/0, /*getcount_only*/0); if (error != 0) printf("Aborting dump due to I/O error.\n"); @@ -419,16 +419,16 @@ ndadump(void *arg, void *virtual, vm_offset_t physical } /* Flush */ - xpt_setup_ccb(&ccb.ccb_h, periph->path, CAM_PRIORITY_NORMAL); + xpt_setup_ccb(&nvmeio.ccb_h, periph->path, CAM_PRIORITY_NORMAL); - ccb.ccb_h.ccb_state = NDA_CCB_DUMP; - nda_nvme_flush(softc, &ccb.nvmeio); - xpt_polled_action(&ccb); + nvmeio.ccb_h.ccb_state = NDA_CCB_DUMP; + nda_nvme_flush(softc, &nvmeio); + xpt_polled_action((union ccb *)&nvmeio); - error = cam_periph_error(&ccb, + error = cam_periph_error((union ccb *)&nvmeio, 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); - if ((ccb.ccb_h.status & CAM_DEV_QFRZN) != 0) - cam_release_devq(ccb.ccb_h.path, /*relsim_flags*/0, + if ((nvmeio.ccb_h.status & CAM_DEV_QFRZN) != 0) + cam_release_devq(nvmeio.ccb_h.path, /*relsim_flags*/0, /*reduction*/0, /*timeout*/0, /*getcount_only*/0); if (error != 0) xpt_print(periph->path, "flush cmd failed\n");