From owner-svn-src-all@freebsd.org Thu Aug 18 11:37:39 2016 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 55A66BBECB4; Thu, 18 Aug 2016 11:37:39 +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 1B3CE1A83; Thu, 18 Aug 2016 11:37:39 +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 u7IBbcLp046921; Thu, 18 Aug 2016 11:37:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IBbcku046919; Thu, 18 Aug 2016 11:37:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181137.u7IBbcku046919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 11:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304416 - stable/10/sys/dev/isp X-SVN-Group: stable-10 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.22 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: Thu, 18 Aug 2016 11:37:39 -0000 Author: mav Date: Thu Aug 18 11:37:38 2016 New Revision: 304416 URL: https://svnweb.freebsd.org/changeset/base/304416 Log: MFC r300222: Fix delaying requests to unknown virtual ports 2s after init. This code was originally implemented 7 years ago, but never really worked due to trivial error. I think this functionality may be not required. Initiators supporting optional periodic command status checks detected those terminated commands and retried them 3 seconds later. But thinking about less featured initiators and the fact that it is our race makes virtual ports "unknown" it may be good to have this feature. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Thu Aug 18 11:23:02 2016 (r304415) +++ stable/10/sys/dev/isp/isp.c Thu Aug 18 11:37:38 2016 (r304416) @@ -2431,6 +2431,7 @@ isp_fc_enable_vp(ispsoftc_t *isp, int ch __func__, chan, vp.vp_mod_hdr.rqs_flags, vp.vp_mod_status); return (EIO); } + GET_NANOTIME(&isp->isp_init_time); return (0); } @@ -5865,6 +5866,7 @@ isp_parse_async_fc(ispsoftc_t *isp, uint * These are broadcast events that have to be sent across * all active channels. */ + GET_NANOTIME(&isp->isp_init_time); for (chan = 0; chan < isp->isp_nchan; chan++) { fcp = FCPARAM(isp, chan); int topo = fcp->isp_topo; @@ -5921,6 +5923,7 @@ isp_parse_async_fc(ispsoftc_t *isp, uint * This is a broadcast event that has to be sent across * all active channels. */ + GET_NANOTIME(&isp->isp_init_time); for (chan = 0; chan < isp->isp_nchan; chan++) { fcp = FCPARAM(isp, chan); if (fcp->role == ISP_ROLE_NONE) @@ -5964,6 +5967,7 @@ isp_parse_async_fc(ispsoftc_t *isp, uint * This is a broadcast event that has to be sent across * all active channels. */ + GET_NANOTIME(&isp->isp_init_time); for (chan = 0; chan < isp->isp_nchan; chan++) { fcp = FCPARAM(isp, chan); if (fcp->role == ISP_ROLE_NONE) @@ -6162,6 +6166,7 @@ isp_handle_other_response(ispsoftc_t *is portid = (uint32_t)rid.ridacq_vp_port_hi << 16 | rid.ridacq_vp_port_lo; if (rid.ridacq_format == 0) { + GET_NANOTIME(&isp->isp_init_time); for (chan = 0; chan < isp->isp_nchan; chan++) { fcparam *fcp = FCPARAM(isp, chan); if (fcp->role == ISP_ROLE_NONE) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Thu Aug 18 11:23:02 2016 (r304415) +++ stable/10/sys/dev/isp/isp_freebsd.c Thu Aug 18 11:37:38 2016 (r304416) @@ -2055,7 +2055,7 @@ isp_handle_platform_atio7(ispsoftc_t *is * It's a bit tricky here as we need to stash this command *somewhere*. */ GET_NANOTIME(&now); - if (NANOTIME_SUB(&isp->isp_init_time, &now) > 2000000000ULL) { + if (NANOTIME_SUB(&now, &isp->isp_init_time) > 2000000000ULL) { isp_prt(isp, ISP_LOGWARN, "%s: [RX_ID 0x%x] D_ID %x not found on any channel- dropping", __func__, aep->at_rxid, did); isp_endcmd(isp, aep, NIL_HANDLE, ISP_NOCHAN, ECMD_TERMINATE, 0); return;