From owner-svn-src-head@freebsd.org Sun Aug 27 03:10:18 2017 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 41519DE4BA7; Sun, 27 Aug 2017 03:10:18 +0000 (UTC) (envelope-from imp@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 017722CEB; Sun, 27 Aug 2017 03:10:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7R3AGMu012118; Sun, 27 Aug 2017 03:10:16 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7R3AGEK012117; Sun, 27 Aug 2017 03:10:16 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201708270310.v7R3AGEK012117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 27 Aug 2017 03:10:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322941 - head/sys/boot/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/boot/efi/boot1 X-SVN-Commit-Revision: 322941 X-SVN-Commit-Repository: base 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.23 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: Sun, 27 Aug 2017 03:10:18 -0000 Author: imp Date: Sun Aug 27 03:10:16 2017 New Revision: 322941 URL: https://svnweb.freebsd.org/changeset/base/322941 Log: Eliminate redunant device path matching. Use efi_devpath_match instead of device_paths_match. They are functionally the same. Remove device_paths_match from boot1.c and call efi_devpath_match instead. Sponsored by: Netflix Modified: head/sys/boot/efi/boot1/boot1.c Modified: head/sys/boot/efi/boot1/boot1.c ============================================================================== --- head/sys/boot/efi/boot1/boot1.c Sat Aug 26 23:13:18 2017 (r322940) +++ head/sys/boot/efi/boot1/boot1.c Sun Aug 27 03:10:16 2017 (r322941) @@ -76,53 +76,6 @@ Free(void *buf, const char *file __unused, int line __ } /* - * nodes_match returns TRUE if the imgpath isn't NULL and the nodes match, - * FALSE otherwise. - */ -static BOOLEAN -nodes_match(EFI_DEVICE_PATH *imgpath, EFI_DEVICE_PATH *devpath) -{ - size_t len; - - if (imgpath == NULL || imgpath->Type != devpath->Type || - imgpath->SubType != devpath->SubType) - return (FALSE); - - len = DevicePathNodeLength(imgpath); - if (len != DevicePathNodeLength(devpath)) - return (FALSE); - - return (memcmp(imgpath, devpath, (size_t)len) == 0); -} - -/* - * device_paths_match returns TRUE if the imgpath isn't NULL and all nodes - * in imgpath and devpath match up to their respective occurrences of a - * media node, FALSE otherwise. - */ -static BOOLEAN -device_paths_match(EFI_DEVICE_PATH *imgpath, EFI_DEVICE_PATH *devpath) -{ - - if (imgpath == NULL) - return (FALSE); - - while (!IsDevicePathEnd(imgpath) && !IsDevicePathEnd(devpath)) { - if (IsDevicePathType(imgpath, MEDIA_DEVICE_PATH) && - IsDevicePathType(devpath, MEDIA_DEVICE_PATH)) - return (TRUE); - - if (!nodes_match(imgpath, devpath)) - return (FALSE); - - imgpath = NextDevicePathNode(imgpath); - devpath = NextDevicePathNode(devpath); - } - - return (FALSE); -} - -/* * devpath_last returns the last non-path end node in devpath. */ static EFI_DEVICE_PATH * @@ -318,7 +271,7 @@ probe_handle(EFI_HANDLE h, EFI_DEVICE_PATH *imgpath, B if (!blkio->Media->LogicalPartition) return (EFI_UNSUPPORTED); - *preferred = device_paths_match(imgpath, devpath); + *preferred = efi_devpath_match(imgpath, devpath); /* Run through each module, see if it can load this partition */ for (i = 0; i < NUM_BOOT_MODULES; i++) { From owner-svn-src-head@freebsd.org Sun Aug 27 05:14:49 2017 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 4A09ADE79C2; Sun, 27 Aug 2017 05:14:49 +0000 (UTC) (envelope-from cem@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 1966C65B54; Sun, 27 Aug 2017 05:14:49 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7R5Emw5064786; Sun, 27 Aug 2017 05:14:48 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7R5EmDK064785; Sun, 27 Aug 2017 05:14:48 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201708270514.v7R5EmDK064785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sun, 27 Aug 2017 05:14:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322942 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 322942 X-SVN-Commit-Repository: base 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.23 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: Sun, 27 Aug 2017 05:14:49 -0000 Author: cem Date: Sun Aug 27 05:14:48 2017 New Revision: 322942 URL: https://svnweb.freebsd.org/changeset/base/322942 Log: Improve scheduler performance Improve scheduler performance by flattening nonsensical topology layers (layers with only one child don't serve any purpose). This is especially relevant on non-AMD Zen systems after r322776. On my dual core Intel laptop, this brings the kern.sched.topology_spec table down from three levels to two. Submitted by: jeff Reviewed by: attilio Sponsored by: Dell EMC Isilon Modified: head/sys/kern/subr_smp.c Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Sun Aug 27 03:10:16 2017 (r322941) +++ head/sys/kern/subr_smp.c Sun Aug 27 05:14:48 2017 (r322942) @@ -630,6 +630,15 @@ smp_topo(void) panic("Built bad topology at %p. CPU mask (%s) != (%s)", top, cpusetobj_strprint(cpusetbuf, &top->cg_mask), cpusetobj_strprint(cpusetbuf2, &all_cpus)); + + /* + * Collapse nonsense levels that may be created out of convenience by + * the MD layers. They cause extra work in the search functions. + */ + while (top->cg_children == 1) { + top = &top->cg_child[0]; + top->cg_parent = NULL; + } return (top); } From owner-svn-src-head@freebsd.org Sun Aug 27 06:24:08 2017 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 4E5E7DE8765; Sun, 27 Aug 2017 06:24:08 +0000 (UTC) (envelope-from scottl@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 EE2E367229; Sun, 27 Aug 2017 06:24:07 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7R6O7CM093060; Sun, 27 Aug 2017 06:24:07 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7R6O6EM093053; Sun, 27 Aug 2017 06:24:06 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201708270624.v7R6O6EM093053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Sun, 27 Aug 2017 06:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322943 - in head/sys/dev: mpr mps X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: in head/sys/dev: mpr mps X-SVN-Commit-Revision: 322943 X-SVN-Commit-Repository: base 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.23 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: Sun, 27 Aug 2017 06:24:08 -0000 Author: scottl Date: Sun Aug 27 06:24:06 2017 New Revision: 322943 URL: https://svnweb.freebsd.org/changeset/base/322943 Log: Start overhauling debug printing in the MPS and MPR drivers. The focus of this commit it to make initiazation less chatty in the normal case, and more useful and informative when real debugging is turned on. Reviewed by: ken (earlier version) Sponsored by: Netflix Modified: head/sys/dev/mpr/mpr.c head/sys/dev/mpr/mpr_mapping.c head/sys/dev/mpr/mpr_sas.c head/sys/dev/mpr/mpr_sas_lsi.c head/sys/dev/mpr/mpr_user.c head/sys/dev/mps/mps.c head/sys/dev/mps/mps_mapping.c head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mps_sas_lsi.c head/sys/dev/mps/mps_user.c Modified: head/sys/dev/mpr/mpr.c ============================================================================== --- head/sys/dev/mpr/mpr.c Sun Aug 27 05:14:48 2017 (r322942) +++ head/sys/dev/mpr/mpr.c Sun Aug 27 06:24:06 2017 (r322943) @@ -115,7 +115,7 @@ static char mpt2_reset_magic[] = { 0x00, 0x0f, 0x04, 0 /* * Added this union to smoothly convert le64toh cm->cm_desc.Words. * Compiler only supports uint64_t to be passed as an argument. - * Otherwise it will through this error: + * Otherwise it will throw this error: * "aggregate value used where an integer was expected" */ typedef union _reply_descriptor { @@ -145,7 +145,7 @@ mpr_diag_reset(struct mpr_softc *sc,int sleep_flag) int i, error, tries = 0; uint8_t first_wait_done = FALSE; - mpr_dprint(sc, MPR_TRACE, "%s\n", __func__); + mpr_dprint(sc, MPR_INIT, "%s entered\n", __func__); /* Clear any pending interrupts */ mpr_regwrite(sc, MPI2_HOST_INTERRUPT_STATUS_OFFSET, 0x0); @@ -161,6 +161,7 @@ mpr_diag_reset(struct mpr_softc *sc,int sleep_flag) #endif //__FreeBSD_version >= 1000029 sleep_flag = NO_SLEEP; + mpr_dprint(sc, MPR_INIT, "sequence start, sleep_flag=%d\n", sleep_flag); /* Push the magic sequence */ error = ETIMEDOUT; while (tries++ < 20) { @@ -183,12 +184,17 @@ mpr_diag_reset(struct mpr_softc *sc,int sleep_flag) break; } } - if (error) + if (error) { + mpr_dprint(sc, MPR_INIT, "sequence failed, error=%d, exit\n", + error); return (error); + } /* Send the actual reset. XXX need to refresh the reg? */ - mpr_regwrite(sc, MPI2_HOST_DIAGNOSTIC_OFFSET, - reg | MPI2_DIAG_RESET_ADAPTER); + reg |= MPI2_DIAG_RESET_ADAPTER; + mpr_dprint(sc, MPR_INIT, "sequence success, sending reset, reg= 0x%x\n", + reg); + mpr_regwrite(sc, MPI2_HOST_DIAGNOSTIC_OFFSET, reg); /* Wait up to 300 seconds in 50ms intervals */ error = ETIMEDOUT; @@ -224,10 +230,14 @@ mpr_diag_reset(struct mpr_softc *sc,int sleep_flag) break; } } - if (error) + if (error) { + mpr_dprint(sc, MPR_INIT, "reset failed, error= %d, exit\n", + error); return (error); + } mpr_regwrite(sc, MPI2_WRITE_SEQUENCE_OFFSET, 0x0); + mpr_dprint(sc, MPR_INIT, "diag reset success, exit\n"); return (0); } @@ -235,20 +245,25 @@ mpr_diag_reset(struct mpr_softc *sc,int sleep_flag) static int mpr_message_unit_reset(struct mpr_softc *sc, int sleep_flag) { + int error; MPR_FUNCTRACE(sc); + mpr_dprint(sc, MPR_INIT, "%s entered\n", __func__); + + error = 0; mpr_regwrite(sc, MPI2_DOORBELL_OFFSET, MPI2_FUNCTION_IOC_MESSAGE_UNIT_RESET << MPI2_DOORBELL_FUNCTION_SHIFT); if (mpr_wait_db_ack(sc, 5, sleep_flag) != 0) { - mpr_dprint(sc, MPR_FAULT, "Doorbell handshake failed : <%s>\n", - __func__); - return (ETIMEDOUT); + mpr_dprint(sc, MPR_INIT|MPR_FAULT, + "Doorbell handshake failed\n"); + error = ETIMEDOUT; } - return (0); + mpr_dprint(sc, MPR_INIT, "%s exit\n", __func__); + return (error); } static int @@ -264,15 +279,21 @@ mpr_transition_ready(struct mpr_softc *sc) ? CAN_SLEEP : NO_SLEEP; error = 0; + + mpr_dprint(sc, MPR_INIT, "%s entered, sleep_flags= %d\n", + __func__, sleep_flags); + while (tries++ < 1200) { reg = mpr_regread(sc, MPI2_DOORBELL_OFFSET); - mpr_dprint(sc, MPR_INIT, "Doorbell= 0x%x\n", reg); + mpr_dprint(sc, MPR_INIT, " Doorbell= 0x%x\n", reg); /* * Ensure the IOC is ready to talk. If it's not, try * resetting it. */ if (reg & MPI2_DOORBELL_USED) { + mpr_dprint(sc, MPR_INIT, " Not ready, sending diag " + "reset\n"); mpr_diag_reset(sc, sleep_flags); DELAY(50000); continue; @@ -281,9 +302,11 @@ mpr_transition_ready(struct mpr_softc *sc) /* Is the adapter owned by another peer? */ if ((reg & MPI2_DOORBELL_WHO_INIT_MASK) == (MPI2_WHOINIT_PCI_PEER << MPI2_DOORBELL_WHO_INIT_SHIFT)) { - device_printf(sc->mpr_dev, "IOC is under the control " - "of another peer host, aborting initialization.\n"); - return (ENXIO); + mpr_dprint(sc, MPR_INIT|MPR_FAULT, "IOC is under the " + "control of another peer host, aborting " + "initialization.\n"); + error = ENXIO; + break; } state = reg & MPI2_IOC_STATE_MASK; @@ -292,7 +315,8 @@ mpr_transition_ready(struct mpr_softc *sc) error = 0; break; } else if (state == MPI2_IOC_STATE_FAULT) { - mpr_dprint(sc, MPR_FAULT, "IOC in fault state 0x%x\n", + mpr_dprint(sc, MPR_INIT|MPR_FAULT, "IOC in fault " + "state 0x%x, resetting\n", state & MPI2_DOORBELL_FAULT_CODE_MASK); mpr_diag_reset(sc, sleep_flags); } else if (state == MPI2_IOC_STATE_OPERATIONAL) { @@ -300,10 +324,10 @@ mpr_transition_ready(struct mpr_softc *sc) mpr_message_unit_reset(sc, sleep_flags); } else if (state == MPI2_IOC_STATE_RESET) { /* Wait a bit, IOC might be in transition */ - mpr_dprint(sc, MPR_FAULT, + mpr_dprint(sc, MPR_INIT|MPR_FAULT, "IOC in unexpected reset state\n"); } else { - mpr_dprint(sc, MPR_FAULT, + mpr_dprint(sc, MPR_INIT|MPR_FAULT, "IOC in unknown state 0x%x\n", state); error = EINVAL; break; @@ -314,7 +338,9 @@ mpr_transition_ready(struct mpr_softc *sc) } if (error) - device_printf(sc->mpr_dev, "Cannot transition IOC to ready\n"); + mpr_dprint(sc, MPR_INIT|MPR_FAULT, + "Cannot transition IOC to ready\n"); + mpr_dprint(sc, MPR_INIT, "%s exit\n", __func__); return (error); } @@ -328,18 +354,21 @@ mpr_transition_operational(struct mpr_softc *sc) error = 0; reg = mpr_regread(sc, MPI2_DOORBELL_OFFSET); - mpr_dprint(sc, MPR_INIT, "Doorbell= 0x%x\n", reg); + mpr_dprint(sc, MPR_INIT, "%s entered, Doorbell= 0x%x\n", __func__, reg); state = reg & MPI2_IOC_STATE_MASK; if (state != MPI2_IOC_STATE_READY) { + mpr_dprint(sc, MPR_INIT, "IOC not ready\n"); if ((error = mpr_transition_ready(sc)) != 0) { - mpr_dprint(sc, MPR_FAULT, - "%s failed to transition ready\n", __func__); + mpr_dprint(sc, MPR_INIT|MPR_FAULT, + "failed to transition ready, exit\n"); return (error); } } error = mpr_send_iocinit(sc); + mpr_dprint(sc, MPR_INIT, "%s exit\n", __func__); + return (error); } @@ -358,7 +387,7 @@ mpr_iocfacts_allocate(struct mpr_softc *sc, uint8_t at Mpi2IOCFactsReply_t saved_facts; uint8_t saved_mode, reallocating; - mpr_dprint(sc, MPR_TRACE, "%s\n", __func__); + mpr_dprint(sc, MPR_INIT|MPR_TRACE, "%s entered\n", __func__); /* Save old IOC Facts and then only reallocate if Facts have changed */ if (!attaching) { @@ -372,8 +401,8 @@ mpr_iocfacts_allocate(struct mpr_softc *sc, uint8_t at */ if ((error = mpr_get_iocfacts(sc, sc->facts)) != 0) { if (attaching) { - mpr_dprint(sc, MPR_FAULT, "%s failed to get IOC Facts " - "with error %d\n", __func__, error); + mpr_dprint(sc, MPR_INIT|MPR_FAULT, "Failed to get " + "IOC Facts with error %d, exit\n", error); return (error); } else { panic("%s failed to get IOC Facts with error %d\n", @@ -390,9 +419,10 @@ mpr_iocfacts_allocate(struct mpr_softc *sc, uint8_t at sc->facts->FWVersion.Struct.Unit, sc->facts->FWVersion.Struct.Dev); - mpr_printf(sc, "Firmware: %s, Driver: %s\n", sc->fw_version, + mpr_dprint(sc, MPR_INFO, "Firmware: %s, Driver: %s\n", sc->fw_version, MPR_DRIVER_VERSION); - mpr_printf(sc, "IOCCapabilities: %b\n", sc->facts->IOCCapabilities, + mpr_dprint(sc, MPR_INFO, + "IOCCapabilities: %b\n", sc->facts->IOCCapabilities, "\20" "\3ScsiTaskFull" "\4DiagTrace" "\5SnapBuf" "\6ExtBuf" "\7EEDP" "\10BiDirTarg" "\11Multicast" "\14TransRetry" "\15IR" "\16EventReplay" "\17RaidAccel" "\20MSIXIndex" "\21HostDisc" @@ -405,16 +435,15 @@ mpr_iocfacts_allocate(struct mpr_softc *sc, uint8_t at * but it doesn't hurt to do it again. Only do this if attaching, not * for a Diag Reset. */ - if (attaching) { - if ((sc->facts->IOCCapabilities & - MPI2_IOCFACTS_CAPABILITY_EVENT_REPLAY) == 0) { - mpr_diag_reset(sc, NO_SLEEP); - if ((error = mpr_transition_ready(sc)) != 0) { - mpr_dprint(sc, MPR_FAULT, "%s failed to " - "transition to ready with error %d\n", - __func__, error); - return (error); - } + if (attaching && ((sc->facts->IOCCapabilities & + MPI2_IOCFACTS_CAPABILITY_EVENT_REPLAY) == 0)) { + mpr_dprint(sc, MPR_INIT, "No event replay, resetting\n"); + mpr_diag_reset(sc, NO_SLEEP); + if ((error = mpr_transition_ready(sc)) != 0) { + mpr_dprint(sc, MPR_INIT|MPR_FAULT, "Failed to " + "transition to ready with error %d, exit\n", + error); + return (error); } } @@ -429,8 +458,8 @@ mpr_iocfacts_allocate(struct mpr_softc *sc, uint8_t at sc->ir_firmware = 1; if (!attaching) { if (sc->ir_firmware != saved_mode) { - mpr_dprint(sc, MPR_FAULT, "%s new IR/IT mode in IOC " - "Facts does not match previous mode\n", __func__); + mpr_dprint(sc, MPR_INIT|MPR_FAULT, "new IR/IT mode " + "in IOC Facts does not match previous mode\n"); } } @@ -540,8 +569,9 @@ mpr_iocfacts_allocate(struct mpr_softc *sc, uint8_t at ((error = mpr_alloc_replies(sc)) != 0) || ((error = mpr_alloc_requests(sc)) != 0)) { if (attaching ) { - mpr_dprint(sc, MPR_FAULT, "%s failed to alloc " - "queues with error %d\n", __func__, error); + mpr_dprint(sc, MPR_INIT|MPR_ERROR, + "Failed to alloc queues with error %d\n", + error); mpr_free(sc); return (error); } else { @@ -563,8 +593,8 @@ mpr_iocfacts_allocate(struct mpr_softc *sc, uint8_t at error = mpr_transition_operational(sc); if (error != 0) { if (attaching) { - mpr_printf(sc, "%s failed to transition to operational " - "with error %d\n", __func__, error); + mpr_dprint(sc, MPR_INIT|MPR_FAULT, "Failed to " + "transition to operational with error %d\n", error); mpr_free(sc); return (error); } else { @@ -592,18 +622,20 @@ mpr_iocfacts_allocate(struct mpr_softc *sc, uint8_t at */ /* XXX Should be dynamic so that IM/IR and user modules can attach */ if (attaching) { + mpr_dprint(sc, MPR_INIT, "Attaching subsystems\n"); if (((error = mpr_attach_log(sc)) != 0) || ((error = mpr_attach_sas(sc)) != 0) || ((error = mpr_attach_user(sc)) != 0)) { - mpr_printf(sc, "%s failed to attach all subsystems: " - "error %d\n", __func__, error); + mpr_dprint(sc, MPR_INIT|MPR_ERROR, + "Failed to attach all subsystems: error %d\n", + error); mpr_free(sc); return (error); } if ((error = mpr_pci_setup_interrupts(sc)) != 0) { - mpr_printf(sc, "%s failed to setup interrupts\n", - __func__); + mpr_dprint(sc, MPR_INIT|MPR_ERROR, + "Failed to setup interrupts\n"); mpr_free(sc); return (error); } @@ -706,14 +738,14 @@ mpr_reinit(struct mpr_softc *sc) mtx_assert(&sc->mpr_mtx, MA_OWNED); + mpr_dprint(sc, MPR_INIT|MPR_INFO, "Reinitializing controller\n"); if (sc->mpr_flags & MPR_FLAGS_DIAGRESET) { - mpr_dprint(sc, MPR_INIT, "%s reset already in progress\n", - __func__); + mpr_dprint(sc, MPR_INIT, "Reset already in progress\n"); return 0; } - mpr_dprint(sc, MPR_INFO, "Reinitializing controller,\n"); - /* make sure the completion callbacks can recognize they're getting + /* + * Make sure the completion callbacks can recognize they're getting * a NULL cm_reply due to a reset. */ sc->mpr_flags |= MPR_FLAGS_DIAGRESET; @@ -721,7 +753,7 @@ mpr_reinit(struct mpr_softc *sc) /* * Mask interrupts here. */ - mpr_dprint(sc, MPR_INIT, "%s mask interrupts\n", __func__); + mpr_dprint(sc, MPR_INIT, "Masking interrupts and resetting\n"); mpr_mask_intr(sc); error = mpr_diag_reset(sc, CAN_SLEEP); @@ -776,9 +808,10 @@ mpr_reinit(struct mpr_softc *sc) mpr_reregister_events(sc); /* the end of discovery will release the simq, so we're done. */ - mpr_dprint(sc, MPR_INFO, "%s finished sc %p post %u free %u\n", - __func__, sc, sc->replypostindex, sc->replyfreeindex); + mpr_dprint(sc, MPR_INIT|MPR_XINFO, "Finished sc %p post %u free %u\n", + sc, sc->replypostindex, sc->replyfreeindex); mprsas_release_simq_reinit(sassc); + mpr_dprint(sc, MPR_INIT, "%s exit error= %d\n", __func__, error); return 0; } @@ -800,7 +833,7 @@ mpr_wait_db_ack(struct mpr_softc *sc, int timeout, int do { int_status = mpr_regread(sc, MPI2_HOST_INTERRUPT_STATUS_OFFSET); if (!(int_status & MPI2_HIS_SYS2IOC_DB_STATUS)) { - mpr_dprint(sc, MPR_INIT, "%s: successful count(%d), " + mpr_dprint(sc, MPR_TRACE, "%s: successful count(%d), " "timeout(%d)\n", __func__, count, timeout); return 0; } else if (int_status & MPI2_HIS_IOC2SYS_DB_STATUS) { @@ -1022,6 +1055,7 @@ mpr_get_iocfacts(struct mpr_softc *sc, MPI2_IOC_FACTS_ int error, req_sz, reply_sz; MPR_FUNCTRACE(sc); + mpr_dprint(sc, MPR_INIT, "%s entered\n", __func__); req_sz = sizeof(MPI2_IOC_FACTS_REQUEST); reply_sz = sizeof(MPI2_IOC_FACTS_REPLY); @@ -1031,6 +1065,7 @@ mpr_get_iocfacts(struct mpr_softc *sc, MPI2_IOC_FACTS_ request.Function = MPI2_FUNCTION_IOC_FACTS; error = mpr_request_sync(sc, &request, reply, req_sz, reply_sz, 5); + mpr_dprint(sc, MPR_INIT, "%s exit, error= %d\n", __func__, error); return (error); } @@ -1044,6 +1079,7 @@ mpr_send_iocinit(struct mpr_softc *sc) uint64_t time_in_msec; MPR_FUNCTRACE(sc); + mpr_dprint(sc, MPR_INIT, "%s entered\n", __func__); req_sz = sizeof(MPI2_IOC_INIT_REQUEST); reply_sz = sizeof(MPI2_IOC_INIT_REPLY); @@ -1083,6 +1119,7 @@ mpr_send_iocinit(struct mpr_softc *sc) error = ENXIO; mpr_dprint(sc, MPR_INIT, "IOCInit status= 0x%x\n", reply.IOCStatus); + mpr_dprint(sc, MPR_INIT, "%s exit\n", __func__); return (error); } @@ -1130,12 +1167,12 @@ mpr_alloc_queues(struct mpr_softc *sc) 0, /* flags */ NULL, NULL, /* lockfunc, lockarg */ &sc->queues_dmat)) { - device_printf(sc->mpr_dev, "Cannot allocate queues DMA tag\n"); + mpr_dprint(sc, MPR_ERROR, "Cannot allocate queues DMA tag\n"); return (ENOMEM); } if (bus_dmamem_alloc(sc->queues_dmat, (void **)&queues, BUS_DMA_NOWAIT, &sc->queues_map)) { - device_printf(sc->mpr_dev, "Cannot allocate queues memory\n"); + mpr_dprint(sc, MPR_ERROR, "Cannot allocate queues memory\n"); return (ENOMEM); } bzero(queues, qsize); @@ -1174,12 +1211,12 @@ mpr_alloc_replies(struct mpr_softc *sc) 0, /* flags */ NULL, NULL, /* lockfunc, lockarg */ &sc->reply_dmat)) { - device_printf(sc->mpr_dev, "Cannot allocate replies DMA tag\n"); + mpr_dprint(sc, MPR_ERROR, "Cannot allocate replies DMA tag\n"); return (ENOMEM); } if (bus_dmamem_alloc(sc->reply_dmat, (void **)&sc->reply_frames, BUS_DMA_NOWAIT, &sc->reply_map)) { - device_printf(sc->mpr_dev, "Cannot allocate replies memory\n"); + mpr_dprint(sc, MPR_ERROR, "Cannot allocate replies memory\n"); return (ENOMEM); } bzero(sc->reply_frames, rsize); @@ -1208,12 +1245,12 @@ mpr_alloc_requests(struct mpr_softc *sc) 0, /* flags */ NULL, NULL, /* lockfunc, lockarg */ &sc->req_dmat)) { - device_printf(sc->mpr_dev, "Cannot allocate request DMA tag\n"); + mpr_dprint(sc, MPR_ERROR, "Cannot allocate request DMA tag\n"); return (ENOMEM); } if (bus_dmamem_alloc(sc->req_dmat, (void **)&sc->req_frames, BUS_DMA_NOWAIT, &sc->req_map)) { - device_printf(sc->mpr_dev, "Cannot allocate request memory\n"); + mpr_dprint(sc, MPR_ERROR, "Cannot allocate request memory\n"); return (ENOMEM); } bzero(sc->req_frames, rsize); @@ -1253,12 +1290,12 @@ mpr_alloc_requests(struct mpr_softc *sc) 0, /* flags */ NULL, NULL, /* lockfunc, lockarg */ &sc->chain_dmat)) { - device_printf(sc->mpr_dev, "Cannot allocate chain DMA tag\n"); + mpr_dprint(sc, MPR_ERROR, "Cannot allocate chain DMA tag\n"); return (ENOMEM); } if (bus_dmamem_alloc(sc->chain_dmat, (void **)&sc->chain_frames, BUS_DMA_NOWAIT, &sc->chain_map)) { - device_printf(sc->mpr_dev, "Cannot allocate chain memory\n"); + mpr_dprint(sc, MPR_ERROR, "Cannot allocate chain memory\n"); return (ENOMEM); } bzero(sc->chain_frames, rsize); @@ -1277,12 +1314,12 @@ mpr_alloc_requests(struct mpr_softc *sc) 0, /* flags */ NULL, NULL, /* lockfunc, lockarg */ &sc->sense_dmat)) { - device_printf(sc->mpr_dev, "Cannot allocate sense DMA tag\n"); + mpr_dprint(sc, MPR_ERROR, "Cannot allocate sense DMA tag\n"); return (ENOMEM); } if (bus_dmamem_alloc(sc->sense_dmat, (void **)&sc->sense_frames, BUS_DMA_NOWAIT, &sc->sense_map)) { - device_printf(sc->mpr_dev, "Cannot allocate sense memory\n"); + mpr_dprint(sc, MPR_ERROR, "Cannot allocate sense memory\n"); return (ENOMEM); } bzero(sc->sense_frames, rsize); @@ -1292,8 +1329,7 @@ mpr_alloc_requests(struct mpr_softc *sc) sc->chains = malloc(sizeof(struct mpr_chain) * sc->max_chains, M_MPR, M_WAITOK | M_ZERO); if (!sc->chains) { - device_printf(sc->mpr_dev, "Cannot allocate memory %s %d\n", - __func__, __LINE__); + mpr_dprint(sc, MPR_ERROR, "Cannot allocate chain memory\n"); return (ENOMEM); } for (i = 0; i < sc->max_chains; i++) { @@ -1330,7 +1366,7 @@ mpr_alloc_requests(struct mpr_softc *sc) busdma_lock_mutex, /* lockfunc */ &sc->mpr_mtx, /* lockarg */ &sc->buffer_dmat)) { - device_printf(sc->mpr_dev, "Cannot allocate buffer DMA tag\n"); + mpr_dprint(sc, MPR_ERROR, "Cannot allocate buffer DMA tag\n"); return (ENOMEM); } @@ -1341,8 +1377,7 @@ mpr_alloc_requests(struct mpr_softc *sc) sc->commands = malloc(sizeof(struct mpr_command) * sc->num_reqs, M_MPR, M_WAITOK | M_ZERO); if (!sc->commands) { - device_printf(sc->mpr_dev, "Cannot allocate memory %s %d\n", - __func__, __LINE__); + mpr_dprint(sc, MPR_ERROR, "Cannot allocate command memory\n"); return (ENOMEM); } for (i = 1; i < sc->num_reqs; i++) { @@ -1428,13 +1463,13 @@ mpr_alloc_nvme_prp_pages(struct mpr_softc *sc) 0, /* flags */ NULL, NULL, /* lockfunc, lockarg */ &sc->prp_page_dmat)) { - device_printf(sc->mpr_dev, "Cannot allocate NVMe PRP DMA " + mpr_dprint(sc, MPR_ERROR, "Cannot allocate NVMe PRP DMA " "tag\n"); return (ENOMEM); } if (bus_dmamem_alloc(sc->prp_page_dmat, (void **)&sc->prp_pages, BUS_DMA_NOWAIT, &sc->prp_page_map)) { - device_printf(sc->mpr_dev, "Cannot allocate NVMe PRP memory\n"); + mpr_dprint(sc, MPR_ERROR, "Cannot allocate NVMe PRP memory\n"); return (ENOMEM); } bzero(sc->prp_pages, rsize); @@ -1664,6 +1699,7 @@ mpr_attach(struct mpr_softc *sc) int error; MPR_FUNCTRACE(sc); + mpr_dprint(sc, MPR_INIT, "%s entered\n", __func__); mtx_init(&sc->mpr_mtx, "MPR lock", NULL, MTX_DEF); callout_init_mtx(&sc->periodic, &sc->mpr_mtx, 0); @@ -1672,15 +1708,16 @@ mpr_attach(struct mpr_softc *sc) timevalclear(&sc->lastfail); if ((error = mpr_transition_ready(sc)) != 0) { - mpr_printf(sc, "%s failed to transition ready\n", __func__); + mpr_dprint(sc, MPR_INIT|MPR_FAULT, + "Failed to transition ready\n"); return (error); } sc->facts = malloc(sizeof(MPI2_IOC_FACTS_REPLY), M_MPR, M_ZERO|M_NOWAIT); if (!sc->facts) { - device_printf(sc->mpr_dev, "Cannot allocate memory %s %d\n", - __func__, __LINE__); + mpr_dprint(sc, MPR_INIT|MPR_FAULT, + "Cannot allocate memory, exit\n"); return (ENOMEM); } @@ -1692,8 +1729,8 @@ mpr_attach(struct mpr_softc *sc) * memory. If this fails, any allocated memory should already be freed. */ if ((error = mpr_iocfacts_allocate(sc, TRUE)) != 0) { - mpr_dprint(sc, MPR_FAULT, "%s IOC Facts based allocation " - "failed with error %d\n", __func__, error); + mpr_dprint(sc, MPR_INIT|MPR_FAULT, "IOC Facts allocation " + "failed with error %d\n", error); return (error); } @@ -1708,7 +1745,8 @@ mpr_attach(struct mpr_softc *sc) sc->mpr_ich.ich_func = mpr_startup; sc->mpr_ich.ich_arg = sc; if (config_intrhook_establish(&sc->mpr_ich) != 0) { - mpr_dprint(sc, MPR_ERROR, "Cannot establish MPR config hook\n"); + mpr_dprint(sc, MPR_INIT|MPR_ERROR, + "Cannot establish MPR config hook\n"); error = EINVAL; } @@ -1719,12 +1757,13 @@ mpr_attach(struct mpr_softc *sc) mprsas_ir_shutdown, sc, SHUTDOWN_PRI_DEFAULT); if (sc->shutdown_eh == NULL) - mpr_dprint(sc, MPR_ERROR, "shutdown event registration " - "failed\n"); + mpr_dprint(sc, MPR_INIT|MPR_ERROR, + "shutdown event registration failed\n"); mpr_setup_sysctl(sc); sc->mpr_flags |= MPR_FLAGS_ATTACH_DONE; + mpr_dprint(sc, MPR_INIT, "%s exit error= %d\n", __func__, error); return (error); } @@ -1736,6 +1775,7 @@ mpr_startup(void *arg) struct mpr_softc *sc; sc = (struct mpr_softc *)arg; + mpr_dprint(sc, MPR_INIT, "%s entered\n", __func__); mpr_lock(sc); mpr_unmask_intr(sc); @@ -1745,6 +1785,7 @@ mpr_startup(void *arg) mpr_mapping_initialize(sc); mprsas_startup(sc); mpr_unlock(sc); + mpr_dprint(sc, MPR_INIT, "%s exit\n", __func__); } /* Periodic watchdog. Is called with the driver lock already held. */ @@ -1831,6 +1872,7 @@ mpr_free(struct mpr_softc *sc) { int error; + mpr_dprint(sc, MPR_INIT, "%s entered\n", __func__); /* Turn off the watchdog */ mpr_lock(sc); sc->mpr_flags |= MPR_FLAGS_SHUTDOWN; @@ -1840,8 +1882,11 @@ mpr_free(struct mpr_softc *sc) callout_drain(&sc->device_check_callout); if (((error = mpr_detach_log(sc)) != 0) || - ((error = mpr_detach_sas(sc)) != 0)) + ((error = mpr_detach_sas(sc)) != 0)) { + mpr_dprint(sc, MPR_INIT|MPR_FAULT, "failed to detach " + "subsystems, error= %d, exit\n", error); return (error); + } mpr_detach_user(sc); @@ -1870,6 +1915,7 @@ mpr_free(struct mpr_softc *sc) EVENTHANDLER_DEREGISTER(shutdown_final, sc->shutdown_eh); mtx_destroy(&sc->mpr_mtx); + mpr_dprint(sc, MPR_INIT, "%s exit\n", __func__); return (0); } @@ -2215,8 +2261,8 @@ mpr_register_events(struct mpr_softc *sc, uint8_t *mas eh = malloc(sizeof(struct mpr_event_handle), M_MPR, M_WAITOK|M_ZERO); if (!eh) { - device_printf(sc->mpr_dev, "Cannot allocate memory %s %d\n", - __func__, __LINE__); + mpr_dprint(sc, MPR_EVENT|MPR_ERROR, + "Cannot allocate event memory\n"); return (ENOMEM); } eh->callback = cb; @@ -2760,13 +2806,11 @@ mpr_check_pcie_native_sgl(struct mpr_softc *sc, struct * boundary if this is not the first page. If so, this is not * expected so have FW build the SGL. */ - if (i) { - if ((uint32_t)paddr & page_mask) { - mpr_dprint(sc, MPR_ERROR, "Unaligned SGE while " - "building NVMe PRPs, low address is 0x%x\n", - (uint32_t)paddr); - return 1; - } + if ((i != 0) && (((uint32_t)paddr & page_mask) != 0)) { + mpr_dprint(sc, MPR_ERROR, "Unaligned SGE while " + "building NVMe PRPs, low address is 0x%x\n", + (uint32_t)paddr); + return 1; } /* Apart from last SGE, if any other SGE boundary is not page Modified: head/sys/dev/mpr/mpr_mapping.c ============================================================================== --- head/sys/dev/mpr/mpr_mapping.c Sun Aug 27 05:14:48 2017 (r322942) +++ head/sys/dev/mpr/mpr_mapping.c Sun Aug 27 06:24:06 2017 (r322943) @@ -1188,9 +1188,6 @@ _mapping_get_dev_info(struct mpr_softc *sc, "disk type (SSD or HDD) and SAS Address " "for SATA device with handle 0x%04x\n", __func__, phy_change->dev_handle); - } else { - mpr_dprint(sc, MPR_INFO, "SAS Address for SATA " - "device = %jx\n", sas_address); } } Modified: head/sys/dev/mpr/mpr_sas.c ============================================================================== --- head/sys/dev/mpr/mpr_sas.c Sun Aug 27 05:14:48 2017 (r322942) +++ head/sys/dev/mpr/mpr_sas.c Sun Aug 27 06:24:06 2017 (r322943) @@ -731,11 +731,12 @@ mpr_attach_sas(struct mpr_softc *sc) int unit, error = 0; MPR_FUNCTRACE(sc); + mpr_dprint(sc, MPR_INIT, "%s entered\n", __func__); sassc = malloc(sizeof(struct mprsas_softc), M_MPR, M_WAITOK|M_ZERO); if (!sassc) { - device_printf(sc->mpr_dev, "Cannot allocate memory %s %d\n", - __func__, __LINE__); + mpr_dprint(sc, MPR_INIT|MPR_ERROR, + "Cannot allocate SAS subsystem memory\n"); return (ENOMEM); } @@ -749,8 +750,8 @@ mpr_attach_sas(struct mpr_softc *sc) sassc->targets = malloc(sizeof(struct mprsas_target) * sassc->maxtargets, M_MPR, M_WAITOK|M_ZERO); if (!sassc->targets) { - device_printf(sc->mpr_dev, "Cannot allocate memory %s %d\n", - __func__, __LINE__); + mpr_dprint(sc, MPR_INIT|MPR_ERROR, + "Cannot allocate SAS target memory\n"); free(sassc, M_MPR); return (ENOMEM); } @@ -758,7 +759,7 @@ mpr_attach_sas(struct mpr_softc *sc) sassc->sc = sc; if ((sassc->devq = cam_simq_alloc(sc->num_reqs)) == NULL) { - mpr_dprint(sc, MPR_ERROR, "Cannot allocate SIMQ\n"); + mpr_dprint(sc, MPR_INIT|MPR_ERROR, "Cannot allocate SIMQ\n"); error = ENOMEM; goto out; } @@ -767,7 +768,7 @@ mpr_attach_sas(struct mpr_softc *sc) sassc->sim = cam_sim_alloc(mprsas_action, mprsas_poll, "mpr", sassc, unit, &sc->mpr_mtx, sc->num_reqs, sc->num_reqs, sassc->devq); if (sassc->sim == NULL) { - mpr_dprint(sc, MPR_ERROR, "Cannot allocate SIM\n"); + mpr_dprint(sc, MPR_INIT|MPR_ERROR, "Cannot allocate SIM\n"); error = EINVAL; goto out; } @@ -789,8 +790,8 @@ mpr_attach_sas(struct mpr_softc *sc) * everything is just a target on a single bus. */ if ((error = xpt_bus_register(sassc->sim, sc->mpr_dev, 0)) != 0) { - mpr_dprint(sc, MPR_ERROR, "Error %d registering SCSI bus\n", - error); + mpr_dprint(sc, MPR_INIT|MPR_ERROR, + "Error %d registering SCSI bus\n", error); mpr_unlock(sc); goto out; } @@ -814,7 +815,8 @@ mpr_attach_sas(struct mpr_softc *sc) cam_sim_path(sc->sassc->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); if (status != CAM_REQ_CMP) { - mpr_printf(sc, "Error %#x creating sim path\n", status); + mpr_dprint(sc, MPR_INIT|MPR_ERROR, + "Error %#x creating sim path\n", status); sassc->path = NULL; } else { int event; @@ -890,6 +892,8 @@ mpr_attach_sas(struct mpr_softc *sc) out: if (error) mpr_detach_sas(sc); + + mpr_dprint(sc, MPR_INIT, "%s exit, error= %d\n", __func__, error); return (error); } Modified: head/sys/dev/mpr/mpr_sas_lsi.c ============================================================================== --- head/sys/dev/mpr/mpr_sas_lsi.c Sun Aug 27 05:14:48 2017 (r322942) +++ head/sys/dev/mpr/mpr_sas_lsi.c Sun Aug 27 06:24:06 2017 (r322943) @@ -798,7 +798,8 @@ mprsas_add_device(struct mpr_softc *sc, u16 handle, u8 if ((mpr_config_get_sas_device_pg0(sc, &tmp_mpi_reply, &parent_config_page, MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, le16toh(config_page.ParentDevHandle)))) { - printf("%s: error reading SAS device %#x page0\n", + mpr_dprint(sc, MPR_MAPPING|MPR_FAULT, + "%s: error reading SAS device %#x page0\n", __func__, le16toh(config_page.ParentDevHandle)); } else { parent_sas_address = parent_config_page.SASAddress.High; @@ -810,8 +811,8 @@ mprsas_add_device(struct mpr_softc *sc, u16 handle, u8 /* TODO Check proper endianness */ sas_address = config_page.SASAddress.High; sas_address = (sas_address << 32) | config_page.SASAddress.Low; - mpr_dprint(sc, MPR_INFO, "SAS Address from SAS device page0 = %jx\n", - sas_address); + mpr_dprint(sc, MPR_MAPPING, "Handle 0x%04x SAS Address from SAS device " + "page0 = %jx\n", handle, sas_address); /* * Always get SATA Identify information because this is used to @@ -822,12 +823,13 @@ mprsas_add_device(struct mpr_softc *sc, u16 handle, u8 ret = mprsas_get_sas_address_for_sata_disk(sc, &sas_address, handle, device_info, &is_SATA_SSD); if (ret) { - mpr_dprint(sc, MPR_ERROR, "%s: failed to get disk type " - "(SSD or HDD) for SATA device with handle 0x%04x\n", + mpr_dprint(sc, MPR_MAPPING|MPR_ERROR, + "%s: failed to get disk type (SSD or HDD) for SATA " + "device with handle 0x%04x\n", __func__, handle); } else { - mpr_dprint(sc, MPR_INFO, "SAS Address from SATA " - "device = %jx\n", sas_address); + mpr_dprint(sc, MPR_MAPPING, "Handle 0x%04x SAS Address " + "from SATA device = %jx\n", handle, sas_address); } } @@ -870,8 +872,8 @@ mprsas_add_device(struct mpr_softc *sc, u16 handle, u8 targ = &sassc->targets[id]; if (!(targ->flags & MPR_TARGET_FLAGS_RAID_COMPONENT)) { if (mprsas_check_id(sassc, id) != 0) { - device_printf(sc->mpr_dev, "Excluding target id %d\n", - id); + mpr_dprint(sc, MPR_MAPPING|MPR_INFO, + "Excluding target id %d\n", id); error = ENXIO; goto out; } @@ -884,8 +886,6 @@ mprsas_add_device(struct mpr_softc *sc, u16 handle, u8 } } - mpr_dprint(sc, MPR_MAPPING, "SAS Address from SAS device page0 = %jx\n", - sas_address); targ->devinfo = device_info; targ->devname = le32toh(config_page.DeviceName.High); targ->devname = (targ->devname << 32) | @@ -1292,7 +1292,8 @@ mprsas_add_pcie_device(struct mpr_softc *sc, u16 handl __func__, id); if (mprsas_check_id(sassc, id) != 0) { - device_printf(sc->mpr_dev, "Excluding target id %d\n", id); + mpr_dprint(sc, MPR_MAPPING|MPR_INFO, + "Excluding target id %d\n", id); error = ENXIO; goto out; } Modified: head/sys/dev/mpr/mpr_user.c ============================================================================== --- head/sys/dev/mpr/mpr_user.c Sun Aug 27 05:14:48 2017 (r322942) +++ head/sys/dev/mpr/mpr_user.c Sun Aug 27 06:24:06 2017 (r322943) @@ -1504,14 +1504,14 @@ mpr_diag_register(struct mpr_softc *sc, mpr_fw_diag_re 0, /* flags */ NULL, NULL, /* lockfunc, lockarg */ &sc->fw_diag_dmat)) { - device_printf(sc->mpr_dev, "Cannot allocate FW diag buffer DMA " - "tag\n"); + mpr_dprint(sc, MPR_ERROR, + "Cannot allocate FW diag buffer DMA tag\n"); return (ENOMEM); } if (bus_dmamem_alloc(sc->fw_diag_dmat, (void **)&sc->fw_diag_buffer, BUS_DMA_NOWAIT, &sc->fw_diag_map)) { - device_printf(sc->mpr_dev, "Cannot allocate FW diag buffer " - "memory\n"); + mpr_dprint(sc, MPR_ERROR, + "Cannot allocate FW diag buffer memory\n"); return (ENOMEM); } bzero(sc->fw_diag_buffer, buffer_size); Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Sun Aug 27 05:14:48 2017 (r322942) +++ head/sys/dev/mps/mps.c Sun Aug 27 06:24:06 2017 (r322943) @@ -111,7 +111,7 @@ static char mpt2_reset_magic[] = { 0x00, 0x0f, 0x04, 0 /* Added this union to smoothly convert le64toh cm->cm_desc.Words. * Compiler only support unint64_t to be passed as argument. - * Otherwise it will through below error + * Otherwise it will throw below error * "aggregate value used where an integer was expected" */ @@ -143,16 +143,19 @@ mps_diag_reset(struct mps_softc *sc,int sleep_flag) int i, error, tries = 0; uint8_t first_wait_done = FALSE; - mps_dprint(sc, MPS_TRACE, "%s\n", __func__); + mps_dprint(sc, MPS_INIT, "%s entered\n", __func__); /* Clear any pending interrupts */ mps_regwrite(sc, MPI2_HOST_INTERRUPT_STATUS_OFFSET, 0x0); - /*Force NO_SLEEP for threads prohibited to sleep - * e.a Thread from interrupt handler are prohibited to sleep. - */ + /* + * Force NO_SLEEP for threads prohibited to sleep + * e.a Thread from interrupt handler are prohibited to sleep. + */ if (curthread->td_no_sleeping != 0) sleep_flag = NO_SLEEP; + + mps_dprint(sc, MPS_INIT, "sequence start, sleep_flag= %d\n", sleep_flag); /* Push the magic sequence */ error = ETIMEDOUT; @@ -175,12 +178,17 @@ mps_diag_reset(struct mps_softc *sc,int sleep_flag) break; } } - if (error) + if (error) { + mps_dprint(sc, MPS_INIT, "sequence failed, error=%d, exit\n", + error); return (error); + } /* Send the actual reset. XXX need to refresh the reg? */ - mps_regwrite(sc, MPI2_HOST_DIAGNOSTIC_OFFSET, - reg | MPI2_DIAG_RESET_ADAPTER); + reg |= MPI2_DIAG_RESET_ADAPTER; + mps_dprint(sc, MPS_INIT, "sequence success, sending reset, reg= 0x%x\n", + reg); + mps_regwrite(sc, MPI2_HOST_DIAGNOSTIC_OFFSET, reg); /* Wait up to 300 seconds in 50ms intervals */ error = ETIMEDOUT; @@ -216,10 +224,14 @@ mps_diag_reset(struct mps_softc *sc,int sleep_flag) break; } } - if (error) + if (error) { + mps_dprint(sc, MPS_INIT, "reset failed, error= %d, exit\n", + error); return (error); + } mps_regwrite(sc, MPI2_WRITE_SEQUENCE_OFFSET, 0x0); + mps_dprint(sc, MPS_INIT, "diag reset success, exit\n"); return (0); } @@ -227,20 +239,25 @@ mps_diag_reset(struct mps_softc *sc,int sleep_flag) static int mps_message_unit_reset(struct mps_softc *sc, int sleep_flag) { + int error; MPS_FUNCTRACE(sc); + mps_dprint(sc, MPS_INIT, "%s entered\n", __func__); + + error = 0; mps_regwrite(sc, MPI2_DOORBELL_OFFSET, MPI2_FUNCTION_IOC_MESSAGE_UNIT_RESET << MPI2_DOORBELL_FUNCTION_SHIFT); if (mps_wait_db_ack(sc, 5, sleep_flag) != 0) { - mps_dprint(sc, MPS_FAULT, "Doorbell handshake failed : <%s>\n", - __func__); - return (ETIMEDOUT); + mps_dprint(sc, MPS_INIT|MPS_FAULT, + "Doorbell handshake failed\n"); + error = ETIMEDOUT; } - return (0); + mps_dprint(sc, MPS_INIT, "%s exit\n", __func__); + return (error); } static int @@ -255,15 +272,21 @@ mps_transition_ready(struct mps_softc *sc) sleep_flags = (sc->mps_flags & MPS_FLAGS_ATTACH_DONE) ? CAN_SLEEP:NO_SLEEP; error = 0; + + mps_dprint(sc, MPS_INIT, "%s entered, sleep_flags= %d\n", + __func__, sleep_flags); + while (tries++ < 1200) { reg = mps_regread(sc, MPI2_DOORBELL_OFFSET); - mps_dprint(sc, MPS_INIT, "Doorbell= 0x%x\n", reg); + mps_dprint(sc, MPS_INIT, " Doorbell= 0x%x\n", reg); /* * Ensure the IOC is ready to talk. If it's not, try * resetting it. */ if (reg & MPI2_DOORBELL_USED) { + mps_dprint(sc, MPS_INIT, " Not ready, sending diag " + "reset\n"); mps_diag_reset(sc, sleep_flags); DELAY(50000); continue; @@ -272,9 +295,11 @@ mps_transition_ready(struct mps_softc *sc) /* Is the adapter owned by another peer? */ if ((reg & MPI2_DOORBELL_WHO_INIT_MASK) == (MPI2_WHOINIT_PCI_PEER << MPI2_DOORBELL_WHO_INIT_SHIFT)) { - device_printf(sc->mps_dev, "IOC is under the control " - "of another peer host, aborting initialization.\n"); - return (ENXIO); + mps_dprint(sc, MPS_INIT|MPS_FAULT, "IOC is under the " + "control of another peer host, aborting " + "initialization.\n"); + error = ENXIO; + break; } state = reg & MPI2_IOC_STATE_MASK; @@ -283,7 +308,8 @@ mps_transition_ready(struct mps_softc *sc) error = 0; break; } else if (state == MPI2_IOC_STATE_FAULT) { - mps_dprint(sc, MPS_FAULT, "IOC in fault state 0x%x, resetting\n", + mps_dprint(sc, MPS_INIT|MPS_FAULT, "IOC in fault " + "state 0x%x, resetting\n", state & MPI2_DOORBELL_FAULT_CODE_MASK); mps_diag_reset(sc, sleep_flags); } else if (state == MPI2_IOC_STATE_OPERATIONAL) { @@ -291,10 +317,10 @@ mps_transition_ready(struct mps_softc *sc) mps_message_unit_reset(sc, sleep_flags); } else if (state == MPI2_IOC_STATE_RESET) { /* Wait a bit, IOC might be in transition */ - mps_dprint(sc, MPS_FAULT, + mps_dprint(sc, MPS_INIT|MPS_FAULT, "IOC in unexpected reset state\n"); } else { - mps_dprint(sc, MPS_FAULT, + mps_dprint(sc, MPS_INIT|MPS_FAULT, "IOC in unknown state 0x%x\n", state); error = EINVAL; break; @@ -305,7 +331,9 @@ mps_transition_ready(struct mps_softc *sc) } if (error) - device_printf(sc->mps_dev, "Cannot transition IOC to ready\n"); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Aug 27 08:19:00 2017 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 822A4DEA342 for ; Sun, 27 Aug 2017 08:19:00 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x233.google.com (mail-yw0-x233.google.com [IPv6:2607:f8b0:4002:c05::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42D5569E75 for ; Sun, 27 Aug 2017 08:19:00 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x233.google.com with SMTP id t188so16606685ywb.1 for ; Sun, 27 Aug 2017 01:19:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=tN8Njho87bvaVmoMBOy8dopwaAPMs9lMlPfHkSieQ1w=; b=nt+UlxOkd5Gi/IuJ7au8vLzhMh+bAL2arjtp9PEyMro6IOAsdlezchkhOgL46NbBdg BCFnEzSQ/4xSh7Hxxxk4VNO6Dvp6/xZWpbP3TI7yhAiOzZyXDr0Ekpvr3/OGhdh+dhRC j++LtEy5zqpAuI5yQqKpb9imPBQMUd99Wpffc1bRfA5W/eGCDs7aVx7PGcNJaRM3rXho gSOc/Xnv4e5fbO+RFjMpIQ9PILwv/HBZHhJ7JVzXixTUyTUFvBSckGkgy1g9v6MV6++P Eoa8I8qP07AQ1pC5+fmr7aT6eu6+zokf4qYGobSBDd33lLOrDs2FNXwNjWAEXaTcKGRh aNOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=tN8Njho87bvaVmoMBOy8dopwaAPMs9lMlPfHkSieQ1w=; b=Gf4ooA4B0NJTo7jB2LmlVA60OryUGwmoi1MFU7B847uupoYJ30EdOjaDkeDSxEI0yo XbEe5kWkiSWsksHqWM4I+8iJxz3HgI7QVENSDUz1CmETEs0YCaGIMX0yPR8AYMyFshqC gui3e0VnGdn0WeCX6444glsNrzDxVuGJjqotweawQp0SV68GBGae/4dr8atVYZUS8jSt bXEypk4cDhX0SmCqtPlF5uyAxFIYULCxRbpwhhalVx+8IMrhpxPpBO8Z6BHiLJOz+LQ+ tTfenx2zP06fAcSX3FnBZGRLoDc4HGJCqxBwe+Q5VHuvdaa+4ieOBR+6/SMhl41+6c0Y q0zw== X-Gm-Message-State: AHYfb5gOs3hPfPA5bRRb7VXeUkAMZeA9wzTNaKRt1Au31GfP78YULVIE eY1d/5ARmKy3ruyTwZBRW7fauScOuLK9 X-Received: by 10.129.50.206 with SMTP id y197mr737860ywy.314.1503821939370; Sun, 27 Aug 2017 01:18:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.227.193 with HTTP; Sun, 27 Aug 2017 01:18:28 -0700 (PDT) In-Reply-To: <201708270514.v7R5EmDK064785@repo.freebsd.org> References: <201708270514.v7R5EmDK064785@repo.freebsd.org> From: Ed Schouten Date: Sun, 27 Aug 2017 10:18:28 +0200 Message-ID: Subject: Re: svn commit: r322942 - head/sys/kern To: Conrad Meyer Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Sun, 27 Aug 2017 08:19:00 -0000 Hi Conrad, [ Context: I don't understand anything about CPU topologies! ] 2017-08-27 7:14 GMT+02:00 Conrad Meyer : > + while (top->cg_children == 1) { > + top = &top->cg_child[0]; > + top->cg_parent = NULL; > + } This only removes layers from the top if they only have a single child. Question: is it possible/likely to have CPU topologies where one of the middle layers only has one child? If so, would it make sense to use tree traversal here to do the flattening? -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Sun Aug 27 11:37:09 2017 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 39726DEDB84; Sun, 27 Aug 2017 11:37:09 +0000 (UTC) (envelope-from kib@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 070CD6F293; Sun, 27 Aug 2017 11:37:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7RBb8n7020164; Sun, 27 Aug 2017 11:37:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7RBb81R020163; Sun, 27 Aug 2017 11:37:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708271137.v7RBb81R020163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 27 Aug 2017 11:37:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322947 - head/sys/dev/ppc X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/dev/ppc X-SVN-Commit-Revision: 322947 X-SVN-Commit-Repository: base 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.23 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: Sun, 27 Aug 2017 11:37:09 -0000 Author: kib Date: Sun Aug 27 11:37:07 2017 New Revision: 322947 URL: https://svnweb.freebsd.org/changeset/base/322947 Log: Add PCI Id for MosChip MCS9900. Submitted by: Robert Clausecker PR: 214670 MFC after: 1 week Modified: head/sys/dev/ppc/ppc_pci.c Modified: head/sys/dev/ppc/ppc_pci.c ============================================================================== --- head/sys/dev/ppc/ppc_pci.c Sun Aug 27 11:27:27 2017 (r322946) +++ head/sys/dev/ppc/ppc_pci.c Sun Aug 27 11:37:07 2017 (r322947) @@ -91,6 +91,7 @@ static struct pci_id pci_ids[] = { { 0xc1101415, "Oxford Semiconductor OXPCIe952 Parallel port", 0x10 }, { 0x98059710, "NetMos NM9805 1284 Printer port", 0x10 }, { 0x98659710, "MosChip MCS9865 1284 Printer port", 0x10 }, + { 0x99009710, "MosChip MCS9900 PCIe to Peripheral Controller", 0x10 }, { 0x99019710, "MosChip MCS9901 PCIe to Peripheral Controller", 0x10 }, { 0xffff } }; From owner-svn-src-head@freebsd.org Sun Aug 27 12:24:26 2017 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 8B1AADEF0CD; Sun, 27 Aug 2017 12:24:26 +0000 (UTC) (envelope-from kib@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 5ABCE7092B; Sun, 27 Aug 2017 12:24:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7RCOPMm040061; Sun, 27 Aug 2017 12:24:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7RCOPGY040060; Sun, 27 Aug 2017 12:24:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201708271224.v7RCOPGY040060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 27 Aug 2017 12:24:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322948 - head/sys/geom X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/geom X-SVN-Commit-Revision: 322948 X-SVN-Commit-Repository: base 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.23 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: Sun, 27 Aug 2017 12:24:26 -0000 Author: kib Date: Sun Aug 27 12:24:25 2017 New Revision: 322948 URL: https://svnweb.freebsd.org/changeset/base/322948 Log: Let g_access() log the actual error number. Submitted by: Fabian Keil PR: 221855 MFC after: 1 week Modified: head/sys/geom/geom_subr.c Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Sun Aug 27 11:37:07 2017 (r322947) +++ head/sys/geom/geom_subr.c Sun Aug 27 12:24:25 2017 (r322948) @@ -918,8 +918,8 @@ g_access(struct g_consumer *cp, int dcr, int dcw, int return (EPERM); /* If we try to open more but provider is error'ed: fail */ else if ((dcr > 0 || dcw > 0 || dce > 0) && pp->error != 0) { - printf("%s(%d): provider %s has error\n", - __func__, __LINE__, pp->name); + printf("%s(%d): provider %s has error %d set\n", + __func__, __LINE__, pp->name, pp->error); return (pp->error); } From owner-svn-src-head@freebsd.org Sun Aug 27 12:44:57 2017 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 873E0DEF79A; Sun, 27 Aug 2017 12:44:57 +0000 (UTC) (envelope-from avos@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 62A847110B; Sun, 27 Aug 2017 12:44:57 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7RCiuXE048131; Sun, 27 Aug 2017 12:44:56 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7RCiuFq048126; Sun, 27 Aug 2017 12:44:56 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201708271244.v7RCiuFq048126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 27 Aug 2017 12:44:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322949 - in head/sys/dev/rtwn: rtl8188e rtl8192c X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys/dev/rtwn: rtl8188e rtl8192c X-SVN-Commit-Revision: 322949 X-SVN-Commit-Repository: base 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.23 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: Sun, 27 Aug 2017 12:44:57 -0000 Author: avos Date: Sun Aug 27 12:44:56 2017 New Revision: 322949 URL: https://svnweb.freebsd.org/changeset/base/322949 Log: rtwn(4): change type for Tx power values (RTL8192C / RTL8188EU). Tx power values can easily fit into uint8_t + only 8 bits are written to registers; values may overflow only in case if ROM contains malformed data (but limit is checked anyway). Tested with RTL8188CUS, dev.rtwn.1.debug=0x2000 (no changes). Modified: head/sys/dev/rtwn/rtl8188e/r88e.h head/sys/dev/rtwn/rtl8188e/r88e_chan.c head/sys/dev/rtwn/rtl8192c/r92c.h head/sys/dev/rtwn/rtl8192c/r92c_chan.c head/sys/dev/rtwn/rtl8192c/r92c_var.h Modified: head/sys/dev/rtwn/rtl8188e/r88e.h ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e.h Sun Aug 27 12:24:25 2017 (r322948) +++ head/sys/dev/rtwn/rtl8188e/r88e.h Sun Aug 27 12:44:56 2017 (r322949) @@ -49,7 +49,7 @@ uint8_t r88e_temp_read(struct rtwn_softc *); /* r88e_chan.c */ void r88e_get_txpower(struct rtwn_softc *, int, - struct ieee80211_channel *, uint16_t[]); + struct ieee80211_channel *, uint8_t[]); void r88e_set_bw20(struct rtwn_softc *, uint8_t); void r88e_set_gain(struct rtwn_softc *, uint8_t); Modified: head/sys/dev/rtwn/rtl8188e/r88e_chan.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e_chan.c Sun Aug 27 12:24:25 2017 (r322948) +++ head/sys/dev/rtwn/rtl8188e/r88e_chan.c Sun Aug 27 12:44:56 2017 (r322949) @@ -85,7 +85,7 @@ r88e_get_power_group(struct rtwn_softc *sc, struct iee void r88e_get_txpower(struct rtwn_softc *sc, int chain, - struct ieee80211_channel *c, uint16_t power[RTWN_RIDX_COUNT]) + struct ieee80211_channel *c, uint8_t power[RTWN_RIDX_COUNT]) { struct r92c_softc *rs = sc->sc_priv; const struct rtwn_r88e_txpwr *rt = rs->rs_txpwr; Modified: head/sys/dev/rtwn/rtl8192c/r92c.h ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c.h Sun Aug 27 12:24:25 2017 (r322948) +++ head/sys/dev/rtwn/rtl8192c/r92c.h Sun Aug 27 12:44:56 2017 (r322949) @@ -55,7 +55,7 @@ uint8_t r92c_temp_read(struct rtwn_softc *); /* r92c_chan.c */ void r92c_get_txpower(struct rtwn_softc *, int, - struct ieee80211_channel *, uint16_t[]); + struct ieee80211_channel *, uint8_t[]); void r92c_set_bw20(struct rtwn_softc *, uint8_t); void r92c_set_chan(struct rtwn_softc *, struct ieee80211_channel *); void r92c_set_gain(struct rtwn_softc *, uint8_t); Modified: head/sys/dev/rtwn/rtl8192c/r92c_chan.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c_chan.c Sun Aug 27 12:24:25 2017 (r322948) +++ head/sys/dev/rtwn/rtl8192c/r92c_chan.c Sun Aug 27 12:44:56 2017 (r322949) @@ -82,7 +82,7 @@ r92c_get_power_group(struct rtwn_softc *sc, struct iee /* XXX recheck */ void r92c_get_txpower(struct rtwn_softc *sc, int chain, - struct ieee80211_channel *c, uint16_t power[RTWN_RIDX_COUNT]) + struct ieee80211_channel *c, uint8_t power[RTWN_RIDX_COUNT]) { struct r92c_softc *rs = sc->sc_priv; struct rtwn_r92c_txpwr *rt = rs->rs_txpwr; @@ -158,7 +158,7 @@ r92c_get_txpower(struct rtwn_softc *sc, int chain, static void r92c_write_txpower(struct rtwn_softc *sc, int chain, - uint16_t power[RTWN_RIDX_COUNT]) + uint8_t power[RTWN_RIDX_COUNT]) { uint32_t reg; @@ -221,7 +221,7 @@ r92c_write_txpower(struct rtwn_softc *sc, int chain, static void r92c_set_txpower(struct rtwn_softc *sc, struct ieee80211_channel *c) { - uint16_t power[RTWN_RIDX_COUNT]; + uint8_t power[RTWN_RIDX_COUNT]; int i; for (i = 0; i < sc->ntxchains; i++) { Modified: head/sys/dev/rtwn/rtl8192c/r92c_var.h ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c_var.h Sun Aug 27 12:24:25 2017 (r322948) +++ head/sys/dev/rtwn/rtl8192c/r92c_var.h Sun Aug 27 12:44:56 2017 (r322949) @@ -53,7 +53,7 @@ struct r92c_softc { void (*rs_set_bw20)(struct rtwn_softc *, uint8_t); void (*rs_get_txpower)(struct rtwn_softc *, int, - struct ieee80211_channel *, uint16_t[]); + struct ieee80211_channel *, uint8_t[]); void (*rs_set_gain)(struct rtwn_softc *, uint8_t); void (*rs_tx_enable_ampdu)(void *, int); void (*rs_tx_setup_hwseq)(void *); From owner-svn-src-head@freebsd.org Sun Aug 27 13:02:53 2017 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 9A3CEDEFB58; Sun, 27 Aug 2017 13:02:53 +0000 (UTC) (envelope-from avos@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 69C8F717AF; Sun, 27 Aug 2017 13:02:53 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7RD2qPM056054; Sun, 27 Aug 2017 13:02:52 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7RD2pV0056051; Sun, 27 Aug 2017 13:02:51 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201708271302.v7RD2pV0056051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 27 Aug 2017 13:02:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322950 - in head/sys/dev/rtwn: rtl8192c rtl8192e X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys/dev/rtwn: rtl8192c rtl8192e X-SVN-Commit-Revision: 322950 X-SVN-Commit-Repository: base 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.23 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: Sun, 27 Aug 2017 13:02:53 -0000 Author: avos Date: Sun Aug 27 13:02:51 2017 New Revision: 322950 URL: https://svnweb.freebsd.org/changeset/base/322950 Log: rtwn(4): deduplicate r92c_write_txpower(). Modified: head/sys/dev/rtwn/rtl8192c/r92c.h head/sys/dev/rtwn/rtl8192c/r92c_chan.c head/sys/dev/rtwn/rtl8192e/r92e_chan.c Modified: head/sys/dev/rtwn/rtl8192c/r92c.h ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c.h Sun Aug 27 12:44:56 2017 (r322949) +++ head/sys/dev/rtwn/rtl8192c/r92c.h Sun Aug 27 13:02:51 2017 (r322950) @@ -56,6 +56,8 @@ uint8_t r92c_temp_read(struct rtwn_softc *); /* r92c_chan.c */ void r92c_get_txpower(struct rtwn_softc *, int, struct ieee80211_channel *, uint8_t[]); +void r92c_write_txpower(struct rtwn_softc *, int, + uint8_t power[]); void r92c_set_bw20(struct rtwn_softc *, uint8_t); void r92c_set_chan(struct rtwn_softc *, struct ieee80211_channel *); void r92c_set_gain(struct rtwn_softc *, uint8_t); Modified: head/sys/dev/rtwn/rtl8192c/r92c_chan.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c_chan.c Sun Aug 27 12:44:56 2017 (r322949) +++ head/sys/dev/rtwn/rtl8192c/r92c_chan.c Sun Aug 27 13:02:51 2017 (r322950) @@ -156,7 +156,7 @@ r92c_get_txpower(struct rtwn_softc *sc, int chain, } } -static void +void r92c_write_txpower(struct rtwn_softc *sc, int chain, uint8_t power[RTWN_RIDX_COUNT]) { Modified: head/sys/dev/rtwn/rtl8192e/r92e_chan.c ============================================================================== --- head/sys/dev/rtwn/rtl8192e/r92e_chan.c Sun Aug 27 12:44:56 2017 (r322949) +++ head/sys/dev/rtwn/rtl8192e/r92e_chan.c Sun Aug 27 13:02:51 2017 (r322950) @@ -57,6 +57,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #include #include @@ -144,70 +146,7 @@ r92e_get_txpower(struct rtwn_softc *sc, int chain, str #endif } - static void -r92e_write_txpower(struct rtwn_softc *sc, int chain, - uint8_t power[RTWN_RIDX_COUNT]) -{ - uint32_t reg; - - /* Write per-CCK rate Tx power. */ - if (chain == 0) { - reg = rtwn_bb_read(sc, R92C_TXAGC_A_CCK1_MCS32); - reg = RW(reg, R92C_TXAGC_A_CCK1, power[RTWN_RIDX_CCK1]); - rtwn_bb_write(sc, R92C_TXAGC_A_CCK1_MCS32, reg); - reg = rtwn_bb_read(sc, R92C_TXAGC_B_CCK11_A_CCK2_11); - reg = RW(reg, R92C_TXAGC_A_CCK2, power[RTWN_RIDX_CCK2]); - reg = RW(reg, R92C_TXAGC_A_CCK55, power[RTWN_RIDX_CCK55]); - reg = RW(reg, R92C_TXAGC_A_CCK11, power[RTWN_RIDX_CCK11]); - rtwn_bb_write(sc, R92C_TXAGC_B_CCK11_A_CCK2_11, reg); - } else { - reg = rtwn_bb_read(sc, R92C_TXAGC_B_CCK1_55_MCS32); - reg = RW(reg, R92C_TXAGC_B_CCK1, power[RTWN_RIDX_CCK1]); - reg = RW(reg, R92C_TXAGC_B_CCK2, power[RTWN_RIDX_CCK2]); - reg = RW(reg, R92C_TXAGC_B_CCK55, power[RTWN_RIDX_CCK55]); - rtwn_bb_write(sc, R92C_TXAGC_B_CCK1_55_MCS32, reg); - reg = rtwn_bb_read(sc, R92C_TXAGC_B_CCK11_A_CCK2_11); - reg = RW(reg, R92C_TXAGC_B_CCK11, power[RTWN_RIDX_CCK11]); - rtwn_bb_write(sc, R92C_TXAGC_B_CCK11_A_CCK2_11, reg); - } - /* Write per-OFDM rate Tx power. */ - rtwn_bb_write(sc, R92C_TXAGC_RATE18_06(chain), - SM(R92C_TXAGC_RATE06, power[RTWN_RIDX_OFDM6]) | - SM(R92C_TXAGC_RATE09, power[RTWN_RIDX_OFDM9]) | - SM(R92C_TXAGC_RATE12, power[RTWN_RIDX_OFDM12]) | - SM(R92C_TXAGC_RATE18, power[RTWN_RIDX_OFDM18])); - rtwn_bb_write(sc, R92C_TXAGC_RATE54_24(chain), - SM(R92C_TXAGC_RATE24, power[RTWN_RIDX_OFDM24]) | - SM(R92C_TXAGC_RATE36, power[RTWN_RIDX_OFDM36]) | - SM(R92C_TXAGC_RATE48, power[RTWN_RIDX_OFDM48]) | - SM(R92C_TXAGC_RATE54, power[RTWN_RIDX_OFDM54])); - /* Write per-MCS Tx power. */ - rtwn_bb_write(sc, R92C_TXAGC_MCS03_MCS00(chain), - SM(R92C_TXAGC_MCS00, power[RTWN_RIDX_MCS(0)]) | - SM(R92C_TXAGC_MCS01, power[RTWN_RIDX_MCS(1)]) | - SM(R92C_TXAGC_MCS02, power[RTWN_RIDX_MCS(2)]) | - SM(R92C_TXAGC_MCS03, power[RTWN_RIDX_MCS(3)])); - rtwn_bb_write(sc, R92C_TXAGC_MCS07_MCS04(chain), - SM(R92C_TXAGC_MCS04, power[RTWN_RIDX_MCS(4)]) | - SM(R92C_TXAGC_MCS05, power[RTWN_RIDX_MCS(5)]) | - SM(R92C_TXAGC_MCS06, power[RTWN_RIDX_MCS(6)]) | - SM(R92C_TXAGC_MCS07, power[RTWN_RIDX_MCS(7)])); - if (sc->ntxchains >= 2) { - rtwn_bb_write(sc, R92C_TXAGC_MCS11_MCS08(chain), - SM(R92C_TXAGC_MCS08, power[RTWN_RIDX_MCS(8)]) | - SM(R92C_TXAGC_MCS09, power[RTWN_RIDX_MCS(9)]) | - SM(R92C_TXAGC_MCS10, power[RTWN_RIDX_MCS(10)]) | - SM(R92C_TXAGC_MCS11, power[RTWN_RIDX_MCS(11)])); - rtwn_bb_write(sc, R92C_TXAGC_MCS15_MCS12(chain), - SM(R92C_TXAGC_MCS12, power[RTWN_RIDX_MCS(12)]) | - SM(R92C_TXAGC_MCS13, power[RTWN_RIDX_MCS(13)]) | - SM(R92C_TXAGC_MCS14, power[RTWN_RIDX_MCS(14)]) | - SM(R92C_TXAGC_MCS15, power[RTWN_RIDX_MCS(15)])); - } -} - -static void r92e_set_txpower(struct rtwn_softc *sc, struct ieee80211_channel *c) { uint8_t power[RTWN_RIDX_COUNT]; @@ -218,7 +157,7 @@ r92e_set_txpower(struct rtwn_softc *sc, struct ieee802 /* Compute per-rate Tx power values. */ r92e_get_txpower(sc, i, c, power); /* Write per-rate Tx power values to hardware. */ - r92e_write_txpower(sc, i, power); + r92c_write_txpower(sc, i, power); } } From owner-svn-src-head@freebsd.org Sun Aug 27 15:51:17 2017 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 45A95DF2373; Sun, 27 Aug 2017 15:51:17 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f46.google.com (mail-oi0-f46.google.com [209.85.218.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 08C2D75634; Sun, 27 Aug 2017 15:51:16 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f46.google.com with SMTP id g127so15196522oic.1; Sun, 27 Aug 2017 08:51:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=ESQTjw8rafNGbnsSyxxIwvfiK0oyxYvdXCDRR5fuJYc=; b=E/SG0Db43L6MdkTNllPFF+4jyBPP67H4Sv/dyZ63ZiMgOONQ+5QXlxIyis1Se4TCe9 88ucyg7rvUHMv0YLR4B2gXmeCPrUMn2lx+ZAzQQC5NYlZtSpWYbvtgwsXFwvMm0Zgvee Tv3dQPPLXfSaUNhMYuCUg0enJ1OkrLVw/3n26dmUQA+hb5NirFdEE4VDSQ729FwCSpHc sjc6fIaMJwRixB/kVB7P5Mfsu701ZtTuLwv73XWW8fZBZKQJGAREhX7oTvWaBqMeNKBd xNbyywt5M9G7xQt0umeoz9npp0HLoxu288b6O/8Wn2us3nUWH7meIop+5G3JeiJhGKKx rWvg== X-Gm-Message-State: AHYfb5i5aX9zUCczxomub/wDz6MwFsmdOVp96IOQuuhvE1S9KiKXWNMP EwiwrR7sazmTZMx1BwY= X-Received: by 10.202.181.138 with SMTP id e132mr5936843oif.8.1503849070217; Sun, 27 Aug 2017 08:51:10 -0700 (PDT) Received: from mail-io0-f169.google.com (mail-io0-f169.google.com. [209.85.223.169]) by smtp.gmail.com with ESMTPSA id c187sm12193146oig.41.2017.08.27.08.51.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Aug 2017 08:51:10 -0700 (PDT) Received: by mail-io0-f169.google.com with SMTP id k22so9848149iod.2; Sun, 27 Aug 2017 08:51:09 -0700 (PDT) X-Received: by 10.107.44.68 with SMTP id s65mr3849959ios.88.1503849069644; Sun, 27 Aug 2017 08:51:09 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.81.131 with HTTP; Sun, 27 Aug 2017 08:51:09 -0700 (PDT) In-Reply-To: References: <201708270514.v7R5EmDK064785@repo.freebsd.org> From: Conrad Meyer Date: Sun, 27 Aug 2017 08:51:09 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r322942 - head/sys/kern To: Ed Schouten Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Sun, 27 Aug 2017 15:51:17 -0000 On Sun, Aug 27, 2017 at 1:18 AM, Ed Schouten wrote: > Hi Conrad, > > [ Context: I don't understand anything about CPU topologies! ] > > 2017-08-27 7:14 GMT+02:00 Conrad Meyer : >> + while (top->cg_children == 1) { >> + top = &top->cg_child[0]; >> + top->cg_parent = NULL; >> + } > > This only removes layers from the top if they only have a single > child. Question: is it possible/likely to have CPU topologies where > one of the middle layers only has one child? If so, would it make > sense to use tree traversal here to do the flattening? Hi Ed, It is probably possible for middle layers to have a single child, and your proposal is a good one. This is just the canned patch from Jeff I already had lying around :-). Best, Conrad From owner-svn-src-head@freebsd.org Sun Aug 27 16:15:39 2017 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 2112DDF2C0F; Sun, 27 Aug 2017 16:15:39 +0000 (UTC) (envelope-from ngie@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 DCEDC76071; Sun, 27 Aug 2017 16:15:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7RGFclG033968; Sun, 27 Aug 2017 16:15:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7RGFcKs033967; Sun, 27 Aug 2017 16:15:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708271615.v7RGFcKs033967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 27 Aug 2017 16:15:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322951 - head X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 322951 X-SVN-Commit-Repository: base 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.23 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: Sun, 27 Aug 2017 16:15:39 -0000 Author: ngie Date: Sun Aug 27 16:15:37 2017 New Revision: 322951 URL: https://svnweb.freebsd.org/changeset/base/322951 Log: Respect MK_TCSH with build-tools and native-xtools This helps reduce the WORLDTMP footprint slightly. Based on a patch I submitted 5 years ago to GNATS. PR: 174051 MFC after: 2 weeks Relnotes: yes (anyone who cross-builds with MK_TCSH=yes will run into build failures if the host doesn't have tcsh(1)) Reminded by: Fabian Keil Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Aug 27 13:02:51 2017 (r322950) +++ head/Makefile.inc1 Sun Aug 27 16:15:37 2017 (r322951) @@ -1984,8 +1984,12 @@ _gcc_tools= gnu/usr.bin/cc/cc_tools _rescue=rescue/rescue .endif +.if ${MK_TCSH} != "no" +_tcsh=bin/csh +.endif + .for _tool in \ - bin/csh \ + ${_tcsh} \ bin/sh \ ${LOCAL_TOOL_DIRS} \ lib/ncurses/ncurses \ @@ -2143,7 +2147,7 @@ native-xtools: .PHONY bin/cat \ bin/chmod \ bin/cp \ - bin/csh \ + ${_tcsh} \ bin/echo \ bin/expr \ bin/hostname \ From owner-svn-src-head@freebsd.org Sun Aug 27 16:46:53 2017 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 0B722DF33E8; Sun, 27 Aug 2017 16:46:53 +0000 (UTC) (envelope-from ngie@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 D601976C06; Sun, 27 Aug 2017 16:46:52 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7RGkpEl046183; Sun, 27 Aug 2017 16:46:51 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7RGkpLc046182; Sun, 27 Aug 2017 16:46:51 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708271646.v7RGkpLc046182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 27 Aug 2017 16:46:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322952 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 322952 X-SVN-Commit-Repository: base 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.23 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: Sun, 27 Aug 2017 16:46:53 -0000 Author: ngie Date: Sun Aug 27 16:46:51 2017 New Revision: 322952 URL: https://svnweb.freebsd.org/changeset/base/322952 Log: Try and rebase the bsd.lib.mk changes after ^/head@r322824 was merged in Unfortunately the snippet's now broken -- need to get the matching expressions to work properly. Modified: head/share/mk/bsd.lib.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Sun Aug 27 16:15:37 2017 (r322951) +++ head/share/mk/bsd.lib.mk Sun Aug 27 16:46:51 2017 (r322952) @@ -76,6 +76,13 @@ CTFFLAGS+= -g .include +.if ${MK_COVERAGE} != "no" && (!empty(CFLAGS:M-g*) || !empty(CXXFLAGS:M-g*)) +_COV_FLAG= --coverage +CFLAGS+= ${_COV_FLAG} +CXXFLAGS+= ${_COV_FLAG} +.error "foo" +.endif + # prefer .s to a .c, add .po, remove stuff not used in the BSD libraries # .pico used for PIC object files .SUFFIXES: .out .o .bc .ll .po .pico .S .asm .s .c .cc .cpp .cxx .C .f .y .l .ln @@ -95,14 +102,14 @@ PO_FLAG=-pg ${CTFCONVERT_CMD} .c.pico: - ${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CC} ${PICFLAG} -DPIC ${PO_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} .cc.po .C.po .cpp.po .cxx.po: ${CXX} ${PO_FLAG} ${STATIC_CXXFLAGS} ${PO_CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} .cc.pico .C.pico .cpp.pico .cxx.pico: - ${CXX} ${PICFLAG} -DPIC ${SHARED_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CXX} ${PICFLAG} -DPIC ${PO_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} .f.po: ${FC} -pg ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC} @@ -142,6 +149,12 @@ _SHLIBDIR:=${SHLIBDIR} .if defined(SHLIB_NAME) .if ${MK_DEBUG_FILES} != "no" SHLIB_NAME_FULL=${SHLIB_NAME}.full +.if ${MK_COVERAGE} != "no" +COVERAGEFILEDIR=${COVERAGEDIR}${_SHLIBDIR} +.if !exists(${DESTDIR}${COVERAGEFILEDIR}) +COVERAGEMKDIR= +.endif +.endif # Use ${DEBUGDIR} for base system debug files, else .debug subdirectory .if ${_SHLIBDIR} == "/boot" ||\ ${SHLIBDIR:C%/lib(/.*)?$%/lib%} == "/lib" ||\ @@ -221,6 +234,9 @@ CLEANFILES+= ${SOBJS} .if defined(SHLIB_NAME) _LIBS+= ${SHLIB_NAME} +.if !empty(_COV_FLAG) +SOLINKOPTS+= ${_COV_FLAG} +.endif SOLINKOPTS+= -shared -Wl,-x .if defined(LD_FATAL_WARNINGS) && ${LD_FATAL_WARNINGS} == "no" SOLINKOPTS+= -Wl,--no-fatal-warnings @@ -360,6 +376,14 @@ _libinstall: ${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \ ${SHLIB_NAME} ${DESTDIR}${_SHLIBDIR}/ .if ${MK_DEBUG_FILES} != "no" +.if ${MK_COVERAGE} != "no" +.if defined(COVERAGEMKDIR) + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},coverage} -d ${DESTDIR}${COVERAGEFILEDIR}/ +.endif + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},coverage} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ + ${_INSTALLFLAGS} \ + ${SHLIB_NAME}.full ${DESTDIR}${COVERAGEFILEDIR}/${SHLIB_NAME} +.endif .if defined(DEBUGMKDIR) ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},debug} -d ${DESTDIR}${DEBUGFILEDIR}/ .endif @@ -411,6 +435,11 @@ _libinstall: .if !defined(LIBRARIES_ONLY) .include +.if defined(_COV_FLAG) +COV_OBJS= ${OBJS} +COV_SRCS= ${SRCS:M*.[c|cc|cpp|cxx|C]} +.include +.endif .include .include .include From owner-svn-src-head@freebsd.org Sun Aug 27 16:57:45 2017 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 65C37DF378B; Sun, 27 Aug 2017 16:57:45 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f41.google.com (mail-oi0-f41.google.com [209.85.218.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 340C077125; Sun, 27 Aug 2017 16:57:44 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f41.google.com with SMTP id g127so15787151oic.1; Sun, 27 Aug 2017 09:57:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=0u/zVFuu9U7l1xEGsJlTQJG80nTDCqAAnqIJF+koTHs=; b=q9gCf0zJUSjtFu9usPa4pYgEQEpAnqkl9C38/xMUtLlTxjcdeuQbFsLjR+KNe18GKR CyXHlzjeBAe1lGiXl3Eh6n4WriVGDVg1pFVIkn+AombRdnR/8NfSAb33FkGj9VlR5TiR CspfDwx4bdYSn8ToDkaRG2C3J66Drx/vJsPeBrITDtFbvKgjZSQAgpT5ZnS7irOb6Lon t97BlaEsCOfc4LslXTJwrTdlCyHt3BB9uVmtvOgBkBp+gN15U1hCxaNBOVs+8hC1O11+ VHgFjmgXYQFfRu4nhcRQYpByw5mrCHtxd2cHCKN0fEO+1sTiBOJuv56/jIgjE64a8Fnc y+AA== X-Gm-Message-State: AHYfb5j3TSuTmqXoMcWcMLZGv6CXBktokbkzCR5Cr/eo5P7Qf0+Cx9P5 lNehh2fb+wpv5ZuZrEc= X-Received: by 10.202.105.198 with SMTP id e189mr5370896oic.197.1503853057601; Sun, 27 Aug 2017 09:57:37 -0700 (PDT) Received: from mail-io0-f174.google.com (mail-io0-f174.google.com. [209.85.223.174]) by smtp.gmail.com with ESMTPSA id e204sm11749301oia.45.2017.08.27.09.57.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Aug 2017 09:57:37 -0700 (PDT) Received: by mail-io0-f174.google.com with SMTP id c18so10170725ioj.1; Sun, 27 Aug 2017 09:57:37 -0700 (PDT) X-Received: by 10.107.38.206 with SMTP id m197mr4657775iom.157.1503853057055; Sun, 27 Aug 2017 09:57:37 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.81.131 with HTTP; Sun, 27 Aug 2017 09:57:36 -0700 (PDT) In-Reply-To: <201708271646.v7RGkpLc046182@repo.freebsd.org> References: <201708271646.v7RGkpLc046182@repo.freebsd.org> From: Conrad Meyer Date: Sun, 27 Aug 2017 09:57:36 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r322952 - head/share/mk To: svn-src-all@freebsd.org Cc: src-committers , svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Sun, 27 Aug 2017 16:57:45 -0000 This appears to be breaking the build: -------------------------------------------------------------- >>> stage 1.1: legacy release compatibility shims -------------------------------------------------------------- ===> tools/build (obj,includes,all,install) make[5]: "/home/cem/head.svn/share/mk/bsd.lib.mk" line 79: Malformed conditional (${MK_COVERAGE} != "no" && (!empty(CFLAGS:M-g*) || !empty(CXXFLAGS:M-g*))) make[5]: Fatal errors encountered -- cannot continue make[5]: stopped in /home/cem/head.svn/tools/build On Sun, Aug 27, 2017 at 9:46 AM, Ngie Cooper wrote: > Author: ngie > Date: Sun Aug 27 16:46:51 2017 > New Revision: 322952 > URL: https://svnweb.freebsd.org/changeset/base/322952 > > Log: > Try and rebase the bsd.lib.mk changes after ^/head@r322824 was merged in > > Unfortunately the snippet's now broken -- need to get the matching expressions to > work properly. > > Modified: > head/share/mk/bsd.lib.mk > > Modified: head/share/mk/bsd.lib.mk > ============================================================================== > --- head/share/mk/bsd.lib.mk Sun Aug 27 16:15:37 2017 (r322951) > +++ head/share/mk/bsd.lib.mk Sun Aug 27 16:46:51 2017 (r322952) > @@ -76,6 +76,13 @@ CTFFLAGS+= -g > > .include > > +.if ${MK_COVERAGE} != "no" && (!empty(CFLAGS:M-g*) || !empty(CXXFLAGS:M-g*)) > +_COV_FLAG= --coverage > +CFLAGS+= ${_COV_FLAG} > +CXXFLAGS+= ${_COV_FLAG} > +.error "foo" > +.endif > + > # prefer .s to a .c, add .po, remove stuff not used in the BSD libraries > # .pico used for PIC object files > .SUFFIXES: .out .o .bc .ll .po .pico .S .asm .s .c .cc .cpp .cxx .C .f .y .l .ln > @@ -95,14 +102,14 @@ PO_FLAG=-pg > ${CTFCONVERT_CMD} > > .c.pico: > - ${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} > + ${CC} ${PICFLAG} -DPIC ${PO_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} > ${CTFCONVERT_CMD} > > .cc.po .C.po .cpp.po .cxx.po: > ${CXX} ${PO_FLAG} ${STATIC_CXXFLAGS} ${PO_CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} > > .cc.pico .C.pico .cpp.pico .cxx.pico: > - ${CXX} ${PICFLAG} -DPIC ${SHARED_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} > + ${CXX} ${PICFLAG} -DPIC ${PO_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} > > .f.po: > ${FC} -pg ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC} > @@ -142,6 +149,12 @@ _SHLIBDIR:=${SHLIBDIR} > .if defined(SHLIB_NAME) > .if ${MK_DEBUG_FILES} != "no" > SHLIB_NAME_FULL=${SHLIB_NAME}.full > +.if ${MK_COVERAGE} != "no" > +COVERAGEFILEDIR=${COVERAGEDIR}${_SHLIBDIR} > +.if !exists(${DESTDIR}${COVERAGEFILEDIR}) > +COVERAGEMKDIR= > +.endif > +.endif > # Use ${DEBUGDIR} for base system debug files, else .debug subdirectory > .if ${_SHLIBDIR} == "/boot" ||\ > ${SHLIBDIR:C%/lib(/.*)?$%/lib%} == "/lib" ||\ > @@ -221,6 +234,9 @@ CLEANFILES+= ${SOBJS} > .if defined(SHLIB_NAME) > _LIBS+= ${SHLIB_NAME} > > +.if !empty(_COV_FLAG) > +SOLINKOPTS+= ${_COV_FLAG} > +.endif > SOLINKOPTS+= -shared -Wl,-x > .if defined(LD_FATAL_WARNINGS) && ${LD_FATAL_WARNINGS} == "no" > SOLINKOPTS+= -Wl,--no-fatal-warnings > @@ -360,6 +376,14 @@ _libinstall: > ${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \ > ${SHLIB_NAME} ${DESTDIR}${_SHLIBDIR}/ > .if ${MK_DEBUG_FILES} != "no" > +.if ${MK_COVERAGE} != "no" > +.if defined(COVERAGEMKDIR) > + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},coverage} -d ${DESTDIR}${COVERAGEFILEDIR}/ > +.endif > + ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},coverage} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ > + ${_INSTALLFLAGS} \ > + ${SHLIB_NAME}.full ${DESTDIR}${COVERAGEFILEDIR}/${SHLIB_NAME} > +.endif > .if defined(DEBUGMKDIR) > ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},debug} -d ${DESTDIR}${DEBUGFILEDIR}/ > .endif > @@ -411,6 +435,11 @@ _libinstall: > > .if !defined(LIBRARIES_ONLY) > .include > +.if defined(_COV_FLAG) > +COV_OBJS= ${OBJS} > +COV_SRCS= ${SRCS:M*.[c|cc|cpp|cxx|C]} > +.include > +.endif > .include > .include > .include > From owner-svn-src-head@freebsd.org Sun Aug 27 17:06:24 2017 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 D3A87DF3982; Sun, 27 Aug 2017 17:06:24 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x232.google.com (mail-pf0-x232.google.com [IPv6:2607:f8b0:400e:c00::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 917EF774FC; Sun, 27 Aug 2017 17:06:24 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x232.google.com with SMTP id c15so9322426pfm.2; Sun, 27 Aug 2017 10:06:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=MfIuzUT0R4OAg7wl0F3C2tDm6RvNFSMk6OzIeiTdPeg=; b=pyDHRixT1I95wLzn0k4XnYQdyq+T06KsUXooRW/0GLGSGmYZLezM7jVjwa4sxeR+hq oysMvkuCPeoE9hAdKfpIkoNxHrw0CpHlsIQAPKez4HfRd6wE0AYApDVINKB9fB/Ek50G OF5phhw6y7w1B3jnVPfGN0QROIGngBTB160rGZlkskK/isPWGHdXsLko7U5MXAaYonoO k1gXOdxUUV88r/DVZtmHb6+BkQJE1ITycqfuLcYwaIUchQlDLkQrgR7emJ+JylSa16sX zc4yh1XOYU9NZr67LJYuHaBp9aHoWaiymTlLwNRreGT7s0r5iMGFL2di3Sea+CR9c34c i1YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=MfIuzUT0R4OAg7wl0F3C2tDm6RvNFSMk6OzIeiTdPeg=; b=aiMaTEYPRaAINaB8QK5VxrwiXg7pyOl7UMyT8xvtu3y+5nRoyP1Yy0cFczZjR5bIJH YIvAQlsA5VvV6NnfOzgnB91ml/aMTAMCc9ta1j83Kr11CQecUlLuMgicg2QkXMDmeBS/ OfTzB0SZ6EQnd+J/OFWVG4/OFc9P8/TF6lYzgHMe4z9yv4Z8j+Ke62RUWzrES0rcFJko WtKIKSjYWC10X+WH53UyXXAlQnBGgXdRDPVKYb2p02EkPf3k0n8TXuE2g6Z6OBIDc3YW Nnls5o0Av3ulYoSaOP0pyE4fFonLz1s7FWLsy3VCMkayEHwkvJmIbdIJWRFXZYoRQMik RppQ== X-Gm-Message-State: AHYfb5gnSHkentFKm0ZBRve13XVUbC+sGQZhRwpfVOAc2lOqr/Ns9HoV 919rRGu1NNY4ORkDj8M= X-Received: by 10.99.99.70 with SMTP id x67mr4027140pgb.37.1503853583682; Sun, 27 Aug 2017 10:06:23 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id d25sm21489199pfb.163.2017.08.27.10.06.22 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 27 Aug 2017 10:06:22 -0700 (PDT) Subject: Re: svn commit: r322952 - head/share/mk Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_5A6766A9-369F-4BEF-A314-222DED3DB39C"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Sun, 27 Aug 2017 10:06:21 -0700 Cc: svn-src-all@freebsd.org, src-committers , svn-src-head@freebsd.org Message-Id: <20ED2CEB-4399-40E2-9A07-5146A199C26D@gmail.com> References: <201708271646.v7RGkpLc046182@repo.freebsd.org> To: cem@freebsd.org X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Sun, 27 Aug 2017 17:06:25 -0000 --Apple-Mail=_5A6766A9-369F-4BEF-A314-222DED3DB39C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Aug 27, 2017, at 09:57, Conrad Meyer wrote: >=20 > This appears to be breaking the build: >=20 > -------------------------------------------------------------- >>>> stage 1.1: legacy release compatibility shims > -------------------------------------------------------------- > =3D=3D=3D> tools/build (obj,includes,all,install) > make[5]: "/home/cem/head.svn/share/mk/bsd.lib.mk" line 79: Malformed > conditional (${MK_COVERAGE} !=3D "no" && (!empty(CFLAGS:M-g*) || > !empty(CXXFLAGS:M-g*))) > make[5]: Fatal errors encountered -- cannot continue > make[5]: stopped in /home/cem/head.svn/tools/build The svn switch didn=E2=80=99t complete successfully =E2=80=94 great. = I=E2=80=99ll fix this shortly. -Ngie --Apple-Mail=_5A6766A9-369F-4BEF-A314-222DED3DB39C Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZovwNAAoJEPWDqSZpMIYVP8AP/1R/cpVTUdCw2r2tURXlh9c2 VZ7kJj/rM3pxqUh/sBuEew3V7VyQeMdqZata4PcW7lM+YBeRHtDVFGr0en4EpBhj ExoaNjr4ryns9u4JA2K7pCMuI/UhpBlsJEqW4b/gKy3MjUBrDbm0Oscv96ipDc28 u3S9KHMGXOppP4YYUh75Hu73aIDYrpqJ6Nd8en9my4mxoZ8Lxxa1g7kMoqVvQOjm ijyLNok7xutwZ6Rjgl0pRbdtC5KjcbFi2t5/o9e8utbvSaPgJZyA8YLGLDfyipxM vfKbFNBbRv0zf/g4l9MCCvNMjjCrEGsk30xEV6j7pY+CB3eKdue81V6S+fwFUlHa 8OC+GytzBCf03X1x5R0+op8LuaG6Vu8mrr0qpyuVPY0Rb1ZunwEyVksJUDsclwXl Qj9ZCBrcFLloRMitYVUDFKmJYOkHnRaogPBhQ72BJ8edPWwUQzcfujl8ZAWIGKDF VLncmVMQJAmJTSC0VAHPu0H/oC/hFfy915y+HhfDAS6APoCuf51tYeWyXM6f6CZR Rs5GCmxUpWzty+fYFIvOVDKHJGC0fMSiPuIOHX8HNfof5DUrJ4w+UgprJOZcTgTX R9vpyKMKAvH2/D1fhXt3gu2sTwf/8qJsvhk/EXw7S3MiJ2N+f3irSvtkPcZe1zqs raA/RLGPIKCZL+v5hnax =BvFI -----END PGP SIGNATURE----- --Apple-Mail=_5A6766A9-369F-4BEF-A314-222DED3DB39C-- From owner-svn-src-head@freebsd.org Sun Aug 27 17:08:09 2017 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 E1842DF3BEA; Sun, 27 Aug 2017 17:08:09 +0000 (UTC) (envelope-from ngie@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 BB27E77718; Sun, 27 Aug 2017 17:08:09 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7RH88De054471; Sun, 27 Aug 2017 17:08:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7RH88OA054470; Sun, 27 Aug 2017 17:08:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201708271708.v7RH88OA054470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sun, 27 Aug 2017 17:08:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322953 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: ngie X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 322953 X-SVN-Commit-Repository: base 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.23 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: Sun, 27 Aug 2017 17:08:10 -0000 Author: ngie Date: Sun Aug 27 17:08:08 2017 New Revision: 322953 URL: https://svnweb.freebsd.org/changeset/base/322953 Log: Revert change (r322952) that was not yet destined for ^/head This unbreaks the build. This happened because of a botched "svn switch". Reported by: cem Modified: head/share/mk/bsd.lib.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Sun Aug 27 16:46:51 2017 (r322952) +++ head/share/mk/bsd.lib.mk Sun Aug 27 17:08:08 2017 (r322953) @@ -76,13 +76,6 @@ CTFFLAGS+= -g .include -.if ${MK_COVERAGE} != "no" && (!empty(CFLAGS:M-g*) || !empty(CXXFLAGS:M-g*)) -_COV_FLAG= --coverage -CFLAGS+= ${_COV_FLAG} -CXXFLAGS+= ${_COV_FLAG} -.error "foo" -.endif - # prefer .s to a .c, add .po, remove stuff not used in the BSD libraries # .pico used for PIC object files .SUFFIXES: .out .o .bc .ll .po .pico .S .asm .s .c .cc .cpp .cxx .C .f .y .l .ln @@ -102,14 +95,14 @@ PO_FLAG=-pg ${CTFCONVERT_CMD} .c.pico: - ${CC} ${PICFLAG} -DPIC ${PO_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CC} ${PICFLAG} -DPIC ${SHARED_CFLAGS} ${CFLAGS} -c ${.IMPSRC} -o ${.TARGET} ${CTFCONVERT_CMD} .cc.po .C.po .cpp.po .cxx.po: ${CXX} ${PO_FLAG} ${STATIC_CXXFLAGS} ${PO_CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} .cc.pico .C.pico .cpp.pico .cxx.pico: - ${CXX} ${PICFLAG} -DPIC ${PO_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} + ${CXX} ${PICFLAG} -DPIC ${SHARED_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET} .f.po: ${FC} -pg ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC} @@ -149,12 +142,6 @@ _SHLIBDIR:=${SHLIBDIR} .if defined(SHLIB_NAME) .if ${MK_DEBUG_FILES} != "no" SHLIB_NAME_FULL=${SHLIB_NAME}.full -.if ${MK_COVERAGE} != "no" -COVERAGEFILEDIR=${COVERAGEDIR}${_SHLIBDIR} -.if !exists(${DESTDIR}${COVERAGEFILEDIR}) -COVERAGEMKDIR= -.endif -.endif # Use ${DEBUGDIR} for base system debug files, else .debug subdirectory .if ${_SHLIBDIR} == "/boot" ||\ ${SHLIBDIR:C%/lib(/.*)?$%/lib%} == "/lib" ||\ @@ -234,9 +221,6 @@ CLEANFILES+= ${SOBJS} .if defined(SHLIB_NAME) _LIBS+= ${SHLIB_NAME} -.if !empty(_COV_FLAG) -SOLINKOPTS+= ${_COV_FLAG} -.endif SOLINKOPTS+= -shared -Wl,-x .if defined(LD_FATAL_WARNINGS) && ${LD_FATAL_WARNINGS} == "no" SOLINKOPTS+= -Wl,--no-fatal-warnings @@ -376,14 +360,6 @@ _libinstall: ${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \ ${SHLIB_NAME} ${DESTDIR}${_SHLIBDIR}/ .if ${MK_DEBUG_FILES} != "no" -.if ${MK_COVERAGE} != "no" -.if defined(COVERAGEMKDIR) - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},coverage} -d ${DESTDIR}${COVERAGEFILEDIR}/ -.endif - ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},coverage} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ - ${_INSTALLFLAGS} \ - ${SHLIB_NAME}.full ${DESTDIR}${COVERAGEFILEDIR}/${SHLIB_NAME} -.endif .if defined(DEBUGMKDIR) ${INSTALL} ${TAG_ARGS:D${TAG_ARGS},debug} -d ${DESTDIR}${DEBUGFILEDIR}/ .endif @@ -435,11 +411,6 @@ _libinstall: .if !defined(LIBRARIES_ONLY) .include -.if defined(_COV_FLAG) -COV_OBJS= ${OBJS} -COV_SRCS= ${SRCS:M*.[c|cc|cpp|cxx|C]} -.include -.endif .include .include .include From owner-svn-src-head@freebsd.org Sun Aug 27 17:12:32 2017 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 1C55ADF3E2A; Sun, 27 Aug 2017 17:12:32 +0000 (UTC) (envelope-from cem@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 EB8E177B25; Sun, 27 Aug 2017 17:12:31 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7RHCVqo058306; Sun, 27 Aug 2017 17:12:31 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7RHCVXk058305; Sun, 27 Aug 2017 17:12:31 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201708271712.v7RHCVXk058305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sun, 27 Aug 2017 17:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322954 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 322954 X-SVN-Commit-Repository: base 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.23 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: Sun, 27 Aug 2017 17:12:32 -0000 Author: cem Date: Sun Aug 27 17:12:30 2017 New Revision: 322954 URL: https://svnweb.freebsd.org/changeset/base/322954 Log: Enhance debugibility of sysctl leaf re-use warnings Print the full conflicting oid path, and include the function name in the warning so it is clear that the warnings are sysctl-related. PR: 221853 Submitted by: Fabian Keil (earlier version) Sponsored by: Dell EMC Isilon Modified: head/sys/kern/kern_sysctl.c Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Sun Aug 27 17:08:08 2017 (r322953) +++ head/sys/kern/kern_sysctl.c Sun Aug 27 17:12:30 2017 (r322954) @@ -323,6 +323,91 @@ sysctl_load_tunable_by_oid_locked(struct sysctl_oid *o freeenv(penv); } +static int +sbuf_printf_drain(void *arg __unused, const char *data, int len) +{ + + return (printf("%.*s", len, data)); +} + +/* + * Locate the path to a given oid. Returns the length of the resulting path, + * or -1 if the oid was not found. nodes must have room for CTL_MAXNAME + * elements and be NULL initialized. + */ +static int +sysctl_search_oid(struct sysctl_oid **nodes, struct sysctl_oid *needle) +{ + int indx; + + SYSCTL_ASSERT_LOCKED(); + indx = 0; + while (indx < CTL_MAXNAME && indx >= 0) { + if (nodes[indx] == NULL && indx == 0) + nodes[indx] = SLIST_FIRST(&sysctl__children); + else if (nodes[indx] == NULL) + nodes[indx] = SLIST_FIRST(&nodes[indx - 1]->oid_children); + else + nodes[indx] = SLIST_NEXT(nodes[indx], oid_link); + + if (nodes[indx] == needle) + return (indx + 1); + + if (nodes[indx] == NULL) { + indx--; + continue; + } + + if ((nodes[indx]->oid_kind & CTLTYPE) == CTLTYPE_NODE) { + indx++; + continue; + } + } + return (-1); +} + +static void +sysctl_warn_reuse(const char *func, struct sysctl_oid *leaf) +{ + struct sysctl_oid *nodes[CTL_MAXNAME]; + char buf[128]; + struct sbuf sb; + int rc, i; + + (void)sbuf_new(&sb, buf, sizeof(buf), SBUF_FIXEDLEN | SBUF_INCLUDENUL); + sbuf_set_drain(&sb, sbuf_printf_drain, NULL); + + sbuf_printf(&sb, "%s: can't re-use a leaf (", __func__); + + memset(nodes, 0, sizeof(nodes)); + rc = sysctl_search_oid(nodes, leaf); + if (rc > 0) { + for (i = 0; i < rc; i++) + sbuf_printf(&sb, "%s%.*s", nodes[i]->oid_name, + i != (rc - 1), "."); + } else { + sbuf_printf(&sb, "%s", leaf->oid_name); + } + sbuf_printf(&sb, ")!\n"); + + (void)sbuf_finish(&sb); +} + +#ifdef SYSCTL_DEBUG +static int +sysctl_reuse_test(SYSCTL_HANDLER_ARGS) +{ + struct rm_priotracker tracker; + + SYSCTL_RLOCK(&tracker); + sysctl_warn_reuse(__func__, oidp); + SYSCTL_RUNLOCK(&tracker); + return (0); +} +SYSCTL_PROC(_sysctl, 0, reuse_test, CTLTYPE_STRING|CTLFLAG_RD|CTLFLAG_MPSAFE, + 0, 0, sysctl_reuse_test, "-", ""); +#endif + void sysctl_register_oid(struct sysctl_oid *oidp) { @@ -343,7 +428,7 @@ sysctl_register_oid(struct sysctl_oid *oidp) p->oid_refcnt++; return; } else { - printf("can't re-use a leaf (%s)!\n", p->oid_name); + sysctl_warn_reuse(__func__, p); return; } } @@ -715,8 +800,8 @@ sysctl_add_oid(struct sysctl_ctx_list *clist, struct s SYSCTL_WUNLOCK(); return (oidp); } else { + sysctl_warn_reuse(__func__, oidp); SYSCTL_WUNLOCK(); - printf("can't re-use a leaf (%s)!\n", name); return (NULL); } } From owner-svn-src-head@freebsd.org Sun Aug 27 22:13:04 2017 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 E00C5DF8F05; Sun, 27 Aug 2017 22:13:04 +0000 (UTC) (envelope-from avos@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 AA6F483F7A; Sun, 27 Aug 2017 22:13:04 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7RMD3rh083076; Sun, 27 Aug 2017 22:13:03 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7RMD3Yw083075; Sun, 27 Aug 2017 22:13:03 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201708272213.v7RMD3Yw083075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 27 Aug 2017 22:13:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322957 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 322957 X-SVN-Commit-Repository: base 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.23 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: Sun, 27 Aug 2017 22:13:05 -0000 Author: avos Date: Sun Aug 27 22:13:03 2017 New Revision: 322957 URL: https://svnweb.freebsd.org/changeset/base/322957 Log: net80211: fix a typo (premable -> preamble). Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Sun Aug 27 21:36:44 2017 (r322956) +++ head/sys/net80211/ieee80211_output.c Sun Aug 27 22:13:03 2017 (r322957) @@ -2500,7 +2500,7 @@ ieee80211_send_mgmt(struct ieee80211_node *ni, int typ capinfo |= IEEE80211_CAPINFO_PRIVACY; /* * NB: Some 11a AP's reject the request when - * short premable is set. + * short preamble is set. */ if ((ic->ic_flags & IEEE80211_F_SHPREAMBLE) && IEEE80211_IS_CHAN_2GHZ(ic->ic_curchan)) From owner-svn-src-head@freebsd.org Mon Aug 28 02:42:22 2017 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 1F71DE03DAC; Mon, 28 Aug 2017 02:42:22 +0000 (UTC) (envelope-from jhb@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 EF2AF657CF; Mon, 28 Aug 2017 02:42:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7S2gLe0091953; Mon, 28 Aug 2017 02:42:21 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7S2gLoH091952; Mon, 28 Aug 2017 02:42:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201708280242.v7S2gLoH091952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 28 Aug 2017 02:42:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322959 - head/usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/usr.bin/truss X-SVN-Commit-Revision: 322959 X-SVN-Commit-Repository: base 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.23 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: Mon, 28 Aug 2017 02:42:22 -0000 Author: jhb Date: Mon Aug 28 02:42:20 2017 New Revision: 322959 URL: https://svnweb.freebsd.org/changeset/base/322959 Log: Decode extra signal information for caught signals. Decode fields from the siginfo_t stored in the PT_LWPINFO structure when a signal is caught by a traced process. This includes the signal code (si_code) as well as additional members such as si_addr, si_pid, etc. Modified: head/usr.bin/truss/setup.c Modified: head/usr.bin/truss/setup.c ============================================================================== --- head/usr.bin/truss/setup.c Mon Aug 28 00:05:24 2017 (r322958) +++ head/usr.bin/truss/setup.c Mon Aug 28 02:42:20 2017 (r322959) @@ -585,8 +585,62 @@ report_new_child(struct trussinfo *info) } static void -report_signal(struct trussinfo *info, siginfo_t *si) +decode_siginfo(FILE *fp, siginfo_t *si) { + const char *str; + + fprintf(fp, " code="); + str = sysdecode_sigcode(si->si_signo, si->si_code); + if (str == NULL) + fprintf(fp, "%d", si->si_code); + else + fprintf(fp, "%s", str); + switch (si->si_code) { + case SI_NOINFO: + break; + case SI_QUEUE: + fprintf(fp, " value=%p", si->si_value.sival_ptr); + /* FALLTHROUGH */ + case SI_USER: + case SI_LWP: + fprintf(fp, " pid=%jd uid=%jd", (intmax_t)si->si_pid, + (intmax_t)si->si_uid); + break; + case SI_TIMER: + fprintf(fp, " value=%p", si->si_value.sival_ptr); + fprintf(fp, " timerid=%d", si->si_timerid); + fprintf(fp, " overrun=%d", si->si_overrun); + if (si->si_errno != 0) + fprintf(fp, " errno=%d", si->si_errno); + break; + case SI_ASYNCIO: + fprintf(fp, " value=%p", si->si_value.sival_ptr); + break; + case SI_MESGQ: + fprintf(fp, " value=%p", si->si_value.sival_ptr); + fprintf(fp, " mqd=%d", si->si_mqd); + break; + default: + switch (si->si_signo) { + case SIGILL: + case SIGFPE: + case SIGSEGV: + case SIGBUS: + fprintf(fp, " trapno=%d", si->si_trapno); + fprintf(fp, " addr=%p", si->si_addr); + break; + case SIGCHLD: + fprintf(fp, " pid=%jd uid=%jd", (intmax_t)si->si_pid, + (intmax_t)si->si_uid); + fprintf(fp, " status=%d", si->si_status); + break; + } + } +} + +static void +report_signal(struct trussinfo *info, siginfo_t *si, struct ptrace_lwpinfo *pl) +{ struct threadinfo *t; const char *signame; @@ -596,7 +650,11 @@ report_signal(struct trussinfo *info, siginfo_t *si) signame = sysdecode_signal(si->si_status); if (signame == NULL) signame = "?"; - fprintf(info->outfile, "SIGNAL %u (%s)\n", si->si_status, signame); + fprintf(info->outfile, "SIGNAL %u (%s)", si->si_status, signame); + if (pl->pl_event == PL_EVENT_SIGNAL && pl->pl_flags & PL_FLAG_SI) + decode_siginfo(info->outfile, &pl->pl_siginfo); + fprintf(info->outfile, "\n"); + } /* @@ -673,7 +731,7 @@ eventloop(struct trussinfo *info) pending_signal = 0; } else { if ((info->flags & NOSIGS) == 0) - report_signal(info, &si); + report_signal(info, &si, &pl); pending_signal = si.si_status; } ptrace(PT_SYSCALL, si.si_pid, (caddr_t)1, From owner-svn-src-head@freebsd.org Mon Aug 28 03:13:17 2017 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 8D523E04702; Mon, 28 Aug 2017 03:13:17 +0000 (UTC) (envelope-from np@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 5A6B56697C; Mon, 28 Aug 2017 03:13:17 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7S3DGil005011; Mon, 28 Aug 2017 03:13:16 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7S3DG2N005008; Mon, 28 Aug 2017 03:13:16 GMT (envelope-from np@FreeBSD.org) Message-Id: <201708280313.v7S3DG2N005008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 28 Aug 2017 03:13:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322960 - in head/sys/dev/cxgbe: . common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . common X-SVN-Commit-Revision: 322960 X-SVN-Commit-Repository: base 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.23 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: Mon, 28 Aug 2017 03:13:17 -0000 Author: np Date: Mon Aug 28 03:13:16 2017 New Revision: 322960 URL: https://svnweb.freebsd.org/changeset/base/322960 Log: cxgbe(4): Verify that the driver accesses the firmware mailbox in a thread-safe manner. MFC after: 3 days Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Mon Aug 28 02:42:20 2017 (r322959) +++ head/sys/dev/cxgbe/adapter.h Mon Aug 28 03:13:16 2017 (r322960) @@ -151,7 +151,7 @@ enum { /* adapter flags */ FULL_INIT_DONE = (1 << 0), FW_OK = (1 << 1), - /* INTR_DIRECT = (1 << 2), No longer used. */ + CHK_MBOX_ACCESS = (1 << 2), MASTER_PF = (1 << 3), ADAP_SYSCTL_CTX = (1 << 4), /* TOM_INIT_DONE= (1 << 5), No longer used */ Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Mon Aug 28 02:42:20 2017 (r322959) +++ head/sys/dev/cxgbe/common/t4_hw.c Mon Aug 28 03:13:16 2017 (r322960) @@ -286,6 +286,9 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int __be64 cmd_rpl[MBOX_LEN/8]; u32 pcie_fw; + if (adap->flags & CHK_MBOX_ACCESS) + ASSERT_SYNCHRONIZED_OP(adap); + if ((size & 15) || size > MBOX_LEN) return -EINVAL; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Aug 28 02:42:20 2017 (r322959) +++ head/sys/dev/cxgbe/t4_main.c Mon Aug 28 03:13:16 2017 (r322960) @@ -1221,6 +1221,15 @@ t4_attach(device_t dev) goto done; } + /* + * Ensure thread-safe mailbox access (in debug builds). + * + * So far this was the only thread accessing the mailbox but various + * ifnets and sysctls are about to be created and their handlers/ioctls + * will access the mailbox from different threads. + */ + sc->flags |= CHK_MBOX_ACCESS; + rc = bus_generic_attach(dev); if (rc != 0) { device_printf(dev, @@ -1336,6 +1345,7 @@ t4_detach_common(device_t dev) sc = device_get_softc(dev); + sc->flags &= ~CHK_MBOX_ACCESS; if (sc->flags & FULL_INIT_DONE) { if (!(sc->flags & IS_VF)) t4_intr_disable(sc); From owner-svn-src-head@freebsd.org Mon Aug 28 03:25:43 2017 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 18030E0493B; Mon, 28 Aug 2017 03:25:43 +0000 (UTC) (envelope-from np@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 D9C2566DB6; Mon, 28 Aug 2017 03:25:42 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7S3Pg8j009210; Mon, 28 Aug 2017 03:25:42 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7S3PgqQ009209; Mon, 28 Aug 2017 03:25:42 GMT (envelope-from np@FreeBSD.org) Message-Id: <201708280325.v7S3PgqQ009209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 28 Aug 2017 03:25:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322961 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 322961 X-SVN-Commit-Repository: base 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.23 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: Mon, 28 Aug 2017 03:25:43 -0000 Author: np Date: Mon Aug 28 03:25:41 2017 New Revision: 322961 URL: https://svnweb.freebsd.org/changeset/base/322961 Log: cxgbe(4): Fix some assertions during driver detach. The netmap queues can't be initialized if the VI isn't. MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Mon Aug 28 03:13:16 2017 (r322960) +++ head/sys/dev/cxgbe/t4_sge.c Mon Aug 28 03:25:41 2017 (r322961) @@ -3306,7 +3306,10 @@ free_nm_rxq(struct vi_info *vi, struct sge_nm_rxq *nm_ { struct adapter *sc = vi->pi->adapter; - MPASS(nm_rxq->iq_cntxt_id == INVALID_NM_RXQ_CNTXT_ID); + if (vi->flags & VI_INIT_DONE) + MPASS(nm_rxq->iq_cntxt_id == INVALID_NM_RXQ_CNTXT_ID); + else + MPASS(nm_rxq->iq_cntxt_id == 0); free_ring(sc, nm_rxq->iq_desc_tag, nm_rxq->iq_desc_map, nm_rxq->iq_ba, nm_rxq->iq_desc); @@ -3366,7 +3369,10 @@ free_nm_txq(struct vi_info *vi, struct sge_nm_txq *nm_ { struct adapter *sc = vi->pi->adapter; - MPASS(nm_txq->cntxt_id == INVALID_NM_TXQ_CNTXT_ID); + if (vi->flags & VI_INIT_DONE) + MPASS(nm_txq->cntxt_id == INVALID_NM_TXQ_CNTXT_ID); + else + MPASS(nm_txq->cntxt_id == 0); free_ring(sc, nm_txq->desc_tag, nm_txq->desc_map, nm_txq->ba, nm_txq->desc); From owner-svn-src-head@freebsd.org Mon Aug 28 04:06:42 2017 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 4552CE04FE0; Mon, 28 Aug 2017 04:06:42 +0000 (UTC) (envelope-from np@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 058C267A61; Mon, 28 Aug 2017 04:06:41 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7S46fTN025317; Mon, 28 Aug 2017 04:06:41 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7S46fgO025316; Mon, 28 Aug 2017 04:06:41 GMT (envelope-from np@FreeBSD.org) Message-Id: <201708280406.v7S46fgO025316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 28 Aug 2017 04:06:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322962 - head/sys/dev/cxgbe/common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/common X-SVN-Commit-Revision: 322962 X-SVN-Commit-Repository: base 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.23 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: Mon, 28 Aug 2017 04:06:42 -0000 Author: np Date: Mon Aug 28 04:06:40 2017 New Revision: 322962 URL: https://svnweb.freebsd.org/changeset/base/322962 Log: cxgbe(4): Remove write only variable from t4_port_init. MFC after: 3 days Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Mon Aug 28 03:25:41 2017 (r322961) +++ head/sys/dev/cxgbe/common/t4_hw.c Mon Aug 28 04:06:40 2017 (r322962) @@ -8354,12 +8354,9 @@ int t4_port_init(struct adapter *adap, int mbox, int p { u8 addr[6]; int ret, i, j; - struct fw_port_cmd c; u16 rss_size; struct port_info *p = adap2pinfo(adap, port_id); u32 param, val; - - memset(&c, 0, sizeof(c)); for (i = 0, j = -1; i <= p->port_id; i++) { do { From owner-svn-src-head@freebsd.org Mon Aug 28 06:55:11 2017 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 E38B2E074E5 for ; Mon, 28 Aug 2017 06:55:11 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x232.google.com (mail-yw0-x232.google.com [IPv6:2607:f8b0:4002:c05::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94EAF6B913 for ; Mon, 28 Aug 2017 06:55:11 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x232.google.com with SMTP id t188so24566954ywb.1 for ; Sun, 27 Aug 2017 23:55:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=DvodAsPZpi2wonsgqc1V0TKjRmiLF0x3zShDcRQIQuw=; b=O9zCMtlK22rDzs/GFznZmXLiUSnwGnZN9OWsuGmuqHCVuxlUsSCwWrcFtFPZ8FT8NB 9PyCvdH6nYRwlnmN767kQMdbPyARuVFduIhl7FZ+/qyrZsU5LjO2QajJ3/yNW6u9BPS0 AeDWxRWXPkeajxgFmWtyv+tS4RAhQNTGMCZMFcQPzmUhr7e0YeF0RuRqYVUuwieUkkXb Ivd1TAM6Dy00HAcf6kXLHci8fDL3+KT8TR+SB3t5ATQHb0Se5yLU1vPETrly7lU/0zHE AQ4+QdJ7RTiISH/0082nfmusdq49x0MRLGJm+IpwA/qeSZG3AQ1n9zEjj6iSE0TXlv1H Wfhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=DvodAsPZpi2wonsgqc1V0TKjRmiLF0x3zShDcRQIQuw=; b=FZnx4jP5dJDXYjyARo6c5p0KEWFpdvUmOBAX2F+dvn6ceEhs1pp1ObIBWqGTgR5bBM MLUubf/FN7GhRn34R3hxIZ/S9nBIdiNlJ4j0jLM6JHLxGP7JwdlCsyuPNGz5JR7COOLN qvJyrrP8JeSxkgAjxl4vft+YPLxB5Uw2jxqMX5SFLndbHNWg/ONC/h5SJ+/W/Tt0VPrd QADnn6tqp+sjYwLz9wScA8DJJkY7QJ67TnSub8OXnuOkACcJuqIvQ3Fzyb+MqtnH875r rkT4Eeqki2/+hWScSMIL1rcTPgUtqgYUzyQR9HwZ0QWmSg+x8k9zdKFXpo7AJAsAMeYw wNBA== X-Gm-Message-State: AHYfb5hk5CtIHgAYzRjhxpD24OasUjlHz+z01ky/uv+gnGJYMbhTaXLc F8T3tR9aM3KWBsBNAbtCChNJFp7hZnD9 X-Received: by 10.129.50.206 with SMTP id y197mr2857517ywy.314.1503903310687; Sun, 27 Aug 2017 23:55:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.227.193 with HTTP; Sun, 27 Aug 2017 23:54:40 -0700 (PDT) In-Reply-To: References: <1C5A448F-C91A-4599-8500-E4E46E6F5205@dsl-only.net> From: Ed Schouten Date: Mon, 28 Aug 2017 08:54:40 +0200 Message-ID: Subject: Re: svn commit: r322875 - head/sys/dev/nvme To: Mark Millard Cc: David Chisnall , Warner Losh , svn-src-head@freebsd.org, FreeBSD Current , FreeBSD-STABLE Mailing List , freebsd-hackers Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Mon, 28 Aug 2017 06:55:12 -0000 Mark, 2017-08-25 14:53 GMT+02:00 Ed Schouten : > 2017-08-25 9:46 GMT+02:00 Mark Millard : >> It appears that at least 11.1-STABLE -r322807 does not handle >> -std=c++98 styles of use of _Static_assert for g++7 in that >> g++7 reports an error: > > Maybe we need to do something like this? > > Index: sys/sys/cdefs.h > =================================================================== > --- sys/sys/cdefs.h (revision 322887) > +++ sys/sys/cdefs.h (working copy) > @@ -294,7 +294,7 @@ > #if (defined(__cplusplus) && __cplusplus >= 201103L) || \ > __has_extension(cxx_static_assert) > #define _Static_assert(x, y) static_assert(x, y) > -#elif __GNUC_PREREQ__(4,6) > +#elif __GNUC_PREREQ__(4,6) && !defined(__cplusplus) > /* Nothing, gcc 4.6 and higher has _Static_assert built-in */ > #elif defined(__COUNTER__) > #define _Static_assert(x, y) __Static_assert(x, __COUNTER__) Could you let me know whether this patch fixes the build for you? If so, I'll commit it! -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Mon Aug 28 07:50:55 2017 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 AF7B7E0816A; Mon, 28 Aug 2017 07:50:55 +0000 (UTC) (envelope-from np@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 7EA616CE8F; Mon, 28 Aug 2017 07:50:55 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7S7osUs014186; Mon, 28 Aug 2017 07:50:54 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7S7ostW014185; Mon, 28 Aug 2017 07:50:54 GMT (envelope-from np@FreeBSD.org) Message-Id: <201708280750.v7S7ostW014185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Mon, 28 Aug 2017 07:50:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322964 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 322964 X-SVN-Commit-Repository: base 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.23 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: Mon, 28 Aug 2017 07:50:55 -0000 Author: np Date: Mon Aug 28 07:50:54 2017 New Revision: 322964 URL: https://svnweb.freebsd.org/changeset/base/322964 Log: cxgbe(4): vi_mac_funcs should include the base Ethernet function. It is already used in the driver as if it does. MFC after: 3 days Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Aug 28 06:17:04 2017 (r322963) +++ head/sys/dev/cxgbe/t4_main.c Mon Aug 28 07:50:54 2017 (r322964) @@ -467,8 +467,9 @@ TUNABLE_INT("hw.cxl.write_combine", &t5_write_combine) static int t4_num_vis = 1; TUNABLE_INT("hw.cxgbe.num_vis", &t4_num_vis); -/* Functions used by extra VIs to obtain unique MAC addresses for each VI. */ +/* Functions used by VIs to obtain unique MAC addresses for each VI. */ static int vi_mac_funcs[] = { + FW_VI_FUNC_ETH, FW_VI_FUNC_OFLD, FW_VI_FUNC_IWARP, FW_VI_FUNC_OPENISCSI, @@ -2146,6 +2147,7 @@ vcxgbe_attach(device_t dev) sc = pi->adapter; index = vi - pi->vi; + MPASS(index > 0); /* This function deals with _extra_ VIs only */ KASSERT(index < nitems(vi_mac_funcs), ("%s: VI %s doesn't have a MAC func", __func__, device_get_nameunit(dev))); From owner-svn-src-head@freebsd.org Mon Aug 28 09:02:15 2017 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 02DDCE09404 for ; Mon, 28 Aug 2017 09:02:15 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: from asp.reflexion.net (outbound-mail-210-57.reflexion.net [208.70.210.57]) (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 9D8796EFC8 for ; Mon, 28 Aug 2017 09:02:14 +0000 (UTC) (envelope-from markmi@dsl-only.net) Received: (qmail 1841 invoked from network); 28 Aug 2017 09:03:58 -0000 Received: from unknown (HELO mail-cs-01.app.dca.reflexion.local) (10.81.19.1) by 0 (rfx-qmail) with SMTP; 28 Aug 2017 09:03:58 -0000 Received: by mail-cs-01.app.dca.reflexion.local (Reflexion email security v8.40.2) with SMTP; Mon, 28 Aug 2017 05:02:07 -0400 (EDT) Received: (qmail 3497 invoked from network); 28 Aug 2017 09:02:07 -0000 Received: from unknown (HELO iron2.pdx.net) (69.64.224.71) by 0 (rfx-qmail) with (AES256-SHA encrypted) SMTP; 28 Aug 2017 09:02:07 -0000 Received: from [192.168.1.109] (c-67-170-167-181.hsd1.or.comcast.net [67.170.167.181]) by iron2.pdx.net (Postfix) with ESMTPSA id 54F3EEC8816; Mon, 28 Aug 2017 02:02:06 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r322875 - head/sys/dev/nvme From: Mark Millard In-Reply-To: Date: Mon, 28 Aug 2017 02:02:05 -0700 Cc: David Chisnall , Warner Losh , svn-src-head@freebsd.org, FreeBSD Current , FreeBSD-STABLE Mailing List , freebsd-hackers Content-Transfer-Encoding: 7bit Message-Id: <0639EC0E-1F0F-4CB0-A3FE-4E8CD814B6D3@dsl-only.net> References: <1C5A448F-C91A-4599-8500-E4E46E6F5205@dsl-only.net> To: Ed Schouten X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Mon, 28 Aug 2017 09:02:15 -0000 On 2017-Aug-27, at 11:54 PM, Ed Schouten wrote: > 2017-08-25 14:53 GMT+02:00 Ed Schouten : >> 2017-08-25 9:46 GMT+02:00 Mark Millard : >>> It appears that at least 11.1-STABLE -r322807 does not handle >>> -std=c++98 styles of use of _Static_assert for g++7 in that >>> g++7 reports an error: >> >> Maybe we need to do something like this? >> >> Index: sys/sys/cdefs.h >> =================================================================== >> --- sys/sys/cdefs.h (revision 322887) >> +++ sys/sys/cdefs.h (working copy) >> @@ -294,7 +294,7 @@ >> #if (defined(__cplusplus) && __cplusplus >= 201103L) || \ >> __has_extension(cxx_static_assert) >> #define _Static_assert(x, y) static_assert(x, y) >> -#elif __GNUC_PREREQ__(4,6) >> +#elif __GNUC_PREREQ__(4,6) && !defined(__cplusplus) >> /* Nothing, gcc 4.6 and higher has _Static_assert built-in */ >> #elif defined(__COUNTER__) >> #define _Static_assert(x, y) __Static_assert(x, __COUNTER__) > > Could you let me know whether this patch fixes the build for you? If > so, I'll commit it! As a variant of stable/11 -r322807 . . . buildworld and buildkernel seem to work fine. (I did not try any port [re-]builds.) Based on the same main.cc as before . . . g++7 -std=c++98 main.cc g++7 -Wpedantic -std=c++98 main.cc g++7 -std=c++03 main.cc g++7 -Wpedantic -std=c++03 main.cc no longer complain (so no error, no warning). clang++ -Wpedantic -std=c++11 main.cc clang++ -Wpedantic -std=c++98 main.cc clang++ -Wpedantic -std=c++03 main.cc each still give the warning but no error. g++7 -Wpedantic -std=c++11 main.cc g++7 -std=c++11 main.cc clang++ -std=c++11 main.cc clang++ -std=c++98 main.cc clang++ -std=c++03 main.cc are still silent, no errors, no warnings. Note that clang here is version 4 --the same as in my original report that had the g++7 rejection example. This is because of the stable/11 context that I used. (An intended MFC had been listed.) If needed I could probably try under some version of head (and so test clang version 5). === Mark Millard markmi at dsl-only.net From owner-svn-src-head@freebsd.org Mon Aug 28 09:35:18 2017 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 8326BE09CC8; Mon, 28 Aug 2017 09:35:18 +0000 (UTC) (envelope-from ed@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 5269F70013; Mon, 28 Aug 2017 09:35:18 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7S9ZH51058879; Mon, 28 Aug 2017 09:35:17 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7S9ZH9a058878; Mon, 28 Aug 2017 09:35:17 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201708280935.v7S9ZH9a058878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 28 Aug 2017 09:35:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322965 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 322965 X-SVN-Commit-Repository: base 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.23 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: Mon, 28 Aug 2017 09:35:18 -0000 Author: ed Date: Mon Aug 28 09:35:17 2017 New Revision: 322965 URL: https://svnweb.freebsd.org/changeset/base/322965 Log: Make _Static_assert() work with GCC in older C++ standards. GCC only activates C11 keywords in C mode, not C++ mode. This means that when targeting an older C++ standard, we cannot fall back to using _Static_assert(). In this case, do define _Static_assert() as a macro that uses a typedef'ed array. Discussed in: r322875 commit thread Reported by: Mark MIllard MFC after: 1 month Modified: head/sys/sys/cdefs.h Modified: head/sys/sys/cdefs.h ============================================================================== --- head/sys/sys/cdefs.h Mon Aug 28 07:50:54 2017 (r322964) +++ head/sys/sys/cdefs.h Mon Aug 28 09:35:17 2017 (r322965) @@ -294,7 +294,7 @@ #if (defined(__cplusplus) && __cplusplus >= 201103L) || \ __has_extension(cxx_static_assert) #define _Static_assert(x, y) static_assert(x, y) -#elif __GNUC_PREREQ__(4,6) +#elif __GNUC_PREREQ__(4,6) && !defined(__cplusplus) /* Nothing, gcc 4.6 and higher has _Static_assert built-in */ #elif defined(__COUNTER__) #define _Static_assert(x, y) __Static_assert(x, __COUNTER__) From owner-svn-src-head@freebsd.org Mon Aug 28 09:36:49 2017 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 DBF04E09D3B for ; Mon, 28 Aug 2017 09:36:49 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x22e.google.com (mail-yw0-x22e.google.com [IPv6:2607:f8b0:4002:c05::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8EB9C70176 for ; Mon, 28 Aug 2017 09:36:49 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x22e.google.com with SMTP id s187so13809319ywf.2 for ; Mon, 28 Aug 2017 02:36:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=u/B4CIKTIpXtJTDiWp0pYzBNCK+pwX/dz8cXZe59aU8=; b=OwN4Jvtgsv4wQf6E8c3As7Ou7Z1YkhCYLnKYu8zHXGLKeyX+xTCHlpOBDvhVe10Zvq ElF9ntamn5VUAT/O7Ez2jGTc0rpMacYEWoo6q6BMzQjcfUp+d96BwKq664r9s5MHIkvJ xxfTWcZ4M36HU7iv5qlXL82htQWtiGdhaAtf2Irc8hLIJUVgf9LP48HZ1TNMrM7yjWVA 3nK2iFESEU1UiAlnzZu669y9XN63++gj2rilZo/Qf0hhsMSY2/fq/j/avj/qX1V8ZUJX lXIHdMsBMYYslASPcMxtYzzYv1IHHwyK9mEfjqZD5oRw4+gBERdnYINkmcCvEOPAtk1M 0LZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=u/B4CIKTIpXtJTDiWp0pYzBNCK+pwX/dz8cXZe59aU8=; b=Et2NqD4yehVMtfIHEHzupd3aH6O8OW0FFXpwpmEIXA1Gruf6VVXjC/e3MxR36ZnXFr LRdqL16QHDX+9tIOwAF6Z2KT6YpWPvtKRbG/dpNg66GN/7qB4agXY+/ng+tx2jJZ5T84 +6SWsrcwfKt4GlKkTAk3QvRV6T+7AnuuUxOPbhjGdHaKvGnhq49RDZAx5QntMU7auxXn k7EyM5w3LY+K+OglvsFZhMwS9xluatW2hUG+b8pp4NX1pg2/8L9QgcHJd4GWaf0ziHB0 F4CQwTCwvnRZbBNF3wCacIfOHpSYaI7NngZfLczvlN6O7HaTtP/V9bCMalT+Iy9zO8sS WnNQ== X-Gm-Message-State: AHYfb5i1XUlyU4ODDBl81lfwJGvat7PuDidpBRmtkUDdpVIX+RGMj+n6 FJ432/DY4Q1wMnhQvxNDZcoGpakteGufrz8= X-Received: by 10.37.171.208 with SMTP id v74mr5173459ybi.99.1503913008729; Mon, 28 Aug 2017 02:36:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.227.193 with HTTP; Mon, 28 Aug 2017 02:36:18 -0700 (PDT) In-Reply-To: <0639EC0E-1F0F-4CB0-A3FE-4E8CD814B6D3@dsl-only.net> References: <1C5A448F-C91A-4599-8500-E4E46E6F5205@dsl-only.net> <0639EC0E-1F0F-4CB0-A3FE-4E8CD814B6D3@dsl-only.net> From: Ed Schouten Date: Mon, 28 Aug 2017 11:36:18 +0200 Message-ID: Subject: Re: svn commit: r322875 - head/sys/dev/nvme To: Mark Millard Cc: David Chisnall , Warner Losh , svn-src-head@freebsd.org, FreeBSD Current , FreeBSD-STABLE Mailing List , freebsd-hackers Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Mon, 28 Aug 2017 09:36:50 -0000 2017-08-28 11:02 GMT+02:00 Mark Millard : > Based on the same main.cc as before . . . > > g++7 -std=c++98 main.cc > g++7 -Wpedantic -std=c++98 main.cc > g++7 -std=c++03 main.cc > g++7 -Wpedantic -std=c++03 main.cc > > no longer complain (so no error, no > warning). Perfect! I've committed this change as r322965. Thanks for testing! -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-head@freebsd.org Mon Aug 28 11:41:19 2017 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 66862E0BB95; Mon, 28 Aug 2017 11:41:19 +0000 (UTC) (envelope-from tuexen@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 33B57737B4; Mon, 28 Aug 2017 11:41:19 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7SBfI2o011159; Mon, 28 Aug 2017 11:41:18 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7SBfItt011158; Mon, 28 Aug 2017 11:41:18 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201708281141.v7SBfItt011158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 28 Aug 2017 11:41:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322967 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 322967 X-SVN-Commit-Repository: base 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.23 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: Mon, 28 Aug 2017 11:41:19 -0000 Author: tuexen Date: Mon Aug 28 11:41:18 2017 New Revision: 322967 URL: https://svnweb.freebsd.org/changeset/base/322967 Log: Fix blackhole detection. There were two bugs related to the blackhole detection: * The smalles size was tried more than two times. * The restored MSS was not the original one, but the second candidate. MFC after: 1 week Sponsored by: Netflix, Inc. Modified: head/sys/netinet/tcp_timer.c Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Mon Aug 28 10:02:47 2017 (r322966) +++ head/sys/netinet/tcp_timer.c Mon Aug 28 11:41:18 2017 (r322967) @@ -726,19 +726,21 @@ tcp_timer_rexmt(void * xtp) */ if (((tp->t_flags2 & (TF2_PLPMTU_PMTUD|TF2_PLPMTU_MAXSEGSNT)) == (TF2_PLPMTU_PMTUD|TF2_PLPMTU_MAXSEGSNT)) && - (tp->t_rxtshift >= 2 && tp->t_rxtshift % 2 == 0)) { + (tp->t_rxtshift >= 2 && tp->t_rxtshift < 6 && + tp->t_rxtshift % 2 == 0)) { /* * Enter Path MTU Black-hole Detection mechanism: * - Disable Path MTU Discovery (IP "DF" bit). * - Reduce MTU to lower value than what we * negotiated with peer. */ - /* Record that we may have found a black hole. */ - tp->t_flags2 |= TF2_PLPMTU_BLACKHOLE; + if ((tp->t_flags2 & TF2_PLPMTU_BLACKHOLE) == 0) { + /* Record that we may have found a black hole. */ + tp->t_flags2 |= TF2_PLPMTU_BLACKHOLE; + /* Keep track of previous MSS. */ + tp->t_pmtud_saved_maxseg = tp->t_maxseg; + } - /* Keep track of previous MSS. */ - tp->t_pmtud_saved_maxseg = tp->t_maxseg; - /* * Reduce the MSS to blackhole value or to the default * in an attempt to retransmit. @@ -796,7 +798,7 @@ tcp_timer_rexmt(void * xtp) * stage (1448, 1188, 524) 2 chances to recover. */ if ((tp->t_flags2 & TF2_PLPMTU_BLACKHOLE) && - (tp->t_rxtshift > 6)) { + (tp->t_rxtshift >= 6)) { tp->t_flags2 |= TF2_PLPMTU_PMTUD; tp->t_flags2 &= ~TF2_PLPMTU_BLACKHOLE; tp->t_maxseg = tp->t_pmtud_saved_maxseg; From owner-svn-src-head@freebsd.org Mon Aug 28 14:49:27 2017 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 C3E41E0E926; Mon, 28 Aug 2017 14:49:27 +0000 (UTC) (envelope-from gjb@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 93B717D95B; Mon, 28 Aug 2017 14:49:27 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7SEnQi2085753; Mon, 28 Aug 2017 14:49:26 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7SEnQDm085752; Mon, 28 Aug 2017 14:49:26 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201708281449.v7SEnQDm085752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 28 Aug 2017 14:49:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322968 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 322968 X-SVN-Commit-Repository: base 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.23 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: Mon, 28 Aug 2017 14:49:27 -0000 Author: gjb Date: Mon Aug 28 14:49:26 2017 New Revision: 322968 URL: https://svnweb.freebsd.org/changeset/base/322968 Log: Increase the Amazon EC2 AMI image size from 2GB to 3GB to prevent image build failures due to a full md(4)-backed filesystem. Sponsored by: The FreeBSD Foundation Modified: head/release/tools/ec2.conf Modified: head/release/tools/ec2.conf ============================================================================== --- head/release/tools/ec2.conf Mon Aug 28 11:41:18 2017 (r322967) +++ head/release/tools/ec2.conf Mon Aug 28 14:49:26 2017 (r322968) @@ -11,12 +11,12 @@ export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebs # Set to a list of third-party software to enable in rc.conf(5). export VM_RC_LIST="ec2_configinit ec2_fetchkey ec2_ephemeralswap ec2_loghostkey firstboot_freebsd_update firstboot_pkgs" -# Build with a 2 GB UFS partition; the growfs rc.d script will expand +# Build with a 3 GB UFS partition; the growfs rc.d script will expand # the partition to fill the root disk after the EC2 instance is launched. # Note that if this is set to G, we will end up with an GB disk # image since VMSIZE is the size of the UFS partition, not the disk which # it resides within. -export VMSIZE=2048M +export VMSIZE=3072M # No swap space; the ec2_ephemeralswap rc.d script will allocate swap # space on EC2 ephemeral disks. (If they exist -- the T2 low-cost instances From owner-svn-src-head@freebsd.org Mon Aug 28 15:54:09 2017 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 68213E0F6C4; Mon, 28 Aug 2017 15:54:09 +0000 (UTC) (envelope-from sobomax@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 40E3D7F637; Mon, 28 Aug 2017 15:54:09 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v7SFs8T5014274; Mon, 28 Aug 2017 15:54:08 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v7SFs8fr014268; Mon, 28 Aug 2017 15:54:08 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201708281554.v7SFs8fr014268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Mon, 28 Aug 2017 15:54:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322969 - in head: sbin/mdconfig sys/dev/md sys/sys X-SVN-Group: head X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: in head: sbin/mdconfig sys/dev/md sys/sys X-SVN-Commit-Revision: 322969 X-SVN-Commit-Repository: base 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.23 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: Mon, 28 Aug 2017 15:54:09 -0000 Author: sobomax Date: Mon Aug 28 15:54:07 2017 New Revision: 322969 URL: https://svnweb.freebsd.org/changeset/base/322969 Log: Add ability to label md(4) devices. This feature comes from the fact that we rely memory-backed md(4) in our build process heavily. However, if the build goes haywire the allocated resources (i.e. swap and memory-backed md(4)'s) need to be purged. It is extremely useful to have ability to attach arbitrary labels to each of the virtual disks so that they can be identified and GC'ed if neecessary. MFC after: 4 weeks Differential Revision: https://reviews.freebsd.org/D10457 Modified: head/sbin/mdconfig/mdconfig.8 head/sbin/mdconfig/mdconfig.c head/sys/dev/md/md.c head/sys/sys/mdioctl.h Modified: head/sbin/mdconfig/mdconfig.8 ============================================================================== --- head/sbin/mdconfig/mdconfig.8 Mon Aug 28 14:49:26 2017 (r322968) +++ head/sbin/mdconfig/mdconfig.8 Mon Aug 28 15:54:07 2017 (r322969) @@ -37,7 +37,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 10, 2015 +.Dd August 28, 2017 .Dt MDCONFIG 8 .Os .Sh NAME @@ -55,6 +55,7 @@ .Op Fl u Ar unit .Op Fl x Ar sectors/track .Op Fl y Ar heads/cylinder +.Op Fl L Ar label .Nm .Fl d .Fl u Ar unit @@ -189,6 +190,12 @@ and options can be used to specify a synthetic geometry. This is useful for constructing bootable images for later download to other devices. +.It Fl L Ar label +Associate a label (arbitrary string) with the new memory disk. +The label can then be inspected with +.Bd -literal -offset indent +.Nm Fl l v +.Ed .It Fl o Oo Cm no Oc Ns Ar option Set or reset options. .Bl -tag -width indent Modified: head/sbin/mdconfig/mdconfig.c ============================================================================== --- head/sbin/mdconfig/mdconfig.c Mon Aug 28 14:49:26 2017 (r322968) +++ head/sbin/mdconfig/mdconfig.c Mon Aug 28 15:54:07 2017 (r322969) @@ -79,7 +79,7 @@ usage(void) fprintf(stderr, "usage: mdconfig -a -t type [-n] [-o [no]option] ... [-f file]\n" -" [-s size] [-S sectorsize] [-u unit]\n" +" [-s size] [-S sectorsize] [-u unit] [-L label]\n" " [-x sectors/track] [-y heads/cylinder]\n" " mdconfig -d -u unit [-o [no]force]\n" " mdconfig -r -u unit -s size [-o [no]force]\n" @@ -102,15 +102,17 @@ main(int argc, char **argv) bzero(&mdio, sizeof(mdio)); mdio.md_file = malloc(PATH_MAX); - if (mdio.md_file == NULL) + mdio.md_label = malloc(PATH_MAX); + if (mdio.md_file == NULL || mdio.md_label == NULL) err(1, "could not allocate memory"); vflag = 0; bzero(mdio.md_file, PATH_MAX); + bzero(mdio.md_label, PATH_MAX); if (argc == 1) usage(); - while ((ch = getopt(argc, argv, "ab:df:lno:rs:S:t:u:vx:y:")) != -1) { + while ((ch = getopt(argc, argv, "ab:df:lno:rs:S:t:u:vx:y:L:")) != -1) { switch (ch) { case 'a': if (action != UNSET && action != ATTACH) @@ -243,6 +245,9 @@ main(int argc, char **argv) case 'y': mdio.md_fwheads = strtoul(optarg, &p, 0); break; + case 'L': + strlcpy(mdio.md_label, optarg, PATH_MAX); + break; default: usage(); } @@ -422,7 +427,8 @@ md_list(const char *units, int opt, const char *fflag) struct gclass *gcl; void *sq; int retcode, ffound, ufound; - char *type, *file, *length; + char *length; + const char *type, *file, *label; type = file = length = NULL; @@ -477,10 +483,14 @@ md_list(const char *units, int opt, const char *fflag) printf("\t%s\t", type); if (length != NULL) md_prthumanval(length); - if (file != NULL) { - printf("\t%s", file); - file = NULL; - } + if (file == NULL) + file = "-"; + printf("\t%s", file); + file = NULL; + label = geom_config_get(gc, "label"); + if (label == NULL) + label = ""; + printf("\t%s", label); } opt |= OPT_DONE; if ((opt & OPT_LIST) && !(opt & OPT_VERBOSE)) Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Mon Aug 28 14:49:26 2017 (r322968) +++ head/sys/dev/md/md.c Mon Aug 28 15:54:07 2017 (r322969) @@ -226,6 +226,7 @@ struct md_s { /* MD_VNODE related fields */ struct vnode *vnode; char file[PATH_MAX]; + char label[PATH_MAX]; struct ucred *cred; /* MD_SWAP related fields */ @@ -1645,6 +1646,11 @@ xmdctlioctl(struct cdev *dev, u_long cmd, caddr_t addr } if (sc == NULL) return (error); + if (mdio->md_label != NULL) + error = copyinstr(mdio->md_label, sc->label, + sizeof(sc->label), NULL); + if (error != 0) + goto err_after_new; if (mdio->md_options & MD_AUTOUNIT) mdio->md_unit = sc->unit; sc->mediasize = mdio->md_mediasize; @@ -1676,6 +1682,7 @@ xmdctlioctl(struct cdev *dev, u_long cmd, caddr_t addr error = mdcreate_null(sc, mdio, td); break; } +err_after_new: if (error != 0) { mddestroy(sc, td); return (error); @@ -1721,6 +1728,11 @@ xmdctlioctl(struct cdev *dev, u_long cmd, caddr_t addr mdio->md_options = sc->flags; mdio->md_mediasize = sc->mediasize; mdio->md_sectorsize = sc->sectorsize; + error = 0; + if (mdio->md_label != NULL) { + error = copyout(sc->label, mdio->md_label, + strlen(sc->label) + 1); + } if (sc->type == MD_VNODE || (sc->type == MD_PRELOAD && mdio->md_file != NULL)) error = copyout(sc->file, mdio->md_file, @@ -1873,6 +1885,7 @@ g_md_dumpconf(struct sbuf *sb, const char *indent, str if ((mp->type == MD_VNODE && mp->vnode != NULL) || (mp->type == MD_PRELOAD && mp->file[0] != '\0')) sbuf_printf(sb, " file %s", mp->file); + sbuf_printf(sb, " label %s", mp->label); } else { sbuf_printf(sb, "%s%d\n", indent, mp->unit); @@ -1897,6 +1910,9 @@ g_md_dumpconf(struct sbuf *sb, const char *indent, str g_conf_printf_escaped(sb, "%s", mp->file); sbuf_printf(sb, "\n"); } + sbuf_printf(sb, "%s\n"); } } } Modified: head/sys/sys/mdioctl.h ============================================================================== --- head/sys/sys/mdioctl.h Mon Aug 28 14:49:26 2017 (r322968) +++ head/sys/sys/mdioctl.h Mon Aug 28 15:54:07 2017 (r322969) @@ -49,7 +49,7 @@ enum md_types {MD_MALLOC, MD_PRELOAD, MD_VNODE, MD_SWA * Ioctl definitions for memory disk pseudo-device. */ -#define MDNPAD 97 +#define MDNPAD 96 struct md_ioctl { unsigned md_version; /* Structure layout version */ unsigned md_unit; /* unit number */ @@ -61,6 +61,7 @@ struct md_ioctl { u_int64_t md_base; /* base address */ int md_fwheads; /* firmware heads */ int md_fwsectors; /* firmware sectors */ + char *md_label; /* label of the device */ int md_pad[MDNPAD]; /* padding for future ideas */ }; From owner-svn-src-head@freebsd.org Mon Aug 28 16:22:51 2017 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 33638E0FB4B; Mon, 28 Aug 2017 16:22:51 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10F3B8005D; Mon, 28 Aug 2017 16:22:51 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 777DF10AF3A; Mon, 28 Aug 2017 12:22:49 -0400 (EDT) From: John Baldwin To: Maxim Sobolev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r322969 - in head: sbin/mdconfig sys/dev/md sys/sys Date: Mon, 28 Aug 2017 09:19:15 -0700 Message-ID: <7384187.efIiCynxO3@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201708281554.v7SFs8fr014268@repo.freebsd.org> References: <201708281554.v7SFs8fr014268@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 28 Aug 2017 12:22:49 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 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: Mon, 28 Aug 2017 16:22:51 -0000 On Monday, August 28, 2017 03:54:08 PM Maxim Sobolev wrote: > Author: sobomax > Date: Mon Aug 28 15:54:07 2017 > New Revision: 322969 > URL: https://svnweb.freebsd.org/changeset/base/322969 > > Log: > Add ability to label md(4) devices. > > This feature comes from the fact that we rely memory-backed md(4) > in our build process heavily. However, if the build goes haywire > the allocated resources (i.e. swap and memory-backed md(4)'s) need > to be purged. It is extremely useful to have ability to attach > arbitrary labels to each of the virtual disks so that they can > be identified and GC'ed if neecessary. > > MFC after: 4 weeks > Differential Revision: https://reviews.freebsd.org/D10457 > > Modified: > head/sbin/mdconfig/mdconfig.8 > head/sbin/mdconfig/mdconfig.c > head/sys/dev/md/md.c > head/sys/sys/mdioctl.h > > Modified: head/sys/sys/mdioctl.h > ============================================================================== > --- head/sys/sys/mdioctl.h Mon Aug 28 14:49:26 2017 (r322968) > +++ head/sys/sys/mdioctl.h Mon Aug 28 15:54:07 2017 (r322969) > @@ -49,7 +49,7 @@ enum md_types {MD_MALLOC, MD_PRELOAD, MD_VNODE, MD_SWA > * Ioctl definitions for memory disk pseudo-device. > */ > > -#define MDNPAD 97 > +#define MDNPAD 96 > struct md_ioctl { > unsigned md_version; /* Structure layout version */ > unsigned md_unit; /* unit number */ > @@ -61,6 +61,7 @@ struct md_ioctl { > u_int64_t md_base; /* base address */ > int md_fwheads; /* firmware heads */ > int md_fwsectors; /* firmware sectors */ > + char *md_label; /* label of the device */ > int md_pad[MDNPAD]; /* padding for future ideas */ > }; This isn't correct on 64-bit platforms. MDNPAD needs to be 95 on those platforms. It would be really neat if one could use the label more pervasively. For example, it would be nice to do something like this: # mdconfig -a -t malloc -s 16M -L foo # newfs /dev/md/foo # mdconfig -d -L foo This would mean that labelled memory disks would not create /dev/mdX entries, but would instead create /dev/md/