From owner-svn-src-head@freebsd.org Fri Sep 25 09:55:52 2015 Return-Path: Delivered-To: svn-src-head@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 9242EA08F6E; Fri, 25 Sep 2015 09:55:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 830F21447; Fri, 25 Sep 2015 09:55:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8P9tqVx059987; Fri, 25 Sep 2015 09:55:52 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8P9tqNG059986; Fri, 25 Sep 2015 09:55:52 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201509250955.t8P9tqNG059986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 25 Sep 2015 09:55:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r288214 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Sep 2015 09:55:52 -0000 Author: mav Date: Fri Sep 25 09:55:51 2015 New Revision: 288214 URL: https://svnweb.freebsd.org/changeset/base/288214 Log: Collect DMA statistics on secondary HA node. Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Fri Sep 25 09:14:29 2015 (r288213) +++ head/sys/cam/ctl/ctl.c Fri Sep 25 09:55:51 2015 (r288214) @@ -1365,6 +1365,9 @@ ctl_isc_event_handler(ctl_ha_channel cha io->io_hdr.status = msg->hdr.status; if (msg->dt.sg_sequence == 0) { +#ifdef CTL_TIME_IO + getbintime(&io->io_hdr.dma_start_bt); +#endif i = msg->dt.kern_sg_entries + msg->dt.kern_data_len / CTL_HA_DATAMOVE_SEGMENT + 1; @@ -12622,9 +12625,11 @@ static void ctl_send_datamove_done(union ctl_io *io, int have_lock) { union ctl_ha_msg msg; +#ifdef CTL_TIME_IO + struct bintime cur_bt; +#endif memset(&msg, 0, sizeof(msg)); - msg.hdr.msg_type = CTL_MSG_DATAMOVE_DONE; msg.hdr.original_sc = io; msg.hdr.serializing_sc = io->io_hdr.serializing_sc; @@ -12640,15 +12645,20 @@ ctl_send_datamove_done(union ctl_io *io, msg.scsi.fetd_status = io->io_hdr.port_status; msg.scsi.residual = io->scsiio.residual; io->io_hdr.flags &= ~CTL_FLAG_IO_ACTIVE; - if (io->io_hdr.flags & CTL_FLAG_FAILOVER) { ctl_failover_io(io, /*have_lock*/ have_lock); return; } - ctl_ha_msg_send(CTL_HA_CHAN_CTL, &msg, sizeof(msg.scsi) - sizeof(msg.scsi.sense_data) + msg.scsi.sense_len, M_WAITOK); + +#ifdef CTL_TIME_IO + getbintime(&cur_bt); + bintime_sub(&cur_bt, &io->io_hdr.dma_start_bt); + bintime_add(&io->io_hdr.dma_bt, &cur_bt); + io->io_hdr.num_dmas++; +#endif } /*