From owner-svn-src-all@freebsd.org Fri Nov 20 08:54:20 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DD9CA32A70; Fri, 20 Nov 2015 08:54: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 mx1.freebsd.org (Postfix) with ESMTPS id 2DE79186C; Fri, 20 Nov 2015 08:54:20 +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 tAK8sJdW000224; Fri, 20 Nov 2015 08:54:19 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAK8sJlL000223; Fri, 20 Nov 2015 08:54:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201511200854.tAK8sJlL000223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 20 Nov 2015 08:54:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291092 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Nov 2015 08:54:20 -0000 Author: mav Date: Fri Nov 20 08:54:19 2015 New Revision: 291092 URL: https://svnweb.freebsd.org/changeset/base/291092 Log: Optimize SNS_GID_FT request scratch memory usage. Now with present 4K of scratch we can fetch up to 508 ports (16 more). Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Fri Nov 20 08:45:59 2015 (r291091) +++ head/sys/dev/isp/isp.c Fri Nov 20 08:54:19 2015 (r291092) @@ -3193,16 +3193,16 @@ abort: */ /* - * Take less than half of our scratch area to store Port IDs + * Take half of our scratch area to store Port IDs */ -#define GIDLEN ((ISP_FC_SCRLEN >> 1) - 16 - SNS_GID_FT_REQ_SIZE) +#define GIDLEN (ISP_FC_SCRLEN >> 1) #define NGENT ((GIDLEN - 16) >> 2) -#define IGPOFF (2 * QENTRY_LEN) +#define IGPOFF (0) #define OGPOFF (ISP_FC_SCRLEN >> 1) -#define ZTXOFF (ISP_FC_SCRLEN - (1 * QENTRY_LEN)) -#define CTXOFF (ISP_FC_SCRLEN - (2 * QENTRY_LEN)) -#define XTXOFF (ISP_FC_SCRLEN - (3 * QENTRY_LEN)) +#define XTXOFF (ISP_FC_SCRLEN - (3 * QENTRY_LEN)) /* CT request */ +#define CTXOFF (ISP_FC_SCRLEN - (2 * QENTRY_LEN)) /* Request IOCB */ +#define ZTXOFF (ISP_FC_SCRLEN - (1 * QENTRY_LEN)) /* Response IOCB */ static int isp_gid_ft_sns(ispsoftc_t *isp, int chan) @@ -3213,6 +3213,7 @@ isp_gid_ft_sns(ispsoftc_t *isp, int chan } un; fcparam *fcp = FCPARAM(isp, chan); sns_gid_ft_req_t *rq = &un._x; + uint8_t *scp = fcp->isp_scratch; mbreg_t mbs; isp_prt(isp, ISP_LOGDEBUG0, "Chan %d scanning fabric (GID_FT) via SNS", chan); @@ -3228,16 +3229,16 @@ isp_gid_ft_sns(ispsoftc_t *isp, int chan rq->snscb_mword_div_2 = NGENT; rq->snscb_fc4_type = FC4_SCSI; - isp_put_gid_ft_request(isp, rq, fcp->isp_scratch); + isp_put_gid_ft_request(isp, rq, (sns_gid_ft_req_t *)&scp[CTXOFF]); MEMORYBARRIER(isp, SYNC_SFORDEV, 0, SNS_GID_FT_REQ_SIZE, chan); MBSINIT(&mbs, MBOX_SEND_SNS, MBLOGALL, 10000000); mbs.param[0] = MBOX_SEND_SNS; mbs.param[1] = SNS_GID_FT_REQ_SIZE >> 1; - mbs.param[2] = DMA_WD1(fcp->isp_scdma); - mbs.param[3] = DMA_WD0(fcp->isp_scdma); - mbs.param[6] = DMA_WD3(fcp->isp_scdma); - mbs.param[7] = DMA_WD2(fcp->isp_scdma); + mbs.param[2] = DMA_WD1(fcp->isp_scdma + CTXOFF); + mbs.param[3] = DMA_WD0(fcp->isp_scdma + CTXOFF); + mbs.param[6] = DMA_WD3(fcp->isp_scdma + CTXOFF); + mbs.param[7] = DMA_WD2(fcp->isp_scdma + CTXOFF); isp_mboxcmd(isp, &mbs); if (mbs.param[0] != MBOX_COMMAND_COMPLETE) { if (mbs.param[0] == MBOX_INVALID_COMMAND) { @@ -3337,9 +3338,9 @@ isp_gid_ft_ct_passthru(ispsoftc_t *isp, chan, pt->ctp_status); return (-1); } - MEMORYBARRIER(isp, SYNC_SFORCPU, IGPOFF, GIDLEN + 16, chan); + MEMORYBARRIER(isp, SYNC_SFORCPU, IGPOFF, GIDLEN, chan); if (isp->isp_dblev & ISP_LOGDEBUG1) { - isp_print_bytes(isp, "CT response", GIDLEN+16, &scp[IGPOFF]); + isp_print_bytes(isp, "CT response", GIDLEN, &scp[IGPOFF]); } return (0); }