From owner-svn-src-stable@freebsd.org Sat Mar 2 03:17:24 2019 Return-Path: Delivered-To: svn-src-stable@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 A5E69150E1C5; Sat, 2 Mar 2019 03:17:24 +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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A98171D8A; Sat, 2 Mar 2019 03:17:24 +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 3E50F26904; Sat, 2 Mar 2019 03:17:24 +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 x223HOWJ058286; Sat, 2 Mar 2019 03:17:24 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x223HNOY058283; Sat, 2 Mar 2019 03:17:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201903020317.x223HNOY058283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 2 Mar 2019 03:17:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r344717 - stable/12/sys/cam/ctl X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cam/ctl X-SVN-Commit-Revision: 344717 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4A98171D8A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 02 Mar 2019 03:17:25 -0000 Author: mav Date: Sat Mar 2 03:17:23 2019 New Revision: 344717 URL: https://svnweb.freebsd.org/changeset/base/344717 Log: MFC r344480: Remove disabled CTL_LEGACY_STATS support. It was not only disabled for quite a while, but also appeared to be broken at r325517, when maximum number of ports was made configurable. Modified: stable/12/sys/cam/ctl/ctl.c stable/12/sys/cam/ctl/ctl_ioctl.h stable/12/sys/cam/ctl/ctl_private.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/ctl/ctl.c ============================================================================== --- stable/12/sys/cam/ctl/ctl.c Sat Mar 2 01:51:41 2019 (r344716) +++ stable/12/sys/cam/ctl/ctl.c Sat Mar 2 03:17:23 2019 (r344717) @@ -2743,39 +2743,6 @@ ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, #endif /* CTL_IO_DELAY */ break; } -#ifdef CTL_LEGACY_STATS - case CTL_GETSTATS: { - struct ctl_stats *stats = (struct ctl_stats *)addr; - int i; - - /* - * XXX KDM no locking here. If the LUN list changes, - * things can blow up. - */ - i = 0; - stats->status = CTL_SS_OK; - stats->fill_len = 0; - STAILQ_FOREACH(lun, &softc->lun_list, links) { - if (stats->fill_len + sizeof(lun->legacy_stats) > - stats->alloc_len) { - stats->status = CTL_SS_NEED_MORE_SPACE; - break; - } - retval = copyout(&lun->legacy_stats, &stats->lun_stats[i++], - sizeof(lun->legacy_stats)); - if (retval != 0) - break; - stats->fill_len += sizeof(lun->legacy_stats); - } - stats->num_luns = softc->num_luns; - stats->flags = CTL_STATS_FLAG_NONE; -#ifdef CTL_TIME_IO - stats->flags |= CTL_STATS_FLAG_TIME_VALID; -#endif - getnanouptime(&stats->timestamp); - break; - } -#endif /* CTL_LEGACY_STATS */ case CTL_ERROR_INJECT: { struct ctl_error_desc *err_desc, *new_err_desc; @@ -4758,17 +4725,6 @@ fail: ctl_init_log_page_index(lun); /* Setup statistics gathering */ -#ifdef CTL_LEGACY_STATS - lun->legacy_stats.device_type = be_lun->lun_type; - lun->legacy_stats.lun_number = lun_number; - lun->legacy_stats.blocksize = be_lun->blocksize; - if (be_lun->blocksize == 0) - lun->legacy_stats.flags = CTL_LUN_STATS_NO_BLOCKSIZE; - lun->legacy_stats.ports = malloc(sizeof(struct ctl_lun_io_port_stats) * - ctl_max_ports, M_DEVBUF, M_WAITOK | M_ZERO); - for (len = 0; len < ctl_max_ports; len++) - lun->legacy_stats.ports[len].targ_port = len; -#endif /* CTL_LEGACY_STATS */ lun->stats.item = lun_number; /* @@ -13078,21 +13034,6 @@ ctl_process_done(union ctl_io *io) type = CTL_STATS_WRITE; else type = CTL_STATS_NO_IO; - -#ifdef CTL_LEGACY_STATS - uint32_t targ_port = port->targ_port; - lun->legacy_stats.ports[targ_port].bytes[type] += - io->scsiio.kern_total_len; - lun->legacy_stats.ports[targ_port].operations[type] ++; - lun->legacy_stats.ports[targ_port].num_dmas[type] += - io->io_hdr.num_dmas; -#ifdef CTL_TIME_IO - bintime_add(&lun->legacy_stats.ports[targ_port].dma_time[type], - &io->io_hdr.dma_bt); - bintime_add(&lun->legacy_stats.ports[targ_port].time[type], - &bt); -#endif -#endif /* CTL_LEGACY_STATS */ lun->stats.bytes[type] += io->scsiio.kern_total_len; lun->stats.operations[type] ++; Modified: stable/12/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- stable/12/sys/cam/ctl/ctl_ioctl.h Sat Mar 2 01:51:41 2019 (r344716) +++ stable/12/sys/cam/ctl/ctl_ioctl.h Sat Mar 2 03:17:23 2019 (r344717) @@ -69,9 +69,6 @@ /* Hopefully this won't conflict with new misc devices that pop up */ #define CTL_MINOR 225 -/* Legacy statistics accumulated for every port for every LU. */ -//#define CTL_LEGACY_STATS 1 - typedef enum { CTL_DELAY_TYPE_NONE, CTL_DELAY_TYPE_CONT, @@ -119,39 +116,6 @@ typedef enum { CTL_STATS_FLAG_TIME_VALID = 0x01 } ctl_stats_flags; -#ifdef CTL_LEGACY_STATS -typedef enum { - CTL_LUN_STATS_NO_BLOCKSIZE = 0x01 -} ctl_lun_stats_flags; - -struct ctl_lun_io_port_stats { - uint32_t targ_port; - uint64_t bytes[CTL_STATS_NUM_TYPES]; - uint64_t operations[CTL_STATS_NUM_TYPES]; - struct bintime time[CTL_STATS_NUM_TYPES]; - uint64_t num_dmas[CTL_STATS_NUM_TYPES]; - struct bintime dma_time[CTL_STATS_NUM_TYPES]; -}; - -struct ctl_lun_io_stats { - uint8_t device_type; - uint64_t lun_number; - uint32_t blocksize; - ctl_lun_stats_flags flags; - struct ctl_lun_io_port_stats *ports; -}; - -struct ctl_stats { - int alloc_len; /* passed to kernel */ - struct ctl_lun_io_stats *lun_stats; /* passed to/from kernel */ - int fill_len; /* passed to userland */ - int num_luns; /* passed to userland */ - ctl_stats_status status; /* passed to userland */ - ctl_stats_flags flags; /* passed to userland */ - struct timespec timestamp; /* passed to userland */ -}; -#endif /* CTL_LEGACY_STATS */ - struct ctl_io_stats { uint32_t item; uint64_t bytes[CTL_STATS_NUM_TYPES]; @@ -795,7 +759,6 @@ struct ctl_lun_map { #define CTL_ENABLE_PORT _IOW(CTL_MINOR, 0x04, struct ctl_port_entry) #define CTL_DISABLE_PORT _IOW(CTL_MINOR, 0x05, struct ctl_port_entry) #define CTL_DELAY_IO _IOWR(CTL_MINOR, 0x10, struct ctl_io_delay_info) -#define CTL_GETSTATS _IOWR(CTL_MINOR, 0x15, struct ctl_stats) #define CTL_ERROR_INJECT _IOWR(CTL_MINOR, 0x16, struct ctl_error_desc) #define CTL_GET_OOA _IOWR(CTL_MINOR, 0x18, struct ctl_ooa) #define CTL_DUMP_STRUCTS _IO(CTL_MINOR, 0x19) Modified: stable/12/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/12/sys/cam/ctl/ctl_private.h Sat Mar 2 01:51:41 2019 (r344716) +++ stable/12/sys/cam/ctl/ctl_private.h Sat Mar 2 03:17:23 2019 (r344717) @@ -403,9 +403,6 @@ struct ctl_lun { struct callout ie_callout; /* INTERVAL TIMER */ struct ctl_mode_pages mode_pages; struct ctl_log_pages log_pages; -#ifdef CTL_LEGACY_STATS - struct ctl_lun_io_stats legacy_stats; -#endif /* CTL_LEGACY_STATS */ struct ctl_io_stats stats; uint32_t res_idx; uint32_t pr_generation;