From owner-svn-src-all@freebsd.org Sun Nov 27 01:42:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22356C58811; Sun, 27 Nov 2016 01:42:55 +0000 (UTC) (envelope-from alc@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 CC405DBD; Sun, 27 Nov 2016 01:42:54 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAR1gsqM015884; Sun, 27 Nov 2016 01:42:54 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAR1gs9G015883; Sun, 27 Nov 2016 01:42:54 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201611270142.uAR1gs9G015883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 27 Nov 2016 01:42:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309203 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 01:42:55 -0000 Author: alc Date: Sun Nov 27 01:42:53 2016 New Revision: 309203 URL: https://svnweb.freebsd.org/changeset/base/309203 Log: Recursion on the free page queue mutex occurred when UMA needed to allocate a new page of radix trie nodes to complete a vm_radix_insert() operation that was requested by vm_page_cache(). Specifically, vm_page_cache() already held the free page queue lock when UMA tried to acquire it through a call to vm_page_alloc(). This code path no longer exists, so there is no longer any reason to allow recursion on the free page queue mutex. Improve nearby comments. Reviewed by: kib, markj Tested by: pho Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8628 Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sat Nov 26 23:22:32 2016 (r309202) +++ head/sys/vm/vm_page.c Sun Nov 27 01:42:53 2016 (r309203) @@ -1512,19 +1512,17 @@ vm_page_alloc(vm_object_t object, vm_pin } /* - * The page allocation request can came from consumers which already - * hold the free page queue mutex, like vm_page_insert() in - * vm_page_cache(). + * Allocate a page if the number of free pages exceeds the minimum + * for the request class. */ - mtx_lock_flags(&vm_page_queue_free_mtx, MTX_RECURSE); + mtx_lock(&vm_page_queue_free_mtx); if (vm_cnt.v_free_count > vm_cnt.v_free_reserved || (req_class == VM_ALLOC_SYSTEM && vm_cnt.v_free_count > vm_cnt.v_interrupt_free_min) || (req_class == VM_ALLOC_INTERRUPT && vm_cnt.v_free_count > 0)) { /* - * Allocate from the free queue if the number of free pages - * exceeds the minimum for the request class. + * Can we allocate the page from a reservation? */ #if VM_NRESERVLEVEL > 0 if (object == NULL || (object->flags & (OBJ_COLORED | @@ -1532,6 +1530,9 @@ vm_page_alloc(vm_object_t object, vm_pin vm_reserv_alloc_page(object, pindex, mpred)) == NULL) #endif { + /* + * If not, allocate it from the free page queues. + */ m = vm_phys_alloc_pages(object != NULL ? VM_FREEPOOL_DEFAULT : VM_FREEPOOL_DIRECT, 0); #if VM_NRESERVLEVEL > 0 @@ -1841,7 +1842,7 @@ vm_page_alloc_freelist(int flind, int re /* * Do not allocate reserved pages unless the req has asked for it. */ - mtx_lock_flags(&vm_page_queue_free_mtx, MTX_RECURSE); + mtx_lock(&vm_page_queue_free_mtx); if (vm_cnt.v_free_count > vm_cnt.v_free_reserved || (req_class == VM_ALLOC_SYSTEM && vm_cnt.v_free_count > vm_cnt.v_interrupt_free_min) || From owner-svn-src-all@freebsd.org Sun Nov 27 01:44:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFB0CC588A6; Sun, 27 Nov 2016 01:44:32 +0000 (UTC) (envelope-from alc@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 A8900F3C; Sun, 27 Nov 2016 01:44:32 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAR1iVM7016005; Sun, 27 Nov 2016 01:44:31 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAR1iVNW016003; Sun, 27 Nov 2016 01:44:31 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201611270144.uAR1iVNW016003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 27 Nov 2016 01:44:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309204 - in head: . share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 01:44:33 -0000 Author: alc Date: Sun Nov 27 01:44:31 2016 New Revision: 309204 URL: https://svnweb.freebsd.org/changeset/base/309204 Log: The function vm_page_cache() no longer exists. Remove its man page. Deleted: head/share/man/man9/vm_page_cache.9 Modified: head/ObsoleteFiles.inc head/share/man/man9/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sun Nov 27 01:42:53 2016 (r309203) +++ head/ObsoleteFiles.inc Sun Nov 27 01:44:31 2016 (r309204) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20161127: Remove vm_page_cache(9) +OLD_FILES+=usr/share/man/man9/vm_page_cache.9.gz # 20161124: new clang import which bumps version from 3.8.0 to 3.9.0. OLD_FILES+=usr/lib/clang/3.8.0/include/sanitizer/allocator_interface.h OLD_FILES+=usr/lib/clang/3.8.0/include/sanitizer/asan_interface.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sun Nov 27 01:42:53 2016 (r309203) +++ head/share/man/man9/Makefile Sun Nov 27 01:44:31 2016 (r309204) @@ -352,7 +352,6 @@ MAN= accept_filter.9 \ vm_page_alloc.9 \ vm_page_bits.9 \ vm_page_busy.9 \ - vm_page_cache.9 \ vm_page_deactivate.9 \ vm_page_dontneed.9 \ vm_page_aflag.9 \ From owner-svn-src-all@freebsd.org Sun Nov 27 05:58:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BB92C58C99; Sun, 27 Nov 2016 05:58:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 664F51C83; Sun, 27 Nov 2016 05:58:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAR5wlIN016998; Sun, 27 Nov 2016 05:58:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAR5wl22016996; Sun, 27 Nov 2016 05:58:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201611270558.uAR5wl22016996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 27 Nov 2016 05:58:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309205 - stable/11/sys/geom/mirror X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 05:58:48 -0000 Author: mav Date: Sun Nov 27 05:58:47 2016 New Revision: 309205 URL: https://svnweb.freebsd.org/changeset/base/309205 Log: MFC r308608: Use providergone method to cover race between destroy and g_access(). Modified: stable/11/sys/geom/mirror/g_mirror.c stable/11/sys/geom/mirror/g_mirror.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/11/sys/geom/mirror/g_mirror.c Sun Nov 27 01:44:31 2016 (r309204) +++ stable/11/sys/geom/mirror/g_mirror.c Sun Nov 27 05:58:47 2016 (r309205) @@ -78,12 +78,12 @@ SYSCTL_UINT(_kern_geom_mirror, OID_AUTO, static eventhandler_tag g_mirror_post_sync = NULL; static int g_mirror_shutdown = 0; -static int g_mirror_destroy_geom(struct gctl_req *req, struct g_class *mp, - struct g_geom *gp); +static g_ctl_destroy_geom_t g_mirror_destroy_geom; static g_taste_t g_mirror_taste; +static g_init_t g_mirror_init; +static g_fini_t g_mirror_fini; +static g_provgone_t g_mirror_providergone; static g_resize_t g_mirror_resize; -static void g_mirror_init(struct g_class *mp); -static void g_mirror_fini(struct g_class *mp); struct g_class g_mirror_class = { .name = G_MIRROR_CLASS_NAME, @@ -93,6 +93,7 @@ struct g_class g_mirror_class = { .destroy_geom = g_mirror_destroy_geom, .init = g_mirror_init, .fini = g_mirror_fini, + .providergone = g_mirror_providergone, .resize = g_mirror_resize }; @@ -507,6 +508,26 @@ g_mirror_destroy_disk(struct g_mirror_di } static void +g_mirror_free_device(struct g_mirror_softc *sc) +{ + + mtx_destroy(&sc->sc_queue_mtx); + mtx_destroy(&sc->sc_events_mtx); + mtx_destroy(&sc->sc_done_mtx); + sx_destroy(&sc->sc_lock); + free(sc, M_MIRROR); +} + +static void +g_mirror_providergone(struct g_provider *pp) +{ + struct g_mirror_softc *sc = pp->private; + + if ((--sc->sc_refcnt) == 0) + g_mirror_free_device(sc); +} + +static void g_mirror_destroy_device(struct g_mirror_softc *sc) { struct g_mirror_disk *disk; @@ -548,12 +569,10 @@ g_mirror_destroy_device(struct g_mirror_ g_wither_geom(sc->sc_sync.ds_geom, ENXIO); G_MIRROR_DEBUG(0, "Device %s destroyed.", gp->name); g_wither_geom(gp, ENXIO); - g_topology_unlock(); - mtx_destroy(&sc->sc_queue_mtx); - mtx_destroy(&sc->sc_events_mtx); - mtx_destroy(&sc->sc_done_mtx); sx_xunlock(&sc->sc_lock); - sx_destroy(&sc->sc_lock); + if ((--sc->sc_refcnt) == 0) + g_mirror_free_device(sc); + g_topology_unlock(); } static void @@ -866,7 +885,7 @@ g_mirror_flush_done(struct bio *bp) struct bio *pbp; pbp = bp->bio_parent; - sc = pbp->bio_to->geom->softc; + sc = pbp->bio_to->private; mtx_lock(&sc->sc_done_mtx); if (pbp->bio_error == 0) pbp->bio_error = bp->bio_error; @@ -903,7 +922,7 @@ g_mirror_regular_request(struct bio *bp) g_topology_assert_not(); pbp = bp->bio_parent; - sc = pbp->bio_to->geom->softc; + sc = pbp->bio_to->private; bp->bio_from->index--; if (bp->bio_cmd == BIO_WRITE) sc->sc_writes--; @@ -1027,7 +1046,7 @@ g_mirror_candelete(struct bio *bp) struct g_mirror_disk *disk; int *val; - sc = bp->bio_to->geom->softc; + sc = bp->bio_to->private; LIST_FOREACH(disk, &sc->sc_disks, d_next) { if (disk->d_flags & G_MIRROR_DISK_FLAG_CANDELETE) break; @@ -1052,7 +1071,7 @@ g_mirror_kernel_dump(struct bio *bp) * we will not be able to read the dump after the reboot if it will be * connected and synchronized later. Can we do something better? */ - sc = bp->bio_to->geom->softc; + sc = bp->bio_to->private; disk = LIST_FIRST(&sc->sc_disks); gkd = (struct g_kerneldump *)bp->bio_data; @@ -1112,7 +1131,7 @@ g_mirror_start(struct bio *bp) { struct g_mirror_softc *sc; - sc = bp->bio_to->geom->softc; + sc = bp->bio_to->private; /* * If sc == NULL or there are no valid disks, provider's error * should be set and g_mirror_start() should not be called at all. @@ -1619,7 +1638,7 @@ g_mirror_register_request(struct bio *bp { struct g_mirror_softc *sc; - sc = bp->bio_to->geom->softc; + sc = bp->bio_to->private; switch (bp->bio_cmd) { case BIO_READ: switch (sc->sc_balance) { @@ -1785,7 +1804,6 @@ g_mirror_try_destroy(struct g_mirror_sof } else { g_topology_unlock(); g_mirror_destroy_device(sc); - free(sc, M_MIRROR); } return (1); } @@ -2097,6 +2115,8 @@ g_mirror_launch_provider(struct g_mirror } } } + pp->private = sc; + sc->sc_refcnt++; sc->sc_provider = pp; g_error_provider(pp, 0); g_topology_unlock(); @@ -2871,9 +2891,7 @@ g_mirror_access(struct g_provider *pp, i G_MIRROR_DEBUG(2, "Access request for %s: r%dw%de%d.", pp->name, acr, acw, ace); - sc = pp->geom->softc; - if (sc == NULL && acr <= 0 && acw <= 0 && ace <= 0) - return (0); + sc = pp->private; KASSERT(sc != NULL, ("NULL softc (provider=%s).", pp->name)); g_topology_unlock(); @@ -2932,6 +2950,7 @@ g_mirror_create(struct g_class *mp, cons sc->sc_idle = 1; sc->sc_last_write = time_uptime; sc->sc_writes = 0; + sc->sc_refcnt = 1; sx_init(&sc->sc_lock, "gmirror:lock"); bioq_init(&sc->sc_queue); mtx_init(&sc->sc_queue_mtx, "gmirror:queue", NULL, MTX_DEF); @@ -2962,12 +2981,8 @@ g_mirror_create(struct g_class *mp, cons G_MIRROR_DEBUG(1, "Cannot create kernel thread for %s.", sc->sc_name); g_destroy_geom(sc->sc_sync.ds_geom); - mtx_destroy(&sc->sc_done_mtx); - mtx_destroy(&sc->sc_events_mtx); - mtx_destroy(&sc->sc_queue_mtx); - sx_destroy(&sc->sc_lock); g_destroy_geom(sc->sc_geom); - free(sc, M_MIRROR); + g_mirror_free_device(sc); return (NULL); } @@ -2990,8 +3005,6 @@ g_mirror_destroy(struct g_mirror_softc * struct g_mirror_disk *disk; g_topology_assert_not(); - if (sc == NULL) - return (ENXIO); sx_assert(&sc->sc_lock, SX_XLOCKED); if (sc->sc_provider_open != 0 || SCHEDULER_STOPPED()) { @@ -3041,7 +3054,6 @@ g_mirror_destroy(struct g_mirror_softc * G_MIRROR_DEBUG(4, "%s: Woken up %p.", __func__, &sc->sc_worker); sx_xlock(&sc->sc_lock); g_mirror_destroy_device(sc); - free(sc, M_MIRROR); return (0); } Modified: stable/11/sys/geom/mirror/g_mirror.h ============================================================================== --- stable/11/sys/geom/mirror/g_mirror.h Sun Nov 27 01:44:31 2016 (r309204) +++ stable/11/sys/geom/mirror/g_mirror.h Sun Nov 27 05:58:47 2016 (r309205) @@ -207,6 +207,7 @@ struct g_mirror_softc { int sc_idle; /* DIRTY flags removed. */ time_t sc_last_write; u_int sc_writes; + u_int sc_refcnt; /* Number of softc references */ TAILQ_HEAD(, g_mirror_event) sc_events; struct mtx sc_events_mtx; From owner-svn-src-all@freebsd.org Sun Nov 27 05:59:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 495E4C58D77; Sun, 27 Nov 2016 05:59:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23D821DE6; Sun, 27 Nov 2016 05:59:18 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAR5xHAB017076; Sun, 27 Nov 2016 05:59:17 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAR5xHZG017074; Sun, 27 Nov 2016 05:59:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201611270559.uAR5xHZG017074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 27 Nov 2016 05:59:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309206 - stable/10/sys/geom/mirror X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 05:59:18 -0000 Author: mav Date: Sun Nov 27 05:59:17 2016 New Revision: 309206 URL: https://svnweb.freebsd.org/changeset/base/309206 Log: MFC r308608: Use providergone method to cover race between destroy and g_access(). Modified: stable/10/sys/geom/mirror/g_mirror.c stable/10/sys/geom/mirror/g_mirror.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/mirror/g_mirror.c ============================================================================== --- stable/10/sys/geom/mirror/g_mirror.c Sun Nov 27 05:58:47 2016 (r309205) +++ stable/10/sys/geom/mirror/g_mirror.c Sun Nov 27 05:59:17 2016 (r309206) @@ -84,12 +84,12 @@ SYSCTL_UINT(_kern_geom_mirror, OID_AUTO, static eventhandler_tag g_mirror_post_sync = NULL; static int g_mirror_shutdown = 0; -static int g_mirror_destroy_geom(struct gctl_req *req, struct g_class *mp, - struct g_geom *gp); +static g_ctl_destroy_geom_t g_mirror_destroy_geom; static g_taste_t g_mirror_taste; +static g_init_t g_mirror_init; +static g_fini_t g_mirror_fini; +static g_provgone_t g_mirror_providergone; static g_resize_t g_mirror_resize; -static void g_mirror_init(struct g_class *mp); -static void g_mirror_fini(struct g_class *mp); struct g_class g_mirror_class = { .name = G_MIRROR_CLASS_NAME, @@ -99,6 +99,7 @@ struct g_class g_mirror_class = { .destroy_geom = g_mirror_destroy_geom, .init = g_mirror_init, .fini = g_mirror_fini, + .providergone = g_mirror_providergone, .resize = g_mirror_resize }; @@ -513,6 +514,26 @@ g_mirror_destroy_disk(struct g_mirror_di } static void +g_mirror_free_device(struct g_mirror_softc *sc) +{ + + mtx_destroy(&sc->sc_queue_mtx); + mtx_destroy(&sc->sc_events_mtx); + mtx_destroy(&sc->sc_done_mtx); + sx_destroy(&sc->sc_lock); + free(sc, M_MIRROR); +} + +static void +g_mirror_providergone(struct g_provider *pp) +{ + struct g_mirror_softc *sc = pp->private; + + if ((--sc->sc_refcnt) == 0) + g_mirror_free_device(sc); +} + +static void g_mirror_destroy_device(struct g_mirror_softc *sc) { struct g_mirror_disk *disk; @@ -554,12 +575,10 @@ g_mirror_destroy_device(struct g_mirror_ g_wither_geom(sc->sc_sync.ds_geom, ENXIO); G_MIRROR_DEBUG(0, "Device %s destroyed.", gp->name); g_wither_geom(gp, ENXIO); - g_topology_unlock(); - mtx_destroy(&sc->sc_queue_mtx); - mtx_destroy(&sc->sc_events_mtx); - mtx_destroy(&sc->sc_done_mtx); sx_xunlock(&sc->sc_lock); - sx_destroy(&sc->sc_lock); + if ((--sc->sc_refcnt) == 0) + g_mirror_free_device(sc); + g_topology_unlock(); } static void @@ -872,7 +891,7 @@ g_mirror_flush_done(struct bio *bp) struct bio *pbp; pbp = bp->bio_parent; - sc = pbp->bio_to->geom->softc; + sc = pbp->bio_to->private; mtx_lock(&sc->sc_done_mtx); if (pbp->bio_error == 0) pbp->bio_error = bp->bio_error; @@ -909,7 +928,7 @@ g_mirror_regular_request(struct bio *bp) g_topology_assert_not(); pbp = bp->bio_parent; - sc = pbp->bio_to->geom->softc; + sc = pbp->bio_to->private; bp->bio_from->index--; if (bp->bio_cmd == BIO_WRITE) sc->sc_writes--; @@ -1033,7 +1052,7 @@ g_mirror_candelete(struct bio *bp) struct g_mirror_disk *disk; int *val; - sc = bp->bio_to->geom->softc; + sc = bp->bio_to->private; LIST_FOREACH(disk, &sc->sc_disks, d_next) { if (disk->d_flags & G_MIRROR_DISK_FLAG_CANDELETE) break; @@ -1058,7 +1077,7 @@ g_mirror_kernel_dump(struct bio *bp) * we will not be able to read the dump after the reboot if it will be * connected and synchronized later. Can we do something better? */ - sc = bp->bio_to->geom->softc; + sc = bp->bio_to->private; disk = LIST_FIRST(&sc->sc_disks); gkd = (struct g_kerneldump *)bp->bio_data; @@ -1118,7 +1137,7 @@ g_mirror_start(struct bio *bp) { struct g_mirror_softc *sc; - sc = bp->bio_to->geom->softc; + sc = bp->bio_to->private; /* * If sc == NULL or there are no valid disks, provider's error * should be set and g_mirror_start() should not be called at all. @@ -1625,7 +1644,7 @@ g_mirror_register_request(struct bio *bp { struct g_mirror_softc *sc; - sc = bp->bio_to->geom->softc; + sc = bp->bio_to->private; switch (bp->bio_cmd) { case BIO_READ: switch (sc->sc_balance) { @@ -1791,7 +1810,6 @@ g_mirror_try_destroy(struct g_mirror_sof } else { g_topology_unlock(); g_mirror_destroy_device(sc); - free(sc, M_MIRROR); } return (1); } @@ -2103,6 +2121,8 @@ g_mirror_launch_provider(struct g_mirror } } } + pp->private = sc; + sc->sc_refcnt++; sc->sc_provider = pp; g_error_provider(pp, 0); g_topology_unlock(); @@ -2877,9 +2897,7 @@ g_mirror_access(struct g_provider *pp, i G_MIRROR_DEBUG(2, "Access request for %s: r%dw%de%d.", pp->name, acr, acw, ace); - sc = pp->geom->softc; - if (sc == NULL && acr <= 0 && acw <= 0 && ace <= 0) - return (0); + sc = pp->private; KASSERT(sc != NULL, ("NULL softc (provider=%s).", pp->name)); g_topology_unlock(); @@ -2938,6 +2956,7 @@ g_mirror_create(struct g_class *mp, cons sc->sc_idle = 1; sc->sc_last_write = time_uptime; sc->sc_writes = 0; + sc->sc_refcnt = 1; sx_init(&sc->sc_lock, "gmirror:lock"); bioq_init(&sc->sc_queue); mtx_init(&sc->sc_queue_mtx, "gmirror:queue", NULL, MTX_DEF); @@ -2968,12 +2987,8 @@ g_mirror_create(struct g_class *mp, cons G_MIRROR_DEBUG(1, "Cannot create kernel thread for %s.", sc->sc_name); g_destroy_geom(sc->sc_sync.ds_geom); - mtx_destroy(&sc->sc_done_mtx); - mtx_destroy(&sc->sc_events_mtx); - mtx_destroy(&sc->sc_queue_mtx); - sx_destroy(&sc->sc_lock); g_destroy_geom(sc->sc_geom); - free(sc, M_MIRROR); + g_mirror_free_device(sc); return (NULL); } @@ -2996,8 +3011,6 @@ g_mirror_destroy(struct g_mirror_softc * struct g_mirror_disk *disk; g_topology_assert_not(); - if (sc == NULL) - return (ENXIO); sx_assert(&sc->sc_lock, SX_XLOCKED); if (sc->sc_provider_open != 0) { @@ -3047,7 +3060,6 @@ g_mirror_destroy(struct g_mirror_softc * G_MIRROR_DEBUG(4, "%s: Woken up %p.", __func__, &sc->sc_worker); sx_xlock(&sc->sc_lock); g_mirror_destroy_device(sc); - free(sc, M_MIRROR); return (0); } Modified: stable/10/sys/geom/mirror/g_mirror.h ============================================================================== --- stable/10/sys/geom/mirror/g_mirror.h Sun Nov 27 05:58:47 2016 (r309205) +++ stable/10/sys/geom/mirror/g_mirror.h Sun Nov 27 05:59:17 2016 (r309206) @@ -207,6 +207,7 @@ struct g_mirror_softc { int sc_idle; /* DIRTY flags removed. */ time_t sc_last_write; u_int sc_writes; + u_int sc_refcnt; /* Number of softc references */ TAILQ_HEAD(, g_mirror_event) sc_events; struct mtx sc_events_mtx; From owner-svn-src-all@freebsd.org Sun Nov 27 09:10:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FCE2C58A0B; Sun, 27 Nov 2016 09:10:35 +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 D8DC3B71; Sun, 27 Nov 2016 09:10:34 +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 uAR9AY8w094657; Sun, 27 Nov 2016 09:10:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAR9AXh7094655; Sun, 27 Nov 2016 09:10:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201611270910.uAR9AXh7094655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 27 Nov 2016 09:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309207 - in stable/11/sys: kern ufs/ffs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 09:10:35 -0000 Author: kib Date: Sun Nov 27 09:10:33 2016 New Revision: 309207 URL: https://svnweb.freebsd.org/changeset/base/309207 Log: MFC r308618: Provide simple mutual exclusion between mount point update and unmount. In the update path in ffs_mount(), drop vfs_busy() reference around namei(). Modified: stable/11/sys/kern/vfs_mount.c stable/11/sys/ufs/ffs/ffs_vfsops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_mount.c ============================================================================== --- stable/11/sys/kern/vfs_mount.c Sun Nov 27 05:59:17 2016 (r309206) +++ stable/11/sys/kern/vfs_mount.c Sun Nov 27 09:10:33 2016 (r309207) @@ -934,6 +934,11 @@ vfs_domount_update( VOP_UNLOCK(vp, 0); MNT_ILOCK(mp); + if ((mp->mnt_kern_flag & MNTK_UNMOUNT) != 0) { + MNT_IUNLOCK(mp); + error = EBUSY; + goto end; + } mp->mnt_flag &= ~MNT_UPDATEMASK; mp->mnt_flag |= fsflags & (MNT_RELOAD | MNT_FORCE | MNT_UPDATE | MNT_SNAPSHOT | MNT_ROOTFS | MNT_UPDATEMASK | MNT_RDONLY); @@ -1293,6 +1298,7 @@ dounmount(struct mount *mp, int flags, s vn_start_write(NULL, &mp, V_WAIT | V_MNTREF); MNT_ILOCK(mp); if ((mp->mnt_kern_flag & MNTK_UNMOUNT) != 0 || + (mp->mnt_flag & MNT_UPDATE) != 0 || !TAILQ_EMPTY(&mp->mnt_uppers)) { dounmount_cleanup(mp, coveredvp, 0); return (EBUSY); Modified: stable/11/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- stable/11/sys/ufs/ffs/ffs_vfsops.c Sun Nov 27 05:59:17 2016 (r309206) +++ stable/11/sys/ufs/ffs/ffs_vfsops.c Sun Nov 27 09:10:33 2016 (r309207) @@ -147,7 +147,7 @@ ffs_mount(struct mount *mp) struct ufsmount *ump = NULL; struct fs *fs; pid_t fsckpid = 0; - int error, flags; + int error, error1, flags; uint64_t mntorflags; accmode_t accmode; struct nameidata ndp; @@ -453,6 +453,11 @@ ffs_mount(struct mount *mp) */ if (mp->mnt_flag & MNT_SNAPSHOT) return (ffs_snapshot(mp, fspec)); + + /* + * Must not call namei() while owning busy ref. + */ + vfs_unbusy(mp); } /* @@ -460,7 +465,18 @@ ffs_mount(struct mount *mp) * and verify that it refers to a sensible disk device. */ NDINIT(&ndp, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, fspec, td); - if ((error = namei(&ndp)) != 0) + error = namei(&ndp); + if ((mp->mnt_flag & MNT_UPDATE) != 0) { + /* + * Unmount does not start if MNT_UPDATE is set. Mount + * update busies mp before setting MNT_UPDATE. We + * must be able to retain our busy ref succesfully, + * without sleep. + */ + error1 = vfs_busy(mp, MBF_NOWAIT); + MPASS(error1 == 0); + } + if (error != 0) return (error); NDFREE(&ndp, NDF_ONLY_PNBUF); devvp = ndp.ni_vp; From owner-svn-src-all@freebsd.org Sun Nov 27 09:14:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94FF5C58BD9; Sun, 27 Nov 2016 09:14:53 +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 4A5FDFAA; Sun, 27 Nov 2016 09:14:53 +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 uAR9EqkT098839; Sun, 27 Nov 2016 09:14:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAR9Eq9P098837; Sun, 27 Nov 2016 09:14:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201611270914.uAR9Eq9P098837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 27 Nov 2016 09:14:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309208 - in stable/10/sys: kern ufs/ffs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 09:14:53 -0000 Author: kib Date: Sun Nov 27 09:14:52 2016 New Revision: 309208 URL: https://svnweb.freebsd.org/changeset/base/309208 Log: MFC r308618: Provide simple mutual exclusion between mount point update and unmount. In the update path in ffs_mount(), drop vfs_busy() reference around namei(). Modified: stable/10/sys/kern/vfs_mount.c stable/10/sys/ufs/ffs/ffs_vfsops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/vfs_mount.c ============================================================================== --- stable/10/sys/kern/vfs_mount.c Sun Nov 27 09:10:33 2016 (r309207) +++ stable/10/sys/kern/vfs_mount.c Sun Nov 27 09:14:52 2016 (r309208) @@ -934,6 +934,11 @@ vfs_domount_update( VOP_UNLOCK(vp, 0); MNT_ILOCK(mp); + if ((mp->mnt_kern_flag & MNTK_UNMOUNT) != 0) { + MNT_IUNLOCK(mp); + error = EBUSY; + goto end; + } mp->mnt_flag &= ~MNT_UPDATEMASK; mp->mnt_flag |= fsflags & (MNT_RELOAD | MNT_FORCE | MNT_UPDATE | MNT_SNAPSHOT | MNT_ROOTFS | MNT_UPDATEMASK | MNT_RDONLY); @@ -1252,6 +1257,7 @@ dounmount(struct mount *mp, int flags, s vn_start_write(NULL, &mp, V_WAIT | V_MNTREF); MNT_ILOCK(mp); if ((mp->mnt_kern_flag & MNTK_UNMOUNT) != 0 || + (mp->mnt_flag & MNT_UPDATE) != 0 || !TAILQ_EMPTY(&mp->mnt_uppers)) { MNT_IUNLOCK(mp); if (coveredvp != NULL) { Modified: stable/10/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- stable/10/sys/ufs/ffs/ffs_vfsops.c Sun Nov 27 09:10:33 2016 (r309207) +++ stable/10/sys/ufs/ffs/ffs_vfsops.c Sun Nov 27 09:14:52 2016 (r309208) @@ -147,7 +147,7 @@ ffs_mount(struct mount *mp) struct ufsmount *ump = NULL; struct fs *fs; pid_t fsckpid = 0; - int error, flags; + int error, error1, flags; uint64_t mntorflags; accmode_t accmode; struct nameidata ndp; @@ -461,6 +461,11 @@ ffs_mount(struct mount *mp) */ if (mp->mnt_flag & MNT_SNAPSHOT) return (ffs_snapshot(mp, fspec)); + + /* + * Must not call namei() while owning busy ref. + */ + vfs_unbusy(mp); } /* @@ -468,7 +473,18 @@ ffs_mount(struct mount *mp) * and verify that it refers to a sensible disk device. */ NDINIT(&ndp, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, fspec, td); - if ((error = namei(&ndp)) != 0) + error = namei(&ndp); + if ((mp->mnt_flag & MNT_UPDATE) != 0) { + /* + * Unmount does not start if MNT_UPDATE is set. Mount + * update busies mp before setting MNT_UPDATE. We + * must be able to retain our busy ref succesfully, + * without sleep. + */ + error1 = vfs_busy(mp, MBF_NOWAIT); + MPASS(error1 == 0); + } + if (error != 0) return (error); NDFREE(&ndp, NDF_ONLY_PNBUF); devvp = ndp.ni_vp; From owner-svn-src-all@freebsd.org Sun Nov 27 09:21:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6507BC58FDF; Sun, 27 Nov 2016 09:21:00 +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 1AB875E5; Sun, 27 Nov 2016 09:21:00 +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 uAR9KxhN002022; Sun, 27 Nov 2016 09:20:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAR9KxV0002019; Sun, 27 Nov 2016 09:20:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201611270920.uAR9KxV0002019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 27 Nov 2016 09:20:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309209 - in head/sys: fs/nfsclient fs/nullfs sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 09:21:00 -0000 Author: kib Date: Sun Nov 27 09:20:58 2016 New Revision: 309209 URL: https://svnweb.freebsd.org/changeset/base/309209 Log: NFSv4 client tracks opens, and the track records are only dropped when the vnode is inactivated. This contradicts with the nullfs caching which keeps upper vnode around, as consequence keeping the use reference to lower vnode. Add a filesystem flag to request nullfs to not cache when mounted over that filesystem, and set the flag for nfs v4 mounts. Reported by: asomers Reviewed by: rmacklem Tested by: asomers, rmacklem Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/fs/nullfs/null_vfsops.c head/sys/sys/mount.h Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Sun Nov 27 09:14:52 2016 (r309208) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Sun Nov 27 09:20:58 2016 (r309209) @@ -1320,6 +1320,8 @@ out: MNT_ILOCK(mp); mp->mnt_kern_flag |= MNTK_LOOKUP_SHARED | MNTK_NO_IOPF | MNTK_USES_BCACHE; + if ((VFSTONFS(mp)->nm_flag & NFSMNT_NFSV4) != 0) + mp->mnt_kern_flag |= MNTK_NULL_NOCACHE; MNT_IUNLOCK(mp); } return (error); Modified: head/sys/fs/nullfs/null_vfsops.c ============================================================================== --- head/sys/fs/nullfs/null_vfsops.c Sun Nov 27 09:14:52 2016 (r309208) +++ head/sys/fs/nullfs/null_vfsops.c Sun Nov 27 09:20:58 2016 (r309209) @@ -188,7 +188,8 @@ nullfs_mount(struct mount *mp) } xmp->nullm_flags |= NULLM_CACHE; - if (vfs_getopt(mp->mnt_optnew, "nocache", NULL, NULL) == 0) + if (vfs_getopt(mp->mnt_optnew, "nocache", NULL, NULL) == 0 || + (xmp->nullm_vfs->mnt_kern_flag & MNTK_NULL_NOCACHE) != 0) xmp->nullm_flags &= ~NULLM_CACHE; MNT_ILOCK(mp); Modified: head/sys/sys/mount.h ============================================================================== --- head/sys/sys/mount.h Sun Nov 27 09:14:52 2016 (r309208) +++ head/sys/sys/mount.h Sun Nov 27 09:20:58 2016 (r309209) @@ -370,7 +370,8 @@ void __mnt_vnode_markerfree_act #define MNTK_SUSPEND 0x08000000 /* request write suspension */ #define MNTK_SUSPEND2 0x04000000 /* block secondary writes */ #define MNTK_SUSPENDED 0x10000000 /* write operations are suspended */ -#define MNTK_UNUSED1 0x20000000 +#define MNTK_NULL_NOCACHE 0x20000000 /* auto disable cache for nullfs + mounts over this fs */ #define MNTK_LOOKUP_SHARED 0x40000000 /* FS supports shared lock lookups */ #define MNTK_NOKNOTE 0x80000000 /* Don't send KNOTEs from VOP hooks */ From owner-svn-src-all@freebsd.org Sun Nov 27 12:03:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 624A9C58B1E; Sun, 27 Nov 2016 12:03:36 +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 2311A1141; Sun, 27 Nov 2016 12:03:36 +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 uARC3Zpf068131; Sun, 27 Nov 2016 12:03:35 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uARC3ZLe068129; Sun, 27 Nov 2016 12:03:35 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201611271203.uARC3ZLe068129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 27 Nov 2016 12:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309210 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 12:03:36 -0000 Author: avos Date: Sun Nov 27 12:03:34 2016 New Revision: 309210 URL: https://svnweb.freebsd.org/changeset/base/309210 Log: rsu: various scanning fixes. - Set IEEE80211_FEXT_SCAN_OFFLOAD flag; firmware can send null data frames when associated. - Check IEEE80211_SCAN_ACTIVE scan flag instead of IEEE80211_F_ASCAN ic flag; the last is never set since r170530. - Eliminate software scan (net80211) <-> site_survey (driver) race: * override ic_scan_curchan and ic_scan_mindwell pointers so net80211 will not try to finish scanning automatically; * inform net80211 about current status via ieee80211_cancel_scan() and ieee80211_scan_done(); * remove corresponding workaround from rsu_join_bss(). Now the driver can associate to an AP with hidden SSID. Tested with Asus USB-N10. Modified: head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rsureg.h Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Sun Nov 27 09:20:58 2016 (r309209) +++ head/sys/dev/usb/wlan/if_rsu.c Sun Nov 27 12:03:34 2016 (r309210) @@ -173,6 +173,8 @@ static void rsu_scan_end(struct ieee8021 static void rsu_getradiocaps(struct ieee80211com *, int, int *, struct ieee80211_channel[]); static void rsu_set_channel(struct ieee80211com *); +static void rsu_scan_curchan(struct ieee80211_scan_state *, unsigned long); +static void rsu_scan_mindwell(struct ieee80211_scan_state *); static void rsu_update_mcast(struct ieee80211com *); static int rsu_alloc_rx_list(struct rsu_softc *); static void rsu_free_rx_list(struct rsu_softc *); @@ -203,7 +205,8 @@ static int rsu_newstate(struct ieee80211 static void rsu_set_key(struct rsu_softc *, const struct ieee80211_key *); static void rsu_delete_key(struct rsu_softc *, const struct ieee80211_key *); #endif -static int rsu_site_survey(struct rsu_softc *, struct ieee80211vap *); +static int rsu_site_survey(struct rsu_softc *, + struct ieee80211_scan_ssid *); static int rsu_join_bss(struct rsu_softc *, struct ieee80211_node *); static int rsu_disconnect(struct rsu_softc *); static int rsu_hwrssi_to_rssi(struct rsu_softc *, int hw_rssi); @@ -537,6 +540,7 @@ rsu_attach(device_t self) ic->ic_txstream = sc->sc_ntxstream; ic->ic_rxstream = sc->sc_nrxstream; } + ic->ic_flags_ext |= IEEE80211_FEXT_SCAN_OFFLOAD; rsu_getradiocaps(ic, IEEE80211_CHAN_MAX, &ic->ic_nchans, ic->ic_channels); @@ -547,6 +551,8 @@ rsu_attach(device_t self) ic->ic_scan_end = rsu_scan_end; ic->ic_getradiocaps = rsu_getradiocaps; ic->ic_set_channel = rsu_set_channel; + ic->ic_scan_curchan = rsu_scan_curchan; + ic->ic_scan_mindwell = rsu_scan_mindwell; ic->ic_vap_create = rsu_vap_create; ic->ic_vap_delete = rsu_vap_delete; ic->ic_update_mcast = rsu_update_mcast; @@ -680,16 +686,21 @@ static void rsu_scan_start(struct ieee80211com *ic) { struct rsu_softc *sc = ic->ic_softc; + struct ieee80211_scan_state *ss = ic->ic_scan; + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); int error; /* Scanning is done by the firmware. */ RSU_LOCK(sc); - /* XXX TODO: force awake if in in network-sleep? */ - error = rsu_site_survey(sc, TAILQ_FIRST(&ic->ic_vaps)); + sc->sc_active_scan = !!(ss->ss_flags & IEEE80211_SCAN_ACTIVE); + /* XXX TODO: force awake if in network-sleep? */ + error = rsu_site_survey(sc, ss->ss_nssid > 0 ? &ss->ss_ssid[0] : NULL); RSU_UNLOCK(sc); - if (error != 0) + if (error != 0) { device_printf(sc->sc_dev, "could not send site survey command\n"); + ieee80211_cancel_scan(vap); + } } static void @@ -722,6 +733,24 @@ rsu_set_channel(struct ieee80211com *ic } static void +rsu_scan_curchan(struct ieee80211_scan_state *ss, unsigned long maxdwell) +{ + /* Scan is done in rsu_scan_start(). */ +} + +/** + * Called by the net80211 framework to indicate + * the minimum dwell time has been met, terminate the scan. + * We don't actually terminate the scan as the firmware will notify + * us when it's finished and we have no way to interrupt it. + */ +static void +rsu_scan_mindwell(struct ieee80211_scan_state *ss) +{ + /* NB: don't try to abort scan; wait for firmware to finish */ +} + +static void rsu_update_mcast(struct ieee80211com *ic) { /* XXX do nothing? */ @@ -1323,31 +1352,36 @@ rsu_delete_key(struct rsu_softc *sc, con #endif static int -rsu_site_survey(struct rsu_softc *sc, struct ieee80211vap *vap) +rsu_site_survey(struct rsu_softc *sc, struct ieee80211_scan_ssid *ssid) { struct r92s_fw_cmd_sitesurvey cmd; - struct ieee80211com *ic = &sc->sc_ic; - int r; RSU_ASSERT_LOCKED(sc); memset(&cmd, 0, sizeof(cmd)); - if ((ic->ic_flags & IEEE80211_F_ASCAN) || sc->sc_scan_pass == 1) + /* TODO: passive channels? */ + if (sc->sc_active_scan) cmd.active = htole32(1); cmd.limit = htole32(48); - if (sc->sc_scan_pass == 1 && vap->iv_des_nssid > 0) { - /* Do a directed scan for second pass. */ - cmd.ssidlen = htole32(vap->iv_des_ssid[0].len); - memcpy(cmd.ssid, vap->iv_des_ssid[0].ssid, - vap->iv_des_ssid[0].len); - + + if (ssid != NULL) { + sc->sc_extra_scan = 1; + cmd.ssidlen = htole32(ssid->len); + memcpy(cmd.ssid, ssid->ssid, ssid->len); } - DPRINTF("sending site survey command, pass=%d\n", sc->sc_scan_pass); - r = rsu_fw_cmd(sc, R92S_CMD_SITE_SURVEY, &cmd, sizeof(cmd)); - if (r == 0) { - sc->sc_scanning = 1; +#ifdef USB_DEBUG + if (rsu_debug & (RSU_DEBUG_SCAN | RSU_DEBUG_FWCMD)) { + device_printf(sc->sc_dev, + "sending site survey command, active %d", + le32toh(cmd.active)); + if (ssid != NULL) { + printf(", ssid: "); + ieee80211_print_essid(cmd.ssid, le32toh(cmd.ssidlen)); + } + printf("\n"); } - return (r); +#endif + return (rsu_fw_cmd(sc, R92S_CMD_SITE_SURVEY, &cmd, sizeof(cmd))); } static int @@ -1362,28 +1396,9 @@ rsu_join_bss(struct rsu_softc *sc, struc uint8_t *frm; uint8_t opmode; int error; - int cnt; - char *msg = "rsujoin"; RSU_ASSERT_LOCKED(sc); - /* - * Until net80211 scanning doesn't automatically finish - * before we tell it to, let's just wait until any pending - * scan is done. - * - * XXX TODO: yes, this releases and re-acquires the lock. - * We should re-verify the state whenever we re-attempt this! - */ - cnt = 0; - while (sc->sc_scanning && cnt < 10) { - device_printf(sc->sc_dev, - "%s: still scanning! (attempt %d)\n", - __func__, cnt); - msleep(msg, &sc->sc_mtx, 0, msg, hz / 2); - cnt++; - } - /* Let the FW decide the opmode based on the capinfo field. */ opmode = NDIS802_11AUTOUNKNOWN; RSU_DPRINTF(sc, RSU_DEBUG_RESET, @@ -1634,26 +1649,24 @@ rsu_rx_event(struct rsu_softc *sc, uint8 break; case R92S_EVT_SURVEY_DONE: RSU_DPRINTF(sc, RSU_DEBUG_SCAN, - "%s: site survey pass %d done, found %d BSS\n", - __func__, sc->sc_scan_pass, le32toh(*(uint32_t *)buf)); - sc->sc_scanning = 0; - if (vap->iv_state != IEEE80211_S_SCAN) - break; /* Ignore if not scanning. */ - - /* - * XXX TODO: This needs to be done without a transition to - * the SCAN state again. Grr. - */ - if (sc->sc_scan_pass == 0 && vap->iv_des_nssid != 0) { - /* Schedule a directed scan for hidden APs. */ - /* XXX bad! */ - sc->sc_scan_pass = 1; + "%s: %s scan done, found %d BSS\n", + __func__, sc->sc_extra_scan ? "direct" : "broadcast", + le32toh(*(uint32_t *)buf)); + if (sc->sc_extra_scan == 1) { + /* Send broadcast probe request. */ + sc->sc_extra_scan = 0; + if (vap != NULL && rsu_site_survey(sc, NULL) != 0) { + RSU_UNLOCK(sc); + ieee80211_cancel_scan(vap); + RSU_LOCK(sc); + } + break; + } + if (vap != NULL) { RSU_UNLOCK(sc); - ieee80211_new_state(vap, IEEE80211_S_SCAN, -1); + ieee80211_scan_done(vap); RSU_LOCK(sc); - break; } - sc->sc_scan_pass = 0; break; case R92S_EVT_JOIN_BSS: if (vap->iv_state == IEEE80211_S_AUTH) @@ -2920,12 +2933,11 @@ rsu_init(struct rsu_softc *sc) goto fail; } - sc->sc_scan_pass = 0; + sc->sc_extra_scan = 0; usbd_transfer_start(sc->sc_xfer[RSU_BULK_RX]); /* We're ready to go. */ sc->sc_running = 1; - sc->sc_scanning = 0; return; fail: /* Need to stop all failed transfers, if any */ Modified: head/sys/dev/usb/wlan/if_rsureg.h ============================================================================== --- head/sys/dev/usb/wlan/if_rsureg.h Sun Nov 27 09:20:58 2016 (r309209) +++ head/sys/dev/usb/wlan/if_rsureg.h Sun Nov 27 12:03:34 2016 (r309210) @@ -768,8 +768,8 @@ struct rsu_softc { u_int sc_running:1, sc_calibrating:1, - sc_scanning:1, - sc_scan_pass:1; + sc_active_scan:1, + sc_extra_scan:1; u_int cut; uint8_t sc_rftype; int8_t sc_nrxstream; From owner-svn-src-all@freebsd.org Sun Nov 27 12:04:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 095A6C58CAD; Sun, 27 Nov 2016 12:04:56 +0000 (UTC) (envelope-from hselasky@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 B11D013A7; Sun, 27 Nov 2016 12:04:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uARC4sjS068397; Sun, 27 Nov 2016 12:04:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uARC4sHI068396; Sun, 27 Nov 2016 12:04:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201611271204.uARC4sHI068396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 27 Nov 2016 12:04:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309211 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 12:04:56 -0000 Author: hselasky Date: Sun Nov 27 12:04:54 2016 New Revision: 309211 URL: https://svnweb.freebsd.org/changeset/base/309211 Log: Fix spelling. Modified: head/sys/dev/usb/usb_process.c Modified: head/sys/dev/usb/usb_process.c ============================================================================== --- head/sys/dev/usb/usb_process.c Sun Nov 27 12:03:34 2016 (r309210) +++ head/sys/dev/usb/usb_process.c Sun Nov 27 12:04:54 2016 (r309211) @@ -184,7 +184,7 @@ usb_process(void *arg) continue; } - /* end if messages - check if anyone is waiting for sync */ + /* end of messages - check if anyone is waiting for sync */ if (up->up_dsleep) { up->up_dsleep = 0; cv_broadcast(&up->up_drain); From owner-svn-src-all@freebsd.org Sun Nov 27 14:19:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2E1DC5641E; Sun, 27 Nov 2016 14:19:20 +0000 (UTC) (envelope-from dim@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 B255510C6; Sun, 27 Nov 2016 14:19:20 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAREJJoo021163; Sun, 27 Nov 2016 14:19:19 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAREJJZV021162; Sun, 27 Nov 2016 14:19:19 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201611271419.uAREJJZV021162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 27 Nov 2016 14:19:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309212 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 14:19:21 -0000 Author: dim Date: Sun Nov 27 14:19:19 2016 New Revision: 309212 URL: https://svnweb.freebsd.org/changeset/base/309212 Log: Add a few missed clang 3.9.0 files to OptionalObsoleteFiles. X-MFC-With: 309149 Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun Nov 27 12:04:54 2016 (r309211) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun Nov 27 14:19:19 2016 (r309212) @@ -1142,6 +1142,7 @@ OLD_FILES+=usr/lib/clang/3.9.0/include/s OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/common_interface_defs.h OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/coverage_interface.h OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/dfsan_interface.h +OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/esan_interface.h OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/linux_syscall_hooks.h OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/lsan_interface.h OLD_FILES+=usr/lib/clang/3.9.0/include/sanitizer/msan_interface.h @@ -1233,6 +1234,10 @@ OLD_FILES+=usr/lib/clang/3.9.0/lib/freeb OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.profile-x86_64.a OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.safestack-i386.a OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.safestack-x86_64.a +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.stats-i386.a +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.stats-x86_64.a +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.stats_client-i386.a +OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.stats_client-x86_64.a OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.ubsan_standalone-i386.a OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.ubsan_standalone-x86_64.a OLD_FILES+=usr/lib/clang/3.9.0/lib/freebsd/libclang_rt.ubsan_standalone_cxx-i386.a From owner-svn-src-all@freebsd.org Sun Nov 27 18:06:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5841EC58257; Sun, 27 Nov 2016 18:06: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 32EB91F4; Sun, 27 Nov 2016 18:06: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 uARI63UA017635; Sun, 27 Nov 2016 18:06:03 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uARI63dc017633; Sun, 27 Nov 2016 18:06:03 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201611271806.uARI63dc017633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 27 Nov 2016 18:06:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309214 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 18:06:04 -0000 Author: avos Date: Sun Nov 27 18:06:03 2016 New Revision: 309214 URL: https://svnweb.freebsd.org/changeset/base/309214 Log: rsu: add support for hardware multicast filter setup. The algorithm is the same as in rtwn(4). Tested with Asus USB-N10 (STA) + RTL8188CUS (AP). Modified: head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rsureg.h Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Sun Nov 27 14:27:51 2016 (r309213) +++ head/sys/dev/usb/wlan/if_rsu.c Sun Nov 27 18:06:03 2016 (r309214) @@ -175,6 +175,8 @@ static void rsu_getradiocaps(struct ieee static void rsu_set_channel(struct ieee80211com *); static void rsu_scan_curchan(struct ieee80211_scan_state *, unsigned long); static void rsu_scan_mindwell(struct ieee80211_scan_state *); +static uint8_t rsu_get_multi_pos(const uint8_t[]); +static void rsu_set_multi(struct rsu_softc *); static void rsu_update_mcast(struct ieee80211com *); static int rsu_alloc_rx_list(struct rsu_softc *); static void rsu_free_rx_list(struct rsu_softc *); @@ -750,10 +752,78 @@ rsu_scan_mindwell(struct ieee80211_scan_ /* NB: don't try to abort scan; wait for firmware to finish */ } +/* + * The same as rtwn_get_multi_pos() / rtwn_set_multi(). + */ +static uint8_t +rsu_get_multi_pos(const uint8_t maddr[]) +{ + uint64_t mask = 0x00004d101df481b4; + uint8_t pos = 0x27; /* initial value */ + int i, j; + + for (i = 0; i < IEEE80211_ADDR_LEN; i++) + for (j = (i == 0) ? 1 : 0; j < 8; j++) + if ((maddr[i] >> j) & 1) + pos ^= (mask >> (i * 8 + j - 1)); + + pos &= 0x3f; + + return (pos); +} + +static void +rsu_set_multi(struct rsu_softc *sc) +{ + struct ieee80211com *ic = &sc->sc_ic; + uint32_t mfilt[2]; + + RSU_ASSERT_LOCKED(sc); + + /* general structure was copied from ath(4). */ + if (ic->ic_allmulti == 0) { + struct ieee80211vap *vap; + struct ifnet *ifp; + struct ifmultiaddr *ifma; + + /* + * Merge multicast addresses to form the hardware filter. + */ + mfilt[0] = mfilt[1] = 0; + TAILQ_FOREACH(vap, &ic->ic_vaps, iv_next) { + ifp = vap->iv_ifp; + if_maddr_rlock(ifp); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + caddr_t dl; + uint8_t pos; + + dl = LLADDR((struct sockaddr_dl *) + ifma->ifma_addr); + pos = rsu_get_multi_pos(dl); + + mfilt[pos / 32] |= (1 << (pos % 32)); + } + if_maddr_runlock(ifp); + } + } else + mfilt[0] = mfilt[1] = ~0; + + rsu_write_4(sc, R92S_MAR + 0, mfilt[0]); + rsu_write_4(sc, R92S_MAR + 4, mfilt[1]); + + RSU_DPRINTF(sc, RSU_DEBUG_STATE, "%s: MC filter %08x:%08x\n", + __func__, mfilt[0], mfilt[1]); +} + static void rsu_update_mcast(struct ieee80211com *ic) { - /* XXX do nothing? */ + struct rsu_softc *sc = ic->ic_softc; + + RSU_LOCK(sc); + if (sc->sc_running) + rsu_set_multi(sc); + RSU_UNLOCK(sc); } static int @@ -2925,6 +2995,9 @@ rsu_init(struct rsu_softc *sc) goto fail; } + /* Setup multicast filter (must be done after firmware loading). */ + rsu_set_multi(sc); + /* Set PS mode fully active */ error = rsu_set_fw_power_state(sc, RSU_PWR_ACTIVE); Modified: head/sys/dev/usb/wlan/if_rsureg.h ============================================================================== --- head/sys/dev/usb/wlan/if_rsureg.h Sun Nov 27 14:27:51 2016 (r309213) +++ head/sys/dev/usb/wlan/if_rsureg.h Sun Nov 27 18:06:03 2016 (r309214) @@ -48,6 +48,7 @@ #define R92S_MACIDSETTING 0x0050 #define R92S_MACID (R92S_MACIDSETTING + 0x000) +#define R92S_MAR (R92S_MACIDSETTING + 0x010) #define R92S_GP 0x01e0 #define R92S_GPIO_CTRL (R92S_GP + 0x00c) From owner-svn-src-all@freebsd.org Sun Nov 27 18:34:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D3C3C5886D; Sun, 27 Nov 2016 18:34:31 +0000 (UTC) (envelope-from adrian@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 0CDC3EE4; Sun, 27 Nov 2016 18:34:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uARIYU71029377; Sun, 27 Nov 2016 18:34:30 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uARIYUjJ029375; Sun, 27 Nov 2016 18:34:30 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201611271834.uARIYUjJ029375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 27 Nov 2016 18:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309215 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 18:34:31 -0000 Author: adrian Date: Sun Nov 27 18:34:29 2016 New Revision: 309215 URL: https://svnweb.freebsd.org/changeset/base/309215 Log: [ath] Begin to lay the groundwork for btcoex related ioctl controls. Modified: head/sys/dev/ath/if_ath_ioctl.c head/sys/dev/ath/if_athioctl.h Modified: head/sys/dev/ath/if_ath_ioctl.c ============================================================================== --- head/sys/dev/ath/if_ath_ioctl.c Sun Nov 27 18:06:03 2016 (r309214) +++ head/sys/dev/ath/if_ath_ioctl.c Sun Nov 27 18:34:29 2016 (r309215) @@ -296,6 +296,8 @@ ath_ioctl(struct ieee80211com *ic, u_lon return (ath_ioctl_spectral(sc, data)); case SIOCGATHNODERATESTATS: return (ath_ioctl_ratestats(sc, data)); + case SIOCGATHBTCOEX: + return (ath_btcoex_ioctl(sc, data)); default: /* * This signals the net80211 layer that we didn't handle this Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Sun Nov 27 18:06:03 2016 (r309214) +++ head/sys/dev/ath/if_athioctl.h Sun Nov 27 18:34:29 2016 (r309215) @@ -447,4 +447,9 @@ struct ath_tx_radiotap_header { #define SPECTRAL_CONTROL_ENABLE_AT_RESET 8 #define SPECTRAL_CONTROL_DISABLE_AT_RESET 9 +/* + * Bluetooth coexistence control parameters + */ +#define SIOCGATHBTCOEX _IOWR('i', 152, struct ath_diag) + #endif /* _DEV_ATH_ATHIOCTL_H */ From owner-svn-src-all@freebsd.org Sun Nov 27 19:18:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75D2DC5928E; Sun, 27 Nov 2016 19:18:23 +0000 (UTC) (envelope-from kubito@gmail.com) Received: from mail-wj0-x244.google.com (mail-wj0-x244.google.com [IPv6:2a00:1450:400c:c01::244]) (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 0A7041E79; Sun, 27 Nov 2016 19:18:23 +0000 (UTC) (envelope-from kubito@gmail.com) Received: by mail-wj0-x244.google.com with SMTP id jb2so11531871wjb.3; Sun, 27 Nov 2016 11:18:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=Qw+aUFjvSY2tCcotZbDZm04IWf4nnPC+eHwpUkgbWXQ=; b=XdPeBvvS1CBPd9UM5ICRZymCEJ8s7jrPrP6nH1fNygKOY5AEcDJ9GXL2j4oomHxS8N QZUPoJT6g6iqOw+yrrb3ayldXwhqGUkkGtxx5Vwk7B9E51tYfYKMtpmt9gL6b2mY5cPT mxYAi4QChklQ4fJ/H8zhBA3uUzdzYxJqitDTLJqV1JZLQ9xsasr2iXNbewFQljR01chA OkoIu7hRAFlg/0gCLt4vxZic9x+JFa3DnJ48hHTh9ZzSIFHFI8h30nJ4EleA5GaUV0Mx GjOdVtMeyDHGTwAQPoz7ttYkDjVasrGd/mdfzC9a8AAgP957h7RPI3ALIF0AL+sR8suo iuHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=Qw+aUFjvSY2tCcotZbDZm04IWf4nnPC+eHwpUkgbWXQ=; b=Dj30EFtm5UhKW2vaaTgABu7aPKQDTObGN9ZGv48ieBi9DXdjsMt6Z1BscKVICQ3bA4 x6uPng4ZpEN9zGLHCN2ooNaM93tQqF2xG1JBXRBWTJ2Rm3ybqsGSBuCrKb7ZhLlpNOS9 ndiwVuVJnS37kJM3OvZhwOxEsnH6sbYmtZ4C/XCWDUV1qIT2KNS8Cu5+lpsc1WZ35+TO NKXJ+gwA3O1doQ3ztDjmt9P+RT8NgN43fC/xvByeclwzDKPDcnCOeDj3tCe74bpgqdNa /QS5YhLiiW9cpCkumbc06bbLnbEZoMox7pZu5SQwj2BYTAyZEqvY3RKPnR0JbQm8XvIj 8w4g== X-Gm-Message-State: AKaTC02sWlnWVoACYQGOt98HVDTyXKVFdOQmQF4hMML23LZZD9xCRmGrRCCccc5w4/+nRw== X-Received: by 10.194.94.70 with SMTP id da6mr18231066wjb.180.1480274301190; Sun, 27 Nov 2016 11:18:21 -0800 (PST) Received: from orwell.gmail.com (dhcp-077-248-147-050.chello.nl. [77.248.147.50]) by smtp.gmail.com with ESMTPSA id u17sm24895022wma.24.2016.11.27.11.18.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 27 Nov 2016 11:18:20 -0800 (PST) Sender: Raphael Kubo da Costa From: Raphael Kubo da Costa To: Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309194 - head/usr.sbin/syslogd References: <201611261550.uAQFo0HC074016@repo.freebsd.org> Date: Sun, 27 Nov 2016 20:18:14 +0100 In-Reply-To: <201611261550.uAQFo0HC074016@repo.freebsd.org> (Baptiste Daroussin's message of "Sat, 26 Nov 2016 15:50:00 +0000 (UTC)") Message-ID: <86shqchguh.fsf@FreeBSD.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 19:18:23 -0000 Baptiste Daroussin writes: > Author: bapt > Date: Sat Nov 26 15:49:59 2016 > New Revision: 309194 > URL: https://svnweb.freebsd.org/changeset/base/309194 > > Log: > initialize *nextp which could be left uninitialized in case the configuration > file cannot be open/read > > Reported by: Coverity via cem > MFC after: 2 days > CID: 1365665 This is causing syslogd to crash on launch with SIGILL here (I'm on r309213). The disassembly shows it's stumbling upon an UD2 instruction here on amd64. From owner-svn-src-all@freebsd.org Sun Nov 27 19:27:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A387C594D5; Sun, 27 Nov 2016 19:27:15 +0000 (UTC) (envelope-from bapt@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 C3316680; Sun, 27 Nov 2016 19:27:14 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uARJRDXa049730; Sun, 27 Nov 2016 19:27:13 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uARJRDYA049729; Sun, 27 Nov 2016 19:27:13 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201611271927.uARJRDYA049729@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 27 Nov 2016 19:27:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309216 - head/usr.sbin/syslogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 19:27:15 -0000 Author: bapt Date: Sun Nov 27 19:27:13 2016 New Revision: 309216 URL: https://svnweb.freebsd.org/changeset/base/309216 Log: Properly initialize nextp MFC after: 1 day Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Sun Nov 27 18:34:29 2016 (r309215) +++ head/usr.sbin/syslogd/syslogd.c Sun Nov 27 19:27:13 2016 (r309216) @@ -1835,7 +1835,7 @@ init(int signo) free((char *)f); } Files = NULL; - *nextp = NULL; + nextp = &Files; /* open the configuration file */ if ((cf = fopen(ConfFile, "r")) == NULL) { From owner-svn-src-all@freebsd.org Sun Nov 27 20:11:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 759B0C590B8; Sun, 27 Nov 2016 20:11:56 +0000 (UTC) (envelope-from pfg@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 4556DFA8; Sun, 27 Nov 2016 20:11:56 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uARKBtjO067213; Sun, 27 Nov 2016 20:11:55 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uARKBtdP067212; Sun, 27 Nov 2016 20:11:55 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201611272011.uARKBtdP067212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 27 Nov 2016 20:11:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309217 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 20:11:56 -0000 Author: pfg Date: Sun Nov 27 20:11:55 2016 New Revision: 309217 URL: https://svnweb.freebsd.org/changeset/base/309217 Log: indent(1): minor off-by-one error. This was introduced in r303571. Obtianed from: Piotr Stefaniak Modified: head/usr.bin/indent/parse.c Modified: head/usr.bin/indent/parse.c ============================================================================== --- head/usr.bin/indent/parse.c Sun Nov 27 19:27:13 2016 (r309216) +++ head/usr.bin/indent/parse.c Sun Nov 27 20:11:55 2016 (r309217) @@ -202,7 +202,7 @@ parse(int tk) /* tk: the code for the co } /* end of switch */ - if (ps.tos >= STACKSIZE) + if (ps.tos >= STACKSIZE - 1) errx(1, "Parser stack overflow"); reduce(); /* see if any reduction can be done */ From owner-svn-src-all@freebsd.org Sun Nov 27 20:30:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E6E7C59517; Sun, 27 Nov 2016 20:30:10 +0000 (UTC) (envelope-from pfg@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 0E36F17FC; Sun, 27 Nov 2016 20:30:09 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uARKU9Ns073712; Sun, 27 Nov 2016 20:30:09 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uARKU9jY073711; Sun, 27 Nov 2016 20:30:09 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201611272030.uARKU9jY073711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 27 Nov 2016 20:30:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309219 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 20:30:10 -0000 Author: pfg Date: Sun Nov 27 20:30:09 2016 New Revision: 309219 URL: https://svnweb.freebsd.org/changeset/base/309219 Log: indent(1): fix regression introduced in r303596. Multi-line comments are always block comments in KNF. Restore properly, handling the case when a long one-liner gets wrapped and becomes a multi-line comment. Obtained from: Piotr Stefaniak Modified: head/usr.bin/indent/pr_comment.c Modified: head/usr.bin/indent/pr_comment.c ============================================================================== --- head/usr.bin/indent/pr_comment.c Sun Nov 27 20:21:38 2016 (r309218) +++ head/usr.bin/indent/pr_comment.c Sun Nov 27 20:30:09 2016 (r309219) @@ -162,15 +162,19 @@ pr_comment(void) if (*buf_ptr != ' ' && !ps.box_com) *e_com++ = ' '; - /* Don't put a break delimiter if this comment is a one-liner */ - for (t_ptr = buf_ptr; *t_ptr != '\0' && *t_ptr != '\n'; t_ptr++) { - if (t_ptr >= buf_end) - fill_buffer(); - if (t_ptr[0] == '*' && t_ptr[1] == '/') { - break_delim = false; - break; + /* + * Don't put a break delimiter if this is a one-liner that won't wrap. + */ + if (break_delim) + for (t_ptr = buf_ptr; *t_ptr != '\0' && *t_ptr != '\n'; t_ptr++) { + if (t_ptr >= buf_end) + fill_buffer(); + if (t_ptr[0] == '*' && t_ptr[1] == '/') { + if (adj_max_col >= count_spaces_until(ps.com_col, buf_ptr, t_ptr + 2)) + break_delim = false; + break; + } } - } if (break_delim) { char *t = e_com; From owner-svn-src-all@freebsd.org Sun Nov 27 20:38:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C718C596A3; Sun, 27 Nov 2016 20:38:16 +0000 (UTC) (envelope-from pfg@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 EB4BF1C43; Sun, 27 Nov 2016 20:38:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uARKcF8x077479; Sun, 27 Nov 2016 20:38:15 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uARKcESW077476; Sun, 27 Nov 2016 20:38:14 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201611272038.uARKcESW077476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 27 Nov 2016 20:38:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309220 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 20:38:16 -0000 Author: pfg Date: Sun Nov 27 20:38:14 2016 New Revision: 309220 URL: https://svnweb.freebsd.org/changeset/base/309220 Log: indent(1): Properly handle the wide string literal and wide char constant L. indent(1) treated the "L" in "L'a'" as if it were an identifier and forced a space character after it, breaking valid code. PR: 143090 MFC after: 2 weeks Modified: head/usr.bin/indent/indent.c head/usr.bin/indent/indent_codes.h head/usr.bin/indent/lexi.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Sun Nov 27 20:30:09 2016 (r309219) +++ head/usr.bin/indent/indent.c Sun Nov 27 20:38:14 2016 (r309220) @@ -1004,6 +1004,16 @@ check_type: ps.want_blank = true; break; + case strpfx: + if (ps.want_blank) + *e_code++ = ' '; + for (t_ptr = token; *t_ptr; ++t_ptr) { + CHECK_SIZE_CODE; + *e_code++ = *t_ptr; + } + ps.want_blank = false; + break; + case period: /* treat a period kind of like a binary * operation */ *e_code++ = '.'; /* move the period into line */ Modified: head/usr.bin/indent/indent_codes.h ============================================================================== --- head/usr.bin/indent/indent_codes.h Sun Nov 27 20:30:09 2016 (r309219) +++ head/usr.bin/indent/indent_codes.h Sun Nov 27 20:38:14 2016 (r309220) @@ -68,3 +68,4 @@ #define ifhead 30 #define elsehead 31 #define period 32 +#define strpfx 33 Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Sun Nov 27 20:30:09 2016 (r309219) +++ head/usr.bin/indent/lexi.c Sun Nov 27 20:38:14 2016 (r309220) @@ -237,6 +237,11 @@ lexi(void) fill_buffer(); } *e_token++ = '\0'; + + if (s_token[0] == 'L' && s_token[1] == '\0' && + (*buf_ptr == '"' || *buf_ptr == '\'')) + return (strpfx); + while (*buf_ptr == ' ' || *buf_ptr == '\t') { /* get rid of blanks */ if (++buf_ptr >= buf_end) fill_buffer(); From owner-svn-src-all@freebsd.org Sun Nov 27 20:43:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5089C599C1; Sun, 27 Nov 2016 20:43:08 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mailout.stack.nl (mailout05.stack.nl [IPv6:2001:610:1108:5010::202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 83BBF241; Sun, 27 Nov 2016 20:43:08 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mailout.stack.nl (Postfix) with ESMTP id ECAA737; Sun, 27 Nov 2016 21:43:05 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id D965028494; Sun, 27 Nov 2016 21:43:05 +0100 (CET) Date: Sun, 27 Nov 2016 21:43:05 +0100 From: Jilles Tjoelker To: Julian Elischer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309035 - in head/lib/libpathconv: . tests Message-ID: <20161127204305.GA58954@stack.nl> References: <201611230757.uAN7vqmC008888@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201611230757.uAN7vqmC008888@repo.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 20:43:08 -0000 On Wed, Nov 23, 2016 at 07:57:52AM +0000, Julian Elischer wrote: > Author: julian > Date: Wed Nov 23 07:57:52 2016 > New Revision: 309035 > URL: https://svnweb.freebsd.org/changeset/base/309035 > Log: > This little BSD licensed library has been kicking around for years. > It allows one to trivially convert an absolute path to a relative path > and the reverse. The test programs themselves are very useful in scripts > but the real use comes shortly with the -r and -a arguments to ln. > These are sometimes known as the --relative and --absolute flags and > can force a symlink to be relative when you only have an absolue path. > Another place these are sometimes used is to add -a and -r args to 'realpath'. > Incredibly useful in Makefiles. > I was going to just add the files in with 'ln' but a library makes more sense. > The test programs may come out in their own right some day for scripting. > released under a BSD 2-clause: > * Copyright (c) 1997 Shigio Yamaguchi. All rights reserved. > * Copyright (c) 1999 Tama Communications Corporation. All rights reserved. > The test directry does not conform to any framework. > Not connected to build. > doc people may want to play with the manual pages. > Obtained from: https://www.tamacom.com/pathconvert.html Shigio Yamaguchi. > MFC after: 1 month > Relnotes: yes > Sponsored by: Panzura, Tama Communications Corporation Consider making this a static-only library or a part of an existing library such as libc or libutil, since the overhead of a shared object is rather big compared to the amount of code here. Thanks for not linking this to the build right away. -- Jilles Tjoelker From owner-svn-src-all@freebsd.org Sun Nov 27 22:27:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93127C59F22; Sun, 27 Nov 2016 22:27:53 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wj0-x243.google.com (mail-wj0-x243.google.com [IPv6:2a00:1450:400c:c01::243]) (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 2A1AB1D2C; Sun, 27 Nov 2016 22:27:53 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wj0-x243.google.com with SMTP id xy5so11916137wjc.1; Sun, 27 Nov 2016 14:27:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=61Zp2QBfuQNmqsaUu/haQox0WDUxpONKZd5knKg9jCM=; b=o7By6ci/J3FCfOmFLCyPdOkTAzABeTjnyzNv/DuKk+tbDeeKR+9BYoSRDq8YcqcFEP ww2+847q71r5PxC7G332PMydN4iTt/IxegLsY0BKGBZDetToe1/JtNGg3Ax0EPcBbL6x m66Z7CbMR8xRRmpf0SRTp9niV81Vr5K3Zq0OL9acRf/8e+FX0+Uci+NN9yq4yn3O4ceF dNA+jPsRCzUkW830FFdrnx/t7xJqR8fm6hh82va3SAu5sEcBYJxULBJul6147w42jE8t uqS4Lo7LALd/fvD/6erI1hd/eeTFxa6KE4ALpPsXiGB/a0Uf+YxTFyI7SX+lmu0F2MDX UNFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=61Zp2QBfuQNmqsaUu/haQox0WDUxpONKZd5knKg9jCM=; b=H9QsjjEY6UkEbIbP6aYQ8WGjoiaOV33i5a6jGtP+vIJylYRhpbQspUcv83IIo+U72L VDKFmW1McXxHhqMQ8nuunD1fWbpLWpuljmiE+BSjl9b3DxFCudk5LExU/hYuWPkiTgrT vh+rdzCxAPdF0aeDp5MwG8/WC5gdPI6oXKBJN1MxlEfi5KTiy2fqRH1ExHBDLRjBM1kf IMMvww4Rkp/WsT32Sopr51UycMGyrNIQGnDa/OIb/9fE5ly5xKbjrwZivf6UBhBo01kx kaGFEVkN9h2d2isZFZEsZQc07BUaXiWwHI4izmZPQM0pPJTNB+iEyS5zzRlAx5IBVeLJ 5LEw== X-Gm-Message-State: AKaTC00Kw1pA0LF4RAbIlo/SOBT7dqKn4MBqY0Ez+q8phRN7XkWFiieOM5lm3WCIWfpNRA== X-Received: by 10.194.121.6 with SMTP id lg6mr18770904wjb.105.1480285670489; Sun, 27 Nov 2016 14:27:50 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id n5sm24557729wmf.0.2016.11.27.14.27.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Nov 2016 14:27:49 -0800 (PST) Sender: Baptiste Daroussin Date: Sun, 27 Nov 2016 23:27:48 +0100 From: Baptiste Daroussin To: Jilles Tjoelker Cc: Julian Elischer , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r309035 - in head/lib/libpathconv: . tests Message-ID: <20161127222748.uptaiumgvnyopzic@ivaldir.etoilebsd.net> References: <201611230757.uAN7vqmC008888@repo.freebsd.org> <20161127204305.GA58954@stack.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="yrzfvtni7wfrptil" Content-Disposition: inline In-Reply-To: <20161127204305.GA58954@stack.nl> User-Agent: NeoMutt/20161104 (1.7.1) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Nov 2016 22:27:53 -0000 --yrzfvtni7wfrptil Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 27, 2016 at 09:43:05PM +0100, Jilles Tjoelker wrote: > On Wed, Nov 23, 2016 at 07:57:52AM +0000, Julian Elischer wrote: > > Author: julian > > Date: Wed Nov 23 07:57:52 2016 > > New Revision: 309035 > > URL: https://svnweb.freebsd.org/changeset/base/309035 >=20 > > Log: > > This little BSD licensed library has been kicking around for years. > > It allows one to trivially convert an absolute path to a relative path > > and the reverse. The test programs themselves are very useful in scri= pts > > but the real use comes shortly with the -r and -a arguments to ln. > > These are sometimes known as the --relative and --absolute flags and > > can force a symlink to be relative when you only have an absolue path. > > Another place these are sometimes used is to add -a and -r args to 'r= ealpath'. > > Incredibly useful in Makefiles. >=20 > > I was going to just add the files in with 'ln' but a library makes mo= re sense. > > The test programs may come out in their own right some day for script= ing. >=20 > > released under a BSD 2-clause: > > * Copyright (c) 1997 Shigio Yamaguchi. All rights reserved. > > * Copyright (c) 1999 Tama Communications Corporation. All rights res= erved. >=20 > > The test directry does not conform to any framework. > > Not connected to build. > > doc people may want to play with the manual pages. >=20 > > Obtained from: https://www.tamacom.com/pathconvert.html Shigio Yama= guchi. > > MFC after: 1 month > > Relnotes: yes > > Sponsored by: Panzura, Tama Communications Corporation >=20 > Consider making this a static-only library or a part of an existing > library such as libc or libutil, since the overhead of a shared object > is rather big compared to the amount of code here. >=20 > Thanks for not linking this to the build right away. +1 seems like a good candidate for libutil Best regards, Bapt --yrzfvtni7wfrptil Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlg7XeEACgkQY4mL3PG3 PlqknhAAuqG1Llqsz2f4DaAviEm+/p9HzAKnQ6TeyXf5txYYK74aXFa4GbJdUsYC d6fmLbPgJEAMWBiKz8jmx+6vcVCNVtRpLXhZ+dLzzBhEUAZMJtmpFjYRpMg4A+vA 66mYd6tQHQHI27ua2X9Dgbzwtw5+gpuVDqJY1NHfg62vwfq5ToFuel/ACb57Ifk5 NjKzWxsnQE8mJ3/xUS4wKa873AIjvwz9njy4tMUNH9F3WmlQgIzr873d4jaRCQV4 9DzpgOk4XVHbuxzN62PxpN2FDa0bF/vVvGx03KlUljyAk3IiPefSbUBe6iqU/qcF 7WLJ7ya+/N6wNAMPzwtYykFTXfQDX4KhEmf0Ujti1SdtTQ4FpJBCzhS53YFKlXqm 4e0uYLCXyHxYitBeqi1wOEKCvPtWZhgNaENl7DWNui7IilZtQFsm3N+7jCVZ5mGW tcWouILfsi1mJ4YMay5qqw0E0wrG2YZ3r+g6Muk3f97vVqGNlzcACfM0O77hWlO7 p1kTV2QML0hccUV5HzlKAXrJIGYqoo+z1mg4Sh6HzAYNTAS4bz6xu6osydxvIQrG pi3F2PNOlcD/yDiL0iPUeZoA3VRa98yfcJcAdQ1ICgfkl1RGJMA6+oKDaV+H7LLV pxsAanwLE03iqCZlTJsxmbL04Uo2HMJXLlg5kPuRtaxxuZqtC2k= =NYpy -----END PGP SIGNATURE----- --yrzfvtni7wfrptil-- From owner-svn-src-all@freebsd.org Mon Nov 28 01:16:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3CE8C585DC; Mon, 28 Nov 2016 01:16:56 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (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 6C53D36E4; Mon, 28 Nov 2016 01:16:56 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-io0-x22c.google.com with SMTP id a124so205591577ioe.2; Sun, 27 Nov 2016 17:16:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=8dvyggNus8Ns4JQm1TPy5ykJeKIRt0LDXiAHGuo3aY4=; b=PCtNio8a88YlwDDZ4LEJ/NAX4dfYvETQSUw/46ZjX6qJysiwLDTDUEJoWaAhuHBi7w Ne8vmbLsoqdlxYy5IwHTzNimwkleY1ZJjqgoWD71jhYJnVnQdxrDW2+MF2XB+TVdoWkz mBJNZUkAG16bM0am9UifPLD5kWqpuPv/IJrQxR+8lkzzcbAYSxQTl4A8oectPoXLz6uR kmbcuwWkcDFqSeHASXB3KwMVZlkwgOYhh585s820fypT1gfK4XAUeRlGARvrusnyi4MS 983xvhCLTolgN/Mhuj3RQxqiVH+EkcimKXN3ykzfguY3q8FyR85XVqcW4+oSUeVpJlET dAVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=8dvyggNus8Ns4JQm1TPy5ykJeKIRt0LDXiAHGuo3aY4=; b=SJ+1jyFKC5jWxz/z3vSgWaoY6eqHWbdxYo22ovnKSGk/s53ZlPHm9VvoKEJg6KNYPO Y5AiRavqyXJ7abPbqSO+BW6JN+EfMyD45zTX3MOJhdeKr9SxHApfDW+/pQfVSFhl3K+o ki6ORAbM/J9ciO/FjrlxAGisN/wtxbBTdkn+0+LwkJ5BRzyCgxlb1HN09GSrbwZkkkqs ol1Oj80lCzFCQNwHsTYFIzho1gEFYOJvgb2msYnhGW3Mn9ns9jGsByCHygPr7EDSzoQt h2At36EyRiZxtzMG4+Jymdx1CVIzMiaX2SR3seiF2M5n2UxaJ4Tg/w9cp0P31fryt9Tu p59g== X-Gm-Message-State: AKaTC005uQX3qJWGFNLzEbk5TzJCGU2/QYyKHkMXZWn8icm7o587OtIO+PPXR9liGH/YmzxN1Wf2oLvtnuZfig== X-Received: by 10.107.18.230 with SMTP id 99mr14873206ios.41.1480295815769; Sun, 27 Nov 2016 17:16:55 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.152.204 with HTTP; Sun, 27 Nov 2016 17:16:55 -0800 (PST) In-Reply-To: <201611261550.uAQFo0HC074016@repo.freebsd.org> References: <201611261550.uAQFo0HC074016@repo.freebsd.org> From: Ryan Stone Date: Sun, 27 Nov 2016 20:16:55 -0500 Message-ID: Subject: Re: svn commit: r309194 - head/usr.sbin/syslogd To: Baptiste Daroussin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 01:16:56 -0000 On Sat, Nov 26, 2016 at 10:50 AM, Baptiste Daroussin wrote: > Author: bapt > Date: Sat Nov 26 15:49:59 2016 > New Revision: 309194 > URL: https://svnweb.freebsd.org/changeset/base/309194 > > Log: > initialize *nextp which could be left uninitialized in case the > configuration > file cannot be open/read > > Reported by: Coverity via cem > MFC after: 2 days > CID: 1365665 > > Modified: > head/usr.sbin/syslogd/syslogd.c > > Modified: head/usr.sbin/syslogd/syslogd.c > ============================================================ > ================== > --- head/usr.sbin/syslogd/syslogd.c Sat Nov 26 15:01:35 2016 > (r309193) > +++ head/usr.sbin/syslogd/syslogd.c Sat Nov 26 15:49:59 2016 > (r309194) > @@ -1835,6 +1835,7 @@ init(int signo) > free((char *)f); > } > Files = NULL; > + *nextp = NULL; > > /* open the configuration file */ > if ((cf = fopen(ConfFile, "r")) == NULL) { > > There is something very wrong in the code here. nextp is never initialized, so obviously we can't access *nextp. I'm surprised that this code can even compile with -Werror. I'd fix it but it'd not clear to me what nextp is intended to do. From owner-svn-src-all@freebsd.org Mon Nov 28 01:18:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2CAEC58666; Mon, 28 Nov 2016 01:18:35 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::236]) (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 8B1B337B7; Mon, 28 Nov 2016 01:18:35 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-io0-x236.google.com with SMTP id j65so206089669iof.0; Sun, 27 Nov 2016 17:18:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=wbo7MZvWYfYvnTuw53nKridc4z8bDPTwnYEIq778Sb0=; b=0rW2zxTcSii7LykzKU0vHgWDF89EkdNPZGCGwGflqhSIsLFFAMchI4/kS8DmLktT6x VzNJtSvYsugtrSF1ydebqhLO3/eqH9MWRSMLpcxzoO1ACJnLyTuY/G31Ci0ITPrHP9Hs xdVmrGIpLaljP3mUb9UrlRxmQGTsga/y4i/ruNSqorY46exQuZu8yPvlV+t2GJJ4iGe4 GQn4JGXcAw9DHjF2SMaEUdvV4XxVpCgxYLtF6OXti6XTvIEF6BfbGUPoLfZ1u7GQPWmx dYqL5udiKJQsV70VljGEVPFOhl4fC2t4khEdVpXoYvVyjG879p3uF6y50OCYadJU4+kE q98w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=wbo7MZvWYfYvnTuw53nKridc4z8bDPTwnYEIq778Sb0=; b=Pynwzdt0rMqF37estWucqSvT59UIYbgL6NA+s50xyWvWOZJp+923UUIe4IVJC3Ns8y 7Uy4Kg1E+7OiENB3MdatCxKOJFdoyes4CXhBD3ZdZr3EsB/ta0kbE0OxFDoWjx8hrruJ aIP4DD/0wrgzzAhuD6crhSrrHqdETRtUzWNNfielmDUtqKe6HdQEuF38nvrb0vO7bas5 3KXjYoUEK+HTEmvfKlvdTvEoNWHQJgNlENjpKHrHEtXgC7I+QKBUJD2ZDhi8G9IMS9Hs ru/MD8vcQHal+ypVHlSnT2s1sTEFzPyhrTsgf6IHuzbfYM0mjKly/gV6tCaoBV2JDCfl 6Uhw== X-Gm-Message-State: AKaTC018xVfwA6d/TldVvHoDE0CcwMNA6TJ5trxl0JqMo9qVev9SeWptVJJJtBe0HS+ChhREL25TaYAoRTXojA== X-Received: by 10.107.18.230 with SMTP id 99mr14876367ios.41.1480295914924; Sun, 27 Nov 2016 17:18:34 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.152.204 with HTTP; Sun, 27 Nov 2016 17:18:34 -0800 (PST) In-Reply-To: References: <201611261550.uAQFo0HC074016@repo.freebsd.org> From: Ryan Stone Date: Sun, 27 Nov 2016 20:18:34 -0500 Message-ID: Subject: Re: svn commit: r309194 - head/usr.sbin/syslogd To: Baptiste Daroussin Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 01:18:35 -0000 > > There is something very wrong in the code here. nextp is never > initialized, so obviously we can't access *nextp. I'm surprised that this > code can even compile with -Werror. I'd fix it but it'd not clear to me > what nextp is intended to do. > Apologies for the noise; I didn't see r309216, which properly initialized nextp. From owner-svn-src-all@freebsd.org Mon Nov 28 02:36:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F34C3C59C9F; Mon, 28 Nov 2016 02:36:13 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-yw0-x243.google.com (mail-yw0-x243.google.com [IPv6:2607:f8b0:4002:c05::243]) (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 AE25C10C3; Mon, 28 Nov 2016 02:36:13 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-yw0-x243.google.com with SMTP id a10so8388154ywa.1; Sun, 27 Nov 2016 18:36:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc; bh=MOJM+wICaVFep1oWWqH5N69p4Z5G1oZ/2JY2TWonYCY=; b=dYxaFX3CccnJg6CoF4aQ2FI0Zpg+UVrDza5wws2WvWOwQX5Q4ONRY6r1/DFxrzm5fF qdKjFhQwT0nkvHtwT+0s0ctNCkbF3uOje2iIbckrfd12z8Ie4AXFqpcemDmJzBTrSLmz 8ztgkdqF7qOGHI0zYlaxNmpQSkx65jeRGDnwL03Y00822AvlNyGvFx6DHe0X1zOjTsP3 RaFHVc/oKOK11wYrxaRIVheZnHxEIODrIuMWFmETaq0KInd09Dl0M2vwdzvp6ewwJGr5 +J/waqusk/X7p/p8FxGe10MrjSfh4ny9F8ewzoOl4E2g4PfrWUsFAOBY4LbHYwx9RZia UdDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=MOJM+wICaVFep1oWWqH5N69p4Z5G1oZ/2JY2TWonYCY=; b=c4e+BdlcJ8kNGqj6G3BmhHBjLjW3XUe4p/5okFWOqG2lq+ayHvotR0RSKLQ+RtxKSa nLEyNlK5oxdcCOXK7e58o+WHcTxWLMT32IqLKxX53Zm2WpbEvVn0VExzunr9Pvqj14wa 96Nmfro/mELdO/irrLCQII0y/86pZkNhh5MAACzfIS75o6WQNT3to/4FCSE/3Sb3YhCg t/bJVWanJ+Ku/Ur+7oYsPKm/p2EEEeCCfTC5I5xtT1+hzv85+1CYLRJSCnkN+5Xieyhm 5gaAZBxZc09rKUk0y+CZ8giTiAHIljfmpd2gq0wEzWCCH0lDBRnYmR3P1joMcS4ep/l+ P9Xg== X-Gm-Message-State: AKaTC02b9VeUrFkq+7Rll4u6ZAy6ADmkr+NDQz/GZjhoTz9N/Kms8ctJfGgx1Nwew+jpjHtDs6U7WLJBDFuscw== X-Received: by 10.129.179.8 with SMTP id r8mr22571067ywh.156.1480300572496; Sun, 27 Nov 2016 18:36:12 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.22.196 with HTTP; Sun, 27 Nov 2016 18:36:12 -0800 (PST) Received: by 10.37.22.196 with HTTP; Sun, 27 Nov 2016 18:36:12 -0800 (PST) Reply-To: BYOND.Lenox@gmail.com In-Reply-To: References: <201611242254.uAOMswkb081748@repo.freebsd.org> From: Kyle Evans Date: Sun, 27 Nov 2016 20:36:12 -0600 Message-ID: Subject: Re: svn commit: r309124 - in head: . contrib/compiler-rt contrib/compiler-rt/include/sanitizer contrib/compiler-rt/lib/asan contrib/compiler-rt/lib/builtins contrib/compiler-rt/lib/builtins/arm contrib... To: Dimitry Andric , Glen Barber Cc: src-committers@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 02:36:14 -0000 On Nov 27, 2016 20:20, "Kyle Evans" wrote: > > Hi, > > On Thu, Nov 24, 2016 at 4:54 PM, Dimitry Andric wrote: > > Author: dim > > Date: Thu Nov 24 22:54:55 2016 > > New Revision: 309124 > > URL: https://svnweb.freebsd.org/changeset/base/309124 > > > > Log: > > Upgrade our copies of clang, llvm, lldb, compiler-rt and libc++ to 3.9.0 > > release, and add lld 3.9.0. Also completely revamp the build system for > > clang, llvm, lldb and their related tools. > > > > Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11 > > support to build; see UPDATING for more information. > > > > Release notes for llvm, clang and lld are available here: > > > > > > > > > > Thanks to Ed Maste, Bryan Drewery, Andrew Turner, Antoine Brodin and Jan > > Beich for their help. > > > > Relnotes: yes > > MFC after: 1 month > > First off, thanks for this! =) > > Unfortunately, this commit seems to have done away with the -clang > pkgbase pkg [1], and doesn't seem to have revived the PACKAGE= > elsewhere as FreeBSD-clang has disappeared from my newly built > repository. =( > > [1] https://svnweb.freebsd.org/base/head/usr.bin/clang/clang.prog.mk?limit_changes=0&r1=298107&r2=309124&pathrev=309124 Argh, sorry about the noise here. I just realized that clang was moved to the runtime package -- spooked by the package disappearing for no good reason. From owner-svn-src-all@freebsd.org Mon Nov 28 02:51:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFCEBC59F9A; Mon, 28 Nov 2016 02:51:56 +0000 (UTC) (envelope-from adrian@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 8F7CC19CE; Mon, 28 Nov 2016 02:51:56 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS2ptir029445; Mon, 28 Nov 2016 02:51:55 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS2ptoi029444; Mon, 28 Nov 2016 02:51:55 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201611280251.uAS2ptoi029444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 28 Nov 2016 02:51:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309222 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 02:51:56 -0000 Author: adrian Date: Mon Nov 28 02:51:55 2016 New Revision: 309222 URL: https://svnweb.freebsd.org/changeset/base/309222 Log: [ath] include logging of TU versions of the TSF values. The beacon programming side of things deals in TUs and 1/8th TUs, so it's good to se the TU value here when debugging beaconing issues. Modified: head/sys/dev/ath/if_ath_rx.c Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Sun Nov 27 20:52:52 2016 (r309221) +++ head/sys/dev/ath/if_ath_rx.c Mon Nov 28 02:51:55 2016 (r309222) @@ -420,19 +420,24 @@ ath_recv_mgmt(struct ieee80211_node *ni, tsf_remainder = (tsf_beacon - tsf_beacon_old) % tsf_intval; } - DPRINTF(sc, ATH_DEBUG_BEACON, "%s: old_tsf=%llu, new_tsf=%llu, target_tsf=%llu, delta=%lld, bmiss=%d, remainder=%d\n", + DPRINTF(sc, ATH_DEBUG_BEACON, "%s: old_tsf=%llu (%u), new_tsf=%llu (%u), target_tsf=%llu (%u), delta=%lld, bmiss=%d, remainder=%d\n", __func__, (unsigned long long) tsf_beacon_old, + (unsigned int) (tsf_beacon_old >> 10), (unsigned long long) tsf_beacon, + (unsigned int ) (tsf_beacon >> 10), (unsigned long long) tsf_beacon_target, + (unsigned int) (tsf_beacon_target >> 10), (long long) tsf_delta, tsf_delta_bmiss, tsf_remainder); - DPRINTF(sc, ATH_DEBUG_BEACON, "%s: tsf=%llu, nexttbtt=%llu, delta=%d\n", + DPRINTF(sc, ATH_DEBUG_BEACON, "%s: tsf=%llu (%u), nexttbtt=%llu (%u), delta=%d\n", __func__, (unsigned long long) tsf_beacon, + (unsigned int) (tsf_beacon >> 10), (unsigned long long) nexttbtt, + (unsigned int) (nexttbtt >> 10), (int32_t) tsf_beacon - (int32_t) nexttbtt + tsf_intval); /* We only do syncbeacon on STA VAPs; not on IBSS */ From owner-svn-src-all@freebsd.org Mon Nov 28 02:59:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCB98C584D4; Mon, 28 Nov 2016 02:59:34 +0000 (UTC) (envelope-from adrian@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 A1B2D1F4A; Mon, 28 Nov 2016 02:59:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS2xXVw029734; Mon, 28 Nov 2016 02:59:33 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS2xXcO029733; Mon, 28 Nov 2016 02:59:33 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201611280259.uAS2xXcO029733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 28 Nov 2016 02:59:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309223 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 02:59:34 -0000 Author: adrian Date: Mon Nov 28 02:59:33 2016 New Revision: 309223 URL: https://svnweb.freebsd.org/changeset/base/309223 Log: [ath] fix target beacon interval programming for STA mode when in powersave. This bug has been bugging me for quite some time. I finally sat down with enough coffee to figure it out. The short of it - rounding up to the next intval multiple of the TSF value only works if the AP is transmitting all its beacons on an interval of the TSF. If it isn't - for example, doing staggered beacons on a multi-VAP setup with a single hardware TSF - then weird things occur. The long of it - When powersave is enabled, the MAC and PHY are partially powered off. They can't receive any packets (or transmit, for that matter.) The target beacon timer programming will wake up the MAC/PHY just before the beacon is supposed to be received (well, strictly speaking, at DTIM so it can see the TIM - traffic information map - telling the STA whether any traffic is there for it) and it happens automatically. However, this relies on the target beacon time being programmed correctly. If it isn't then the hardware will wake up and not hear any beacons - and then it'll be asleep for said beacons. After enough of this, net80211 will give up and assume the AP went away. This should fix both TSFOOR interrupts and disconnects from APs with powersave enabled. The annoying bit is that it only happens if APs stagger things or start on a non-zero TSF. So, this would sometimes be fine and sometimes not be fine. What: * I don't know (yet) why the code rounds up to the next intval. For now, just disable rounding it and trust the value we get. TODO: * If we do see a beacon miss in STA mode then we should transition out of sleep for a while so we can hear beacons to resync against. I'd love a patch from someone to enable that particular behaviour. Note - that doesn't require that net80211 brings the chip out of sleep state - only that we wake the chip up through to full-on and then let it go to sleep again when we've seen a beacon. The wifi stack and AP can still completely just stay believing we're in sleep mode. Tested: * AR9485, STA mode, powersave enabled MFC after: 1 week Relnotes: Yes Modified: head/sys/dev/ath/if_ath_beacon.c Modified: head/sys/dev/ath/if_ath_beacon.c ============================================================================== --- head/sys/dev/ath/if_ath_beacon.c Mon Nov 28 02:51:55 2016 (r309222) +++ head/sys/dev/ath/if_ath_beacon.c Mon Nov 28 02:59:33 2016 (r309223) @@ -964,10 +964,30 @@ ath_beacon_config(struct ath_softc *sc, /* NB: the beacon interval is kept internally in TU's */ intval = ni->ni_intval & HAL_BEACON_PERIOD; } + + + /* + * Note: rounding up to the next intval can cause problems. + * + * In STA mode with powersave enabled, beacons are only received + * whenever the beacon timer fires to wake up the hardware. + * Now, if this is rounded up to the next intval, it assumes + * that the AP has started transmitting beacons at TSF values that + * are multiples of intval, versus say being 25 TU off. + * + * I'm not sure why nexttbtt is rounded up to the intval. + * If we sync against a beacon that is way out, we should + * take a beacon miss and re-sync against the next beacon. + * + * So for now - don't round up if we're in STA mode. + * Maybe later (when someone eventually does powersave+IBSS, + * powersave+MBSS) this can be flipped on for those too. + */ if (nexttbtt == 0) /* e.g. for ap mode */ nexttbtt = intval; - else if (intval) /* NB: can be 0 for monitor mode */ + else if ((ic->ic_opmode != IEEE80211_M_STA) && intval) /* NB: can be 0 for monitor mode */ nexttbtt = roundup(nexttbtt, intval); + DPRINTF(sc, ATH_DEBUG_BEACON, "%s: nexttbtt %u intval %u (%u)\n", __func__, nexttbtt, intval, ni->ni_intval); if (ic->ic_opmode == IEEE80211_M_STA && !sc->sc_swbmiss) { From owner-svn-src-all@freebsd.org Mon Nov 28 04:53:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 145C1C59365; Mon, 28 Nov 2016 04:53:38 +0000 (UTC) (envelope-from sephe@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 D81A71E53; Mon, 28 Nov 2016 04:53:37 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS4rb52077707; Mon, 28 Nov 2016 04:53:37 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS4rbU4077706; Mon, 28 Nov 2016 04:53:37 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280453.uAS4rbU4077706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 04:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309224 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 04:53:38 -0000 Author: sephe Date: Mon Nov 28 04:53:36 2016 New Revision: 309224 URL: https://svnweb.freebsd.org/changeset/base/309224 Log: hyperv/vmbus: Zero out GPADL if error happens. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8601 Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chan.c Mon Nov 28 02:59:33 2016 (r309223) +++ head/sys/dev/hyperv/vmbus/vmbus_chan.c Mon Nov 28 04:53:36 2016 (r309224) @@ -503,6 +503,12 @@ vmbus_chan_gpadl_connect(struct vmbus_ch uint64_t page_id; /* + * Reset GPADL, so that the result would consistent, if error + * happened later on. + */ + *gpadl0 = 0; + + /* * Preliminary checks. */ From owner-svn-src-all@freebsd.org Mon Nov 28 05:07:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 155B3C59653; Mon, 28 Nov 2016 05:07:50 +0000 (UTC) (envelope-from sephe@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 BF877147A; Mon, 28 Nov 2016 05:07:49 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS57mpS081701; Mon, 28 Nov 2016 05:07:48 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS57mmf081698; Mon, 28 Nov 2016 05:07:48 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280507.uAS57mmf081698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 05:07:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309225 - in head/sys/dev/hyperv: include vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 05:07:50 -0000 Author: sephe Date: Mon Nov 28 05:07:48 2016 New Revision: 309225 URL: https://svnweb.freebsd.org/changeset/base/309225 Log: hyperv/vmbus: Add supportive transaction wait function. This function supports channel revocation properly. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8611 Modified: head/sys/dev/hyperv/include/vmbus.h head/sys/dev/hyperv/vmbus/vmbus_chan.c Modified: head/sys/dev/hyperv/include/vmbus.h ============================================================================== --- head/sys/dev/hyperv/include/vmbus.h Mon Nov 28 04:53:36 2016 (r309224) +++ head/sys/dev/hyperv/include/vmbus.h Mon Nov 28 05:07:48 2016 (r309225) @@ -116,6 +116,7 @@ struct vmbus_chan_br { }; struct vmbus_channel; +struct vmbus_xact; struct vmbus_xact_ctx; struct hyperv_guid; struct task; @@ -173,6 +174,8 @@ void vmbus_chan_run_task(struct vmbus_c void vmbus_chan_set_orphan(struct vmbus_channel *chan, struct vmbus_xact_ctx *); void vmbus_chan_unset_orphan(struct vmbus_channel *chan); +const void *vmbus_chan_xact_wait(const struct vmbus_channel *chan, + struct vmbus_xact *xact, size_t *resp_len, bool can_sleep); int vmbus_chan_gpadl_connect(struct vmbus_channel *chan, bus_addr_t paddr, int size, uint32_t *gpadl); Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chan.c Mon Nov 28 04:53:36 2016 (r309224) +++ head/sys/dev/hyperv/vmbus/vmbus_chan.c Mon Nov 28 05:07:48 2016 (r309225) @@ -1927,3 +1927,37 @@ vmbus_chan_unset_orphan(struct vmbus_cha chan->ch_orphan_xact = NULL; sx_xunlock(&chan->ch_orphan_lock); } + +const void * +vmbus_chan_xact_wait(const struct vmbus_channel *chan, + struct vmbus_xact *xact, size_t *resp_len, bool can_sleep) +{ + const void *ret; + + if (can_sleep) + ret = vmbus_xact_wait(xact, resp_len); + else + ret = vmbus_xact_busywait(xact, resp_len); + if (vmbus_chan_is_revoked(chan)) { + /* + * This xact probably is interrupted, and the + * interruption can race the reply reception, + * so we have to make sure that there are nothing + * left on the RX bufring, i.e. this xact will + * not be touched, once this function returns. + * + * Since the hypervisor will not put more data + * onto the RX bufring once the channel is revoked, + * the following loop will be terminated, once all + * data are drained by the driver's channel + * callback. + */ + while (!vmbus_chan_rx_empty(chan)) { + if (can_sleep) + pause("chxact", 1); + else + DELAY(1000); + } + } + return (ret); +} From owner-svn-src-all@freebsd.org Mon Nov 28 05:15:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CB41C59859; Mon, 28 Nov 2016 05:15:29 +0000 (UTC) (envelope-from sephe@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 6C1C119E1; Mon, 28 Nov 2016 05:15:29 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS5FSlS085776; Mon, 28 Nov 2016 05:15:28 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS5FSSA085774; Mon, 28 Nov 2016 05:15:28 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280515.uAS5FSSA085774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 05:15:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309226 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 05:15:29 -0000 Author: sephe Date: Mon Nov 28 05:15:28 2016 New Revision: 309226 URL: https://svnweb.freebsd.org/changeset/base/309226 Log: hyperv/hn: Utilize vmbus_chan_xact_wait MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8612 Modified: head/sys/dev/hyperv/netvsc/hn_nvs.c head/sys/dev/hyperv/netvsc/hn_rndis.c Modified: head/sys/dev/hyperv/netvsc/hn_nvs.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hn_nvs.c Mon Nov 28 05:07:48 2016 (r309225) +++ head/sys/dev/hyperv/netvsc/hn_nvs.c Mon Nov 28 05:15:28 2016 (r309226) @@ -109,10 +109,8 @@ hn_nvs_xact_execute(struct hn_softc *sc, vmbus_xact_deactivate(xact); return (NULL); } - if (HN_CAN_SLEEP(sc)) - hdr = vmbus_xact_wait(xact, &resplen); - else - hdr = vmbus_xact_busywait(xact, &resplen); + hdr = vmbus_chan_xact_wait(sc->hn_prichan, xact, &resplen, + HN_CAN_SLEEP(sc)); /* * Check this NVS response message. Modified: head/sys/dev/hyperv/netvsc/hn_rndis.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hn_rndis.c Mon Nov 28 05:07:48 2016 (r309225) +++ head/sys/dev/hyperv/netvsc/hn_rndis.c Mon Nov 28 05:15:28 2016 (r309226) @@ -232,10 +232,8 @@ hn_rndis_xact_exec1(struct hn_softc *sc, if_printf(sc->hn_ifp, "RNDIS ctrl send failed: %d\n", error); return (NULL); } - if (HN_CAN_SLEEP(sc)) - return (vmbus_xact_wait(xact, comp_len)); - else - return (vmbus_xact_busywait(xact, comp_len)); + return (vmbus_chan_xact_wait(sc->hn_prichan, xact, comp_len, + HN_CAN_SLEEP(sc))); } static const void * From owner-svn-src-all@freebsd.org Mon Nov 28 05:23:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D329C59A8B; Mon, 28 Nov 2016 05:23:59 +0000 (UTC) (envelope-from sephe@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 37F1B1E2D; Mon, 28 Nov 2016 05:23:59 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS5NwQw089692; Mon, 28 Nov 2016 05:23:58 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS5NwUq089689; Mon, 28 Nov 2016 05:23:58 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280523.uAS5NwUq089689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 05:23:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309227 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 05:23:59 -0000 Author: sephe Date: Mon Nov 28 05:23:57 2016 New Revision: 309227 URL: https://svnweb.freebsd.org/changeset/base/309227 Log: hyperv/hn: Fix detach error handling. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8613 Modified: head/sys/dev/hyperv/netvsc/hn_nvs.c head/sys/dev/hyperv/netvsc/if_hn.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hn_nvs.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hn_nvs.c Mon Nov 28 05:15:28 2016 (r309226) +++ head/sys/dev/hyperv/netvsc/hn_nvs.c Mon Nov 28 05:23:57 2016 (r309227) @@ -62,8 +62,8 @@ __FBSDID("$FreeBSD$"); static int hn_nvs_conn_chim(struct hn_softc *); static int hn_nvs_conn_rxbuf(struct hn_softc *); -static int hn_nvs_disconn_chim(struct hn_softc *); -static int hn_nvs_disconn_rxbuf(struct hn_softc *); +static void hn_nvs_disconn_chim(struct hn_softc *); +static void hn_nvs_disconn_rxbuf(struct hn_softc *); static int hn_nvs_conf_ndis(struct hn_softc *, int); static int hn_nvs_init_ndis(struct hn_softc *); static int hn_nvs_doinit(struct hn_softc *, uint32_t); @@ -308,7 +308,7 @@ cleanup: return (error); } -static int +static void hn_nvs_disconn_rxbuf(struct hn_softc *sc) { int error; @@ -328,7 +328,12 @@ hn_nvs_disconn_rxbuf(struct hn_softc *sc if (error) { if_printf(sc->hn_ifp, "send nvs rxbuf disconn failed: %d\n", error); - return (error); + /* + * Fine for a revoked channel, since the hypervisor + * does not drain TX bufring for a revoked channel. + */ + if (!vmbus_chan_is_revoked(sc->hn_prichan)) + sc->hn_flags |= HN_FLAG_RXBUF_REF; } sc->hn_flags &= ~HN_FLAG_RXBUF_CONNECTED; @@ -357,14 +362,13 @@ hn_nvs_disconn_rxbuf(struct hn_softc *sc if (error) { if_printf(sc->hn_ifp, "rxbuf gpadl disconn failed: %d\n", error); - return (error); + sc->hn_flags |= HN_FLAG_RXBUF_REF; } sc->hn_rxbuf_gpadl = 0; } - return (0); } -static int +static void hn_nvs_disconn_chim(struct hn_softc *sc) { int error; @@ -384,7 +388,12 @@ hn_nvs_disconn_chim(struct hn_softc *sc) if (error) { if_printf(sc->hn_ifp, "send nvs chim disconn failed: %d\n", error); - return (error); + /* + * Fine for a revoked channel, since the hypervisor + * does not drain TX bufring for a revoked channel. + */ + if (!vmbus_chan_is_revoked(sc->hn_prichan)) + sc->hn_flags |= HN_FLAG_CHIM_REF; } sc->hn_flags &= ~HN_FLAG_CHIM_CONNECTED; @@ -414,7 +423,7 @@ hn_nvs_disconn_chim(struct hn_softc *sc) if (error) { if_printf(sc->hn_ifp, "chim gpadl disconn failed: %d\n", error); - return (error); + sc->hn_flags |= HN_FLAG_CHIM_REF; } sc->hn_chim_gpadl = 0; } @@ -423,7 +432,6 @@ hn_nvs_disconn_chim(struct hn_softc *sc) free(sc->hn_chim_bmap, M_DEVBUF); sc->hn_chim_bmap = NULL; } - return (0); } static int Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Mon Nov 28 05:15:28 2016 (r309226) +++ head/sys/dev/hyperv/netvsc/if_hn.c Mon Nov 28 05:23:57 2016 (r309227) @@ -296,6 +296,7 @@ static int hn_synth_attach(struct hn_s static void hn_synth_detach(struct hn_softc *); static int hn_synth_alloc_subchans(struct hn_softc *, int *); +static bool hn_synth_attachable(const struct hn_softc *); static void hn_suspend(struct hn_softc *); static void hn_suspend_data(struct hn_softc *); static void hn_suspend_mgmt(struct hn_softc *); @@ -3249,7 +3250,10 @@ hn_destroy_rx_data(struct hn_softc *sc) int i; if (sc->hn_rxbuf != NULL) { - hyperv_dmamem_free(&sc->hn_rxbuf_dma, sc->hn_rxbuf); + if ((sc->hn_flags & HN_FLAG_RXBUF_REF) == 0) + hyperv_dmamem_free(&sc->hn_rxbuf_dma, sc->hn_rxbuf); + else + device_printf(sc->hn_dev, "RXBUF is referenced\n"); sc->hn_rxbuf = NULL; } @@ -3261,7 +3265,12 @@ hn_destroy_rx_data(struct hn_softc *sc) if (rxr->hn_br == NULL) continue; - hyperv_dmamem_free(&rxr->hn_br_dma, rxr->hn_br); + if ((rxr->hn_rx_flags & HN_RX_FLAG_BR_REF) == 0) { + hyperv_dmamem_free(&rxr->hn_br_dma, rxr->hn_br); + } else { + device_printf(sc->hn_dev, + "%dth channel bufring is referenced", i); + } rxr->hn_br = NULL; #if defined(INET) || defined(INET6) @@ -3730,7 +3739,12 @@ hn_destroy_tx_data(struct hn_softc *sc) int i; if (sc->hn_chim != NULL) { - hyperv_dmamem_free(&sc->hn_chim_dma, sc->hn_chim); + if ((sc->hn_flags & HN_FLAG_CHIM_REF) == 0) { + hyperv_dmamem_free(&sc->hn_chim_dma, sc->hn_chim); + } else { + device_printf(sc->hn_dev, + "chimney sending buffer is referenced"); + } sc->hn_chim = NULL; } @@ -4214,7 +4228,7 @@ static void hn_chan_detach(struct hn_softc *sc, struct vmbus_channel *chan) { struct hn_rx_ring *rxr; - int idx; + int idx, error; idx = vmbus_chan_subidx(chan); @@ -4243,7 +4257,16 @@ hn_chan_detach(struct hn_softc *sc, stru * NOTE: * Channel closing does _not_ destroy the target channel. */ - vmbus_chan_close(chan); + error = vmbus_chan_close_direct(chan); + if (error == EISCONN) { + if_printf(sc->hn_ifp, "chan%u subidx%u " + "bufring is connected after being closed\n", + vmbus_chan_id(chan), vmbus_chan_subidx(chan)); + rxr->hn_rx_flags |= HN_RX_FLAG_BR_REF; + } else if (error) { + if_printf(sc->hn_ifp, "chan%u subidx%u close failed: %d\n", + vmbus_chan_id(chan), vmbus_chan_subidx(chan), error); + } } static int @@ -4373,6 +4396,23 @@ hn_synth_alloc_subchans(struct hn_softc return (0); } +static bool +hn_synth_attachable(const struct hn_softc *sc) +{ + int i; + + if (sc->hn_flags & HN_FLAG_ERRORS) + return (false); + + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { + const struct hn_rx_ring *rxr = &sc->hn_rx_ring[i]; + + if (rxr->hn_rx_flags & HN_RX_FLAG_BR_REF) + return (false); + } + return (true); +} + static int hn_synth_attach(struct hn_softc *sc, int mtu) { @@ -4383,6 +4423,9 @@ hn_synth_attach(struct hn_softc *sc, int KASSERT((sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) == 0, ("synthetic parts were attached")); + if (!hn_synth_attachable(sc)) + return (ENXIO); + /* Save capabilities for later verification. */ old_caps = sc->hn_caps; sc->hn_caps = 0; Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Mon Nov 28 05:15:28 2016 (r309226) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Mon Nov 28 05:23:57 2016 (r309227) @@ -91,7 +91,8 @@ struct hn_rx_ring { #define HN_TRUST_HCSUM_TCP 0x0002 #define HN_TRUST_HCSUM_UDP 0x0004 -#define HN_RX_FLAG_ATTACHED 0x1 +#define HN_RX_FLAG_ATTACHED 0x0001 +#define HN_RX_FLAG_BR_REF 0x0002 struct hn_tx_ring { #ifndef HN_USE_TXDESC_BUFRING @@ -162,8 +163,8 @@ struct hn_tx_ring { struct sysctl_oid *hn_tx_sysctl_tree; } __aligned(CACHE_LINE_SIZE); -#define HN_TX_FLAG_ATTACHED 0x1 -#define HN_TX_FLAG_HASHVAL 0x2 /* support HASHVAL pktinfo */ +#define HN_TX_FLAG_ATTACHED 0x0001 +#define HN_TX_FLAG_HASHVAL 0x0002 /* support HASHVAL pktinfo */ /* * Device-specific softc structure @@ -237,6 +238,10 @@ struct hn_softc { #define HN_FLAG_HAS_RSSIND 0x0008 #define HN_FLAG_SYNTH_ATTACHED 0x0010 #define HN_FLAG_NO_SLEEPING 0x0020 +#define HN_FLAG_RXBUF_REF 0x0040 +#define HN_FLAG_CHIM_REF 0x0080 + +#define HN_FLAG_ERRORS (HN_FLAG_RXBUF_REF | HN_FLAG_CHIM_REF) #define HN_NO_SLEEPING(sc) \ do { \ From owner-svn-src-all@freebsd.org Mon Nov 28 05:31:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21901C59CE5; Mon, 28 Nov 2016 05:31:38 +0000 (UTC) (envelope-from sephe@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 E53511300; Mon, 28 Nov 2016 05:31:37 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS5VbCo092924; Mon, 28 Nov 2016 05:31:37 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS5Vbw6092923; Mon, 28 Nov 2016 05:31:37 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280531.uAS5Vbw6092923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 05:31:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309228 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 05:31:38 -0000 Author: sephe Date: Mon Nov 28 05:31:36 2016 New Revision: 309228 URL: https://svnweb.freebsd.org/changeset/base/309228 Log: hyperv/hn: Fix multi-packet RNDIS message aggregation size setting. Just in case that no chimney sending buffer can be used. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8619 Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Mon Nov 28 05:23:57 2016 (r309227) +++ head/sys/dev/hyperv/netvsc/if_hn.c Mon Nov 28 05:31:36 2016 (r309228) @@ -706,6 +706,10 @@ hn_set_txagg(struct hn_softc *sc) if (sc->hn_rndis_agg_size < size) size = sc->hn_rndis_agg_size; + /* NOTE: We only aggregate packets using chimney sending buffers. */ + if (size > (uint32_t)sc->hn_chim_szmax) + size = sc->hn_chim_szmax; + if (size <= 2 * HN_PKTSIZE_MIN(sc->hn_rndis_agg_align)) { /* Disable */ size = 0; @@ -717,10 +721,6 @@ hn_set_txagg(struct hn_softc *sc) if (size > INT_MAX) size = INT_MAX; - /* NOTE: We only aggregate packets using chimney sending buffers. */ - if (size > (uint32_t)sc->hn_chim_szmax) - size = sc->hn_chim_szmax; - /* * Setup aggregation packet count. */ From owner-svn-src-all@freebsd.org Mon Nov 28 05:46:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7ED25C59EDE; Mon, 28 Nov 2016 05:46:01 +0000 (UTC) (envelope-from sephe@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 5951B1992; Mon, 28 Nov 2016 05:46:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS5k0A3097644; Mon, 28 Nov 2016 05:46:00 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS5k0nT097641; Mon, 28 Nov 2016 05:46:00 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280546.uAS5k0nT097641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 05:46:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309229 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 05:46:01 -0000 Author: sephe Date: Mon Nov 28 05:46:00 2016 New Revision: 309229 URL: https://svnweb.freebsd.org/changeset/base/309229 Log: hyperv/hn: Fix attach error handling MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8620 Modified: head/sys/dev/hyperv/netvsc/hn_nvs.c head/sys/dev/hyperv/netvsc/hn_rndis.c head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/hn_nvs.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hn_nvs.c Mon Nov 28 05:31:36 2016 (r309228) +++ head/sys/dev/hyperv/netvsc/hn_nvs.c Mon Nov 28 05:46:00 2016 (r309229) @@ -273,8 +273,14 @@ hn_nvs_conn_chim(struct hn_softc *sc) goto cleanup; } if (sectsz == 0) { + /* + * Can't use chimney sending buffer; done! + */ if_printf(sc->hn_ifp, "zero chimney sending buffer " "section size\n"); + sc->hn_chim_szmax = 0; + sc->hn_chim_cnt = 0; + sc->hn_flags |= HN_FLAG_CHIM_CONNECTED; return (0); } @@ -431,6 +437,7 @@ hn_nvs_disconn_chim(struct hn_softc *sc) if (sc->hn_chim_bmap != NULL) { free(sc->hn_chim_bmap, M_DEVBUF); sc->hn_chim_bmap = NULL; + sc->hn_chim_bmap_cnt = 0; } } @@ -620,8 +627,10 @@ hn_nvs_attach(struct hn_softc *sc, int m * Connect chimney sending buffer. */ error = hn_nvs_conn_chim(sc); - if (error) + if (error) { + hn_nvs_disconn_rxbuf(sc); return (error); + } return (0); } Modified: head/sys/dev/hyperv/netvsc/hn_rndis.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hn_rndis.c Mon Nov 28 05:31:36 2016 (r309228) +++ head/sys/dev/hyperv/netvsc/hn_rndis.c Mon Nov 28 05:46:00 2016 (r309229) @@ -979,7 +979,6 @@ hn_rndis_attach(struct hn_softc *sc, int /* * Configure NDIS offload settings. - * XXX no offloading, if error happened? */ hn_rndis_conf_offload(sc, mtu); return (0); Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Mon Nov 28 05:31:36 2016 (r309228) +++ head/sys/dev/hyperv/netvsc/if_hn.c Mon Nov 28 05:46:00 2016 (r309229) @@ -4215,11 +4215,14 @@ hn_chan_attach(struct hn_softc *sc, stru cbr.cbr_rxsz = HN_RXBR_SIZE; error = vmbus_chan_open_br(chan, &cbr, NULL, 0, hn_chan_callback, rxr); if (error) { - if_printf(sc->hn_ifp, "open chan%u failed: %d\n", - vmbus_chan_id(chan), error); - rxr->hn_rx_flags &= ~HN_RX_FLAG_ATTACHED; - if (txr != NULL) - txr->hn_tx_flags &= ~HN_TX_FLAG_ATTACHED; + if (error == EISCONN) { + if_printf(sc->hn_ifp, "bufring is connected after " + "chan%u open failure\n", vmbus_chan_id(chan)); + rxr->hn_rx_flags |= HN_RX_FLAG_BR_REF; + } else { + if_printf(sc->hn_ifp, "open chan%u failed: %d\n", + vmbus_chan_id(chan), error); + } } return (error); } @@ -4276,15 +4279,18 @@ hn_attach_subchans(struct hn_softc *sc) int subchan_cnt = sc->hn_rx_ring_inuse - 1; int i, error = 0; - if (subchan_cnt == 0) - return (0); + KASSERT(subchan_cnt > 0, ("no sub-channels")); /* Attach the sub-channels. */ subchans = vmbus_subchan_get(sc->hn_prichan, subchan_cnt); for (i = 0; i < subchan_cnt; ++i) { - error = hn_chan_attach(sc, subchans[i]); - if (error) - break; + int error1; + + error1 = hn_chan_attach(sc, subchans[i]); + if (error1) { + error = error1; + /* Move on; all channels will be detached later. */ + } } vmbus_subchan_rel(subchans, subchan_cnt); @@ -4416,9 +4422,12 @@ hn_synth_attachable(const struct hn_soft static int hn_synth_attach(struct hn_softc *sc, int mtu) { +#define ATTACHED_NVS 0x0002 +#define ATTACHED_RNDIS 0x0004 + struct ndis_rssprm_toeplitz *rss = &sc->hn_rss; int error, nsubch, nchan, i; - uint32_t old_caps; + uint32_t old_caps, attached = 0; KASSERT((sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) == 0, ("synthetic parts were attached")); @@ -4439,21 +4448,23 @@ hn_synth_attach(struct hn_softc *sc, int */ error = hn_chan_attach(sc, sc->hn_prichan); if (error) - return (error); + goto failed; /* * Attach NVS. */ error = hn_nvs_attach(sc, mtu); if (error) - return (error); + goto failed; + attached |= ATTACHED_NVS; /* * Attach RNDIS _after_ NVS is attached. */ error = hn_rndis_attach(sc, mtu); if (error) - return (error); + goto failed; + attached |= ATTACHED_RNDIS; /* * Make sure capabilities are not changed. @@ -4461,9 +4472,8 @@ hn_synth_attach(struct hn_softc *sc, int if (device_is_attached(sc->hn_dev) && old_caps != sc->hn_caps) { if_printf(sc->hn_ifp, "caps mismatch old 0x%08x, new 0x%08x\n", old_caps, sc->hn_caps); - /* Restore old capabilities and abort. */ - sc->hn_caps = old_caps; - return ENXIO; + error = ENXIO; + goto failed; } /* @@ -4476,19 +4486,32 @@ hn_synth_attach(struct hn_softc *sc, int nsubch = sc->hn_rx_ring_cnt - 1; error = hn_synth_alloc_subchans(sc, &nsubch); if (error) - return (error); + goto failed; + /* NOTE: _Full_ synthetic parts detach is required now. */ + sc->hn_flags |= HN_FLAG_SYNTH_ATTACHED; + /* + * Set the # of TX/RX rings that could be used according to + * the # of channels that NVS offered. + */ nchan = nsubch + 1; + hn_set_ring_inuse(sc, nchan); if (nchan == 1) { /* Only the primary channel can be used; done */ goto back; } /* - * Configure RSS key and indirect table _after_ all sub-channels - * are allocated. + * Attach the sub-channels. */ + error = hn_attach_subchans(sc); + if (error) + goto failed; + /* + * Configure RSS key and indirect table _after_ all sub-channels + * are attached. + */ if ((sc->hn_flags & HN_FLAG_HAS_RSSKEY) == 0) { /* * RSS key is not set yet; set it to the default RSS key. @@ -4521,34 +4544,31 @@ hn_synth_attach(struct hn_softc *sc, int } error = hn_rndis_conf_rss(sc, NDIS_RSS_FLAG_NONE); - if (error) { - /* - * Failed to configure RSS key or indirect table; only - * the primary channel can be used. - */ - nchan = 1; - } -back: - /* - * Set the # of TX/RX rings that could be used according to - * the # of channels that NVS offered. - */ - hn_set_ring_inuse(sc, nchan); - - /* - * Attach the sub-channels, if any. - */ - error = hn_attach_subchans(sc); if (error) - return (error); - + goto failed; +back: /* * Fixup transmission aggregation setup. */ hn_set_txagg(sc); - - sc->hn_flags |= HN_FLAG_SYNTH_ATTACHED; return (0); + +failed: + if (sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) { + hn_synth_detach(sc); + } else { + if (attached & ATTACHED_RNDIS) + hn_rndis_detach(sc); + if (attached & ATTACHED_NVS) + hn_nvs_detach(sc); + hn_chan_detach(sc, sc->hn_prichan); + /* Restore old capabilities. */ + sc->hn_caps = old_caps; + } + return (error); + +#undef ATTACHED_RNDIS +#undef ATTACHED_NVS } /* @@ -4559,7 +4579,6 @@ back: static void hn_synth_detach(struct hn_softc *sc) { - HN_LOCK_ASSERT(sc); KASSERT(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED, ("synthetic parts were not attached")); From owner-svn-src-all@freebsd.org Mon Nov 28 05:54:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FDC6C51184; Mon, 28 Nov 2016 05:54:21 +0000 (UTC) (envelope-from sephe@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 6F7681ECD; Mon, 28 Nov 2016 05:54:21 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS5sK9B001995; Mon, 28 Nov 2016 05:54:20 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS5sKfm001994; Mon, 28 Nov 2016 05:54:20 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280554.uAS5sKfm001994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 05:54:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309230 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 05:54:21 -0000 Author: sephe Date: Mon Nov 28 05:54:20 2016 New Revision: 309230 URL: https://svnweb.freebsd.org/changeset/base/309230 Log: hyperv/hn: Enable multi-packet RNDIS message support by default. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8621 Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Mon Nov 28 05:46:00 2016 (r309229) +++ head/sys/dev/hyperv/netvsc/if_hn.c Mon Nov 28 05:54:20 2016 (r309230) @@ -465,7 +465,7 @@ SYSCTL_INT(_hw_hn, OID_AUTO, tx_agg_size &hn_tx_agg_size, 0, "Packet transmission aggregation size limit"); /* Packet transmission aggregation count limit */ -static int hn_tx_agg_pkts = 0; +static int hn_tx_agg_pkts = -1; SYSCTL_INT(_hw_hn, OID_AUTO, tx_agg_pkts, CTLFLAG_RDTUN, &hn_tx_agg_pkts, 0, "Packet transmission aggregation packet limit"); From owner-svn-src-all@freebsd.org Mon Nov 28 06:10:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C471C51683; Mon, 28 Nov 2016 06:10:43 +0000 (UTC) (envelope-from sephe@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 DFE8A1654; Mon, 28 Nov 2016 06:10:42 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS6Ag9T006375; Mon, 28 Nov 2016 06:10:42 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS6AgVo006374; Mon, 28 Nov 2016 06:10:42 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280610.uAS6AgVo006374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 06:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309231 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 06:10:43 -0000 Author: sephe Date: Mon Nov 28 06:10:41 2016 New Revision: 309231 URL: https://svnweb.freebsd.org/changeset/base/309231 Log: hyperv/hn: Fix vmbus_chan_subidx usage. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8629 Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Mon Nov 28 05:54:20 2016 (r309230) +++ head/sys/dev/hyperv/netvsc/if_hn.c Mon Nov 28 06:10:41 2016 (r309231) @@ -1524,7 +1524,7 @@ hn_txpkt_done(struct hn_nvs_sendctx *snd txr = txd->txr; KASSERT(txr->hn_chan == chan, ("channel mismatch, on chan%u, should be chan%u", - vmbus_chan_subidx(chan), vmbus_chan_subidx(txr->hn_chan))); + vmbus_chan_id(chan), vmbus_chan_id(txr->hn_chan))); txr->hn_has_txeof = 1; hn_txdesc_put(txr, txd); @@ -4262,13 +4262,12 @@ hn_chan_detach(struct hn_softc *sc, stru */ error = vmbus_chan_close_direct(chan); if (error == EISCONN) { - if_printf(sc->hn_ifp, "chan%u subidx%u " - "bufring is connected after being closed\n", - vmbus_chan_id(chan), vmbus_chan_subidx(chan)); + if_printf(sc->hn_ifp, "chan%u bufring is connected " + "after being closed\n", vmbus_chan_id(chan)); rxr->hn_rx_flags |= HN_RX_FLAG_BR_REF; } else if (error) { - if_printf(sc->hn_ifp, "chan%u subidx%u close failed: %d\n", - vmbus_chan_id(chan), vmbus_chan_subidx(chan), error); + if_printf(sc->hn_ifp, "chan%u close failed: %d\n", + vmbus_chan_id(chan), error); } } From owner-svn-src-all@freebsd.org Mon Nov 28 06:32:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5473FC51F92; Mon, 28 Nov 2016 06:32:06 +0000 (UTC) (envelope-from delphij@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 2409D1880; Mon, 28 Nov 2016 06:32:06 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS6W5Mi017928; Mon, 28 Nov 2016 06:32:05 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS6W5mS017927; Mon, 28 Nov 2016 06:32:05 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201611280632.uAS6W5mS017927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 28 Nov 2016 06:32:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309232 - head/usr.bin/sort X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 06:32:06 -0000 Author: delphij Date: Mon Nov 28 06:32:05 2016 New Revision: 309232 URL: https://svnweb.freebsd.org/changeset/base/309232 Log: Fix an obvious typo. MFC after: 2 weeks Modified: head/usr.bin/sort/sort.c Modified: head/usr.bin/sort/sort.c ============================================================================== --- head/usr.bin/sort/sort.c Mon Nov 28 06:10:41 2016 (r309231) +++ head/usr.bin/sort/sort.c Mon Nov 28 06:32:05 2016 (r309232) @@ -280,7 +280,7 @@ set_hw_params(void) pages = sysconf(_SC_PHYS_PAGES); if (pages < 1) { perror("sysconf pages"); - psize = 1; + pages = 1; } psize = sysconf(_SC_PAGESIZE); if (psize < 1) { From owner-svn-src-all@freebsd.org Mon Nov 28 06:36:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7DFFC580D8; Mon, 28 Nov 2016 06:36:11 +0000 (UTC) (envelope-from delphij@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 5DB441BAA; Mon, 28 Nov 2016 06:36:11 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS6aAaf018130; Mon, 28 Nov 2016 06:36:10 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS6aAPC018128; Mon, 28 Nov 2016 06:36:10 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201611280636.uAS6aAPC018128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 28 Nov 2016 06:36:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309233 - head/usr.bin/sort X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 06:36:11 -0000 Author: delphij Date: Mon Nov 28 06:36:10 2016 New Revision: 309233 URL: https://svnweb.freebsd.org/changeset/base/309233 Log: Eliminate variables that are computed, assigned but never used. MFC after: 2 weeks Modified: head/usr.bin/sort/bwstring.c head/usr.bin/sort/sort.c Modified: head/usr.bin/sort/bwstring.c ============================================================================== --- head/usr.bin/sort/bwstring.c Mon Nov 28 06:32:05 2016 (r309232) +++ head/usr.bin/sort/bwstring.c Mon Nov 28 06:36:10 2016 (r309233) @@ -910,7 +910,6 @@ bws_month_score(const struct bwstring *s if (MB_CUR_MAX == 1) { const unsigned char *end, *s; - size_t len; s = s0->data.cstr; end = s + s0->len; @@ -918,8 +917,6 @@ bws_month_score(const struct bwstring *s while (isblank(*s) && s < end) ++s; - len = strlen((const char*)s); - for (int i = 11; i >= 0; --i) { if (cmonths[i] && (s == (unsigned char*)strstr((const char*)s, (char*)(cmonths[i])))) @@ -928,7 +925,6 @@ bws_month_score(const struct bwstring *s } else { const wchar_t *end, *s; - size_t len; s = s0->data.wstr; end = s + s0->len; @@ -936,8 +932,6 @@ bws_month_score(const struct bwstring *s while (iswblank(*s) && s < end) ++s; - len = wcslen(s); - for (int i = 11; i >= 0; --i) { if (wmonths[i] && (s == wcsstr(s, wmonths[i]))) return (i); Modified: head/usr.bin/sort/sort.c ============================================================================== --- head/usr.bin/sort/sort.c Mon Nov 28 06:32:05 2016 (r309232) +++ head/usr.bin/sort/sort.c Mon Nov 28 06:36:10 2016 (r309233) @@ -209,14 +209,10 @@ sort_modifier_empty(struct sort_mods *sm static void usage(bool opt_err) { - struct option *o; FILE *out; - out = stdout; - o = &(long_options[0]); + out = opt_err ? stderr : stdout; - if (opt_err) - out = stderr; fprintf(out, getstr(12), getprogname()); if (opt_err) exit(2); From owner-svn-src-all@freebsd.org Mon Nov 28 06:38:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08CD3C581A6; Mon, 28 Nov 2016 06:38:43 +0000 (UTC) (envelope-from delphij@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 CCA201D41; Mon, 28 Nov 2016 06:38:42 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS6cgY7018253; Mon, 28 Nov 2016 06:38:42 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS6cgc8018252; Mon, 28 Nov 2016 06:38:42 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201611280638.uAS6cgc8018252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 28 Nov 2016 06:38:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309234 - head/usr.bin/sort X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 06:38:43 -0000 Author: delphij Date: Mon Nov 28 06:38:41 2016 New Revision: 309234 URL: https://svnweb.freebsd.org/changeset/base/309234 Log: pages and psize are always assigned, so there is no need to initialize them as zero. MFC after: 2 weeks Modified: head/usr.bin/sort/sort.c Modified: head/usr.bin/sort/sort.c ============================================================================== --- head/usr.bin/sort/sort.c Mon Nov 28 06:36:10 2016 (r309233) +++ head/usr.bin/sort/sort.c Mon Nov 28 06:38:41 2016 (r309234) @@ -267,8 +267,6 @@ set_hw_params(void) { long pages, psize; - pages = psize = 0; - #if defined(SORT_THREADS) ncpu = 1; #endif From owner-svn-src-all@freebsd.org Mon Nov 28 06:40:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DE98C5825C; Mon, 28 Nov 2016 06:40:27 +0000 (UTC) (envelope-from sephe@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 13C701EC4; Mon, 28 Nov 2016 06:40:27 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS6eQHB018373; Mon, 28 Nov 2016 06:40:26 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS6eQMD018372; Mon, 28 Nov 2016 06:40:26 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280640.uAS6eQMD018372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 06:40:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309235 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 06:40:27 -0000 Author: sephe Date: Mon Nov 28 06:40:26 2016 New Revision: 309235 URL: https://svnweb.freebsd.org/changeset/base/309235 Log: hyperv/hn: Simplify RSS indirect table fixup API MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8630 Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Mon Nov 28 06:38:41 2016 (r309234) +++ head/sys/dev/hyperv/netvsc/if_hn.c Mon Nov 28 06:40:26 2016 (r309235) @@ -319,7 +319,7 @@ static void hn_destroy_rx_data(struct static int hn_check_iplen(const struct mbuf *, int); static int hn_set_rxfilter(struct hn_softc *); static int hn_rss_reconfig(struct hn_softc *); -static void hn_rss_ind_fixup(struct hn_softc *, int); +static void hn_rss_ind_fixup(struct hn_softc *); static int hn_rxpkt(struct hn_rx_ring *, const void *, int, const struct hn_rxinfo *); @@ -817,11 +817,12 @@ hn_rss_reconfig(struct hn_softc *sc) } static void -hn_rss_ind_fixup(struct hn_softc *sc, int nchan) +hn_rss_ind_fixup(struct hn_softc *sc) { struct ndis_rssprm_toeplitz *rss = &sc->hn_rss; - int i; + int i, nchan; + nchan = sc->hn_rx_ring_inuse; KASSERT(nchan > 1, ("invalid # of channels %d", nchan)); /* @@ -2943,7 +2944,7 @@ hn_rss_ind_sysctl(SYSCTL_HANDLER_ARGS) goto back; sc->hn_flags |= HN_FLAG_HAS_RSSIND; - hn_rss_ind_fixup(sc, sc->hn_rx_ring_inuse); + hn_rss_ind_fixup(sc); error = hn_rss_reconfig(sc); back: HN_UNLOCK(sc); @@ -4502,6 +4503,8 @@ hn_synth_attach(struct hn_softc *sc, int /* * Attach the sub-channels. + * + * NOTE: hn_set_ring_inuse() _must_ have been called. */ error = hn_attach_subchans(sc); if (error) @@ -4538,8 +4541,10 @@ hn_synth_attach(struct hn_softc *sc, int * # of usable channels may be changed, so we have to * make sure that all entries in RSS indirect table * are valid. + * + * NOTE: hn_set_ring_inuse() _must_ have been called. */ - hn_rss_ind_fixup(sc, nchan); + hn_rss_ind_fixup(sc); } error = hn_rndis_conf_rss(sc, NDIS_RSS_FLAG_NONE); From owner-svn-src-all@freebsd.org Mon Nov 28 06:53:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46099C58702; Mon, 28 Nov 2016 06:53:01 +0000 (UTC) (envelope-from sephe@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 1585A1973; Mon, 28 Nov 2016 06:53:01 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS6r0AA025921; Mon, 28 Nov 2016 06:53:00 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS6r0O8025920; Mon, 28 Nov 2016 06:53:00 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280653.uAS6r0O8025920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 06:53:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309236 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 06:53:01 -0000 Author: sephe Date: Mon Nov 28 06:53:00 2016 New Revision: 309236 URL: https://svnweb.freebsd.org/changeset/base/309236 Log: hyperv/vmbus: Make sure that the allocated GPADL is not zero. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8631 Modified: head/sys/dev/hyperv/vmbus/vmbus.c Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Mon Nov 28 06:40:26 2016 (r309235) +++ head/sys/dev/hyperv/vmbus/vmbus.c Mon Nov 28 06:53:00 2016 (r309236) @@ -325,7 +325,13 @@ vmbus_msghc_wakeup(struct vmbus_softc *s uint32_t vmbus_gpadl_alloc(struct vmbus_softc *sc) { - return atomic_fetchadd_int(&sc->vmbus_gpadl, 1); + uint32_t gpadl; + +again: + gpadl = atomic_fetchadd_int(&sc->vmbus_gpadl, 1); + if (gpadl == 0) + goto again; + return (gpadl); } static int From owner-svn-src-all@freebsd.org Mon Nov 28 07:04:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A73B2C58AB2; Mon, 28 Nov 2016 07:04:33 +0000 (UTC) (envelope-from sephe@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 76BD31E9B; Mon, 28 Nov 2016 07:04:33 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS74W8m030145; Mon, 28 Nov 2016 07:04:32 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS74WeJ030144; Mon, 28 Nov 2016 07:04:32 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280704.uAS74WeJ030144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 07:04:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309237 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 07:04:33 -0000 Author: sephe Date: Mon Nov 28 07:04:32 2016 New Revision: 309237 URL: https://svnweb.freebsd.org/changeset/base/309237 Log: hyperv/vmbus: Stringent GPADL parameter assertion. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8632 Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chan.c Mon Nov 28 06:53:00 2016 (r309236) +++ head/sys/dev/hyperv/vmbus/vmbus_chan.c Mon Nov 28 07:04:32 2016 (r309237) @@ -502,11 +502,7 @@ vmbus_chan_gpadl_connect(struct vmbus_ch int page_count, range_len, i, cnt, error; uint64_t page_id; - /* - * Reset GPADL, so that the result would consistent, if error - * happened later on. - */ - *gpadl0 = 0; + KASSERT(*gpadl0 == 0, ("GPADL is not zero")); /* * Preliminary checks. @@ -652,6 +648,8 @@ vmbus_chan_gpadl_disconnect(struct vmbus struct vmbus_chanmsg_gpadl_disconn *req; int error; + KASSERT(gpadl != 0, ("GPADL is zero")); + mh = vmbus_msghc_get(sc, sizeof(*req)); if (mh == NULL) { vmbus_chan_printf(chan, From owner-svn-src-all@freebsd.org Mon Nov 28 07:19:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4243C58E21; Mon, 28 Nov 2016 07:19:46 +0000 (UTC) (envelope-from delphij@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 A3CFD163E; Mon, 28 Nov 2016 07:19:46 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS7Jj2Y034338; Mon, 28 Nov 2016 07:19:45 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS7JjiA034337; Mon, 28 Nov 2016 07:19:45 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201611280719.uAS7JjiA034337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 28 Nov 2016 07:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309238 - head/bin/kenv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 07:19:46 -0000 Author: delphij Date: Mon Nov 28 07:19:45 2016 New Revision: 309238 URL: https://svnweb.freebsd.org/changeset/base/309238 Log: Plug a potential memory leak. MFC after: 2 weeks Modified: head/bin/kenv/kenv.c Modified: head/bin/kenv/kenv.c ============================================================================== --- head/bin/kenv/kenv.c Mon Nov 28 07:04:32 2016 (r309237) +++ head/bin/kenv/kenv.c Mon Nov 28 07:19:45 2016 (r309238) @@ -63,7 +63,6 @@ main(int argc, char **argv) char *env, *eq, *val; int ch, error; - error = 0; val = NULL; env = NULL; while ((ch = getopt(argc, argv, "hNquv")) != -1) { @@ -128,7 +127,7 @@ main(int argc, char **argv) static int kdumpenv(void) { - char *buf, *cp; + char *buf, *bp, *cp; int buflen, envlen; envlen = kenv(KENV_DUMP, NULL, NULL, 0); @@ -136,10 +135,9 @@ kdumpenv(void) return (-1); for (;;) { buflen = envlen * 120 / 100; - buf = malloc(buflen + 1); + buf = calloc(1, buflen + 1); if (buf == NULL) return (-1); - memset(buf, 0, buflen + 1); /* Be defensive */ envlen = kenv(KENV_DUMP, NULL, buf, buflen); if (envlen < 0) { free(buf); @@ -151,21 +149,23 @@ kdumpenv(void) break; } - for (; *buf != '\0'; buf += strlen(buf) + 1) { + for (bp = buf; *bp != '\0'; bp += strlen(bp) + 1) { if (hflag) { - if (strncmp(buf, "hint.", 5) != 0) + if (strncmp(bp, "hint.", 5) != 0) continue; } - cp = strchr(buf, '='); + cp = strchr(bp, '='); if (cp == NULL) continue; *cp++ = '\0'; if (Nflag) - printf("%s\n", buf); + printf("%s\n", bp); else - printf("%s=\"%s\"\n", buf, cp); - buf = cp; + printf("%s=\"%s\"\n", bp, cp); + bp = cp; } + + free(buf); return (0); } From owner-svn-src-all@freebsd.org Mon Nov 28 07:21:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD184C58F6E; Mon, 28 Nov 2016 07:21:10 +0000 (UTC) (envelope-from delphij@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 9CFC11B1B; Mon, 28 Nov 2016 07:21:10 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS7L9VN035286; Mon, 28 Nov 2016 07:21:09 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS7L9Xt035285; Mon, 28 Nov 2016 07:21:09 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201611280721.uAS7L9Xt035285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 28 Nov 2016 07:21:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309239 - head/bin/kenv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 07:21:10 -0000 Author: delphij Date: Mon Nov 28 07:21:09 2016 New Revision: 309239 URL: https://svnweb.freebsd.org/changeset/base/309239 Log: style(9). MFC after: 2 weeks Modified: head/bin/kenv/kenv.c Modified: head/bin/kenv/kenv.c ============================================================================== --- head/bin/kenv/kenv.c Mon Nov 28 07:19:45 2016 (r309238) +++ head/bin/kenv/kenv.c Mon Nov 28 07:21:09 2016 (r309239) @@ -190,7 +190,7 @@ ksetenv(const char *env, char *val) { int ret; - ret = kenv(KENV_SET, env, val, strlen(val)+1); + ret = kenv(KENV_SET, env, val, strlen(val) + 1); if (ret == 0) printf("%s=\"%s\"\n", env, val); return (ret); @@ -200,7 +200,7 @@ static int kunsetenv(const char *env) { int ret; - + ret = kenv(KENV_UNSET, env, NULL, 0); return (ret); } From owner-svn-src-all@freebsd.org Mon Nov 28 07:27:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8956C593A1; Mon, 28 Nov 2016 07:27:09 +0000 (UTC) (envelope-from sephe@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 933661022; Mon, 28 Nov 2016 07:27:09 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS7R8JT038254; Mon, 28 Nov 2016 07:27:08 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS7R8Tq038253; Mon, 28 Nov 2016 07:27:08 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280727.uAS7R8Tq038253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 07:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309240 - in head/sys/dev/hyperv: include vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 07:27:09 -0000 Author: sephe Date: Mon Nov 28 07:27:08 2016 New Revision: 309240 URL: https://svnweb.freebsd.org/changeset/base/309240 Log: hyperv/vmbus: Add result polling support for xact API. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8633 Modified: head/sys/dev/hyperv/include/vmbus_xact.h head/sys/dev/hyperv/vmbus/vmbus_xact.c Modified: head/sys/dev/hyperv/include/vmbus_xact.h ============================================================================== --- head/sys/dev/hyperv/include/vmbus_xact.h Mon Nov 28 07:21:09 2016 (r309239) +++ head/sys/dev/hyperv/include/vmbus_xact.h Mon Nov 28 07:27:08 2016 (r309240) @@ -55,6 +55,8 @@ const void *vmbus_xact_wait(struct vmbu size_t *resp_len); const void *vmbus_xact_busywait(struct vmbus_xact *xact, size_t *resp_len); +const void *vmbus_xact_poll(struct vmbus_xact *xact, + size_t *resp_len); void vmbus_xact_wakeup(struct vmbus_xact *xact, const void *data, size_t dlen); void vmbus_xact_ctx_wakeup(struct vmbus_xact_ctx *ctx, Modified: head/sys/dev/hyperv/vmbus/vmbus_xact.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_xact.c Mon Nov 28 07:21:09 2016 (r309239) +++ head/sys/dev/hyperv/vmbus/vmbus_xact.c Mon Nov 28 07:27:08 2016 (r309240) @@ -71,8 +71,10 @@ static struct vmbus_xact *vmbus_xact_all static void vmbus_xact_free(struct vmbus_xact *); static struct vmbus_xact *vmbus_xact_get1(struct vmbus_xact_ctx *, uint32_t); -const void *vmbus_xact_wait1(struct vmbus_xact *, size_t *, +static const void *vmbus_xact_wait1(struct vmbus_xact *, size_t *, bool); +static const void *vmbus_xact_return(struct vmbus_xact *, + size_t *); static void vmbus_xact_save_resp(struct vmbus_xact *, const void *, size_t); static void vmbus_xact_ctx_free(struct vmbus_xact_ctx *); @@ -277,27 +279,13 @@ vmbus_xact_deactivate(struct vmbus_xact mtx_unlock(&ctx->xc_lock); } -const void * -vmbus_xact_wait1(struct vmbus_xact *xact, size_t *resp_len, - bool can_sleep) +static const void * +vmbus_xact_return(struct vmbus_xact *xact, size_t *resp_len) { struct vmbus_xact_ctx *ctx = xact->x_ctx; const void *resp; - mtx_lock(&ctx->xc_lock); - - KASSERT(ctx->xc_active == xact, ("xact mismatch")); - while (xact->x_resp == NULL && - (ctx->xc_flags & VMBUS_XACT_CTXF_DESTROY) == 0) { - if (can_sleep) { - mtx_sleep(&ctx->xc_active, &ctx->xc_lock, 0, - "wxact", 0); - } else { - mtx_unlock(&ctx->xc_lock); - DELAY(1000); - mtx_lock(&ctx->xc_lock); - } - } + mtx_assert(&ctx->xc_lock, MA_OWNED); KASSERT(ctx->xc_active == xact, ("xact trashed")); if ((ctx->xc_flags & VMBUS_XACT_CTXF_DESTROY) && xact->x_resp == NULL) { @@ -317,6 +305,32 @@ vmbus_xact_wait1(struct vmbus_xact *xact resp = xact->x_resp; *resp_len = xact->x_resp_len; + return (resp); +} + +static const void * +vmbus_xact_wait1(struct vmbus_xact *xact, size_t *resp_len, + bool can_sleep) +{ + struct vmbus_xact_ctx *ctx = xact->x_ctx; + const void *resp; + + mtx_lock(&ctx->xc_lock); + + KASSERT(ctx->xc_active == xact, ("xact mismatch")); + while (xact->x_resp == NULL && + (ctx->xc_flags & VMBUS_XACT_CTXF_DESTROY) == 0) { + if (can_sleep) { + mtx_sleep(&ctx->xc_active, &ctx->xc_lock, 0, + "wxact", 0); + } else { + mtx_unlock(&ctx->xc_lock); + DELAY(1000); + mtx_lock(&ctx->xc_lock); + } + } + resp = vmbus_xact_return(xact, resp_len); + mtx_unlock(&ctx->xc_lock); return (resp); @@ -336,6 +350,28 @@ vmbus_xact_busywait(struct vmbus_xact *x return (vmbus_xact_wait1(xact, resp_len, false /* can't sleep */)); } +const void * +vmbus_xact_poll(struct vmbus_xact *xact, size_t *resp_len) +{ + struct vmbus_xact_ctx *ctx = xact->x_ctx; + const void *resp; + + mtx_lock(&ctx->xc_lock); + + KASSERT(ctx->xc_active == xact, ("xact mismatch")); + if (xact->x_resp == NULL && + (ctx->xc_flags & VMBUS_XACT_CTXF_DESTROY) == 0) { + mtx_unlock(&ctx->xc_lock); + *resp_len = 0; + return (NULL); + } + resp = vmbus_xact_return(xact, resp_len); + + mtx_unlock(&ctx->xc_lock); + + return (resp); +} + static void vmbus_xact_save_resp(struct vmbus_xact *xact, const void *data, size_t dlen) { From owner-svn-src-all@freebsd.org Mon Nov 28 07:33:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C872C59556; Mon, 28 Nov 2016 07:33:28 +0000 (UTC) (envelope-from delphij@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 C2F3D14DA; Mon, 28 Nov 2016 07:33:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS7XQLi042292; Mon, 28 Nov 2016 07:33:26 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS7XQsM042291; Mon, 28 Nov 2016 07:33:26 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201611280733.uAS7XQsM042291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 28 Nov 2016 07:33:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309241 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 07:33:28 -0000 Author: delphij Date: Mon Nov 28 07:33:26 2016 New Revision: 309241 URL: https://svnweb.freebsd.org/changeset/base/309241 Log: Don't leak 'str' when we see a malformed IPv6 address. MFC after: 2 weeks Modified: head/usr.sbin/ctld/ctld.c Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Mon Nov 28 07:27:08 2016 (r309240) +++ head/usr.sbin/ctld/ctld.c Mon Nov 28 07:33:26 2016 (r309241) @@ -675,8 +675,10 @@ parse_addr_port(char *arg, const char *d */ arg++; addr = strsep(&arg, "]"); - if (arg == NULL) + if (arg == NULL) { + free(str); return (1); + } if (arg[0] == '\0') { port = def_port; } else if (arg[0] == ':') { From owner-svn-src-all@freebsd.org Mon Nov 28 07:36:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5628FC595F9; Mon, 28 Nov 2016 07:36:52 +0000 (UTC) (envelope-from sephe@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 25BBF168C; Mon, 28 Nov 2016 07:36:52 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS7ap3i042456; Mon, 28 Nov 2016 07:36:51 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS7ap45042454; Mon, 28 Nov 2016 07:36:51 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280736.uAS7ap45042454@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 07:36:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309242 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 07:36:52 -0000 Author: sephe Date: Mon Nov 28 07:36:51 2016 New Revision: 309242 URL: https://svnweb.freebsd.org/changeset/base/309242 Log: hyperv/vmbus: Add result polling support for message Hypercall API. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8634 Modified: head/sys/dev/hyperv/vmbus/vmbus.c head/sys/dev/hyperv/vmbus/vmbus_var.h Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Mon Nov 28 07:33:26 2016 (r309241) +++ head/sys/dev/hyperv/vmbus/vmbus.c Mon Nov 28 07:36:51 2016 (r309242) @@ -315,6 +315,14 @@ vmbus_msghc_wait_result(struct vmbus_sof return (vmbus_xact_wait(mh->mh_xact, &resp_len)); } +const struct vmbus_message * +vmbus_msghc_poll_result(struct vmbus_softc *sc __unused, struct vmbus_msghc *mh) +{ + size_t resp_len; + + return (vmbus_xact_poll(mh->mh_xact, &resp_len)); +} + void vmbus_msghc_wakeup(struct vmbus_softc *sc, const struct vmbus_message *msg) { Modified: head/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_var.h Mon Nov 28 07:33:26 2016 (r309241) +++ head/sys/dev/hyperv/vmbus/vmbus_var.h Mon Nov 28 07:36:51 2016 (r309242) @@ -160,6 +160,9 @@ int vmbus_msghc_exec(struct vmbus_softc const struct vmbus_message * vmbus_msghc_wait_result(struct vmbus_softc *, struct vmbus_msghc *); +const struct vmbus_message * + vmbus_msghc_poll_result(struct vmbus_softc *, + struct vmbus_msghc *); void vmbus_msghc_wakeup(struct vmbus_softc *, const struct vmbus_message *); void vmbus_msghc_reset(struct vmbus_msghc *, size_t); From owner-svn-src-all@freebsd.org Mon Nov 28 07:41:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D483DC59908; Mon, 28 Nov 2016 07:41:02 +0000 (UTC) (envelope-from delphij@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 A43A019B3; Mon, 28 Nov 2016 07:41:02 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS7f1ec043296; Mon, 28 Nov 2016 07:41:01 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS7f1UH043295; Mon, 28 Nov 2016 07:41:01 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201611280741.uAS7f1UH043295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 28 Nov 2016 07:41:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309243 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 07:41:02 -0000 Author: delphij Date: Mon Nov 28 07:41:01 2016 New Revision: 309243 URL: https://svnweb.freebsd.org/changeset/base/309243 Log: Plug another leak with malformed IPv6 address. MFC after: 2 weeks Modified: head/usr.sbin/ctld/ctld.c Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Mon Nov 28 07:36:51 2016 (r309242) +++ head/usr.sbin/ctld/ctld.c Mon Nov 28 07:41:01 2016 (r309243) @@ -401,6 +401,7 @@ auth_portal_new(struct auth_group *ag, c return (ap); error: + free(str); free(ap); log_warnx("incorrect initiator portal \"%s\"", portal); return (NULL); From owner-svn-src-all@freebsd.org Mon Nov 28 07:44:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18651C59B21; Mon, 28 Nov 2016 07:44:52 +0000 (UTC) (envelope-from sephe@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 DBFE71D83; Mon, 28 Nov 2016 07:44:51 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS7ipxd046272; Mon, 28 Nov 2016 07:44:51 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS7ioxu046270; Mon, 28 Nov 2016 07:44:50 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280744.uAS7ioxu046270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 07:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309244 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 07:44:52 -0000 Author: sephe Date: Mon Nov 28 07:44:50 2016 New Revision: 309244 URL: https://svnweb.freebsd.org/changeset/base/309244 Log: hyperv/vmbus: Add exec cancel support for message Hypercall API. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8635 Modified: head/sys/dev/hyperv/vmbus/vmbus.c head/sys/dev/hyperv/vmbus/vmbus_var.h Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Mon Nov 28 07:41:01 2016 (r309243) +++ head/sys/dev/hyperv/vmbus/vmbus.c Mon Nov 28 07:44:50 2016 (r309244) @@ -307,6 +307,13 @@ vmbus_msghc_exec(struct vmbus_softc *sc return error; } +void +vmbus_msghc_exec_cancel(struct vmbus_softc *sc __unused, struct vmbus_msghc *mh) +{ + + vmbus_xact_deactivate(mh->mh_xact); +} + const struct vmbus_message * vmbus_msghc_wait_result(struct vmbus_softc *sc __unused, struct vmbus_msghc *mh) { Modified: head/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_var.h Mon Nov 28 07:41:01 2016 (r309243) +++ head/sys/dev/hyperv/vmbus/vmbus_var.h Mon Nov 28 07:44:50 2016 (r309244) @@ -157,6 +157,8 @@ void vmbus_msghc_put(struct vmbus_softc void *vmbus_msghc_dataptr(struct vmbus_msghc *); int vmbus_msghc_exec_noresult(struct vmbus_msghc *); int vmbus_msghc_exec(struct vmbus_softc *, struct vmbus_msghc *); +void vmbus_msghc_exec_cancel(struct vmbus_softc *, + struct vmbus_msghc *); const struct vmbus_message * vmbus_msghc_wait_result(struct vmbus_softc *, struct vmbus_msghc *); From owner-svn-src-all@freebsd.org Mon Nov 28 07:56:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E5F7C59DC5; Mon, 28 Nov 2016 07:56:04 +0000 (UTC) (envelope-from sephe@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 5579312B5; Mon, 28 Nov 2016 07:56:04 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS7u3Le050380; Mon, 28 Nov 2016 07:56:03 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS7u3Xp050379; Mon, 28 Nov 2016 07:56:03 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611280756.uAS7u3Xp050379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 28 Nov 2016 07:56:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309245 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 07:56:04 -0000 Author: sephe Date: Mon Nov 28 07:56:03 2016 New Revision: 309245 URL: https://svnweb.freebsd.org/changeset/base/309245 Log: hyperv/vmbus: Use poll/cancel APIs to wait for the CHOPEN response. Since hypervisor does not respond CHOPEN to a revoked channel. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8636 Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chan.c Mon Nov 28 07:44:50 2016 (r309244) +++ head/sys/dev/hyperv/vmbus/vmbus_chan.c Mon Nov 28 07:56:03 2016 (r309245) @@ -349,7 +349,6 @@ vmbus_chan_open_br(struct vmbus_channel const void *udata, int udlen, vmbus_chan_callback_t cb, void *cbarg) { struct vmbus_softc *sc = chan->ch_vmbus; - const struct vmbus_chanmsg_chopen_resp *resp; const struct vmbus_message *msg; struct vmbus_chanmsg_chopen *req; struct vmbus_msghc *mh; @@ -453,9 +452,50 @@ vmbus_chan_open_br(struct vmbus_channel goto failed; } - msg = vmbus_msghc_wait_result(sc, mh); - resp = (const struct vmbus_chanmsg_chopen_resp *)msg->msg_data; - status = resp->chm_status; + for (;;) { + msg = vmbus_msghc_poll_result(sc, mh); + if (msg != NULL) + break; + if (vmbus_chan_is_revoked(chan)) { + int i; + + /* + * NOTE: + * Hypervisor does _not_ send response CHOPEN to + * a revoked channel. + */ + vmbus_chan_printf(chan, + "chan%u is revoked, when it is being opened\n", + chan->ch_id); + + /* + * XXX + * Add extra delay before cancel the hypercall + * execution; mainly to close any possible + * CHRESCIND and CHOPEN_RESP races on the + * hypervisor side. + */ +#define REVOKE_LINGER 100 + for (i = 0; i < REVOKE_LINGER; ++i) { + msg = vmbus_msghc_poll_result(sc, mh); + if (msg != NULL) + break; + DELAY(1000); + } +#undef REVOKE_LINGER + if (msg == NULL) + vmbus_msghc_exec_cancel(sc, mh); + break; + } + DELAY(1000); + } + if (msg != NULL) { + status = ((const struct vmbus_chanmsg_chopen_resp *) + msg->msg_data)->chm_status; + } else { + /* XXX any non-0 value is ok here. */ + status = 0xff; + } vmbus_msghc_put(sc, mh); From owner-svn-src-all@freebsd.org Mon Nov 28 08:13:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F78FC57367; Mon, 28 Nov 2016 08:13:22 +0000 (UTC) (envelope-from adrian@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 BAA441AF7; Mon, 28 Nov 2016 08:13:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAS8DK4C058303; Mon, 28 Nov 2016 08:13:20 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAS8DKJW058302; Mon, 28 Nov 2016 08:13:20 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201611280813.uAS8DKJW058302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 28 Nov 2016 08:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309246 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 08:13:22 -0000 Author: adrian Date: Mon Nov 28 08:13:20 2016 New Revision: 309246 URL: https://svnweb.freebsd.org/changeset/base/309246 Log: [ath] wake up the hardware from power-save before doing transmit completion checking. This was being done in the pre-AR9380 case, but not for AR9380 and later. When powersave in STA mode is enabled, this may have lead to the transmit completion code doing this: * call the task, which doesn't wake up the hardware * complete the frames, which doesn't touch the hardware * schedule pending frames on the hardware queue, which DOES touch the hardware, and this will be ignored This would show up in the logs like this: (with debugging enabled): Nov 27 23:03:56 lovelace kernel: Q1[ 0] (nseg=1) (DS.V:0xfffffe011bd57300 DS.P:0x49b57300) I: 168cc117 L:00000000 F:0005 ... (in general, doesn't require debugging enabled): Nov 27 23:03:56 lovelace kernel: ath_hal_reg_write: reg=0x00000804, val=0x49b57300, pm=2 That register is a EDMA TX FIFO register (queue 1), and the val is the descriptor being written. Whilst here, make sure the software queue gets kicked here. Tested; * AR9485, STA mode + powersave Modified: head/sys/dev/ath/if_ath_tx_edma.c Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Mon Nov 28 07:56:03 2016 (r309245) +++ head/sys/dev/ath/if_ath_tx_edma.c Mon Nov 28 08:13:20 2016 (r309246) @@ -755,11 +755,30 @@ ath_edma_tx_proc(void *arg, int npending { struct ath_softc *sc = (struct ath_softc *) arg; + ATH_PCU_LOCK(sc); + sc->sc_txproc_cnt++; + ATH_PCU_UNLOCK(sc); + + ATH_LOCK(sc); + ath_power_set_power_state(sc, HAL_PM_AWAKE); + ATH_UNLOCK(sc); + #if 0 DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: called, npending=%d\n", __func__, npending); #endif ath_edma_tx_processq(sc, 1); + + + ATH_PCU_LOCK(sc); + sc->sc_txproc_cnt--; + ATH_PCU_UNLOCK(sc); + + ATH_LOCK(sc); + ath_power_restore_power_state(sc); + ATH_UNLOCK(sc); + + ath_tx_kick(sc); } /* From owner-svn-src-all@freebsd.org Mon Nov 28 14:24:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A02BCC59B70; Mon, 28 Nov 2016 14:24:08 +0000 (UTC) (envelope-from andrew@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 6FC521165; Mon, 28 Nov 2016 14:24:08 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASEO7Ql008858; Mon, 28 Nov 2016 14:24:07 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASEO7WX008857; Mon, 28 Nov 2016 14:24:07 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201611281424.uASEO7WX008857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 28 Nov 2016 14:24:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309248 - head/sys/arm64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 14:24:08 -0000 Author: andrew Date: Mon Nov 28 14:24:07 2016 New Revision: 309248 URL: https://svnweb.freebsd.org/changeset/base/309248 Log: Fix ISS_DATA_DFSC_MASK, it should include all bits in the field. Modified: head/sys/arm64/include/armreg.h Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Mon Nov 28 11:14:38 2016 (r309247) +++ head/sys/arm64/include/armreg.h Mon Nov 28 14:24:07 2016 (r309248) @@ -89,7 +89,7 @@ #define ISS_DATa_CM (0x01 << 8) #define ISS_INSN_S1PTW (0x01 << 7) #define ISS_DATa_WnR (0x01 << 6) -#define ISS_DATA_DFSC_MASK (0x1f << 0) +#define ISS_DATA_DFSC_MASK (0x3f << 0) #define ISS_DATA_DFSC_ASF_L0 (0x00 << 0) #define ISS_DATA_DFSC_ASF_L1 (0x01 << 0) #define ISS_DATA_DFSC_ASF_L2 (0x02 << 0) From owner-svn-src-all@freebsd.org Mon Nov 28 14:55:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB70AC5953F; Mon, 28 Nov 2016 14:55:22 +0000 (UTC) (envelope-from kevans91@ksu.edu) Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0070.outbound.protection.outlook.com [104.47.36.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3881111A2; Mon, 28 Nov 2016 14:55:21 +0000 (UTC) (envelope-from kevans91@ksu.edu) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ksu.edu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=8G2IFPcwlCVMBufp6mEhNDUSJeb+E7sZPdGs8qwslX4=; b=bfkRaTnHM9SnC/Pgaapv+0a1aoKCbulriQ1HU5Z5Ms+8k9rGtsWRfiROmDBq5ic3+Ps/kjOCdfOB3aQ9pFd3o7mp3+C5WLmdUn2Bj6/t822wUWuFTH94u8Wb9jZR+sbIURmAx9YUclpsKXitZ6P+cpOHQbcCjjx4EdjIG5LDUeY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kevans91@ksu.edu; Received: from mail-yw0-f181.google.com (209.85.161.181) by BY1PR0501MB1320.namprd05.prod.outlook.com (10.160.200.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.761.5; Mon, 28 Nov 2016 02:21:23 +0000 Received: by mail-yw0-f181.google.com with SMTP id a10so104161503ywa.3; Sun, 27 Nov 2016 18:21:22 -0800 (PST) X-Gm-Message-State: AKaTC02gWYP2xonrWOyxMRbKrR2tPSJ4JqTgSbeDoV+scTpAG2IbFiPYi785CTnM+OzSCHg6YVfI5vgHSD830w== X-Received: by 10.13.247.65 with SMTP id h62mr24022248ywf.56.1480299677799; Sun, 27 Nov 2016 18:21:17 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.22.196 with HTTP; Sun, 27 Nov 2016 18:20:57 -0800 (PST) In-Reply-To: <201611242254.uAOMswkb081748@repo.freebsd.org> References: <201611242254.uAOMswkb081748@repo.freebsd.org> From: Kyle Evans Date: Sun, 27 Nov 2016 20:20:57 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r309124 - in head: . contrib/compiler-rt contrib/compiler-rt/include/sanitizer contrib/compiler-rt/lib/asan contrib/compiler-rt/lib/builtins contrib/compiler-rt/lib/builtins/arm contrib... To: Dimitry Andric , Glen Barber CC: , , Content-Type: text/plain; charset="UTF-8" X-Originating-IP: [209.85.161.181] X-ClientProxiedBy: BN6PR2001CA0017.namprd20.prod.outlook.com (10.172.112.155) To BY1PR0501MB1320.namprd05.prod.outlook.com (10.160.200.16) X-MS-Office365-Filtering-Correlation-Id: 6e8a6196-b614-4b5d-4a52-08d417353f92 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY1PR0501MB1320; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0501MB1320; 3:K0XpTxGP4jqnuJfLrakSsy0zKHwzFRUQpzaJNvG781rlW9m0R1rvs+pPynB6K37B06V6Fmr/fHbPS/gqcX3Vb1fs1CoFj8Kuiv5AzxDtFsXUqIGvsvcy4fT87F5ketcwjwMtHwOUVNBnWmdaF5dqJK3/tOh2W7kwx2tBRaJMWL+69nQ7K/zj42lYo0iv5TnFKwBISx/0O5n6OBypc+L9i6M8Gm9jopAVtzowyxsAOhRjRNVPtYvhSdagsyuSdoBNCl2Ab+p8C8rgzRWY79KGKg== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0501MB1320; 25:nBMsvu+z2EMgMb85fXBXnjTuSiCTiUnQk31l/n3KjVadNoUUw9SsmXF0DjSCR8adQWt9OWCJP1OrpJhe3GX293CZfzhafgQCiughNDhHjCZ2OuWYb1DaNJB47C9aIsuVsyaDTaoPuvfHM5l6bXGhtF3Q1WAYa/vCc883oaQgEgQqf7+vJ40aoCdAc1/SA3tHXuMdAil6BtAssQoWcOJxhZ180lqThcFUjOr1xdUwbxPE8cyEoN0z4znx7UkQra7MLSkgodl2PCNu4Xk+SDHCPF3Tc+JVLBEl/unsORo3cKf18CM0ZLx/le1GMVyXrWxaPt3+n8jvaHGUIRwv9HqPkLgAZWZdczbnb5bHm482gMYwi7qpKecJh6Xe6iObwvSbxI6m89/+P024Ny0urCfB7pXo0owzFVuenNDO7JE4Uy/9nIkgmTB/JVri8cQc9iEvyNl7vVtKJVHDne4b2igefqJoP0CVeBaMLkkmv8qMH5tKgJJXujYOsOIRSc/J5qbyJz3H1rI9ccCCSMKjyuM+nJpiM5gwctvfLscSQrUW+mQyPmnhx0ydgTrcovP6nrpSPLRpQI3GB5Tsz7AokuhhV9JvNj5pJnu6H8XCRSYSNRL+1LlAgYDMpnHWdzhO5qkge2I6bl3VwuOccGLj9wA+EgBJYN/e4sLT7NdAi8BCx34iQ2kQ6GUpUAa3EoJeCMFisB/w2Ig+Dl3rWd4029Dbh1kRWdNzI38GzSd4HDUXASX3svvl35TLd0J69Lzzna30Xt+4r89xU2Ehp4B8JyKzhYHX4Zj4FKq1t/YyRvJB1okLVxQ8/CoaSZyOasek+D5rmn/waGPbbuU6M87jG/F8Ar+SFMhqnK1DJxqtoVRemQugFOJWVL5PyF6UB+gRBI5R X-Microsoft-Exchange-Diagnostics: 1; BY1PR0501MB1320; 31:RZ31ellp8d++xnQoeVAZqUOaDrP3++D2vrS9bnH+BK2rXFqigCaZKbUg5cH7dJXGpUFk3zcnCma/tgZD5ARgDpfmCHkoASwdySXveA6DUloOi+aAe0TZmZWFfq9pwFOHd/AVSyICJfs326sIk6ahzUJlEBe9Jd9RQmg1ZRuchgLNOF//UfNr+gR75KvNyoUAFd3UpMzC2SSkeBbXrqT74jt5spkVAX/fxk4d81sTJt6i+5SmUolbf13NXRMIT7VmlXCVVvA1m9z37IZXa98msg==; 20:JJTL+CV1hBt+M51qa78e4tIzuKKInLedZY/ifDpf4NqmbCpZ5W0nhY+fau/dJTfS5V0p2H6KzzG2uJbwbYbjvoyJE91MIUaHxqww5C9skWPL/Mt5adcpdvIHVvfmwkwWOkwMO75QCiHfi5zc6RDCNFzbURmcS8Qjwz0OZp+UApgb44J5j3mG6Cc/XVQEtWZDnQmknpwQhiX1rCoQkFjNOqelFU3rwNKx11+RYbDXy/R+XJa514JRb8nVv4lUM0QV0KbVEoxw3bTLG5L9ZVjhVD5v7BGdPf9XkCJa58AnhOna4m66kUFrpSoUWIGB3Ws6O6OgmlDgEbYUtJ89Wo5nJeUgKK8sp85IfcTAAq+pGUvFvQmuOH19v2H56fvepxx8H8ZTmVKeETJLpXS87YDQRmwaN8LURMAHht0XyIzaPlrn4nsTsKl735Oa4gJxuzAXIh/Kp7sRK5JSBApm9gaOeVWRgV7GNzvW4JT3Xkaj3Wg7OP0kdxahC18MlFE27OUr X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(56005881305849)(262104967686372); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6060326)(6040361)(6045199)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(6061324)(20161123560025)(20161123555025)(20161123564025)(20161123562025)(6072148); SRVR:BY1PR0501MB1320; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0501MB1320; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0501MB1320; 4:ThU38gaHtna8ZrhapNK3+0j8etfGfRFIwWuIcX5WaEij/OCs9ucWWafAUx9sHR412GnDZ2Mt9nuJ80zEdG6G9D9p6bxF5bo+RlGz6kHb7yTLURX3GdsDyQ63KXwgMfqt40ii8tBOZZBGZa26gi4/yjs9M5zDrbVGYgEIJ4te2tdrksmMY3jZrz4zv1LJVu7nFfFoEqHTX7Rh5ROI0VLVKHhk02DvY+rtqQZZGgoD3wVxPrcAQCwFbG4SrGsD315lmdon9fa8y5+QIWEoQKEbMCuc5hCegG4n9TLUBBn20pwwt/RN4C8ha1QJRsrh5FsC8WEus9WkegVS3LicRxvmaWbbrGaMNR763j90QrbPovA8/lC+mbeo3ZU4oIvw3AalwUSOcNocmWIUp5oq2UdzvlPQRsDdYJVs7MTvgIEYbU439+YiOaoPLvwcq7kTQ4XiaaH4Yp5v6pTSQM3d66rIpOxaPjWHp46hcca9RJ+v4kAOeic3hOQl1gI+grSAD0bOo9cKtKZfYe9J43vWxnCUVOaGaw48gp8SlG2nefXKtORSPBZUiHUPGoAmswOs1wmHHVUYSGvzURQqGC18aU402ZBkfjyjoA3kRSXqpb0p33ubI32kZsxZBWcDGT/84GmPsToqAHnICNkjxoPA4TvhTXG3xy4Dco0w6++VotaxVE0T3FAdBPA/H/2eQh4QppFI3ek7l6MzgF23lms9kZ8GCw== X-Forefront-PRVS: 01401330D1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(24454002)(199003)(377454003)(189002)(23676002)(122856001)(305945005)(15395725005)(7846002)(89122001)(5820100001)(2950100002)(7736002)(229853002)(5660300001)(189998001)(88552002)(69596002)(55446002)(2906002)(90282001)(4326007)(5001770100001)(39450400002)(101416001)(106356001)(97736004)(39380400001)(39400400001)(6116002)(68736007)(38730400001)(8676002)(9896002)(50466002)(3846002)(450100001)(86362001)(61726006)(92566002)(66066001)(98316002)(75432002)(81166006)(81156014)(9686002)(42186005)(61266001)(63696999)(76176999)(50986999)(54356999)(105586002)(59536001)(93516999)(47776003)(55456009); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0501MB1320; H:mail-yw0-f181.google.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: ksu.edu does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCWTFQUjA1MDFNQjEzMjA7MjM6QkFIYUtTakJtNFE1bStsbDQ3Y1RSNFVQ?= =?utf-8?B?YXFEOWI3cTV5dHpzTjV4T2tzanFkdDFCK09mQmZ3MzBuUmp0SVZyWlg0aUw3?= =?utf-8?B?ZGpSYXRITTQyNHRQbXNjSnNhOVZYVU4rODQ1b0JDMzM4ZWtVYy92dnJYcG9h?= =?utf-8?B?YzVXOUpLdG1NSEowak9iUjVPeEQ4UHhjU1Z6S2lmS05xTkJzcWp4R3N0c0h2?= =?utf-8?B?TzRvY1RxUnRZUzViVVVqUWt4eFFZbzRZZVlDUWhpQ1VnVjN0eWVKdXBKbWFz?= =?utf-8?B?cmVxaUJKZUxVT01RY1ZjdXdaTXUyT2x3R21HdHJlSjYxY2VhaUFjTVlWclh2?= =?utf-8?B?Rlc0dHdGcTg0NmpWbkhveit6czVVR1JhNnBJbkowaW5Xc1JyRHdVcnpuTmor?= =?utf-8?B?VW56Q2VnRDdIb1dIMmpCWEpDc0NkZ2NDM09mZFVtbVYyK0FsSXJQSmFvRW5C?= =?utf-8?B?TE1WZS9QWkNsd1kvVllEL1hCZEZwRlhtVGxxTjdpZ3R0UFdNdXc0YjJ0SlFN?= =?utf-8?B?TGd4cmYwVVFFNUpiTGdxME1uSXVrT3pOQzRCVmhpelJwSTFMUmY1TlA5eGpF?= =?utf-8?B?OUx2aWZ4ZWpFM1Z2WlUwR0RYSGZmN1crNjUzQ2lLRWZBV0kraThvWGlXNGU0?= =?utf-8?B?cTNMb3k5RTB3L0FMRmdocU9OSkdjNmpBSC9RaFdNdjhaYzMwcFZNdCsvRVRQ?= =?utf-8?B?UUttRGRzUWVFdmY2bGVTelpDTkpWR2E5T1lOL2ZCYUFoL0tuNDZCeDRhRDlm?= =?utf-8?B?OEUxcGF4aWJadkxEd3RpMTRtdzhQdUM4bytjdCtWUkZpR1hKMFN6d2pCdkUv?= =?utf-8?B?YnRmZjVpRnpQaDlJMzgwT3ZDckJJSVFmb3dIaDJoYzVnc1I1NkVvd0t6aGdP?= =?utf-8?B?dWFFcnZqQkFFTWFTMzhJWnEzc05SbDl0d2JWZk12OFdDQmE4K1ErU284bzF2?= =?utf-8?B?K09yWm5ZUFZtaC80OUx2L080U2tjSWhIeERYUkFjVnFXYUkzL2o3VjlkaDFl?= =?utf-8?B?VWl2M3FaSkRZWG9Nc1VRSXN2dmZ6VHd5WllyZXVHZ0RZMnhNWnZmTnBzLytH?= =?utf-8?B?eTYrbWhKdlZ4bHpETzJ4aTl6MFdkLzkrczRFaDk4ekdKZy93OXBqRTBkSFZS?= =?utf-8?B?cEloMTkrN3NxV21xWkxlMFZhZDdLOW5IRDEzd1hIZDZYTlROTGZaa3g2MGww?= =?utf-8?B?djlMVm9vUTA5WENjQ3JWTnBLMlNVaUNlL1lScUdvVHNtaUJsdHlMaWcrQUcz?= =?utf-8?B?RHRhRzlPSVQ3MHJ1Um9kbmxDejd4M3VxQkJrTjhpOGNNV1FUYjh2M01JdTIz?= =?utf-8?B?em1vYlg0RlBlaHFiZEx2RllPdFZLQTMzZ24rYUxONVBlYnl3T2tHREdVVEFQ?= =?utf-8?B?WTVkZCt6QzNzNWxrUUI1c2JqdHU3QkdpNXd6cDBKdi9PQjZlemNGMmVEeDFv?= =?utf-8?B?b0FjOFR2OWMzVEFkUWFOTkM1dVBLTHBwL3RCaGhXMGZrTDgvR09GeENWeXhy?= =?utf-8?B?eDdlbzg3TFZnWThLeUFiazlQeC81WWJmVmJ0LzFtOFJ5dWx1cDlYWjRidE85?= =?utf-8?B?T3hwWlZ2MnEwUjdsOW9NdThyNVlRb0Vxay9Odm52emtDUHFBWHZDdVROKzJI?= =?utf-8?B?NGpMM2h5M2Y2VldVK3JLTW1wU2ZHKzU5dkpISFQyQnI1b0NFMFIySVdxT1hR?= =?utf-8?B?NW1TdmNDK3puYmVrVTRhTHNxTk1uSVJrTlpUUkxxclJTSjBocVJmcit1Mmg4?= =?utf-8?B?c2tZZU1vUEtYWnlicnVERkljajcraW00NmVFbWhqK21MclFiaERjMzNFYkto?= =?utf-8?B?MEVhL2h6Q2JpLzNXb1htb2lEUUhEVGpRckxsUTIrR1dJZHNuaDZHby9vR2hI?= =?utf-8?B?ZW5ORkJ0Z3loVVpVZkQ4TEpHRTRoMHNIa293bFpGNEptVDZjN2wwMTlPUTFS?= =?utf-8?B?Rlp0NVNrNXdYc253RjIxdGM1OU9zbDlmNFdpVHVTbll3anZNMHBwM09UVC9u?= =?utf-8?Q?kW9Sccyr?= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0501MB1320; 6:PNxCKGK3Wu7zQfc9Q+uHwFFlVNpcpYnzrOfvKFHKWQoodCxVCRBZTXpPU676VMH+IteaJ1JyWdapbAusVjqKRZpR6q7dHl5JF0cVegArlkyg603dPpwPF4W/NBqHK4zAlT5d3hxVFP6mN6tggZPOsYx86UI3c9WYZ0Vbu1abInT9SQ+xoeO+BVAf5/ZxWFkYjldlOvpkpBvthahTofYBn7QAqYxxm8uEX+1eXg4+D59NRu/XTJ4NaRuMO77c/Kf5fkRBZl9vE8kgG8Ijn9Xq60JUIgUwof+hmVEg7BZy+Zd84JkArTfBrZ2K6MtoEmmAthZY34S6wHsV0J7QwwyEaZIO/80Nli4YdD7VgXq03jsXiHuhW6/WoxI5Z5aLk1P6F+zZ34R7Tu/97TccnkYEgtNQXI+/9SapV4cYM9Hektb4GGcmKqDw8+qGvHdsn3P8SnOTfStPUth4mXpJsLpnhw==; 5:2avsaShLlYcGlTEFVxePNRBhXhQrnn/pRBT1T1qmMAmFC0n+O2uoDGFrpC8OTCmZXwZH333g+CqoQuNJ7U0HxJkQCVZQ1nIQjIFkI1cZ7/Qx707ReY/jTKwzGAW5e0XjsvnhUElWjlETQ8zZ0dQxIF4Hlnij7tVIH/0wpPJuE4Y=; 24:wMcIF4SYQ6wT6/W98O+3I/cfZnkXfdbYeQIyDkdVBbMFj9C02kexDFjpi6Atsjw77mBg34udYvHASUqW49icjJ4wfD8tjcEUl9Y+PA7ZLPs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0501MB1320; 7:Nu1cfh0Gwv26317iXg/8MsKK8N1GzSnCZbpJpioMk4ccA4L7FoRIU+xYa8uUzSzdXn8Lr47eZPgG/iqxXcZNoQ2wl1NGKo42zbD4N2Ad2t62v1BuGl1OAC4MHGP4nSv74kFaSF6ZWjuWgC5d5Fx2z5eGO4Ve4st8sVk7XksbOHPxJxsn8wkhLUAi0Qcq98mRXG23gdCbipQewQWRXVz+3mdCmQsa9dV2+05tCmKs7XOOdb1hCnhhejGDrhqnLWWSe8YSDMsQ/1x7FFpflMnoyear+k8ilfUo4UvBIA9cecpk6UJMQCM32xikGBVR7gtjn55Bxk1sVXv49EQcUu0lIDh/lUHiN1T42mknEJlCiiZaPoMruv/4GRNgvWxJICad3MyXquaN/KXb/KxfAK8a+45gHXmz7uOGmKaKrjEM3mj66X9JSP5L5KBgTngsOBewwStFCDdvcm9Rb8ccwa7ILw==; 20:3TDb4CJEtyu+PjBwmU+sRevxec4y54irYCpWuCxyuqaEtQO3FEFmwe+Ffafu150DLbfCjEybfEHhACWW9931Ha1bNaZgatDec1uKACSqbMUvcrLCkH60DWhwn3J5a8jBk3jD+/zFQWr0NAFWhUZCMbyVobL+OuhVeIahoi6NHg8= X-OriginatorOrg: ksu.edu X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2016 02:21:23.3309 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0501MB1320 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 14:55:23 -0000 Hi, On Thu, Nov 24, 2016 at 4:54 PM, Dimitry Andric wrote: > Author: dim > Date: Thu Nov 24 22:54:55 2016 > New Revision: 309124 > URL: https://svnweb.freebsd.org/changeset/base/309124 > > Log: > Upgrade our copies of clang, llvm, lldb, compiler-rt and libc++ to 3.9.0 > release, and add lld 3.9.0. Also completely revamp the build system for > clang, llvm, lldb and their related tools. > > Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11 > support to build; see UPDATING for more information. > > Release notes for llvm, clang and lld are available here: > > > > > Thanks to Ed Maste, Bryan Drewery, Andrew Turner, Antoine Brodin and Jan > Beich for their help. > > Relnotes: yes > MFC after: 1 month First off, thanks for this! =) Unfortunately, this commit seems to have done away with the -clang pkgbase pkg [1], and doesn't seem to have revived the PACKAGE= elsewhere as FreeBSD-clang has disappeared from my newly built repository. =( [1] https://svnweb.freebsd.org/base/head/usr.bin/clang/clang.prog.mk?limit_changes=0&r1=298107&r2=309124&pathrev=309124 From owner-svn-src-all@freebsd.org Mon Nov 28 15:10:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F6F5C59984; Mon, 28 Nov 2016 15:10:00 +0000 (UTC) (envelope-from avg@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 1A2181899; Mon, 28 Nov 2016 15:10:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASF9xvs025144; Mon, 28 Nov 2016 15:09:59 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASF9xPG025141; Mon, 28 Nov 2016 15:09:59 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201611281509.uASF9xPG025141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 28 Nov 2016 15:09:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r309249 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 15:10:00 -0000 Author: avg Date: Mon Nov 28 15:09:58 2016 New Revision: 309249 URL: https://svnweb.freebsd.org/changeset/base/309249 Log: 3821 Race in rollback, zil close, and zil flush illumos/illumos-gate@43297f973a3543e7403ac27076490ab958a94b15 https://github.com/illumos/illumos-gate/commit/43297f973a3543e7403ac27076490ab958a94b15 https://www.illumos.org/issues/3821 We recently had nodes with some of the latest zfs bits panic on us in a rollback-heavy environment. The following is from my preliminary analysis: Let's look at where we died: > $C ffffff01ea6b9a10 taskq_dispatch+0x3a(0, fffffffff7d20450, ffffff5551dea920, 1) ffffff01ea6b9a60 zil_clean+0xce(ffffff4b7106c080, 7e0f1) ffffff01ea6b9aa0 dsl_pool_sync_done+0x47(ffffff4313065680, 7e0f1) ffffff01ea6b9b70 spa_sync+0x55f(ffffff4310c1d040, 7e0f1) ffffff01ea6b9c20 txg_sync_thread+0x20f(ffffff4313065680) ffffff01ea6b9c30 thread_start+8() If we dig in we can find that this dataset corresponds to a zone: > ffffff4b7106c080::print zilog_t zl_os->os_dsl_dataset->ds_dir->dd_myname zl_os->os_dsl_dataset->ds_dir->dd_myname = [ "8ffce16a-13c2-4efa-a233- 9e378e89877b" ] Okay so we have a null taskq pointer. That only happens during the calls to zil_open and zil_close. If we poke around we can see that we're actually in midst of a rollback: > ::pgrep zfs | ::printf "0x%x %s\\n" proc_t . p_user.u_psargs 0xffffff43262800a0 zfs rollback zones/15714eb6-f5ea-469f-ac6d- 4b8ab06213c2@marlin_init 0xffffff54e22a1028 zfs rollback zones/8ffce16a-13c2-4efa-a233- 9e378e89877b@marlin_init 0xffffff4362f3a058 zfs rollback zones/0ddb8e49-ca7e-42e1-8fdc- 4ac4ba8fe9f8@marlin_init 0xffffff5748e8d020 zfs rollback zones/426357b5-832d-4430-953e- 10cd45ff8e9f@marlin_init 0xffffff436b867008 zfs rollback zones/8f36bf37-8a9c-4a44-995c- 6d1b2751e6f5@marlin_init 0xffffff4381ad4090 zfs rollback zones/6c8eca18-fbd6-46dd-ac24- 2ed45cd0da70@marlin_init Reviewed by: Matthew Ahrens Reviewed by: Dan Kimmel Reviewed by: Pavel Zakharov Reviewed by: Andriy Gapon Approved by: Richard Lowe Author: George Wilson Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Mon Nov 28 14:24:07 2016 (r309248) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c Mon Nov 28 15:09:58 2016 (r309249) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright (c) 2014 Integros [integros.com] @@ -581,9 +581,16 @@ dsl_pool_sync_done(dsl_pool_t *dp, uint6 { zilog_t *zilog; - while (zilog = txg_list_remove(&dp->dp_dirty_zilogs, txg)) { + while (zilog = txg_list_head(&dp->dp_dirty_zilogs, txg)) { dsl_dataset_t *ds = dmu_objset_ds(zilog->zl_os); + /* + * We don't remove the zilog from the dp_dirty_zilogs + * list until after we've cleaned it. This ensures that + * callers of zilog_is_dirty() receive an accurate + * answer when they are racing with the spa sync thread. + */ zil_clean(zilog, txg); + (void) txg_list_remove_this(&dp->dp_dirty_zilogs, zilog, txg); ASSERT(!dmu_objset_is_dirty(zilog->zl_os, txg)); dmu_buf_rele(ds->ds_dbuf, zilog); } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Mon Nov 28 14:24:07 2016 (r309248) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Mon Nov 28 15:09:58 2016 (r309249) @@ -6735,8 +6735,6 @@ spa_sync(spa_t *spa, uint64_t txg) spa->spa_config_syncing = NULL; } - spa->spa_ubsync = spa->spa_uberblock; - dsl_pool_sync_done(dp, txg); mutex_enter(&spa->spa_alloc_lock); @@ -6761,6 +6759,13 @@ spa_sync(spa_t *spa, uint64_t txg) spa->spa_sync_pass = 0; + /* + * Update the last synced uberblock here. We want to do this at + * the end of spa_sync() so that consumers of spa_last_synced_txg() + * will be guaranteed that all the processing associated with + * that txg has been completed. + */ + spa->spa_ubsync = spa->spa_uberblock; spa_config_exit(spa, SCL_CONFIG, FTAG); spa_handle_ignored_writes(spa); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c Mon Nov 28 14:24:07 2016 (r309248) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zil.c Mon Nov 28 15:09:58 2016 (r309249) @@ -20,8 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2014 Integros [integros.com] */ @@ -485,6 +484,27 @@ zilog_dirty(zilog_t *zilog, uint64_t txg } } +/* + * Determine if the zil is dirty in the specified txg. Callers wanting to + * ensure that the dirty state does not change must hold the itxg_lock for + * the specified txg. Holding the lock will ensure that the zil cannot be + * dirtied (zil_itx_assign) or cleaned (zil_clean) while we check its current + * state. + */ +boolean_t +zilog_is_dirty_in_txg(zilog_t *zilog, uint64_t txg) +{ + dsl_pool_t *dp = zilog->zl_dmu_pool; + + if (txg_list_member(&dp->dp_dirty_zilogs, zilog, txg & TXG_MASK)) + return (B_TRUE); + return (B_FALSE); +} + +/* + * Determine if the zil is dirty. The zil is considered dirty if it has + * any pending itx records that have not been cleaned by zil_clean(). + */ boolean_t zilog_is_dirty(zilog_t *zilog) { @@ -1048,8 +1068,6 @@ zil_lwb_commit(zilog_t *zilog, itx_t *it return (NULL); ASSERT(lwb->lwb_buf != NULL); - ASSERT(zilog_is_dirty(zilog) || - spa_freeze_txg(zilog->zl_spa) != UINT64_MAX); if (lrc->lrc_txtype == TX_WRITE && itx->itx_wr_state == WR_NEED_COPY) dlen = P2ROUNDUP_TYPED( @@ -1285,6 +1303,8 @@ zil_itx_assign(zilog_t *zilog, itx_t *it * this itxg. Save the itxs for release below. * This should be rare. */ + zfs_dbgmsg("zil_itx_assign: missed itx cleanup for " + "txg %llu", itxg->itxg_txg); atomic_add_64(&zilog->zl_itx_list_sz, -itxg->itxg_sod); itxg->itxg_sod = 0; clean = itxg->itxg_itxs; @@ -1382,6 +1402,11 @@ zil_get_commit_list(zilog_t *zilog) else otxg = spa_last_synced_txg(zilog->zl_spa) + 1; + /* + * This is inherently racy, since there is nothing to prevent + * the last synced txg from changing. That's okay since we'll + * only commit things in the future. + */ for (txg = otxg; txg < (otxg + TXG_CONCURRENT_STATES); txg++) { itxg_t *itxg = &zilog->zl_itxg[txg & TXG_MASK]; @@ -1391,6 +1416,16 @@ zil_get_commit_list(zilog_t *zilog) continue; } + /* + * If we're adding itx records to the zl_itx_commit_list, + * then the zil better be dirty in this "txg". We can assert + * that here since we're holding the itxg_lock which will + * prevent spa_sync from cleaning it. Once we add the itxs + * to the zl_itx_commit_list we must commit it to disk even + * if it's unnecessary (i.e. the txg was synced). + */ + ASSERT(zilog_is_dirty_in_txg(zilog, txg) || + spa_freeze_txg(zilog->zl_spa) != UINT64_MAX); list_move_tail(commit_list, &itxg->itxg_itxs->i_sync_list); push_sod += itxg->itxg_sod; itxg->itxg_sod = 0; @@ -1416,6 +1451,10 @@ zil_async_to_sync(zilog_t *zilog, uint64 else otxg = spa_last_synced_txg(zilog->zl_spa) + 1; + /* + * This is inherently racy, since there is nothing to prevent + * the last synced txg from changing. + */ for (txg = otxg; txg < (otxg + TXG_CONCURRENT_STATES); txg++) { itxg_t *itxg = &zilog->zl_itxg[txg & TXG_MASK]; @@ -1487,8 +1526,14 @@ zil_commit_writer(zilog_t *zilog) DTRACE_PROBE1(zil__cw1, zilog_t *, zilog); while (itx = list_head(&zilog->zl_itx_commit_list)) { txg = itx->itx_lr.lrc_txg; - ASSERT(txg); + ASSERT3U(txg, !=, 0); + /* + * This is inherently racy and may result in us writing + * out a log block for a txg that was just synced. This is + * ok since we'll end cleaning up that log block the next + * time we call zil_sync(). + */ if (txg > spa_last_synced_txg(spa) || txg > spa_freeze_txg(spa)) lwb = zil_lwb_commit(zilog, itx, lwb); list_remove(&zilog->zl_itx_commit_list, itx); @@ -1805,7 +1850,10 @@ zil_close(zilog_t *zilog) mutex_exit(&zilog->zl_lock); if (txg) txg_wait_synced(zilog->zl_dmu_pool, txg); - ASSERT(!zilog_is_dirty(zilog)); + + if (zilog_is_dirty(zilog)) + zfs_dbgmsg("zil (%p) is dirty, txg %llu", zilog, txg); + VERIFY(!zilog_is_dirty(zilog)); taskq_destroy(zilog->zl_clean_taskq); zilog->zl_clean_taskq = NULL; From owner-svn-src-all@freebsd.org Mon Nov 28 15:14:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E18DC59BA7; Mon, 28 Nov 2016 15:14:32 +0000 (UTC) (envelope-from avg@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 78E141CD6; Mon, 28 Nov 2016 15:14:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASFEVYJ028828; Mon, 28 Nov 2016 15:14:31 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASFEVkH028825; Mon, 28 Nov 2016 15:14:31 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201611281514.uASFEVkH028825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 28 Nov 2016 15:14:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309250 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 15:14:32 -0000 Author: avg Date: Mon Nov 28 15:14:31 2016 New Revision: 309250 URL: https://svnweb.freebsd.org/changeset/base/309250 Log: MFV r309249: 3821 Race in rollback, zil close, and zil flush Note: there was a merge conflict resolved by me. illumos/illumos-gate@43297f973a3543e7403ac27076490ab958a94b15 https://github.com/illumos/illumos-gate/commit/43297f973a3543e7403ac27076490ab958a94b15 https://www.illumos.org/issues/3821 We recently had nodes with some of the latest zfs bits panic on us in a rollback-heavy environment. The following is from my preliminary analysis: Let's look at where we died: > $C ffffff01ea6b9a10 taskq_dispatch+0x3a(0, fffffffff7d20450, ffffff5551dea920, 1) ffffff01ea6b9a60 zil_clean+0xce(ffffff4b7106c080, 7e0f1) ffffff01ea6b9aa0 dsl_pool_sync_done+0x47(ffffff4313065680, 7e0f1) ffffff01ea6b9b70 spa_sync+0x55f(ffffff4310c1d040, 7e0f1) ffffff01ea6b9c20 txg_sync_thread+0x20f(ffffff4313065680) ffffff01ea6b9c30 thread_start+8() If we dig in we can find that this dataset corresponds to a zone: > ffffff4b7106c080::print zilog_t zl_os->os_dsl_dataset->ds_dir->dd_myname zl_os->os_dsl_dataset->ds_dir->dd_myname = [ "8ffce16a-13c2-4efa-a233- 9e378e89877b" ] Okay so we have a null taskq pointer. That only happens during the calls to zil_open and zil_close. If we poke around we can see that we're actually in midst of a rollback: > ::pgrep zfs | ::printf "0x%x %s\\n" proc_t . p_user.u_psargs 0xffffff43262800a0 zfs rollback zones/15714eb6-f5ea-469f-ac6d- 4b8ab06213c2@marlin_init 0xffffff54e22a1028 zfs rollback zones/8ffce16a-13c2-4efa-a233- 9e378e89877b@marlin_init 0xffffff4362f3a058 zfs rollback zones/0ddb8e49-ca7e-42e1-8fdc- 4ac4ba8fe9f8@marlin_init 0xffffff5748e8d020 zfs rollback zones/426357b5-832d-4430-953e- 10cd45ff8e9f@marlin_init 0xffffff436b867008 zfs rollback zones/8f36bf37-8a9c-4a44-995c- 6d1b2751e6f5@marlin_init 0xffffff4381ad4090 zfs rollback zones/6c8eca18-fbd6-46dd-ac24- 2ed45cd0da70@marlin_init Reviewed by: Matthew Ahrens Reviewed by: Dan Kimmel Reviewed by: Pavel Zakharov Reviewed by: Andriy Gapon Approved by: Richard Lowe Author: George Wilson MFC after: 3 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Mon Nov 28 15:09:58 2016 (r309249) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Mon Nov 28 15:14:31 2016 (r309250) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. * Copyright (c) 2014 Integros [integros.com] @@ -681,9 +681,16 @@ dsl_pool_sync_done(dsl_pool_t *dp, uint6 { zilog_t *zilog; - while (zilog = txg_list_remove(&dp->dp_dirty_zilogs, txg)) { + while (zilog = txg_list_head(&dp->dp_dirty_zilogs, txg)) { dsl_dataset_t *ds = dmu_objset_ds(zilog->zl_os); + /* + * We don't remove the zilog from the dp_dirty_zilogs + * list until after we've cleaned it. This ensures that + * callers of zilog_is_dirty() receive an accurate + * answer when they are racing with the spa sync thread. + */ zil_clean(zilog, txg); + (void) txg_list_remove_this(&dp->dp_dirty_zilogs, zilog, txg); ASSERT(!dmu_objset_is_dirty(zilog->zl_os, txg)); dmu_buf_rele(ds->ds_dbuf, zilog); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Nov 28 15:09:58 2016 (r309249) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Nov 28 15:14:31 2016 (r309250) @@ -7086,8 +7086,6 @@ spa_sync(spa_t *spa, uint64_t txg) spa->spa_config_syncing = NULL; } - spa->spa_ubsync = spa->spa_uberblock; - dsl_pool_sync_done(dp, txg); mutex_enter(&spa->spa_alloc_lock); @@ -7112,6 +7110,13 @@ spa_sync(spa_t *spa, uint64_t txg) spa->spa_sync_pass = 0; + /* + * Update the last synced uberblock here. We want to do this at + * the end of spa_sync() so that consumers of spa_last_synced_txg() + * will be guaranteed that all the processing associated with + * that txg has been completed. + */ + spa->spa_ubsync = spa->spa_uberblock; spa_config_exit(spa, SCL_CONFIG, FTAG); spa_handle_ignored_writes(spa); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Mon Nov 28 15:09:58 2016 (r309249) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c Mon Nov 28 15:14:31 2016 (r309250) @@ -20,8 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2014 Integros [integros.com] */ @@ -502,6 +501,27 @@ zilog_dirty(zilog_t *zilog, uint64_t txg } } +/* + * Determine if the zil is dirty in the specified txg. Callers wanting to + * ensure that the dirty state does not change must hold the itxg_lock for + * the specified txg. Holding the lock will ensure that the zil cannot be + * dirtied (zil_itx_assign) or cleaned (zil_clean) while we check its current + * state. + */ +boolean_t +zilog_is_dirty_in_txg(zilog_t *zilog, uint64_t txg) +{ + dsl_pool_t *dp = zilog->zl_dmu_pool; + + if (txg_list_member(&dp->dp_dirty_zilogs, zilog, txg & TXG_MASK)) + return (B_TRUE); + return (B_FALSE); +} + +/* + * Determine if the zil is dirty. The zil is considered dirty if it has + * any pending itx records that have not been cleaned by zil_clean(). + */ boolean_t zilog_is_dirty(zilog_t *zilog) { @@ -1062,8 +1082,6 @@ zil_lwb_commit(zilog_t *zilog, itx_t *it return (NULL); ASSERT(lwb->lwb_buf != NULL); - ASSERT(zilog_is_dirty(zilog) || - spa_freeze_txg(zilog->zl_spa) != UINT64_MAX); if (lrc->lrc_txtype == TX_WRITE && itx->itx_wr_state == WR_NEED_COPY) dlen = P2ROUNDUP_TYPED( @@ -1401,6 +1419,11 @@ zil_get_commit_list(zilog_t *zilog) else otxg = spa_last_synced_txg(zilog->zl_spa) + 1; + /* + * This is inherently racy, since there is nothing to prevent + * the last synced txg from changing. That's okay since we'll + * only commit things in the future. + */ for (txg = otxg; txg < (otxg + TXG_CONCURRENT_STATES); txg++) { itxg_t *itxg = &zilog->zl_itxg[txg & TXG_MASK]; @@ -1410,6 +1433,16 @@ zil_get_commit_list(zilog_t *zilog) continue; } + /* + * If we're adding itx records to the zl_itx_commit_list, + * then the zil better be dirty in this "txg". We can assert + * that here since we're holding the itxg_lock which will + * prevent spa_sync from cleaning it. Once we add the itxs + * to the zl_itx_commit_list we must commit it to disk even + * if it's unnecessary (i.e. the txg was synced). + */ + ASSERT(zilog_is_dirty_in_txg(zilog, txg) || + spa_freeze_txg(zilog->zl_spa) != UINT64_MAX); list_move_tail(commit_list, &itxg->itxg_itxs->i_sync_list); mutex_exit(&itxg->itxg_lock); @@ -1432,6 +1465,10 @@ zil_async_to_sync(zilog_t *zilog, uint64 else otxg = spa_last_synced_txg(zilog->zl_spa) + 1; + /* + * This is inherently racy, since there is nothing to prevent + * the last synced txg from changing. + */ for (txg = otxg; txg < (otxg + TXG_CONCURRENT_STATES); txg++) { itxg_t *itxg = &zilog->zl_itxg[txg & TXG_MASK]; @@ -1503,8 +1540,14 @@ zil_commit_writer(zilog_t *zilog) DTRACE_PROBE1(zil__cw1, zilog_t *, zilog); while (itx = list_head(&zilog->zl_itx_commit_list)) { txg = itx->itx_lr.lrc_txg; - ASSERT(txg); + ASSERT3U(txg, !=, 0); + /* + * This is inherently racy and may result in us writing + * out a log block for a txg that was just synced. This is + * ok since we'll end cleaning up that log block the next + * time we call zil_sync(). + */ if (txg > spa_last_synced_txg(spa) || txg > spa_freeze_txg(spa)) lwb = zil_lwb_commit(zilog, itx, lwb); list_remove(&zilog->zl_itx_commit_list, itx); @@ -1821,7 +1864,10 @@ zil_close(zilog_t *zilog) mutex_exit(&zilog->zl_lock); if (txg) txg_wait_synced(zilog->zl_dmu_pool, txg); - ASSERT(!zilog_is_dirty(zilog)); + + if (zilog_is_dirty(zilog)) + zfs_dbgmsg("zil (%p) is dirty, txg %llu", zilog, txg); + VERIFY(!zilog_is_dirty(zilog)); taskq_destroy(zilog->zl_clean_taskq); zilog->zl_clean_taskq = NULL; From owner-svn-src-all@freebsd.org Mon Nov 28 16:23:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BEB0C5AC2D; Mon, 28 Nov 2016 16:23:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20E211F25; Mon, 28 Nov 2016 16:23:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASGNWbE056996; Mon, 28 Nov 2016 16:23:32 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASGNWoA056995; Mon, 28 Nov 2016 16:23:32 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201611281623.uASGNWoA056995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 28 Nov 2016 16:23:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309251 - head/sys/dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 16:23:33 -0000 Author: mav Date: Mon Nov 28 16:23:32 2016 New Revision: 309251 URL: https://svnweb.freebsd.org/changeset/base/309251 Log: Process port interrupt even is PxIS register is zero. ASMedia ASM1062 AHCI chips with some fancy firmware handling PMP inside seems sometimes forgeting to set bits in PxIS, causing command timeouts. Removal of this check fixes the issue by the theoretical cost of slightly higher CPU usage in some odd cases, but this is what Linux does too. MFC after: 1 month Modified: head/sys/dev/ahci/ahci.c Modified: head/sys/dev/ahci/ahci.c ============================================================================== --- head/sys/dev/ahci/ahci.c Mon Nov 28 15:14:31 2016 (r309250) +++ head/sys/dev/ahci/ahci.c Mon Nov 28 16:23:32 2016 (r309251) @@ -1169,8 +1169,6 @@ ahci_ch_intr(void *arg) /* Read interrupt statuses. */ istatus = ATA_INL(ch->r_mem, AHCI_P_IS); - if (istatus == 0) - return; mtx_lock(&ch->mtx); ahci_ch_intr_main(ch, istatus); @@ -1187,8 +1185,6 @@ ahci_ch_intr_direct(void *arg) /* Read interrupt statuses. */ istatus = ATA_INL(ch->r_mem, AHCI_P_IS); - if (istatus == 0) - return; mtx_lock(&ch->mtx); ch->batch = 1; From owner-svn-src-all@freebsd.org Mon Nov 28 16:25:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE030C5AC90; Mon, 28 Nov 2016 16:25:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDC7C10B2; Mon, 28 Nov 2016 16:25:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASGP5Kn057117; Mon, 28 Nov 2016 16:25:05 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASGP5Ys057116; Mon, 28 Nov 2016 16:25:05 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201611281625.uASGP5Ys057116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 28 Nov 2016 16:25:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309252 - head/sys/dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 16:25:07 -0000 Author: mav Date: Mon Nov 28 16:25:05 2016 New Revision: 309252 URL: https://svnweb.freebsd.org/changeset/base/309252 Log: Add more ASMedia PCI IDs from different sources. Exact device names are not clear, but its better then nothing at all. MFC after: 1 month Modified: head/sys/dev/ahci/ahci_pci.c Modified: head/sys/dev/ahci/ahci_pci.c ============================================================================== --- head/sys/dev/ahci/ahci_pci.c Mon Nov 28 16:23:32 2016 (r309251) +++ head/sys/dev/ahci/ahci_pci.c Mon Nov 28 16:25:05 2016 (r309252) @@ -73,8 +73,15 @@ static const struct { {0x78021022, 0x00, "AMD Hudson-2", 0}, {0x78031022, 0x00, "AMD Hudson-2", 0}, {0x78041022, 0x00, "AMD Hudson-2", 0}, - {0x06111b21, 0x00, "ASMedia ASM2106", 0}, - {0x06121b21, 0x00, "ASMedia ASM1061", 0}, + {0x06011b21, 0x00, "ASMedia ASM1060", 0}, + {0x06021b21, 0x00, "ASMedia ASM1060", 0}, + {0x06111b21, 0x00, "ASMedia ASM1061", 0}, + {0x06121b21, 0x00, "ASMedia ASM1062", 0}, + {0x06201b21, 0x00, "ASMedia ASM106x", 0}, + {0x06211b21, 0x00, "ASMedia ASM106x", 0}, + {0x06221b21, 0x00, "ASMedia ASM106x", 0}, + {0x06241b21, 0x00, "ASMedia ASM106x", 0}, + {0x06251b21, 0x00, "ASMedia ASM106x", 0}, {0x26528086, 0x00, "Intel ICH6", AHCI_Q_NOFORCE}, {0x26538086, 0x00, "Intel ICH6M", AHCI_Q_NOFORCE}, {0x26818086, 0x00, "Intel ESB2", 0}, From owner-svn-src-all@freebsd.org Mon Nov 28 17:06:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB4C4C59C7D; Mon, 28 Nov 2016 17:06:36 +0000 (UTC) (envelope-from adrian@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 80E341964; Mon, 28 Nov 2016 17:06:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASH6Zfl073582; Mon, 28 Nov 2016 17:06:35 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASH6ZtI073581; Mon, 28 Nov 2016 17:06:35 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201611281706.uASH6ZtI073581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 28 Nov 2016 17:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309253 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 17:06:36 -0000 Author: adrian Date: Mon Nov 28 17:06:35 2016 New Revision: 309253 URL: https://svnweb.freebsd.org/changeset/base/309253 Log: [ath] revert the previous commit, after reading the 802.11-2012 spec a bit more. The 802.11-2012 spec talks about this - section 10.1.3.2 - Beacon Generation in Infrastructure Networks. So yes, we should be expecting beacons to be going out in multiples of intval. Silly adrian. So: * fix the FreeBSD APs that are sending beacons at incorrect TBTTs (target beacon transmit time); and * yes indeed we will have to wake up out of network sleep until we sync a beacon. Modified: head/sys/dev/ath/if_ath_beacon.c Modified: head/sys/dev/ath/if_ath_beacon.c ============================================================================== --- head/sys/dev/ath/if_ath_beacon.c Mon Nov 28 16:25:05 2016 (r309252) +++ head/sys/dev/ath/if_ath_beacon.c Mon Nov 28 17:06:35 2016 (r309253) @@ -965,9 +965,9 @@ ath_beacon_config(struct ath_softc *sc, intval = ni->ni_intval & HAL_BEACON_PERIOD; } - /* - * Note: rounding up to the next intval can cause problems. + * Note: rounding up to the next intval can cause problems with + * bad APs when we're in powersave mode. * * In STA mode with powersave enabled, beacons are only received * whenever the beacon timer fires to wake up the hardware. @@ -975,17 +975,14 @@ ath_beacon_config(struct ath_softc *sc, * that the AP has started transmitting beacons at TSF values that * are multiples of intval, versus say being 25 TU off. * - * I'm not sure why nexttbtt is rounded up to the intval. - * If we sync against a beacon that is way out, we should - * take a beacon miss and re-sync against the next beacon. - * - * So for now - don't round up if we're in STA mode. - * Maybe later (when someone eventually does powersave+IBSS, - * powersave+MBSS) this can be flipped on for those too. + * The specification (802.11-2012 10.1.3.2 - Beacon Generation in + * Infrastructure Networks) requires APs be beaconing at a + * mutiple of intval. So, if bintval=100, then we shouldn't + * get beacons at intervals other than around multiples of 100. */ if (nexttbtt == 0) /* e.g. for ap mode */ nexttbtt = intval; - else if ((ic->ic_opmode != IEEE80211_M_STA) && intval) /* NB: can be 0 for monitor mode */ + else nexttbtt = roundup(nexttbtt, intval); DPRINTF(sc, ATH_DEBUG_BEACON, "%s: nexttbtt %u intval %u (%u)\n", From owner-svn-src-all@freebsd.org Mon Nov 28 17:22:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AF9AC5A132; Mon, 28 Nov 2016 17:22:46 +0000 (UTC) (envelope-from hselasky@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 66B2F138C; Mon, 28 Nov 2016 17:22:46 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASHMjTl081672; Mon, 28 Nov 2016 17:22:45 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASHMjoP081671; Mon, 28 Nov 2016 17:22:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201611281722.uASHMjoP081671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 28 Nov 2016 17:22:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309254 - stable/11/sys/dev/usb/net X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 17:22:46 -0000 Author: hselasky Date: Mon Nov 28 17:22:45 2016 New Revision: 309254 URL: https://svnweb.freebsd.org/changeset/base/309254 Log: MFC r308730: Make sure MAC address is reprogrammed when if_init() callback is invoked. Else promiscious mode must be used to pass traffic. While at it fix a debug print macro. Modified: stable/11/sys/dev/usb/net/if_smsc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/net/if_smsc.c ============================================================================== --- stable/11/sys/dev/usb/net/if_smsc.c Mon Nov 28 17:06:35 2016 (r309253) +++ stable/11/sys/dev/usb/net/if_smsc.c Mon Nov 28 17:22:45 2016 (r309254) @@ -152,7 +152,7 @@ static const struct usb_device_id smsc_d device_printf((sc)->sc_ue.ue_dev, "debug: " fmt, ##args); \ } while(0) #else -#define smsc_dbg_printf(sc, fmt, args...) +#define smsc_dbg_printf(sc, fmt, args...) do { } while (0) #endif #define smsc_warn_printf(sc, fmt, args...) \ @@ -822,7 +822,6 @@ static int smsc_sethwcsum(struct smsc_so return (0); } - /** * smsc_setmacaddress - Sets the mac address in the device * @sc: driver soft context @@ -905,6 +904,9 @@ smsc_init(struct usb_ether *ue) SMSC_LOCK_ASSERT(sc, MA_OWNED); + if (smsc_setmacaddress(sc, IF_LLADDR(ifp))) + smsc_dbg_printf(sc, "setting MAC address failed\n"); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) return; From owner-svn-src-all@freebsd.org Mon Nov 28 17:24:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46549C5A215; Mon, 28 Nov 2016 17:24:25 +0000 (UTC) (envelope-from hselasky@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 14D9815AD; Mon, 28 Nov 2016 17:24:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASHOONS081783; Mon, 28 Nov 2016 17:24:24 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASHOORg081782; Mon, 28 Nov 2016 17:24:24 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201611281724.uASHOORg081782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 28 Nov 2016 17:24:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309255 - stable/10/sys/dev/usb/net X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 17:24:25 -0000 Author: hselasky Date: Mon Nov 28 17:24:24 2016 New Revision: 309255 URL: https://svnweb.freebsd.org/changeset/base/309255 Log: MFC r308730: Make sure MAC address is reprogrammed when if_init() callback is invoked. Else promiscious mode must be used to pass traffic. While at it fix a debug print macro. Modified: stable/10/sys/dev/usb/net/if_smsc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/net/if_smsc.c ============================================================================== --- stable/10/sys/dev/usb/net/if_smsc.c Mon Nov 28 17:22:45 2016 (r309254) +++ stable/10/sys/dev/usb/net/if_smsc.c Mon Nov 28 17:24:24 2016 (r309255) @@ -131,7 +131,7 @@ static const struct usb_device_id smsc_d device_printf((sc)->sc_ue.ue_dev, "debug: " fmt, ##args); \ } while(0) #else -#define smsc_dbg_printf(sc, fmt, args...) +#define smsc_dbg_printf(sc, fmt, args...) do { } while (0) #endif #define smsc_warn_printf(sc, fmt, args...) \ @@ -801,7 +801,6 @@ static int smsc_sethwcsum(struct smsc_so return (0); } - /** * smsc_setmacaddress - Sets the mac address in the device * @sc: driver soft context @@ -884,6 +883,9 @@ smsc_init(struct usb_ether *ue) SMSC_LOCK_ASSERT(sc, MA_OWNED); + if (smsc_setmacaddress(sc, IF_LLADDR(ifp))) + smsc_dbg_printf(sc, "setting MAC address failed\n"); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) return; From owner-svn-src-all@freebsd.org Mon Nov 28 17:54:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFE21C5AA39; Mon, 28 Nov 2016 17:54:30 +0000 (UTC) (envelope-from adrian@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 8A2A718FA; Mon, 28 Nov 2016 17:54:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASHsTUx093469; Mon, 28 Nov 2016 17:54:29 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASHsTQe093467; Mon, 28 Nov 2016 17:54:29 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201611281754.uASHsTQe093467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 28 Nov 2016 17:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309256 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 17:54:30 -0000 Author: adrian Date: Mon Nov 28 17:54:29 2016 New Revision: 309256 URL: https://svnweb.freebsd.org/changeset/base/309256 Log: [ath] force wake the hardware if we see a missed beacon. This adds a workaround to incorrectly behaving APs (ie, FreeBSD APs) which don't beacon out exactly when they should (at TBTT multiples of beacon intervals.) It forces the hardware awake (but leaves it in network-sleep so self generated frames still state that the hardware is asleep!) and will remain awake until the next sleep transition driven by net80211. That way if the beacons are just at the wrong interval, we get a much better chance of hearing more consecutive beacons before we go to sleep, thus not constantly disconnecting. Tested: * AR9485, STA mode, against a misbehaving FreeBSD AP. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Mon Nov 28 17:24:24 2016 (r309255) +++ head/sys/dev/ath/if_ath.c Mon Nov 28 17:54:29 2016 (r309256) @@ -285,22 +285,40 @@ ath_legacy_attach_comp_func(struct ath_s * the hardware is being programmed elsewhere, it will * simply store it away and update it when all current * uses of the hardware are completed. + * + * If the chip is going into network sleep or power off, then + * we will wait until all uses of the chip are done before + * going into network sleep or power off. + * + * If the chip is being programmed full-awake, then immediately + * program it full-awake so we can actually stay awake rather than + * the chip potentially going to sleep underneath us. */ void -_ath_power_setpower(struct ath_softc *sc, int power_state, const char *file, int line) +_ath_power_setpower(struct ath_softc *sc, int power_state, int selfgen, + const char *file, int line) { ATH_LOCK_ASSERT(sc); - sc->sc_target_powerstate = power_state; - - DPRINTF(sc, ATH_DEBUG_PWRSAVE, "%s: (%s:%d) state=%d, refcnt=%d\n", + DPRINTF(sc, ATH_DEBUG_PWRSAVE, "%s: (%s:%d) state=%d, refcnt=%d, target=%d, cur=%d\n", __func__, file, line, power_state, - sc->sc_powersave_refcnt); + sc->sc_powersave_refcnt, + sc->sc_target_powerstate, + sc->sc_cur_powerstate); - if (sc->sc_powersave_refcnt == 0 && + sc->sc_target_powerstate = power_state; + + /* + * Don't program the chip into network sleep if the chip + * is being programmed elsewhere. + * + * However, if the chip is being programmed /awake/, force + * the chip awake so we stay awake. + */ + if ((sc->sc_powersave_refcnt == 0 || power_state == HAL_PM_AWAKE) && power_state != sc->sc_cur_powerstate) { sc->sc_cur_powerstate = power_state; ath_hal_setpower(sc->sc_ah, power_state); @@ -313,7 +331,8 @@ _ath_power_setpower(struct ath_softc *sc * we let the above call leave the self-gen * state as "sleep". */ - if (sc->sc_cur_powerstate == HAL_PM_AWAKE && + if (selfgen && + sc->sc_cur_powerstate == HAL_PM_AWAKE && sc->sc_target_selfgen_state != HAL_PM_AWAKE) { ath_hal_setselfgenpower(sc->sc_ah, sc->sc_target_selfgen_state); @@ -379,10 +398,13 @@ _ath_power_set_power_state(struct ath_so sc->sc_powersave_refcnt++; + /* + * Only do the power state change if we're not programming + * it elsewhere. + */ if (power_state != sc->sc_cur_powerstate) { ath_hal_setpower(sc->sc_ah, power_state); sc->sc_cur_powerstate = power_state; - /* * Adjust the self-gen powerstate if appropriate. */ @@ -391,7 +413,6 @@ _ath_power_set_power_state(struct ath_so ath_hal_setselfgenpower(sc->sc_ah, sc->sc_target_selfgen_state); } - } } @@ -1317,7 +1338,7 @@ ath_attach(u_int16_t devid, struct ath_s * Put it to sleep for now. */ ATH_LOCK(sc); - ath_power_setpower(sc, HAL_PM_FULL_SLEEP); + ath_power_setpower(sc, HAL_PM_FULL_SLEEP, 1); ATH_UNLOCK(sc); return 0; @@ -1359,7 +1380,7 @@ ath_detach(struct ath_softc *sc) */ ATH_LOCK(sc); ath_power_set_power_state(sc, HAL_PM_AWAKE); - ath_power_setpower(sc, HAL_PM_AWAKE); + ath_power_setpower(sc, HAL_PM_AWAKE, 1); /* * Stop things cleanly. @@ -1942,7 +1963,7 @@ ath_resume(struct ath_softc *sc) ATH_LOCK(sc); ath_power_setselfgen(sc, HAL_PM_AWAKE); ath_power_set_power_state(sc, HAL_PM_AWAKE); - ath_power_setpower(sc, HAL_PM_AWAKE); + ath_power_setpower(sc, HAL_PM_AWAKE, 1); ATH_UNLOCK(sc); ath_hal_reset(ah, sc->sc_opmode, @@ -2269,8 +2290,13 @@ ath_intr(void *arg) sc->sc_stats.ast_rxorn++; } if (status & HAL_INT_TSFOOR) { + /* out of range beacon - wake the chip up, + * but don't modify self-gen frame config */ device_printf(sc->sc_dev, "%s: TSFOOR\n", __func__); sc->sc_syncbeacon = 1; + ATH_LOCK(sc); + ath_power_setpower(sc, HAL_PM_AWAKE, 0); + ATH_UNLOCK(sc); } if (status & HAL_INT_MCI) { ath_btcoex_mci_intr(sc); @@ -2360,12 +2386,22 @@ ath_bmiss_vap(struct ieee80211vap *vap) } /* - * There's no need to keep the hardware awake during the call - * to av_bmiss(). + * Keep the hardware awake if it's asleep (and leave self-gen + * frame config alone) until the next beacon, so we can resync + * against the next beacon. + * + * This handles three common beacon miss cases in STA powersave mode - + * (a) the beacon TBTT isnt a multiple of bintval; + * (b) the beacon was missed; and + * (c) the beacons are being delayed because the AP is busy and + * isn't reliably able to meet its TBTT. */ ATH_LOCK(sc); + ath_power_setpower(sc, HAL_PM_AWAKE, 0); ath_power_restore_power_state(sc); ATH_UNLOCK(sc); + DPRINTF(sc, ATH_DEBUG_BEACON, + "%s: forced awake; force syncbeacon=1\n", __func__); /* * Attempt to force a beacon resync. @@ -2462,7 +2498,7 @@ ath_init(struct ath_softc *sc) */ ath_power_setselfgen(sc, HAL_PM_AWAKE); ath_power_set_power_state(sc, HAL_PM_AWAKE); - ath_power_setpower(sc, HAL_PM_AWAKE); + ath_power_setpower(sc, HAL_PM_AWAKE, 1); /* * Stop anything previously setup. This is safe @@ -5563,7 +5599,7 @@ ath_newstate(struct ieee80211vap *vap, e /* Ensure we stay awake during scan */ ATH_LOCK(sc); ath_power_setselfgen(sc, HAL_PM_AWAKE); - ath_power_setpower(sc, HAL_PM_AWAKE); + ath_power_setpower(sc, HAL_PM_AWAKE, 1); ATH_UNLOCK(sc); ath_hal_intrset(ah, @@ -5739,7 +5775,7 @@ ath_newstate(struct ieee80211vap *vap, e */ ATH_LOCK(sc); ath_power_setselfgen(sc, HAL_PM_AWAKE); - ath_power_setpower(sc, HAL_PM_AWAKE); + ath_power_setpower(sc, HAL_PM_AWAKE, 1); /* * Finally, start any timers and the task q thread @@ -5795,7 +5831,7 @@ ath_newstate(struct ieee80211vap *vap, e * our beacon timer config may be wrong. */ if (sc->sc_syncbeacon == 0) { - ath_power_setpower(sc, HAL_PM_NETWORK_SLEEP); + ath_power_setpower(sc, HAL_PM_NETWORK_SLEEP, 1); } ATH_UNLOCK(sc); } @@ -6177,7 +6213,7 @@ ath_parent(struct ieee80211com *ic) } else { ath_stop(sc); if (!sc->sc_invalid) - ath_power_setpower(sc, HAL_PM_FULL_SLEEP); + ath_power_setpower(sc, HAL_PM_FULL_SLEEP, 1); } ATH_UNLOCK(sc); Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Mon Nov 28 17:24:24 2016 (r309255) +++ head/sys/dev/ath/if_ath_misc.h Mon Nov 28 17:54:29 2016 (r309256) @@ -109,15 +109,23 @@ extern void ath_tx_dump(struct ath_softc /* * Power state tracking. */ -extern void _ath_power_setpower(struct ath_softc *sc, int power_state, const char *file, int line); -extern void _ath_power_set_selfgen(struct ath_softc *sc, int power_state, const char *file, int line); -extern void _ath_power_set_power_state(struct ath_softc *sc, int power_state, const char *file, int line); -extern void _ath_power_restore_power_state(struct ath_softc *sc, const char *file, int line); - -#define ath_power_setpower(sc, ps) _ath_power_setpower(sc, ps, __FILE__, __LINE__) -#define ath_power_setselfgen(sc, ps) _ath_power_set_selfgen(sc, ps, __FILE__, __LINE__) -#define ath_power_set_power_state(sc, ps) _ath_power_set_power_state(sc, ps, __FILE__, __LINE__) -#define ath_power_restore_power_state(sc) _ath_power_restore_power_state(sc, __FILE__, __LINE__) +extern void _ath_power_setpower(struct ath_softc *sc, int power_state, + int selfgen, const char *file, int line); +extern void _ath_power_set_selfgen(struct ath_softc *sc, + int power_state, const char *file, int line); +extern void _ath_power_set_power_state(struct ath_softc *sc, + int power_state, const char *file, int line); +extern void _ath_power_restore_power_state(struct ath_softc *sc, + const char *file, int line); + +#define ath_power_setpower(sc, ps, sg) _ath_power_setpower(sc, ps, sg, \ + __FILE__, __LINE__) +#define ath_power_setselfgen(sc, ps) _ath_power_set_selfgen(sc, ps, \ + __FILE__, __LINE__) +#define ath_power_set_power_state(sc, ps) \ + _ath_power_set_power_state(sc, ps, __FILE__, __LINE__) +#define ath_power_restore_power_state(sc) \ + _ath_power_restore_power_state(sc, __FILE__, __LINE__) /* * Kick the frame TX task. From owner-svn-src-all@freebsd.org Mon Nov 28 17:55:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F75EC5AB36; Mon, 28 Nov 2016 17:55:33 +0000 (UTC) (envelope-from ae@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 29CF81B99; Mon, 28 Nov 2016 17:55:33 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASHtWW8093582; Mon, 28 Nov 2016 17:55:32 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASHtWFR093581; Mon, 28 Nov 2016 17:55:32 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201611281755.uASHtWFR093581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 28 Nov 2016 17:55:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309257 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 17:55:33 -0000 Author: ae Date: Mon Nov 28 17:55:32 2016 New Revision: 309257 URL: https://svnweb.freebsd.org/changeset/base/309257 Log: Rework ip_tryforward() to use FIB4 KPI. Tested by: olivier Obtained from: Yandex LLC MFC after: 1 month Sponsored by: Yandex LLC Differential Revision: https://reviews.freebsd.org/D8526 Modified: head/sys/netinet/ip_fastfwd.c Modified: head/sys/netinet/ip_fastfwd.c ============================================================================== --- head/sys/netinet/ip_fastfwd.c Mon Nov 28 17:54:29 2016 (r309256) +++ head/sys/netinet/ip_fastfwd.c Mon Nov 28 17:55:32 2016 (r309257) @@ -97,6 +97,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -107,40 +108,33 @@ __FBSDID("$FreeBSD$"); #include -static struct sockaddr_in * -ip_findroute(struct route *ro, struct in_addr dest, struct mbuf *m) +static int +ip_findroute(struct nhop4_basic *pnh, struct in_addr dest, struct mbuf *m) { - struct sockaddr_in *dst; - struct rtentry *rt; + bzero(pnh, sizeof(*pnh)); + if (fib4_lookup_nh_basic(M_GETFIB(m), dest, 0, 0, pnh) != 0) { + IPSTAT_INC(ips_noroute); + IPSTAT_INC(ips_cantforward); + icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, 0, 0); + return (EHOSTUNREACH); + } /* - * Find route to destination. + * Drop blackholed traffic and directed broadcasts. */ - bzero(ro, sizeof(*ro)); - dst = (struct sockaddr_in *)&ro->ro_dst; - dst->sin_family = AF_INET; - dst->sin_len = sizeof(*dst); - dst->sin_addr.s_addr = dest.s_addr; - in_rtalloc_ign(ro, 0, M_GETFIB(m)); - - /* - * Route there and interface still up? - */ - rt = ro->ro_rt; - if (rt && (rt->rt_flags & RTF_UP) && - (rt->rt_ifp->if_flags & IFF_UP) && - (rt->rt_ifp->if_drv_flags & IFF_DRV_RUNNING)) { - if (rt->rt_flags & RTF_GATEWAY) - dst = (struct sockaddr_in *)rt->rt_gateway; - } else { - IPSTAT_INC(ips_noroute); + if ((pnh->nh_flags & (NHF_BLACKHOLE | NHF_BROADCAST)) != 0) { + IPSTAT_INC(ips_cantforward); + m_freem(m); + return (EHOSTUNREACH); + } + + if (pnh->nh_flags & NHF_REJECT) { IPSTAT_INC(ips_cantforward); - if (rt) - RTFREE(rt); icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, 0, 0); - return NULL; + return (EHOSTUNREACH); } - return dst; + + return (0); } /* @@ -155,13 +149,11 @@ ip_tryforward(struct mbuf *m) { struct ip *ip; struct mbuf *m0 = NULL; - struct route ro; - struct sockaddr_in *dst = NULL; - struct ifnet *ifp; + struct nhop4_basic nh; + struct sockaddr_in dst; struct in_addr odest, dest; uint16_t ip_len, ip_off; int error = 0; - int mtu; struct m_tag *fwd_tag = NULL; /* @@ -171,9 +163,6 @@ ip_tryforward(struct mbuf *m) M_ASSERTVALID(m); M_ASSERTPKTHDR(m); - bzero(&ro, sizeof(ro)); - - #ifdef ALTQ /* * Is packet dropped by traffic conditioner? @@ -305,29 +294,17 @@ passin: /* * Find route to destination. */ - if ((dst = ip_findroute(&ro, dest, m)) == NULL) - return NULL; /* icmp unreach already sent */ - ifp = ro.ro_rt->rt_ifp; - - /* - * Immediately drop blackholed traffic, and directed broadcasts - * for either the all-ones or all-zero subnet addresses on - * locally attached networks. - */ - if ((ro.ro_rt->rt_flags & (RTF_BLACKHOLE|RTF_BROADCAST)) != 0) - goto drop; + if (ip_findroute(&nh, dest, m) != 0) + return (NULL); /* icmp unreach already sent */ /* * Step 5: outgoing firewall packet processing */ - - /* - * Run through list of hooks for output packets. - */ if (!PFIL_HOOKED(&V_inet_pfil_hook)) goto passout; - if (pfil_run_hooks(&V_inet_pfil_hook, &m, ifp, PFIL_OUT, NULL) || m == NULL) { + if (pfil_run_hooks(&V_inet_pfil_hook, &m, nh.nh_ifp, PFIL_OUT, NULL) || + m == NULL) { goto drop; } @@ -352,9 +329,7 @@ forwardlocal: * Return packet for processing by ip_input(). */ m->m_flags |= M_FASTFWD_OURS; - if (ro.ro_rt) - RTFREE(ro.ro_rt); - return m; + return (m); } /* * Redo route lookup with new destination address @@ -365,10 +340,8 @@ forwardlocal: m_tag_delete(m, fwd_tag); m->m_flags &= ~M_IP_NEXTHOP; } - RTFREE(ro.ro_rt); - if ((dst = ip_findroute(&ro, dest, m)) == NULL) - return NULL; /* icmp unreach already sent */ - ifp = ro.ro_rt->rt_ifp; + if (ip_findroute(&nh, dest, m) != 0) + return (NULL); /* icmp unreach already sent */ } passout: @@ -378,32 +351,15 @@ passout: ip_len = ntohs(ip->ip_len); ip_off = ntohs(ip->ip_off); - /* - * Check if route is dampned (when ARP is unable to resolve) - */ - if ((ro.ro_rt->rt_flags & RTF_REJECT) && - (ro.ro_rt->rt_expire == 0 || time_uptime < ro.ro_rt->rt_expire)) { - icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, 0, 0); - goto consumed; - } - - /* - * Check if media link state of interface is not down - */ - if (ifp->if_link_state == LINK_STATE_DOWN) { - icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_HOST, 0, 0); - goto consumed; - } + bzero(&dst, sizeof(dst)); + dst.sin_family = AF_INET; + dst.sin_len = sizeof(dst); + dst.sin_addr = nh.nh_addr; /* * Check if packet fits MTU or if hardware will fragment for us */ - if (ro.ro_rt->rt_mtu) - mtu = min(ro.ro_rt->rt_mtu, ifp->if_mtu); - else - mtu = ifp->if_mtu; - - if (ip_len <= mtu) { + if (ip_len <= nh.nh_mtu) { /* * Avoid confusing lower layers. */ @@ -411,9 +367,9 @@ passout: /* * Send off the packet via outgoing interface */ - IP_PROBE(send, NULL, NULL, ip, ifp, ip, NULL); - error = (*ifp->if_output)(ifp, m, - (struct sockaddr *)dst, &ro); + IP_PROBE(send, NULL, NULL, ip, nh.nh_ifp, ip, NULL); + error = (*nh.nh_ifp->if_output)(nh.nh_ifp, m, + (struct sockaddr *)&dst, NULL); } else { /* * Handle EMSGSIZE with icmp reply needfrag for TCP MTU discovery @@ -421,14 +377,15 @@ passout: if (ip_off & IP_DF) { IPSTAT_INC(ips_cantfrag); icmp_error(m, ICMP_UNREACH, ICMP_UNREACH_NEEDFRAG, - 0, mtu); + 0, nh.nh_mtu); goto consumed; } else { /* * We have to fragment the packet */ m->m_pkthdr.csum_flags |= CSUM_IP; - if (ip_fragment(ip, &m, mtu, ifp->if_hwassist)) + if (ip_fragment(ip, &m, nh.nh_mtu, + nh.nh_ifp->if_hwassist) != 0) goto drop; KASSERT(m != NULL, ("null mbuf and no error")); /* @@ -443,9 +400,11 @@ passout: */ m_clrprotoflags(m); - IP_PROBE(send, NULL, NULL, ip, ifp, ip, NULL); - error = (*ifp->if_output)(ifp, m, - (struct sockaddr *)dst, &ro); + IP_PROBE(send, NULL, NULL, ip, nh.nh_ifp, + ip, NULL); + /* XXX: we can use cached route here */ + error = (*nh.nh_ifp->if_output)(nh.nh_ifp, m, + (struct sockaddr *)&dst, NULL); if (error) break; } while ((m = m0) != NULL); @@ -463,17 +422,13 @@ passout: if (error != 0) IPSTAT_INC(ips_odropped); else { - counter_u64_add(ro.ro_rt->rt_pksent, 1); IPSTAT_INC(ips_forward); IPSTAT_INC(ips_fastforward); } consumed: - RTFREE(ro.ro_rt); return NULL; drop: if (m) m_freem(m); - if (ro.ro_rt) - RTFREE(ro.ro_rt); return NULL; } From owner-svn-src-all@freebsd.org Mon Nov 28 18:36:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86074C5990A; Mon, 28 Nov 2016 18:36:38 +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 3B4021915; Mon, 28 Nov 2016 18:36:38 +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 uASIab1d010492; Mon, 28 Nov 2016 18:36:37 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASIablV010490; Mon, 28 Nov 2016 18:36:37 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201611281836.uASIablV010490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 28 Nov 2016 18:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309258 - in stable: 10/include 10/sys/sys 11/include 11/sys/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 18:36:38 -0000 Author: jhb Date: Mon Nov 28 18:36:37 2016 New Revision: 309258 URL: https://svnweb.freebsd.org/changeset/base/309258 Log: MFC 307756: Define max_align_t for C11. libc++'s stddef.h includes an existing definition of max_align_t for C++11, but it is only defined for C++, not for C. In addition, GCC and clang both define an alternate version of max_align_t that uses a union of multiple types rather than a plain long double as in libc++. This adds a __max_align_t to that matches the GCC and clang definition that is mapped to max_align_t in . PR: 210890 Modified: stable/10/include/stddef.h stable/10/sys/sys/_types.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/include/stddef.h stable/11/sys/sys/_types.h Directory Properties: stable/11/ (props changed) Modified: stable/10/include/stddef.h ============================================================================== --- stable/10/include/stddef.h Mon Nov 28 17:55:32 2016 (r309257) +++ stable/10/include/stddef.h Mon Nov 28 18:36:37 2016 (r309258) @@ -59,6 +59,14 @@ typedef ___wchar_t wchar_t; #endif #endif +#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L +#ifndef __CLANG_MAX_ALIGN_T_DEFINED +typedef __max_align_t max_align_t; +#define __CLANG_MAX_ALIGN_T_DEFINED +#define __GCC_MAX_ALIGN_T +#endif +#endif + #define offsetof(type, member) __offsetof(type, member) #endif /* _STDDEF_H_ */ Modified: stable/10/sys/sys/_types.h ============================================================================== --- stable/10/sys/sys/_types.h Mon Nov 28 17:55:32 2016 (r309257) +++ stable/10/sys/sys/_types.h Mon Nov 28 18:36:37 2016 (r309258) @@ -99,6 +99,11 @@ typedef __uint_least32_t __char32_t; #define _CHAR32_T_DECLARED #endif +typedef struct { + long long __max_align1 __aligned(_Alignof(long long)); + long double __max_align2 __aligned(_Alignof(long double)); +} __max_align_t; + typedef __uint32_t __dev_t; /* device number */ typedef __uint32_t __fixpt_t; /* fixed point number */ From owner-svn-src-all@freebsd.org Mon Nov 28 18:36:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4D3DC5990E; Mon, 28 Nov 2016 18:36:38 +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 89EA21916; Mon, 28 Nov 2016 18:36:38 +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 uASIabuq010499; Mon, 28 Nov 2016 18:36:37 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASIabsc010497; Mon, 28 Nov 2016 18:36:37 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201611281836.uASIabsc010497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 28 Nov 2016 18:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309258 - in stable: 10/include 10/sys/sys 11/include 11/sys/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 18:36:38 -0000 Author: jhb Date: Mon Nov 28 18:36:37 2016 New Revision: 309258 URL: https://svnweb.freebsd.org/changeset/base/309258 Log: MFC 307756: Define max_align_t for C11. libc++'s stddef.h includes an existing definition of max_align_t for C++11, but it is only defined for C++, not for C. In addition, GCC and clang both define an alternate version of max_align_t that uses a union of multiple types rather than a plain long double as in libc++. This adds a __max_align_t to that matches the GCC and clang definition that is mapped to max_align_t in . PR: 210890 Modified: stable/11/include/stddef.h stable/11/sys/sys/_types.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/include/stddef.h stable/10/sys/sys/_types.h Directory Properties: stable/10/ (props changed) Modified: stable/11/include/stddef.h ============================================================================== --- stable/11/include/stddef.h Mon Nov 28 17:55:32 2016 (r309257) +++ stable/11/include/stddef.h Mon Nov 28 18:36:37 2016 (r309258) @@ -62,6 +62,14 @@ typedef ___wchar_t wchar_t; #endif #endif +#if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L +#ifndef __CLANG_MAX_ALIGN_T_DEFINED +typedef __max_align_t max_align_t; +#define __CLANG_MAX_ALIGN_T_DEFINED +#define __GCC_MAX_ALIGN_T +#endif +#endif + #define offsetof(type, member) __offsetof(type, member) #endif /* _STDDEF_H_ */ Modified: stable/11/sys/sys/_types.h ============================================================================== --- stable/11/sys/sys/_types.h Mon Nov 28 17:55:32 2016 (r309257) +++ stable/11/sys/sys/_types.h Mon Nov 28 18:36:37 2016 (r309258) @@ -100,6 +100,11 @@ typedef __uint_least32_t __char32_t; #define _CHAR32_T_DECLARED #endif +typedef struct { + long long __max_align1 __aligned(_Alignof(long long)); + long double __max_align2 __aligned(_Alignof(long double)); +} __max_align_t; + typedef __uint32_t __dev_t; /* device number */ typedef __uint32_t __fixpt_t; /* fixed point number */ From owner-svn-src-all@freebsd.org Mon Nov 28 19:44:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BD0DC5AD92; Mon, 28 Nov 2016 19:44:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 422F71173; Mon, 28 Nov 2016 19:44:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:7b8:3a7::704c:f7e5:d757:16ee] (unknown [IPv6:2001:7b8:3a7:0:704c:f7e5:d757:16ee]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 9CF0842AD6; Mon, 28 Nov 2016 20:44:54 +0100 (CET) Content-Type: multipart/signed; boundary="Apple-Mail=_1DFD626C-61B2-40F3-81EA-106D7F9D6D66"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r309124 - in head: . contrib/compiler-rt contrib/compiler-rt/include/sanitizer contrib/compiler-rt/lib/asan contrib/compiler-rt/lib/builtins contrib/compiler-rt/lib/builtins/arm contrib... From: Dimitry Andric In-Reply-To: Date: Mon, 28 Nov 2016 20:44:47 +0100 Cc: Glen Barber , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <0D261A71-8296-4CA7-8E6B-0E0B104E5142@FreeBSD.org> References: <201611242254.uAOMswkb081748@repo.freebsd.org> To: Kyle Evans X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 19:44:58 -0000 --Apple-Mail=_1DFD626C-61B2-40F3-81EA-106D7F9D6D66 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 28 Nov 2016, at 03:20, Kyle Evans wrote: > > On Thu, Nov 24, 2016 at 4:54 PM, Dimitry Andric wrote: >> Author: dim >> Date: Thu Nov 24 22:54:55 2016 >> New Revision: 309124 >> URL: https://svnweb.freebsd.org/changeset/base/309124 >> >> Log: >> Upgrade our copies of clang, llvm, lldb, compiler-rt and libc++ to 3.9.0 >> release, and add lld 3.9.0. Also completely revamp the build system for >> clang, llvm, lldb and their related tools. ... > Unfortunately, this commit seems to have done away with the -clang > pkgbase pkg [1], and doesn't seem to have revived the PACKAGE= > elsewhere as FreeBSD-clang has disappeared from my newly built > repository. =( Sorry about that. I have submitted the following review to make amends: https://reviews.freebsd.org/D8666 -Dimitry --Apple-Mail=_1DFD626C-61B2-40F3-81EA-106D7F9D6D66 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----- Version: GnuPG/MacGPG2 v2.0.30 iEYEARECAAYFAlg8iTcACgkQsF6jCi4glqP4mgCeNvfmD6sh8nDBFil1IR9KwzoP GjsAoNPTe5Mx+tOPRrEUoaXU4iKdM3k8 =P+0F -----END PGP SIGNATURE----- --Apple-Mail=_1DFD626C-61B2-40F3-81EA-106D7F9D6D66-- From owner-svn-src-all@freebsd.org Mon Nov 28 20:06:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B4C3C58381; Mon, 28 Nov 2016 20:06:24 +0000 (UTC) (envelope-from kevans91@ksu.edu) Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0046.outbound.protection.outlook.com [104.47.33.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B961F1DB0; Mon, 28 Nov 2016 20:06:23 +0000 (UTC) (envelope-from kevans91@ksu.edu) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ksu.edu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=GHLEIxr+lwjcATsaOrsxWM4i1UHKNoqer55oIQNdvZ0=; b=avf7C7trtIcEXhi4akbynoiY4bV4akHuzwc4uFOBnOl/V3d/1FdS0gUFEPHx4O3W59ZixIR+q3bz4BxKCLkuKqQ3eXhmUGViAzvH8/9eMPDkCX7lfbyb+GjB0ZIiZBuqv1zVbyQh/6DBIPGkjCVEvIHang5vFyO7XNvDEsBfFM4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kevans91@ksu.edu; Received: from mail-yw0-f172.google.com (209.85.161.172) by BN3PR0501MB1316.namprd05.prod.outlook.com (10.160.183.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.761.5; Mon, 28 Nov 2016 19:51:10 +0000 Received: by mail-yw0-f172.google.com with SMTP id r204so123968670ywb.0; Mon, 28 Nov 2016 11:51:10 -0800 (PST) X-Gm-Message-State: AKaTC03cHs9ezEZEWrt3ONqjPs38zH2ioyPYIkHt33KZ/nrNfZhpSyPCdXj/UWEYikC/arIVFZZMZuE6b9p8kQ== X-Received: by 10.129.179.8 with SMTP id r8mr27021166ywh.156.1480362664964; Mon, 28 Nov 2016 11:51:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.22.196 with HTTP; Mon, 28 Nov 2016 11:50:44 -0800 (PST) In-Reply-To: <0D261A71-8296-4CA7-8E6B-0E0B104E5142@FreeBSD.org> References: <201611242254.uAOMswkb081748@repo.freebsd.org> <0D261A71-8296-4CA7-8E6B-0E0B104E5142@FreeBSD.org> From: Kyle Evans Date: Mon, 28 Nov 2016 13:50:44 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r309124 - in head: . contrib/compiler-rt contrib/compiler-rt/include/sanitizer contrib/compiler-rt/lib/asan contrib/compiler-rt/lib/builtins contrib/compiler-rt/lib/builtins/arm contrib... To: Dimitry Andric CC: Glen Barber , , , Content-Type: text/plain; charset="UTF-8" X-Originating-IP: [209.85.161.172] X-ClientProxiedBy: SN2PR18CA0005.namprd18.prod.outlook.com (10.169.189.15) To BN3PR0501MB1316.namprd05.prod.outlook.com (10.160.183.17) X-MS-Office365-Filtering-Correlation-Id: 707b4ae3-f5dd-4f39-086b-08d417c7e6c0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN3PR0501MB1316; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0501MB1316; 3:BS3zytaV6XhHw8rYpbAFHaMdHsqLAnonJm7JYHbc+rOt6rOEugxO2EB06bJf+JR0RiW5I0PFzpOBuPcew0gtwXO1Q0RIg0PJoQbax02VUKKFE86MUy2ZeEQ/z9JdbMFwr86XWU08j3ApbRTyPtbCNJEeC8zyZQIAztxyTHuo4rHXl7rrpDIwtmUc2U9+qkTKLcIi5aEGb5YL9itsGD77zgOlKCNA8GPUs9p7TCeVLBFDCWAvXoosE7y7GHXoFWS3P3Fft1ZfwTMUVrRvmp1SDA== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0501MB1316; 25:Ig2kgGe/agmaBdg03R/tp1jBtzB/A4Bc7ypqZsPkMJ1Cl4BivMu2Q7ap5Snn4oSlt3n0nKJnS4vWbHSbh5RntIBuFZIukX0RRWRKK6yqJG+Gdu59BC3tmShceWLnrA+locZV3ZYYjvR0uQl6mqjgNE8cJzRY/rCXLt3+doeUobgbW8omn5Iun0f644c9mevfF4s+nwvyGZ5p5iNLk45CHehOSLKG6NjFlpDRCpxVhQPtEKi3SztK8IoJ2pxNIiadEwxJRN3FQ6J42mvl+rxsuMaGLWcCk4lTpb1kuRX2b5rwlDm/VNS2s5TZFXFiYMYphaCzAjqWmERyvdXBD1J5Qkz9nrSBBb6/f61TLnhaYamud8NIkQLFjwujw5bweAqUova2JoSynB534q5jVSKBNugmksMeFniz5DwvI/qP7U0T1HvREEmKgMNea3sCfMj5pZlOq4PH1fke9StTiTsf1Gh8/Kqw1z96B+8Ms1VIt3KROcDnQFOkNJklyykWiwfjAumB3zA4KFl0ILGUHNSY5MZ5PV/GG8xuKlik0chuAjmsgLPuAQYby3BROzJkbJQstOrvXiPgeJMvRAxYp4HUUeIlnVbH9aDNf6REMN+d3tNbu/I9i/bOc5BqXCnc4iJvyQvHsE9sLxIkk5TeviX7nMFbMo+flU5gILvPPBKS8n2aP2TKY81efGFHAQNQ6JKD5O4JYy5tN5NMinm2sGhydHhHjRaZlHjY0kubTvOj1L2dUVHeVrp6C9KJ4QUXi/YGvWD3Y2MaWi66+T+Oa9M8WDDxCMxAE1sJDUNVy+G3Y7zRQYHhmSnin7krc5+iAFN/SvqfXioCNz2MC/8knPePIr4Eqpa226aQQ4m1MZKqAeW3WnGuJ+p5LqdRinUHNODe X-Microsoft-Exchange-Diagnostics: 1; BN3PR0501MB1316; 31:svvzJMA+acSVMgKMIIuVh6WLDX9cYGvALJFkzF3yVZo3yxENi9pf70XlHoU/Wbxh628bNnVAXaz8jdqbYkGNi+2H89J56s+Mm9dQDLH2uxmR4IUoOfdRI2MYa59X56z0gAMjpW0E4p9QdVjOgO69HuuDG4KcXaKC70UetJ6Z6Sm3vQCYXuCxoF/disoxmV5XUqBmfeO4NlwVjqLxasqF3rCFWteWAjg9y3fBHTHlKpxxYnBb+ng62lY4AVul5psDXgjrpKb6Fp5y1katVKdr3g==; 20:khDV6QvqgP5kpq51TNlvYHGDcR3Ik5tLQpLU+l0zMmTzX2WGyqnO9QaUC4gyCNlxbG6K+LUBHREE1eeOdq2VAFMrwjn8wwWbC+aiOi4iPusv8gNYif1724q2RY/DE2BSVJmR3Udht9KKaaOedXtDbPEBZQ+ZHQYnFHSyfMtMUse0pvFKztGgOe3B/C6bLPL0lOYwHAjLCvN1qzlYprnKw1MC+b8f+zDn+zwfif/kglMCOK4X2eZXAuif2vyHGzozd2Y9biBjoAA+xthO/XScwaGJSUcWQiXzCOrbTIsagby6yv+koA0vKPeNEHn/4VjXB/iyAjixGUPWzqskwmp0n9vjjBqTNO4ZCGAy9grM7QpCEVLjOhgsxVZVILKvjoCcif70M1o2NmPwl/VRqhmk8ibgTvreYZRnCndk6hwU9Qe28xygi/BQLC7m+v2dG7pZaRjKZlz3V6MPM6v0fapXy6RwOzOpWNF8mhXxjb4cBaGpsYFyEES4QeDdQzjNrNoP X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(56005881305849)(112903893386949); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6060326)(6040361)(6045199)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(6061324)(20161123562025)(20161123564025)(20161123560025)(20161123555025); SRVR:BN3PR0501MB1316; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0501MB1316; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0501MB1316; 4:eGOKMOHt14T7qU0kcTuLngnuSBFotlgqPLWN/GuBavmGDtPe4t4DrwGdxyWgc7qhr0FzIRKw455vSA8uQA6319MTJT8GaqTrl1k5lwXRbefZcW2Cf/vQcfSopO/XICKQOr5/XK9XzqLAnSKBY75pLTZ1X9Q5nUqXxwuz1qYnQxvGN9eNK3pdCDhSjYztCeCaNGoYfITDP0k5ELW/rYzIIMsQhU0TxezRcv/hK88mNT82QUkOpDHInEhNMIBp1UICPKQSHyhizplNs2uglDPct/DPIHQaBIz6NBPEKtoh0lhhcDMEM0fMKGmMngK5A4HHX6le+9z+g68r8NxPQbtdSBGbwX8SZtr9nzVq3SW3JVOJUKscQ3h7II3LmenRmdssY6uZ5xj9+DX15YAVLg1s1kJAN8DKUw4xRhzSBoCVyrNyjdoqsNkZiPFIKZ2KJhe6AjQbGaW9neM2nTpTG20dsesr4nNixF/HS8uBiNlEtSxNYqvMVnglW0y3kM/GzdYiNoO7MIxqlmbEniqI/6Czv229iVVIRCjYzLNn5McgNHOO1h/wopdwlaGuQq0kE6mVW50DlQ9uckD4g3U2w+K+JO0S6eTl7S5OcmMAKhutJp5FWcAN02wqlEZQY27qnZtJ/zvin9sUE7VXoTY0ZDTyyFRHbD06HOVzr9SMTItPsUKnxrOcmA++N3/qLXpOam6C X-Forefront-PRVS: 01401330D1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(199003)(24454002)(189002)(377454003)(122856001)(110136003)(39380400001)(88552002)(66066001)(50466002)(5660300001)(59536001)(39400400001)(81156014)(81166006)(42186005)(39450400002)(69596002)(92566002)(106356001)(101416001)(105586002)(61266001)(47776003)(63696999)(54356999)(89122001)(86362001)(93516999)(90282001)(76176999)(189998001)(3846002)(61726006)(68736007)(229853002)(4326007)(7736002)(2906002)(50986999)(7846002)(6916009)(38730400001)(8676002)(2950100002)(55446002)(9686002)(75432002)(6116002)(97736004)(23676002)(5820100001)(9896002)(450100001)(305945005)(55456009); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0501MB1316; H:mail-yw0-f172.google.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: ksu.edu does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjNQUjA1MDFNQjEzMTY7MjM6UUZkVTZ5L0gwdHhwSXEvLzNRWWlYdnJk?= =?utf-8?B?TDUxekc1KzJudVB3ZHk3d3dZQzNaRUJ3cXdlUUJtMVhWN1NJN1d2UVVtWDZL?= =?utf-8?B?OTRPcVdzWWlXQ2QxbmFDRFNWUVo3SG05b1R0SVArckc3ZVAwV2xZSVc1Q2NQ?= =?utf-8?B?bVFhWi9OcHphSjdXdjNPTzZqTHhHbnppV0ZVTlA4TFhPZzl2YVFRVWcyUWgy?= =?utf-8?B?dUx2MDZLUm02YXE3UUN3YXpPTytINkFob1hRRk9ZV3FqZlNmeXZaenVhQXZG?= =?utf-8?B?TEhXOUVJanhFWmQwcUQ2bkJvNkhVVHF1bERpSjJzNWh1c0RLelEwRFdjTkly?= =?utf-8?B?Q085OUFXMFZWL2NNdExsZndjS0p5UXZTZ0lxYzM0Y3NxV3ZiRjlQVlRwVVgy?= =?utf-8?B?VENzUUpBbTFiL09qVXRUdmtpWDA3U3dFQ1c0NXZQYVRYVjMvRjlWeTFTMzcw?= =?utf-8?B?VmcxTGtlZjdTSjA2YWlocUZEbEdVSkNFaHdlZW9RNHpWVlNmeUtQaDZzbWFD?= =?utf-8?B?Z2xnL3p0VE1hanA3bi9hcE16QmVod2dobkJ4QWJLWm80bEViNWNwUjdvWUtK?= =?utf-8?B?Q3laY1E0dDFCMmcxMXhBYlEyUzhrNlE1NDdFODliTnZlYXRtOG9HMmJHVUlm?= =?utf-8?B?VHVKYWJaTDZDUXpzeVNrU3VUNEtFLzZ2N3hyNGQ1VHg3UGJXdjRydklVV2U1?= =?utf-8?B?WTliRjBlN2R5SzI0UEVMQmdQVEJpcVc5WTk5TVg1ZnZMOHhPWU11T0xwOW0x?= =?utf-8?B?WDQrcFBxQTQxcXdLSDJGL1lENTBkSTE4NGpSVXlyakF0N2RWTUp5OHFRV0NL?= =?utf-8?B?NVEvRkk0eDBVdGNvUzEwTVZTYVcvZU94NW95a1BwVldLREtkNDAyQTFvdnN1?= =?utf-8?B?TEN1Yy9pR3prc0F1Qy9ONFhPWHJuTENwUFVvRTZtSVZPKzRFa2pZOUNkdjZz?= =?utf-8?B?SE4xZnZGNHRyNDU3d1QrSWY5dVdIbGRhQmIrNG9KTVlzYmVjeFdSQnFKMVA2?= =?utf-8?B?UjcrTm5rZEdMRHdJRHhtWmFhU2xFYXhZek11VjhZc0lXWEM5cUlLZXBwNUhR?= =?utf-8?B?dXc0RE9oOWRvSFZZQVRPL3gxaVFZdVdCTDVMVXR4Sk9oa0pGSDJRUGpvcDdT?= =?utf-8?B?TlJ4S2p0cmJzZlpWOWdESVBOdTFZSDNtU0crcXRCZWpHcnl6QmY2R0RPN1k2?= =?utf-8?B?VmhKaFh4TXZBandUSkZJdHdPZzhqMTZoeUlnUGhHVHdrd3pJV1U1Mk8yODV3?= =?utf-8?B?NmdvMzdldHpRZmVNSkJvbzdQTUdGQnUzTitEM0xVTWdqcC9Gejd3cGdnYUN2?= =?utf-8?B?VkhZK2YxeWoxRGVLd0FoSjVVRXRvTjQ5b3RON2RIV1FJdytnNThjSXJ5aEln?= =?utf-8?B?STJERFNZNWVrNGhmOHdFQnRJakFsNVNRMlB6b1VvWktPd2NHQ3p1Q1Nybjkz?= =?utf-8?B?VEg1Ym9XRWtwWHhPa1owdnlZL2o1UnpwYzJNazZsQ0Y3ZU1vd2wxTEtGcGo4?= =?utf-8?B?WHJaUStVZ1J3L29uK25CbFFHOWRQZk1EM1JzeDFkV3pYTmNEYjZZclhxVXBG?= =?utf-8?B?dnZNZ3MzZ3UvT1J0MUhRaTczaUVacnh3dVBReFRneWY0SjZ6aHJPNU5QUjdi?= =?utf-8?B?VHYzYmpxdytFRzhFMm5naENzUUVmaXZiVzZUWG1WczI2a01VSmMvR1hTWXN6?= =?utf-8?B?cjcyVk1jdTBlbTEyb2N5aCtvVTRvMDZDcDZBYUhISG8yRHc2MlFCOWIyMWQr?= =?utf-8?B?d0RqWTgvaXVDRWhyWGVyb3p1RVNYTFNxQkJwRUtTTXFoNSt6L01aTWN2MVZO?= =?utf-8?B?aVVQaTc0OVRFaE5ZQjJjUGo1d2pJVlI4VGV2NklVMWsyS2pkY3RnSnNxTDNU?= =?utf-8?B?YzJEaGkwbFF6QXZlRGJEUldJbGdzR0ZLcm8wdHFTOTkzVGhmSHhINzdGc3R1?= =?utf-8?B?clVKQk1MYUFucnc9PQ==?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0501MB1316; 6:vuiZGPtAxFau2zzYzce5fZYzZUVvi0m/MzrA26EKUbjT+3SaV3boo6RTg6Uk4q1Buh/xGHPG9MHshUwinMzsE/iW81XQlGAUxgTRo9q93C69tZ1fNcqng2MIvVnOr9pYeOEJLdyjwWCUvU8CD9yVY/8J5YwvbnW0H3h2SrntJdeqH3MpM/4MyWXiWeAwx2SON2ODJWch/vDG5MreEygEn6EnWR+DIXD7MhcUWrHbtPcoiKlYQmskdBaf/rAE6UUuWkZPjud33sWA40r0WZFR99ZAtk7jjFugUSqrQ8RiukDFG+PXLMPjSl4ckICJRCY+z/zcJpOzJhAafO0RkVCjANTdux6wSVuyVM07gLxido3emk26gtTBPdxDYoxl82Su8iDZJPQpHECzXFQ2OTLRIhH6IjryDWSpjJae/EFLNzny4IQziqP8AR9YEZ7WBtDeD12LT+iRbDevOcHAGcKHMg==; 5:peAJmaW8KJLV5iHWtuGYpKcGYJIvvJbbLu3/5pR7kirxv+iYbccjyzIQq2g5XBwUWAEE3bVErfxXC2mrXxME+dDAUXdsY5nbXei3Ly21FMz86exg12Zd1UvFw5NL20DKLISLgVLcDl+453yVC/n1DT2fTk4j+sQp9e/Yd6SXgEk=; 24:y7tGN5IRG8VGUrrykHkmmawKo2nQTGgxNuSJY+k9khKMm/l9Ql9mQbI/lFQJ7/DeWhLNKzp7B0WtzeMnCUEtR2+Ad+QUhW1YonHsKld/2c4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN3PR0501MB1316; 7:sL3UMRPW8VFMu4GhPAIBYx7aZaeyqTu/izkPe2nDRgTWrbU2Jx+n8mMI4TpwVF+Eot0XBRpN+GJF67DGPJJYu1rg9rEoNV5eRd+qYcYUVnnK+7UByx1KSCB7cFyCqf6ydY2q4vCWrrbj00PBVCmBx2jWM+w2wFPz7G7LDwEHzERHD3vYuSdk3K6uFpbSp1IXJCTBxIuQq0zaFyuh/vb7IJplmG6uFReK0x6i+98aYxmNXfqUNGy5PX8XdRhqiN+K3x/W+PnfQbWv1H5OZyCSbT90xHZMKnB2UwxozxnpcvqjqYN39p/7mLz7/hhAaCY+qgOoSBskJfxYg3I/XxYeLZZ8Wvck52Ec762bqWsFQkXfil7egSo6Dx4HFnQnhgpjF0V8ZXW9KYtms8Q5hAK6oN2/KYv0sgIUhO4wM6JGJMaqEc3AFuJcMjP1r8ErtAP7bwuW1Y0Xyo2f4bmQU6E0BQ==; 20:o4YpwTtIOWW1ED3X/JpRovy8nesUgsaPOo0PEcfdlYXF/5moh9bvkNYXDgxkikR/YtZpkHXlqEr93BzPBSVc2XHMihn9/8T4jo2DKn3qx2aoLdHhK22xyPwZeTdUZekbt6Q5cFgnaPZP29hbc4DXDTPiHFxVZLD/Yrp5Mj9hOC8= X-OriginatorOrg: ksu.edu X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2016 19:51:10.3328 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0501MB1316 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 20:06:24 -0000 On Mon, Nov 28, 2016 at 1:44 PM, Dimitry Andric wrote: > On 28 Nov 2016, at 03:20, Kyle Evans wrote: >> >> On Thu, Nov 24, 2016 at 4:54 PM, Dimitry Andric wrote: >>> Author: dim >>> Date: Thu Nov 24 22:54:55 2016 >>> New Revision: 309124 >>> URL: https://svnweb.freebsd.org/changeset/base/309124 >>> >>> Log: >>> Upgrade our copies of clang, llvm, lldb, compiler-rt and libc++ to 3.9.0 >>> release, and add lld 3.9.0. Also completely revamp the build system for >>> clang, llvm, lldb and their related tools. > ... >> Unfortunately, this commit seems to have done away with the -clang >> pkgbase pkg [1], and doesn't seem to have revived the PACKAGE= >> elsewhere as FreeBSD-clang has disappeared from my newly built >> repository. =( > > Sorry about that. I have submitted the following review to make amends: > > https://reviews.freebsd.org/D8666 > > -Dimitry > Thanks! I had a brief moment of panic where I thought perhaps this meant clang would be omitted from the upgraded system as the old -clang package got removed upon upgrade. Of course, I was pleasantly surprised to find that the lack of PACKAGE= just meant a fallback to the -runtime package -- this design I like, even though the -clang package is desired. =) Kyle Evans From owner-svn-src-all@freebsd.org Mon Nov 28 20:08:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1C0DC5841A; Mon, 28 Nov 2016 20:08:55 +0000 (UTC) (envelope-from cognet@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 6619A1F5A; Mon, 28 Nov 2016 20:08:55 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASK8sUL046184; Mon, 28 Nov 2016 20:08:54 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASK8rWS046168; Mon, 28 Nov 2016 20:08:53 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201611282008.uASK8rWS046168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Mon, 28 Nov 2016 20:08:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r309260 - in vendor-sys/ck: . dist dist/build dist/doc dist/include dist/include/gcc dist/include/gcc/aarch64 dist/include/gcc/arm dist/include/gcc/ppc dist/include/gcc/ppc64 dist/inclu... X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 20:08:55 -0000 Author: cognet Date: Mon Nov 28 20:08:52 2016 New Revision: 309260 URL: https://svnweb.freebsd.org/changeset/base/309260 Log: Import concurrencykit as of commit 566bb28dba963a1904e0889b74fe7005a5bc5eb8 Added: vendor-sys/ck/ vendor-sys/ck/dist/ vendor-sys/ck/dist/LICENSE vendor-sys/ck/dist/Makefile.in (contents, props changed) vendor-sys/ck/dist/README vendor-sys/ck/dist/build/ vendor-sys/ck/dist/build/ck.build.aarch64 (contents, props changed) vendor-sys/ck/dist/build/ck.build.arm vendor-sys/ck/dist/build/ck.build.in (contents, props changed) vendor-sys/ck/dist/build/ck.build.ppc vendor-sys/ck/dist/build/ck.build.ppc64 vendor-sys/ck/dist/build/ck.build.sparcv9 vendor-sys/ck/dist/build/ck.build.x86 vendor-sys/ck/dist/build/ck.build.x86_64 vendor-sys/ck/dist/build/ck.pc.in (contents, props changed) vendor-sys/ck/dist/build/ck.spec.in (contents, props changed) vendor-sys/ck/dist/build/regressions.build.in (contents, props changed) vendor-sys/ck/dist/configure (contents, props changed) vendor-sys/ck/dist/doc/ vendor-sys/ck/dist/doc/CK_ARRAY_FOREACH vendor-sys/ck/dist/doc/CK_COHORT_INIT vendor-sys/ck/dist/doc/CK_COHORT_INSTANCE vendor-sys/ck/dist/doc/CK_COHORT_LOCK vendor-sys/ck/dist/doc/CK_COHORT_PROTOTYPE vendor-sys/ck/dist/doc/CK_COHORT_TRYLOCK vendor-sys/ck/dist/doc/CK_COHORT_TRYLOCK_PROTOTYPE vendor-sys/ck/dist/doc/CK_COHORT_UNLOCK vendor-sys/ck/dist/doc/CK_HS_HASH vendor-sys/ck/dist/doc/CK_RHS_HASH vendor-sys/ck/dist/doc/CK_RWCOHORT_INIT vendor-sys/ck/dist/doc/CK_RWCOHORT_INSTANCE vendor-sys/ck/dist/doc/CK_RWCOHORT_PROTOTYPE vendor-sys/ck/dist/doc/CK_RWCOHORT_READ_LOCK vendor-sys/ck/dist/doc/CK_RWCOHORT_READ_UNLOCK vendor-sys/ck/dist/doc/CK_RWCOHORT_WRITE_LOCK vendor-sys/ck/dist/doc/CK_RWCOHORT_WRITE_UNLOCK vendor-sys/ck/dist/doc/Makefile.in (contents, props changed) vendor-sys/ck/dist/doc/ck_array_buffer vendor-sys/ck/dist/doc/ck_array_commit vendor-sys/ck/dist/doc/ck_array_deinit vendor-sys/ck/dist/doc/ck_array_init vendor-sys/ck/dist/doc/ck_array_initialized vendor-sys/ck/dist/doc/ck_array_length vendor-sys/ck/dist/doc/ck_array_put vendor-sys/ck/dist/doc/ck_array_put_unique vendor-sys/ck/dist/doc/ck_array_remove vendor-sys/ck/dist/doc/ck_bitmap_base vendor-sys/ck/dist/doc/ck_bitmap_bits vendor-sys/ck/dist/doc/ck_bitmap_bts vendor-sys/ck/dist/doc/ck_bitmap_buffer vendor-sys/ck/dist/doc/ck_bitmap_clear vendor-sys/ck/dist/doc/ck_bitmap_init vendor-sys/ck/dist/doc/ck_bitmap_iterator_init vendor-sys/ck/dist/doc/ck_bitmap_next vendor-sys/ck/dist/doc/ck_bitmap_reset vendor-sys/ck/dist/doc/ck_bitmap_set vendor-sys/ck/dist/doc/ck_bitmap_size vendor-sys/ck/dist/doc/ck_bitmap_test vendor-sys/ck/dist/doc/ck_bitmap_union vendor-sys/ck/dist/doc/ck_brlock vendor-sys/ck/dist/doc/ck_cohort vendor-sys/ck/dist/doc/ck_elide vendor-sys/ck/dist/doc/ck_epoch_barrier vendor-sys/ck/dist/doc/ck_epoch_begin vendor-sys/ck/dist/doc/ck_epoch_call vendor-sys/ck/dist/doc/ck_epoch_end vendor-sys/ck/dist/doc/ck_epoch_init vendor-sys/ck/dist/doc/ck_epoch_poll vendor-sys/ck/dist/doc/ck_epoch_reclaim vendor-sys/ck/dist/doc/ck_epoch_recycle vendor-sys/ck/dist/doc/ck_epoch_register vendor-sys/ck/dist/doc/ck_epoch_synchronize vendor-sys/ck/dist/doc/ck_epoch_unregister vendor-sys/ck/dist/doc/ck_hs_apply vendor-sys/ck/dist/doc/ck_hs_count vendor-sys/ck/dist/doc/ck_hs_destroy vendor-sys/ck/dist/doc/ck_hs_fas vendor-sys/ck/dist/doc/ck_hs_gc vendor-sys/ck/dist/doc/ck_hs_get vendor-sys/ck/dist/doc/ck_hs_grow vendor-sys/ck/dist/doc/ck_hs_init vendor-sys/ck/dist/doc/ck_hs_iterator_init vendor-sys/ck/dist/doc/ck_hs_move vendor-sys/ck/dist/doc/ck_hs_next vendor-sys/ck/dist/doc/ck_hs_put vendor-sys/ck/dist/doc/ck_hs_put_unique vendor-sys/ck/dist/doc/ck_hs_rebuild vendor-sys/ck/dist/doc/ck_hs_remove vendor-sys/ck/dist/doc/ck_hs_reset vendor-sys/ck/dist/doc/ck_hs_reset_size vendor-sys/ck/dist/doc/ck_hs_set vendor-sys/ck/dist/doc/ck_hs_stat vendor-sys/ck/dist/doc/ck_ht_count vendor-sys/ck/dist/doc/ck_ht_destroy vendor-sys/ck/dist/doc/ck_ht_entry_empty vendor-sys/ck/dist/doc/ck_ht_entry_key vendor-sys/ck/dist/doc/ck_ht_entry_key_direct vendor-sys/ck/dist/doc/ck_ht_entry_key_length vendor-sys/ck/dist/doc/ck_ht_entry_key_set vendor-sys/ck/dist/doc/ck_ht_entry_key_set_direct vendor-sys/ck/dist/doc/ck_ht_entry_set vendor-sys/ck/dist/doc/ck_ht_entry_set_direct vendor-sys/ck/dist/doc/ck_ht_entry_value vendor-sys/ck/dist/doc/ck_ht_entry_value_direct vendor-sys/ck/dist/doc/ck_ht_gc vendor-sys/ck/dist/doc/ck_ht_get_spmc vendor-sys/ck/dist/doc/ck_ht_grow_spmc vendor-sys/ck/dist/doc/ck_ht_hash vendor-sys/ck/dist/doc/ck_ht_hash_direct vendor-sys/ck/dist/doc/ck_ht_init vendor-sys/ck/dist/doc/ck_ht_iterator_init vendor-sys/ck/dist/doc/ck_ht_next vendor-sys/ck/dist/doc/ck_ht_put_spmc vendor-sys/ck/dist/doc/ck_ht_remove_spmc vendor-sys/ck/dist/doc/ck_ht_reset_size_spmc vendor-sys/ck/dist/doc/ck_ht_reset_spmc vendor-sys/ck/dist/doc/ck_ht_set_spmc vendor-sys/ck/dist/doc/ck_ht_stat vendor-sys/ck/dist/doc/ck_pflock vendor-sys/ck/dist/doc/ck_pr vendor-sys/ck/dist/doc/ck_pr_add vendor-sys/ck/dist/doc/ck_pr_and vendor-sys/ck/dist/doc/ck_pr_barrier vendor-sys/ck/dist/doc/ck_pr_btc vendor-sys/ck/dist/doc/ck_pr_btr vendor-sys/ck/dist/doc/ck_pr_bts vendor-sys/ck/dist/doc/ck_pr_cas vendor-sys/ck/dist/doc/ck_pr_dec vendor-sys/ck/dist/doc/ck_pr_faa vendor-sys/ck/dist/doc/ck_pr_fas vendor-sys/ck/dist/doc/ck_pr_fence_acquire vendor-sys/ck/dist/doc/ck_pr_fence_atomic vendor-sys/ck/dist/doc/ck_pr_fence_atomic_load vendor-sys/ck/dist/doc/ck_pr_fence_atomic_store vendor-sys/ck/dist/doc/ck_pr_fence_load vendor-sys/ck/dist/doc/ck_pr_fence_load_atomic vendor-sys/ck/dist/doc/ck_pr_fence_load_depends vendor-sys/ck/dist/doc/ck_pr_fence_load_store vendor-sys/ck/dist/doc/ck_pr_fence_memory vendor-sys/ck/dist/doc/ck_pr_fence_release vendor-sys/ck/dist/doc/ck_pr_fence_store vendor-sys/ck/dist/doc/ck_pr_fence_store_atomic vendor-sys/ck/dist/doc/ck_pr_fence_store_load vendor-sys/ck/dist/doc/ck_pr_inc vendor-sys/ck/dist/doc/ck_pr_load vendor-sys/ck/dist/doc/ck_pr_neg vendor-sys/ck/dist/doc/ck_pr_not vendor-sys/ck/dist/doc/ck_pr_or vendor-sys/ck/dist/doc/ck_pr_rtm vendor-sys/ck/dist/doc/ck_pr_stall vendor-sys/ck/dist/doc/ck_pr_store vendor-sys/ck/dist/doc/ck_pr_sub vendor-sys/ck/dist/doc/ck_pr_xor vendor-sys/ck/dist/doc/ck_queue vendor-sys/ck/dist/doc/ck_rhs_apply vendor-sys/ck/dist/doc/ck_rhs_count vendor-sys/ck/dist/doc/ck_rhs_destroy vendor-sys/ck/dist/doc/ck_rhs_fas vendor-sys/ck/dist/doc/ck_rhs_gc vendor-sys/ck/dist/doc/ck_rhs_get vendor-sys/ck/dist/doc/ck_rhs_grow vendor-sys/ck/dist/doc/ck_rhs_init vendor-sys/ck/dist/doc/ck_rhs_iterator_init vendor-sys/ck/dist/doc/ck_rhs_move vendor-sys/ck/dist/doc/ck_rhs_next vendor-sys/ck/dist/doc/ck_rhs_put vendor-sys/ck/dist/doc/ck_rhs_put_unique vendor-sys/ck/dist/doc/ck_rhs_rebuild vendor-sys/ck/dist/doc/ck_rhs_remove vendor-sys/ck/dist/doc/ck_rhs_reset vendor-sys/ck/dist/doc/ck_rhs_reset_size vendor-sys/ck/dist/doc/ck_rhs_set vendor-sys/ck/dist/doc/ck_rhs_set_load_factor vendor-sys/ck/dist/doc/ck_rhs_stat vendor-sys/ck/dist/doc/ck_ring_capacity vendor-sys/ck/dist/doc/ck_ring_dequeue_spmc vendor-sys/ck/dist/doc/ck_ring_dequeue_spsc vendor-sys/ck/dist/doc/ck_ring_enqueue_spmc vendor-sys/ck/dist/doc/ck_ring_enqueue_spmc_size vendor-sys/ck/dist/doc/ck_ring_enqueue_spsc vendor-sys/ck/dist/doc/ck_ring_enqueue_spsc_size vendor-sys/ck/dist/doc/ck_ring_init vendor-sys/ck/dist/doc/ck_ring_size vendor-sys/ck/dist/doc/ck_ring_trydequeue_spmc vendor-sys/ck/dist/doc/ck_rwcohort vendor-sys/ck/dist/doc/ck_rwlock vendor-sys/ck/dist/doc/ck_sequence vendor-sys/ck/dist/doc/ck_spinlock vendor-sys/ck/dist/doc/ck_swlock vendor-sys/ck/dist/doc/ck_tflock vendor-sys/ck/dist/doc/refcheck.pl (contents, props changed) vendor-sys/ck/dist/include/ vendor-sys/ck/dist/include/ck_array.h (contents, props changed) vendor-sys/ck/dist/include/ck_backoff.h (contents, props changed) vendor-sys/ck/dist/include/ck_barrier.h (contents, props changed) vendor-sys/ck/dist/include/ck_bitmap.h (contents, props changed) vendor-sys/ck/dist/include/ck_brlock.h (contents, props changed) vendor-sys/ck/dist/include/ck_bytelock.h (contents, props changed) vendor-sys/ck/dist/include/ck_cc.h (contents, props changed) vendor-sys/ck/dist/include/ck_cohort.h (contents, props changed) vendor-sys/ck/dist/include/ck_elide.h (contents, props changed) vendor-sys/ck/dist/include/ck_epoch.h (contents, props changed) vendor-sys/ck/dist/include/ck_fifo.h (contents, props changed) vendor-sys/ck/dist/include/ck_hp.h (contents, props changed) vendor-sys/ck/dist/include/ck_hp_fifo.h (contents, props changed) vendor-sys/ck/dist/include/ck_hp_stack.h (contents, props changed) vendor-sys/ck/dist/include/ck_hs.h (contents, props changed) vendor-sys/ck/dist/include/ck_ht.h (contents, props changed) vendor-sys/ck/dist/include/ck_limits.h (contents, props changed) vendor-sys/ck/dist/include/ck_malloc.h (contents, props changed) vendor-sys/ck/dist/include/ck_md.h.in (contents, props changed) vendor-sys/ck/dist/include/ck_pflock.h (contents, props changed) vendor-sys/ck/dist/include/ck_pr.h (contents, props changed) vendor-sys/ck/dist/include/ck_queue.h (contents, props changed) vendor-sys/ck/dist/include/ck_rhs.h (contents, props changed) vendor-sys/ck/dist/include/ck_ring.h (contents, props changed) vendor-sys/ck/dist/include/ck_rwcohort.h (contents, props changed) vendor-sys/ck/dist/include/ck_rwlock.h (contents, props changed) vendor-sys/ck/dist/include/ck_sequence.h (contents, props changed) vendor-sys/ck/dist/include/ck_spinlock.h (contents, props changed) vendor-sys/ck/dist/include/ck_stack.h (contents, props changed) vendor-sys/ck/dist/include/ck_stdbool.h (contents, props changed) vendor-sys/ck/dist/include/ck_stddef.h (contents, props changed) vendor-sys/ck/dist/include/ck_stdint.h (contents, props changed) vendor-sys/ck/dist/include/ck_stdlib.h (contents, props changed) vendor-sys/ck/dist/include/ck_string.h (contents, props changed) vendor-sys/ck/dist/include/ck_swlock.h (contents, props changed) vendor-sys/ck/dist/include/ck_tflock.h (contents, props changed) vendor-sys/ck/dist/include/gcc/ vendor-sys/ck/dist/include/gcc/aarch64/ vendor-sys/ck/dist/include/gcc/aarch64/ck_f_pr.h (contents, props changed) vendor-sys/ck/dist/include/gcc/aarch64/ck_pr.h (contents, props changed) vendor-sys/ck/dist/include/gcc/arm/ vendor-sys/ck/dist/include/gcc/arm/ck_f_pr.h (contents, props changed) vendor-sys/ck/dist/include/gcc/arm/ck_pr.h (contents, props changed) vendor-sys/ck/dist/include/gcc/ck_cc.h (contents, props changed) vendor-sys/ck/dist/include/gcc/ck_f_pr.h (contents, props changed) vendor-sys/ck/dist/include/gcc/ck_pr.h (contents, props changed) vendor-sys/ck/dist/include/gcc/ppc/ vendor-sys/ck/dist/include/gcc/ppc/ck_f_pr.h (contents, props changed) vendor-sys/ck/dist/include/gcc/ppc/ck_pr.h (contents, props changed) vendor-sys/ck/dist/include/gcc/ppc64/ vendor-sys/ck/dist/include/gcc/ppc64/ck_f_pr.h (contents, props changed) vendor-sys/ck/dist/include/gcc/ppc64/ck_pr.h (contents, props changed) vendor-sys/ck/dist/include/gcc/sparcv9/ vendor-sys/ck/dist/include/gcc/sparcv9/ck_f_pr.h (contents, props changed) vendor-sys/ck/dist/include/gcc/sparcv9/ck_pr.h (contents, props changed) vendor-sys/ck/dist/include/gcc/x86/ vendor-sys/ck/dist/include/gcc/x86/ck_f_pr.h (contents, props changed) vendor-sys/ck/dist/include/gcc/x86/ck_pr.h (contents, props changed) vendor-sys/ck/dist/include/gcc/x86_64/ vendor-sys/ck/dist/include/gcc/x86_64/ck_f_pr.h (contents, props changed) vendor-sys/ck/dist/include/gcc/x86_64/ck_pr.h (contents, props changed) vendor-sys/ck/dist/include/gcc/x86_64/ck_pr_rtm.h (contents, props changed) vendor-sys/ck/dist/include/spinlock/ vendor-sys/ck/dist/include/spinlock/anderson.h (contents, props changed) vendor-sys/ck/dist/include/spinlock/cas.h (contents, props changed) vendor-sys/ck/dist/include/spinlock/clh.h (contents, props changed) vendor-sys/ck/dist/include/spinlock/dec.h (contents, props changed) vendor-sys/ck/dist/include/spinlock/fas.h (contents, props changed) vendor-sys/ck/dist/include/spinlock/hclh.h (contents, props changed) vendor-sys/ck/dist/include/spinlock/mcs.h (contents, props changed) vendor-sys/ck/dist/include/spinlock/ticket.h (contents, props changed) vendor-sys/ck/dist/regressions/ vendor-sys/ck/dist/regressions/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/Makefile.unsupported (contents, props changed) vendor-sys/ck/dist/regressions/ck_array/ vendor-sys/ck/dist/regressions/ck_array/validate/ vendor-sys/ck/dist/regressions/ck_array/validate/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_array/validate/serial.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_backoff/ vendor-sys/ck/dist/regressions/ck_backoff/validate/ vendor-sys/ck/dist/regressions/ck_backoff/validate/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_backoff/validate/validate.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_barrier/ vendor-sys/ck/dist/regressions/ck_barrier/benchmark/ vendor-sys/ck/dist/regressions/ck_barrier/benchmark/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_barrier/benchmark/throughput.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_barrier/validate/ vendor-sys/ck/dist/regressions/ck_barrier/validate/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_barrier/validate/barrier_centralized.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_barrier/validate/barrier_combining.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_barrier/validate/barrier_dissemination.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_barrier/validate/barrier_mcs.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_barrier/validate/barrier_tournament.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_bitmap/ vendor-sys/ck/dist/regressions/ck_bitmap/validate/ vendor-sys/ck/dist/regressions/ck_bitmap/validate/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_bitmap/validate/serial.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_brlock/ vendor-sys/ck/dist/regressions/ck_brlock/benchmark/ vendor-sys/ck/dist/regressions/ck_brlock/benchmark/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_brlock/benchmark/latency.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_brlock/benchmark/throughput.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_brlock/validate/ vendor-sys/ck/dist/regressions/ck_brlock/validate/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_brlock/validate/validate.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_bytelock/ vendor-sys/ck/dist/regressions/ck_bytelock/benchmark/ vendor-sys/ck/dist/regressions/ck_bytelock/benchmark/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_bytelock/benchmark/latency.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_bytelock/validate/ vendor-sys/ck/dist/regressions/ck_bytelock/validate/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_bytelock/validate/validate.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_cohort/ vendor-sys/ck/dist/regressions/ck_cohort/benchmark/ vendor-sys/ck/dist/regressions/ck_cohort/benchmark/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_cohort/benchmark/ck_cohort.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_cohort/benchmark/throughput.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_cohort/ck_cohort.h (contents, props changed) vendor-sys/ck/dist/regressions/ck_cohort/validate/ vendor-sys/ck/dist/regressions/ck_cohort/validate/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_cohort/validate/validate.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_epoch/ vendor-sys/ck/dist/regressions/ck_epoch/validate/ vendor-sys/ck/dist/regressions/ck_epoch/validate/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_epoch/validate/ck_epoch_call.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_epoch/validate/ck_epoch_poll.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_epoch/validate/ck_epoch_section.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_epoch/validate/ck_epoch_section_2.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_epoch/validate/ck_epoch_synchronize.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_epoch/validate/ck_stack.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_epoch/validate/torture.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_fifo/ vendor-sys/ck/dist/regressions/ck_fifo/benchmark/ vendor-sys/ck/dist/regressions/ck_fifo/benchmark/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_fifo/benchmark/latency.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_fifo/validate/ vendor-sys/ck/dist/regressions/ck_fifo/validate/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_fifo/validate/ck_fifo_mpmc.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_fifo/validate/ck_fifo_mpmc_iterator.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_fifo/validate/ck_fifo_spsc.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_fifo/validate/ck_fifo_spsc_iterator.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_hp/ vendor-sys/ck/dist/regressions/ck_hp/benchmark/ vendor-sys/ck/dist/regressions/ck_hp/benchmark/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_hp/benchmark/fifo_latency.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_hp/benchmark/stack_latency.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_hp/validate/ vendor-sys/ck/dist/regressions/ck_hp/validate/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_hp/validate/ck_hp_fifo.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_hp/validate/ck_hp_fifo_donner.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_hp/validate/ck_hp_stack.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_hp/validate/nbds_haz_test.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_hp/validate/serial.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_hs/ vendor-sys/ck/dist/regressions/ck_hs/benchmark/ vendor-sys/ck/dist/regressions/ck_hs/benchmark/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_hs/benchmark/apply.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_hs/benchmark/parallel_bytestring.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_hs/benchmark/serial.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_hs/validate/ vendor-sys/ck/dist/regressions/ck_hs/validate/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_hs/validate/serial.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_ht/ vendor-sys/ck/dist/regressions/ck_ht/benchmark/ vendor-sys/ck/dist/regressions/ck_ht/benchmark/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_ht/benchmark/parallel_bytestring.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_ht/benchmark/parallel_direct.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_ht/benchmark/serial.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_ht/validate/ vendor-sys/ck/dist/regressions/ck_ht/validate/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_ht/validate/serial.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_pflock/ vendor-sys/ck/dist/regressions/ck_pflock/benchmark/ vendor-sys/ck/dist/regressions/ck_pflock/benchmark/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_pflock/benchmark/latency.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_pflock/benchmark/throughput.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_pflock/validate/ vendor-sys/ck/dist/regressions/ck_pflock/validate/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_pflock/validate/validate.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_pr/ vendor-sys/ck/dist/regressions/ck_pr/benchmark/ vendor-sys/ck/dist/regressions/ck_pr/benchmark/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_pr/benchmark/benchmark.h (contents, props changed) vendor-sys/ck/dist/regressions/ck_pr/benchmark/ck_pr_cas_64.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_pr/benchmark/ck_pr_cas_64_2.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_pr/benchmark/ck_pr_fas_64.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_pr/benchmark/fp.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_pr/validate/ vendor-sys/ck/dist/regressions/ck_pr/validate/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_pr/validate/ck_pr_add.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_pr/validate/ck_pr_and.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_pr/validate/ck_pr_bin.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_pr/validate/ck_pr_btc.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_pr/validate/ck_pr_btr.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_pr/validate/ck_pr_bts.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_pr/validate/ck_pr_btx.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_pr/validate/ck_pr_cas.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_pr/validate/ck_pr_dec.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_pr/validate/ck_pr_faa.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_pr/validate/ck_pr_fas.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_pr/validate/ck_pr_fax.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_pr/validate/ck_pr_inc.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_pr/validate/ck_pr_load.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_pr/validate/ck_pr_n.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_pr/validate/ck_pr_or.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_pr/validate/ck_pr_store.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_pr/validate/ck_pr_sub.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_pr/validate/ck_pr_unary.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_pr/validate/ck_pr_xor.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_queue/ vendor-sys/ck/dist/regressions/ck_queue/validate/ vendor-sys/ck/dist/regressions/ck_queue/validate/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_queue/validate/ck_list.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_queue/validate/ck_slist.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_queue/validate/ck_stailq.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_rhs/ vendor-sys/ck/dist/regressions/ck_rhs/benchmark/ vendor-sys/ck/dist/regressions/ck_rhs/benchmark/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_rhs/benchmark/parallel_bytestring.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_rhs/benchmark/serial.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_rhs/validate/ vendor-sys/ck/dist/regressions/ck_rhs/validate/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_rhs/validate/serial.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_ring/ vendor-sys/ck/dist/regressions/ck_ring/benchmark/ vendor-sys/ck/dist/regressions/ck_ring/benchmark/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_ring/benchmark/latency.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_ring/validate/ vendor-sys/ck/dist/regressions/ck_ring/validate/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_ring/validate/ck_ring_mpmc.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_ring/validate/ck_ring_mpmc_template.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_ring/validate/ck_ring_spmc.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_ring/validate/ck_ring_spmc_template.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_ring/validate/ck_ring_spsc.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_rwcohort/ vendor-sys/ck/dist/regressions/ck_rwcohort/benchmark/ vendor-sys/ck/dist/regressions/ck_rwcohort/benchmark/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_rwcohort/benchmark/ck_neutral.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_rwcohort/benchmark/ck_rp.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_rwcohort/benchmark/ck_wp.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_rwcohort/benchmark/latency.h (contents, props changed) vendor-sys/ck/dist/regressions/ck_rwcohort/benchmark/throughput.h (contents, props changed) vendor-sys/ck/dist/regressions/ck_rwcohort/ck_neutral.h (contents, props changed) vendor-sys/ck/dist/regressions/ck_rwcohort/ck_rp.h (contents, props changed) vendor-sys/ck/dist/regressions/ck_rwcohort/ck_wp.h (contents, props changed) vendor-sys/ck/dist/regressions/ck_rwcohort/validate/ vendor-sys/ck/dist/regressions/ck_rwcohort/validate/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_rwcohort/validate/ck_neutral.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_rwcohort/validate/ck_rp.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_rwcohort/validate/ck_wp.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_rwcohort/validate/validate.h (contents, props changed) vendor-sys/ck/dist/regressions/ck_rwlock/ vendor-sys/ck/dist/regressions/ck_rwlock/benchmark/ vendor-sys/ck/dist/regressions/ck_rwlock/benchmark/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_rwlock/benchmark/latency.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_rwlock/benchmark/throughput.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_rwlock/validate/ vendor-sys/ck/dist/regressions/ck_rwlock/validate/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_rwlock/validate/validate.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_sequence/ vendor-sys/ck/dist/regressions/ck_sequence/benchmark/ vendor-sys/ck/dist/regressions/ck_sequence/benchmark/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_sequence/benchmark/ck_sequence.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_sequence/validate/ vendor-sys/ck/dist/regressions/ck_sequence/validate/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_sequence/validate/ck_sequence.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/ vendor-sys/ck/dist/regressions/ck_spinlock/benchmark/ vendor-sys/ck/dist/regressions/ck_spinlock/benchmark/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/benchmark/ck_anderson.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/benchmark/ck_cas.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/benchmark/ck_clh.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/benchmark/ck_dec.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/benchmark/ck_fas.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/benchmark/ck_hclh.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/benchmark/ck_mcs.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/benchmark/ck_spinlock.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/benchmark/ck_ticket.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/benchmark/ck_ticket_pb.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/benchmark/latency.h (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/benchmark/linux_spinlock.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/benchmark/throughput.h (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/ck_anderson.h (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/ck_cas.h (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/ck_clh.h (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/ck_dec.h (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/ck_fas.h (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/ck_hclh.h (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/ck_mcs.h (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/ck_spinlock.h (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/ck_ticket.h (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/ck_ticket_pb.h (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/linux_spinlock.h (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/validate/ vendor-sys/ck/dist/regressions/ck_spinlock/validate/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/validate/ck_anderson.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/validate/ck_cas.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/validate/ck_clh.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/validate/ck_dec.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/validate/ck_fas.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/validate/ck_hclh.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/validate/ck_mcs.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/validate/ck_spinlock.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/validate/ck_ticket.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/validate/ck_ticket_pb.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/validate/linux_spinlock.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_spinlock/validate/validate.h (contents, props changed) vendor-sys/ck/dist/regressions/ck_stack/ vendor-sys/ck/dist/regressions/ck_stack/benchmark/ vendor-sys/ck/dist/regressions/ck_stack/benchmark/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_stack/benchmark/latency.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_stack/validate/ vendor-sys/ck/dist/regressions/ck_stack/validate/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_stack/validate/pair.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_stack/validate/pop.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_stack/validate/push.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_stack/validate/serial.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_swlock/ vendor-sys/ck/dist/regressions/ck_swlock/benchmark/ vendor-sys/ck/dist/regressions/ck_swlock/benchmark/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_swlock/benchmark/latency.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_swlock/benchmark/throughput.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_swlock/validate/ vendor-sys/ck/dist/regressions/ck_swlock/validate/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_swlock/validate/validate.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_tflock/ vendor-sys/ck/dist/regressions/ck_tflock/benchmark/ vendor-sys/ck/dist/regressions/ck_tflock/benchmark/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_tflock/benchmark/latency.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_tflock/benchmark/throughput.c (contents, props changed) vendor-sys/ck/dist/regressions/ck_tflock/validate/ vendor-sys/ck/dist/regressions/ck_tflock/validate/Makefile (contents, props changed) vendor-sys/ck/dist/regressions/ck_tflock/validate/validate.c (contents, props changed) vendor-sys/ck/dist/regressions/common.h (contents, props changed) vendor-sys/ck/dist/src/ vendor-sys/ck/dist/src/Makefile.in (contents, props changed) vendor-sys/ck/dist/src/ck_array.c (contents, props changed) vendor-sys/ck/dist/src/ck_barrier_centralized.c (contents, props changed) vendor-sys/ck/dist/src/ck_barrier_combining.c (contents, props changed) vendor-sys/ck/dist/src/ck_barrier_dissemination.c (contents, props changed) vendor-sys/ck/dist/src/ck_barrier_mcs.c (contents, props changed) vendor-sys/ck/dist/src/ck_barrier_tournament.c (contents, props changed) vendor-sys/ck/dist/src/ck_epoch.c (contents, props changed) vendor-sys/ck/dist/src/ck_hp.c (contents, props changed) vendor-sys/ck/dist/src/ck_hs.c (contents, props changed) vendor-sys/ck/dist/src/ck_ht.c (contents, props changed) vendor-sys/ck/dist/src/ck_ht_hash.h (contents, props changed) vendor-sys/ck/dist/src/ck_internal.h (contents, props changed) vendor-sys/ck/dist/src/ck_rhs.c (contents, props changed) vendor-sys/ck/dist/tools/ vendor-sys/ck/dist/tools/feature.sh (contents, props changed) Added: vendor-sys/ck/dist/LICENSE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/ck/dist/LICENSE Mon Nov 28 20:08:52 2016 (r309260) @@ -0,0 +1,54 @@ +Copyright 2010-2014 Samy Al Bahra. +Copyright 2011-2013 AppNexus, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +Hazard Pointers (src/ck_hp.c) also includes this license: + +(c) Copyright 2008, IBM Corporation. +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + +ck_pr_rtm leverages work from Andi Kleen: +Copyright (c) 2012,2013 Intel Corporation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that: (1) source code distributions +retain the above copyright notice and this paragraph in its entirety, (2) +distributions including binary code include the above copyright notice and +this paragraph in its entirety in the documentation or other materials +provided with the distribution + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + Added: vendor-sys/ck/dist/Makefile.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/ck/dist/Makefile.in Mon Nov 28 20:08:52 2016 (r309260) @@ -0,0 +1,103 @@ +.PHONY: all check clean dist distclean doc install install-headers regressions uninstall + +BUILD_DIR=@BUILD_DIR@ +SRC_DIR=@SRC_DIR@ +CFLAGS=@CFLAGS@ +VERSION=@VERSION@ +VERSION_MAJOR=@VERSION_MAJOR@ +PREFIX=@PREFIX@ +LIBRARY=@LIBRARY@ +HEADERS=@HEADERS@ +PKGCONFIG_DATA=@LIBRARY@/pkgconfig +LDNAME=@LDNAME@ +LDNAME_VERSION=@LDNAME_VERSION@ +LDNAME_MAJOR=@LDNAME_MAJOR@ + +all: doc + $(MAKE) -C src all || exit + @echo + @echo + @echo ---[ Concurrency Kit has built successfully. You may now \"make install\". + +doc: + $(MAKE) -C doc all || exit + @echo ---[ Manual pages are ready for installation. + +regressions: + $(MAKE) -C regressions all || exit + @echo ---[ Regressions have built successfully. + +check: regressions + @echo ---[ Executing unit tests... + $(MAKE) -C regressions check + @echo ---[ Unit tests have completed successfully. + +install-headers: + mkdir -p $(DESTDIR)/$(HEADERS) || exit + cp $(SRC_DIR)/include/*.h $(DESTDIR)/$(HEADERS) || exit + chmod 644 $(DESTDIR)/$(HEADERS)/ck_*.h || exit + mkdir -p $(DESTDIR)$(HEADERS)/gcc || exit + cp -r $(SRC_DIR)/include/gcc/* $(DESTDIR)/$(HEADERS)/gcc || exit + cp include/ck_md.h $(DESTDIR)/$(HEADERS)/ck_md.h || exit + chmod 755 $(DESTDIR)/$(HEADERS)/gcc + chmod 644 $(DESTDIR)/$(HEADERS)/gcc/ck_*.h $(DESTDIR)/$(HEADERS)/gcc/*/ck_*.h || exit + mkdir -p $(DESTDIR)$(HEADERS)/spinlock || exit + cp -r $(SRC_DIR)/include/spinlock/* $(DESTDIR)/$(HEADERS)/spinlock || exit + chmod 755 $(DESTDIR)/$(HEADERS)/spinlock + chmod 644 $(DESTDIR)/$(HEADERS)/spinlock/*.h || exit + +install-so: + mkdir -p $(DESTDIR)/$(LIBRARY) + cp src/libck.so $(DESTDIR)/$(LIBRARY)/$(LDNAME_VERSION) + ln -sf $(LDNAME_VERSION) $(DESTDIR)/$(LIBRARY)/$(LDNAME) + ln -sf $(LDNAME_VERSION) $(DESTDIR)/$(LIBRARY)/$(LDNAME_MAJOR) + chmod 744 $(DESTDIR)/$(LIBRARY)/$(LDNAME_VERSION) \ + $(DESTDIR)/$(LIBRARY)/$(LDNAME) \ + $(DESTDIR)/$(LIBRARY)/$(LDNAME_MAJOR) + +install-lib: + mkdir -p $(DESTDIR)/$(LIBRARY) + cp src/libck.a $(DESTDIR)/$(LIBRARY)/libck.a + chmod 644 $(DESTDIR)/$(LIBRARY)/libck.a + +install: all install-headers @INSTALL_LIBS@ + $(MAKE) -C doc install + mkdir -p $(DESTDIR)/$(LIBRARY) || exit + mkdir -p $(DESTDIR)/$(PKGCONFIG_DATA) || exit + chmod 755 $(DESTDIR)/$(PKGCONFIG_DATA) + cp build/ck.pc $(DESTDIR)/$(PKGCONFIG_DATA)/ck.pc || exit + @echo + @echo + @echo ---[ Concurrency Kit has installed successfully. + +uninstall: + $(MAKE) -C doc uninstall + rm -f $(DESTDIR)/$(LIBRARY)/$(LDNAME_VERSION) \ + $(DESTDIR)/$(LIBRARY)/$(LDNAME) \ + $(DESTDIR)/$(LIBRARY)/$(LDNAME_MAJOR) + rm -f $(DESTDIR)/$(LIBRARY)/libck.so* + rm -f $(DESTDIR)/$(LIBRARY)/libck.a + rm -f $(DESTDIR)/$(HEADERS)/ck_*.h + rm -f $(DESTDIR)/$(HEADERS)/spinlock/*.h + rm -f $(DESTDIR)/$(HEADERS)/gcc/ck_*.h + rm -f $(DESTDIR)/$(HEADERS)/gcc/*/ck_*.h + rm -f $(DESTDIR)/$(PKGCONFIG_DATA)/ck.pc + +clean: + $(MAKE) -C doc clean + $(MAKE) -C src clean + $(MAKE) -C regressions clean + rm -f $(BUILD_DIR)/*~ $(BUILD_DIR)/*.o $(BUILD_DIR)/*.tar.gz + +dist: + git archive --remote=$(SRC_DIR) --format=tar --prefix=ck-$(VERSION)/ HEAD \ + | gzip > $(BUILD_DIR)/ck-$(VERSION).tar.gz + +distclean: clean + rm -f $(BUILD_DIR)/include/ck_md.h + rm -f $(BUILD_DIR)/build/regressions.build + rm -f $(BUILD_DIR)/build/ck.build + rm -f $(BUILD_DIR)/build/ck.pc + rm -f $(BUILD_DIR)/Makefile + rm -f $(BUILD_DIR)/doc/Makefile + Added: vendor-sys/ck/dist/README ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/ck/dist/README Mon Nov 28 20:08:52 2016 (r309260) @@ -0,0 +1,21 @@ + ____ _ ___ _ + / ___|___ _ __ ___ _ _ _ __ _ __ ___ _ __ ___ _ _ | |/ (_) |_ +| | / _ \| '_ \ / __| | | | '__| '__/ _ \ '_ \ / __| | | | | ' /| | __| +| |__| (_) | | | | (__| |_| | | | | | __/ | | | (__| |_| | | . \| | |_ + \____\___/|_| |_|\___|\__,_|_| |_| \___|_| |_|\___|\__, | |_|\_\_|\__| + |___/ + +Step 1. + ./configure + For additional options try ./configure --help + +Step 2. + In order to compile regressions (requires POSIX threads) use + "make regressions". In order to compile libck use "make all" or "make". + +Step 3. + In order to install use "make install" + To uninstall use "make uninstall". + +See http://concurrencykit.org/ for more information. + Added: vendor-sys/ck/dist/build/ck.build.aarch64 ============================================================================== Binary file. No diff available. Added: vendor-sys/ck/dist/build/ck.build.arm ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/ck/dist/build/ck.build.arm Mon Nov 28 20:08:52 2016 (r309260) @@ -0,0 +1 @@ +CFLAGS+=-D__arm__ Added: vendor-sys/ck/dist/build/ck.build.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/ck/dist/build/ck.build.in Mon Nov 28 20:08:52 2016 (r309260) @@ -0,0 +1,10 @@ +CC=@CC@ +MAKE=make +SRC_DIR=@SRC_DIR@ +BUILD_DIR=@BUILD_DIR@ +CFLAGS+=@CFLAGS@ -I$(SRC_DIR)/include -I$(BUILD_DIR)/include +LDFLAGS+=@LDFLAGS@ +ALL_LIBS=@ALL_LIBS@ +LD=@LD@ + +include $(BUILD_DIR)/build/ck.build.@PROFILE@ Added: vendor-sys/ck/dist/build/ck.build.ppc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/ck/dist/build/ck.build.ppc Mon Nov 28 20:08:52 2016 (r309260) @@ -0,0 +1 @@ +CFLAGS+=-m32 -D__ppc__ Added: vendor-sys/ck/dist/build/ck.build.ppc64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/ck/dist/build/ck.build.ppc64 Mon Nov 28 20:08:52 2016 (r309260) @@ -0,0 +1,2 @@ +CFLAGS+=-m64 -D__ppc64__ +LDFLAGS+=-m64 Added: vendor-sys/ck/dist/build/ck.build.sparcv9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/ck/dist/build/ck.build.sparcv9 Mon Nov 28 20:08:52 2016 (r309260) @@ -0,0 +1 @@ +CFLAGS+=-m64 -D__sparcv9__ Added: vendor-sys/ck/dist/build/ck.build.x86 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/ck/dist/build/ck.build.x86 Mon Nov 28 20:08:52 2016 (r309260) @@ -0,0 +1,2 @@ +CFLAGS+=-m32 -D__x86__ -msse -msse2 +LDFLAGS+=-m32 Added: vendor-sys/ck/dist/build/ck.build.x86_64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/ck/dist/build/ck.build.x86_64 Mon Nov 28 20:08:52 2016 (r309260) @@ -0,0 +1,2 @@ +CFLAGS+=-m64 -D__x86_64__ +LDFLAGS+=-m64 Added: vendor-sys/ck/dist/build/ck.pc.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/ck/dist/build/ck.pc.in Mon Nov 28 20:08:52 2016 (r309260) @@ -0,0 +1,10 @@ +prefix=@PREFIX@ +includedir=@HEADERS@ +libdir=@LIBRARY@ + +Name: Concurrency Kit +Description: Toolkit for well-specified design and implementation of concurrent systems +URL: http://concurrencykit.org/ +Version: @VERSION@ +Libs: -L${libdir} -lck +Cflags: -D__@PROFILE@__ -I${includedir} @PC_CFLAGS@ Added: vendor-sys/ck/dist/build/ck.spec.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/ck/dist/build/ck.spec.in Mon Nov 28 20:08:52 2016 (r309260) @@ -0,0 +1,74 @@ +Name: ck +Version: @VERSION@ +Release: 1%{?dist} +Group: Development/Libraries +Summary: Concurrency Kit +License: Simplified BSD License +URL: http://concurrencykit.org +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) + +Source: http://concurrencykit.org/releases/ck-%{version}.tar.gz + +%description +Concurrency Kit provides a plethora of concurrency primitives, safe memory +reclamation mechanisms and lock-less and lock-free data structures designed to +aid in the design and implementation of high performance concurrent systems. It +is designed to minimize dependencies on operating system-specific interfaces +and most of the interface relies only on a strict subset of the standard +library and more popular compiler extensions. + +%package devel +Group: Development/Libraries +Summary: Header files and libraries for CK development +Requires: %{name} = %{version}-%{release} + +%description devel +Concurrency Kit provides a plethora of concurrency primitives, safe memory +reclamation mechanisms and lock-less and lock-free data structures designed to +aid in the design and implementation of high performance concurrent systems. It +is designed to minimize dependencies on operating system-specific interfaces +and most of the interface relies only on a strict subset of the standard +library and more popular compiler extensions. + +This package provides the libraries, include files, and other +resources needed for developing Concurrency Kit applications. + +%prep +%setup -q + +%build +CFLAGS=$RPM_OPT_FLAGS ./configure \ + --libdir=%{_libdir} \ + --includedir=%{_includedir}/%{name} \ + --mandir=%{_mandir} \ + --prefix=%{_prefix} +make %{?_smp_mflags} + +%install +rm -rf $RPM_BUILD_ROOT +make DESTDIR=$RPM_BUILD_ROOT install + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root,-) +%{_libdir}/libck.so.@VERSION@ +%{_libdir}/libck.so.@VERSION_MAJOR@ + +%files devel +%defattr(-,root,root) +%{_libdir}/libck.so +%{_includedir}/%{name}/*.h +%{_includedir}/%{name}/*/*.h +%{_includedir}/%{name}/*/*/*.h +%{_libdir}/libck.a +%{_libdir}/pkgconfig/%{name}.pc +%{_mandir}/man3/*.3.gz + +%post +/sbin/ldconfig + +%postun +/sbin/ldconfig + Added: vendor-sys/ck/dist/build/regressions.build.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/ck/dist/build/regressions.build.in Mon Nov 28 20:08:52 2016 (r309260) @@ -0,0 +1,10 @@ +CC=@CC@ +MAKE=make +CORES=@CORES@ +CFLAGS=@CFLAGS@ -I../../../include -DCORES=@CORES@ +LD=@LD@ +LDFLAGS=@LDFLAGS@ +PTHREAD_CFLAGS=@PTHREAD_CFLAGS@ +BUILD_DIR=@BUILD_DIR@ + +include $(BUILD_DIR)/build/ck.build.@PROFILE@ Added: vendor-sys/ck/dist/configure ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor-sys/ck/dist/configure Mon Nov 28 20:08:52 2016 (r309260) @@ -0,0 +1,775 @@ +#!/bin/sh +# +# Copyright © 2009-2013 Samy Al Bahra. +# Copyright © 2011 Devon H. O'Dell +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# + +REQUIRE_HEADER="stdbool.h stddef.h stdint.h string.h" + +EXIT_SUCCESS=0 +EXIT_FAILURE=1 +WANT_PIC=yes + +P_PWD=`pwd` +MAINTAINER='sbahra@repnop.org' +VERSION=${VERSION:-'0.5.2'} +VERSION_MAJOR='0' +BUILD="$PWD/build/ck.build" +PREFIX=${PREFIX:-"/usr/local"} +LDNAME="libck.so" +LDNAME_VERSION="libck.so.$VERSION" +LDNAME_MAJOR="libck.so.$VERSION_MAJOR" + +OPTION_CHECKING=1 + +export CFLAGS +export PREFIX +LC_ALL=C +export LC_ALL + +if test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +trap epilog 1 2 3 6 + +epilog() +{ + rm -f .1.c .1 +} + +assert() +{ + + if test "$#" -eq 2; then + fail=$2 + print=true + elif test "$#" -eq 3; then + fail=$3 + print=echo + else + echo "Usage: assert or assert " 1>&2 + exit $EXIT_FAILURE + fi + + if test -z "$1"; then + echo "failed [$fail]" + exit $EXIT_FAILURE + else + ${print} "success [$1]" + fi +} + +get_git_sha() +{ + # return a short SHA for the current HEAD + GIT_SHA="" + GIT_MSG="success" + gitcmd=`which git` + if test -n "$gitcmd"; then + GIT_SHA=`git rev-parse --short HEAD 2>/dev/null` + if ! test -n "$GIT_SHA"; then + GIT_MSG="not within a git repo" + fi + else + GIT_MSG="git not installed or executable" + fi +} + +generate() +{ + sed -e "s#@PROFILE@#$PROFILE#g" \ + -e "s#@VERSION@#$VERSION#g" \ + -e "s#@VERSION_MAJOR@#$VERSION_MAJOR#g" \ + -e "s#@CC@#$CC#g" \ + -e "s#@CFLAGS@#$CFLAGS#g" \ + -e "s#@HEADERS@#$HEADERS#g" \ + -e "s#@LIBRARY@#$LIBRARY#g" \ + -e "s#@PREFIX@#$PREFIX#g" \ + -e "s#@CORES@#$CORES#g" \ + -e "s#@ALL_LIBS@#$ALL_LIBS#g" \ + -e "s#@INSTALL_LIBS@#$INSTALL_LIBS#g" \ + -e "s#@LD@#$LD#g" \ + -e "s#@LDFLAGS@#$LDFLAGS#g" \ + -e "s#@PTHREAD_CFLAGS@#$PTHREAD_CFLAGS#g" \ + -e "s#@MANDIR@#$MANDIR#g" \ + -e "s#@GZIP@#$GZIP#g" \ + -e "s#@GZIP_SUFFIX@#$GZIP_SUFFIX#g" \ + -e "s#@POINTER_PACK_ENABLE@#$POINTER_PACK_ENABLE#g" \ + -e "s#@RTM_ENABLE@#$RTM_ENABLE#g" \ + -e "s#@VMA_BITS@#$VMA_BITS_R#g" \ + -e "s#@VMA_BITS_VALUE@#$VMA_BITS_VALUE_R#g" \ + -e "s#@MM@#$MM#g" \ + -e "s#@BUILD_DIR@#$P_PWD#g" \ + -e "s#@SRC_DIR@#$BUILD_DIR#g" \ + -e "s#@LDNAME@#$LDNAME#g" \ + -e "s#@LDNAME_MAJOR@#$LDNAME_MAJOR#g" \ + -e "s#@LDNAME_VERSION@#$LDNAME_VERSION#g" \ + -e "s#@PC_CFLAGS@#$PC_CFLAGS#g" \ + -e "s#@GIT_SHA@#$GIT_SHA#g" \ + $1 > $2 +} + +generate_stdout() +{ + + echo + echo " VERSION = $VERSION" + echo " GIT_SHA = $GIT_SHA" + echo " BUILD_DIR = $P_PWD" + echo " SRC_DIR = $BUILD_DIR" + echo " SYSTEM = $SYSTEM" + echo " PROFILE = $PROFILE" + echo " CC = $CC" + echo " COMPILER = $COMPILER" + echo " CFLAGS = $CFLAGS" + echo " PTHREAD_CFLAGS = $PTHREAD_CFLAGS" + echo " LD = $LD" + echo " LDNAME = $LDNAME" + echo " LDNAME_VERSION = $LDNAME_VERSION" + echo " LDNAME_MAJOR = $LDNAME_MAJOR" + echo " LDFLAGS = $LDFLAGS" + echo " GZIP = $GZIP" + echo " CORES = $CORES" + echo " POINTER_PACK = $POINTER_PACK_ENABLE" + echo " VMA_BITS = $VMA_BITS" + echo " MEMORY_MODEL = $MM" + echo " RTM = $RTM_ENABLE" + echo + echo "Headers will be installed in $HEADERS" + echo "Libraries will be installed in $LIBRARY" + echo "Documentation will be installed in $MANDIR" +} + +for option; do + case "$option" in + *=?*) + value=`expr -- "$option" : '[^=]*=\(.*\)'` + ;; + *=) + value= + ;; + *) + value=yes + ;; + esac + + case "$option" in + --help) + echo "Usage: $0 [OPTIONS]" + echo + echo "The following options may be used for cross-building." + echo " --profile=N Use custom build profile (use in conjunction with \$CC)" + echo + echo "The following options may be used to modify installation behavior." + echo " --includedir=N Headers directory (default is ${PREFIX}/include)" + echo " --libdir=N Libraries directory (default is ${PREFIX}/lib)" + echo " --mandir=N Manual pages directory (default is ${PREFIX}/man)" + echo " --prefix=N Installs library files in N (default is $PREFIX)" + echo + echo "The following options will affect generated code." + echo " --enable-pointer-packing Assumes address encoding is subset of pointer range" + echo " --enable-rtm Enable restricted transactional memory (power, x86_64)" + echo " --memory-model=N Specify memory model (currently tso, pso or rmo)" + echo " --vma-bits=N Specify valid number of VMA bits" + echo " --platform=N Force the platform type, instead of relying on autodetection" + echo " --use-cc-builtins Use the compiler atomic bultin functions, instead of the CK implementation" + echo + echo "The following options affect regression testing." + echo " --cores=N Specify number of cores available on target machine" + echo + echo "The following environment variables may be used:" + echo " CC C compiler command" + echo " CFLAGS C compiler flags" + echo " LDFLAGS Linker flags" + echo " GZIP GZIP compression tool" + echo + echo "Report bugs to ${MAINTAINER}." + exit $EXIT_SUCCESS + ;; + --memory-model=*) + case "$value" in + "tso") + MM="CK_MD_TSO" + ;; + "rmo") + MM="CK_MD_RMO" + ;; + "pso") + MM="CK_MD_PSO" + ;; + *) + echo "./configure [--help]" + exit $EXIT_FAILURE + ;; + esac + ;; + --vma-bits=*) + VMA_BITS=$value + ;; + --enable-pointer-packing) + POINTER_PACK_ENABLE="CK_MD_POINTER_PACK_ENABLE" + ;; + --enable-rtm) + RTM_ENABLE_SET="CK_MD_RTM_ENABLE" + ;; + --cores=*) + CORES=$value + ;; + --profile=*) + PROFILE=$value + ;; + --prefix=*) + PREFIX=$value + ;; + --includedir=*) + HEADERS=$value + ;; + --libdir=*) + LIBRARY=$value + ;; + --mandir=*) + MANDIR=$value + ;; + --with-pic) + WANT_PIC=yes + ;; + --without-pic) + WANT_PIC=no + ;; + --disable-option-checking) + OPTION_CHECKING=0 + ;; + --use-cc-builtins) + USE_CC_BUILTINS=1 + ;; + --platform=*) + PLATFORM=$value + ;; + --build=*|--host=*|--target=*|--exec-prefix=*|--bindir=*|--sbindir=*|\ + --sysconfdir=*|--datadir=*|--libexecdir=*|--localstatedir=*|\ + --enable-static|\ + --sharedstatedir=*|--infodir=*|--enable-shared|--disable-shared|\ + --cache-file=*|--srcdir=*) + # ignore for compat with regular configure + ;; + --*) + if test "$OPTION_CHECKING" -eq 1; then + echo "$0 [--help]" + echo "Unknown option $option" + exit $EXIT_FAILURE + fi + ;; + *=*) + NAME=`expr -- "$option" : '\([^=]*\)='` + eval "$NAME='$value'" + export $NAME + ;; + *) + echo "$0 [--help]" + echo "Unknown option $option" + exit $EXIT_FAILURE + ;; + esac +done + +HEADERS=${HEADERS:-"${PREFIX}/include"} +LIBRARY=${LIBRARY:-"${PREFIX}/lib"} +MANDIR=${MANDIR:-"${PREFIX}/share/man"} +GZIP=${GZIP:-"gzip -c"} +POINTER_PACK_ENABLE=${POINTER_PACK_ENABLE:-"CK_MD_POINTER_PACK_DISABLE"} +RTM_ENABLE=${RTM_ENABLE_SET:-"CK_MD_RTM_DISABLE"} +VMA_BITS=${VMA_BITS:-"unknown"} + +DCORES=2 +printf "Detecting operating system......." +SYSTEM=`uname -s 2> /dev/null` +case "$SYSTEM" in + "SunOS") + SYSTEM=solaris + ;; + "Linux"|"uClinux") + DCORES=`egrep '(^CPU[0-9]+|^processor.*:.*)' /proc/cpuinfo|wc -l` + SYSTEM=linux + ;; + "FreeBSD"|"GNU/kFreeBSD") + DCORES=`sysctl -n hw.ncpu` + SYSTEM=freebsd + ;; + "NetBSD") + DCORES=`sysctl -n hw.ncpu` + SYSTEM=netbsd + ;; + "OpenBSD") + DCORES=`sysctl -n hw.ncpu` + SYSTEM=openbsd + ;; + "DragonFly") + DCORES=`sysctl -n hw.ncpu` + SYSTEM=dragonflybsd + ;; + "Darwin") + DCORES=`sysctl -n hw.ncpu` + SYSTEM=darwin + ;; + MINGW32*) + SYSTEM=mingw32 + LDFLAGS="-mthreads $LDFLAGS" + ;; + CYGWIN_NT*) + SYSTEM=cygwin + LDFLAGS="-mthreads $LDFLAGS" + ;; + *) + SYSTEM= + ;; +esac + +assert "$SYSTEM" "$SYSTEM" "unsupported" + +CORES=${CORES:-${DCORES}} +printf "Detecting machine architecture..." +if test "x$PLATFORM" = "x"; then + PLATFORM=`uname -m 2> /dev/null` +fi + +case $PLATFORM in + "macppc"|"Power Macintosh"|"powerpc") + RTM_ENABLE="CK_MD_RTM_DISABLE" + MM="${MM:-"CK_MD_RMO"}" + PLATFORM=ppc + ENVIRONMENT=32 + LDFLAGS="-m32 $LDFLAGS" + ;; + "sun4u"|"sun4v"|"sparc64") + RTM_ENABLE="CK_MD_RTM_DISABLE" + MM="${MM:-"CK_MD_TSO"}" + PLATFORM=sparcv9 + ENVIRONMENT=64 + LDFLAGS="-m64 $LDFLAGS" + ;; + i386|i486|i586|i686|i586_i686|pentium*|athlon*|k5|k6|k6_2|k6_3) + MM="${MM:-"CK_MD_TSO"}" + case $SYSTEM in + darwin) + ENVIRONMENT=64 + PLATFORM=x86_64 + ;; + freebsd) + PLATFORM=x86 + ENVIRONMENT=32 + + # FreeBSD doesn't give us a nice way to determine the CPU + # class of the running system, reporting any 32-bit x86 + # architecture as i386. 486 is its minimum supported CPU + # class and cmpxchg8b was implemented first in i586. + dmesg | grep -q "486-class" + if test "$?" -eq 0; then + assert "" "" "Must have an i586 class or higher CPU" + fi + + # FreeBSD still generates code for 486-class CPUs as its + # default 32-bit target, but we need 586 at the least. + echo "$CFLAGS" | grep -q 'march=' + if test "$?" -ne 0; then + # Needed for cmpxchg8b + CFLAGS="$CFLAGS -march=i586" + fi + ;; + linux) + case $PLATFORM in + i386|i486) + assert "" "" "Must have an i586 class or higher CPU" + ;; + esac + + PLATFORM=x86 + ENVIRONMENT=32 + ;; + + *) + PLATFORM=x86 + ENVIRONMENT=32 + assert "$PLATFORM $ENVIRONMENT" "$PLATFORM $ENVIRONMENT" "unsupported" + ;; + esac + ;; + "amd64"|"x86_64") + PLATFORM=x86_64 + ENVIRONMENT=64 + LDFLAGS="-m64 $LDFLAGS" + MM="${MM:-"CK_MD_TSO"}" + ;; + "i86pc") + RTM_ENABLE="CK_MD_RTM_DISABLE" + MM="${MM:-"CK_MD_TSO"}" + if test -z "$ISA"; then ISA=`isainfo -n 2> /dev/null || echo i386` ; fi + case "$ISA" in + "amd64") + RTM_ENABLE=${RTM_ENABLE_SET:-"CK_MD_RTM_DISABLE"} + PLATFORM=x86_64 + ENVIRONMENT=64 + ;; + *) + PLATFORM=x86 + ENVIRONMENT=32 + assert "$PLATFORM $ENVIRONMENT" "$PLATFORM $ENVIRONMENT" "unsupported" + ;; + esac + ;; + "ppc64"|"ppc64le") + RTM_ENABLE="CK_MD_RTM_DISABLE" + MM="${MM:-"CK_MD_RMO"}" + PLATFORM=ppc64 + ENVIRONMENT=64 + ;; + arm|armv6l|armv7l) + if test "$PLATFORM" = "armv6l"; then + CFLAGS="$CFLAGS -march=armv6k"; + elif test "$PLATFORM" = "armv7l"; then + CFLAGS="$CFLAGS -march=armv7-a"; + fi + RTM_ENABLE="CK_MD_RTM_DISABLE" + MM="${MM:-"CK_MD_RMO"}" + PLATFORM=arm + ENVIRONMENT=32 + ;; + "arm64"|"aarch64") + RTM_ENABLE="CK_MD_RTM_DISABLE" + MM="${MM:-"CK_MD_RMO"}" + PLATFORM=aarch64 + ENVIRONMENT=64 + ;; + *) + RTM_ENABLE="CK_MD_RTM_DISABLE" + PLATFORM= + MM="${MM:-"CK_MD_RMO"}" + ;; +esac + +assert "$PLATFORM" "$PLATFORM" "unsupported" + +if test "$VMA" = "unknown"; then + VMA_BITS_R="CK_MD_VMA_BITS_UNKNOWN" + VMA_BITS_VALUE_R="" + POINTER_PACK_ENABLE="CK_MD_POINTER_PACK_DISABLE" +else + VMA_BITS_R="CK_MD_VMA_BITS" + VMA_BITS_VALUE_R="${VMA_BITS}ULL" +fi + +if test "$USE_CC_BUILTINS"; then + CFLAGS="$CFLAGS -DCK_CC_BUILTINS" + PC_CFLAGS="-DCK_CC_BULITINS" +fi + +# `which` on Solaris sucks +pathsearch() +{ + what=$1 + oldFS="$IFS" + IFS=":" + for d in $PATH ; do + if test -x "$d/$what" ; then + echo "$d/$what"; + IFS="$oldFS" + return + fi + done + IFS="$oldFS" +} + +printf "Finding dirname command.........." +DIRNAME=`pathsearch "${DIRNAME:-dirname}"` +if test -z "$DIRNAME" -o ! -x "$DIRNAME"; then + DIRNAME=`pathsearch "${DIRNAME:-dirname}"` + DIRNAME="$DIRNAME" +else + echo "success [$DIRNAME]" +fi + +if test -z "$DIRNAME"; then + echo "not found (out of source build unsupported)" +else + printf "Determining build directory......" + + BUILD_DIR=`$DIRNAME $0` + cd `$DIRNAME $0` + BUILD_DIR=`pwd` + + echo "success [$BUILD_DIR]" +fi + +printf "Finding gzip tool................" +GZIP=`pathsearch "${GZIP:-gzip}"` +if test -z "$GZIP" -o ! -x "$GZIP"; then + GZIP=`pathsearch "${GZIP:-gzip}"` + GZIP="$GZIP" +fi + +if test -z "$GZIP"; then + echo "not found" + GZIP=cat + GZIP_SUFFIX="" +else + echo "success [$GZIP]" + GZIP="$GZIP -c" + GZIP_SUFFIX=".gz" +fi + +printf "Finding suitable compiler........" +CC=`pathsearch "${CC:-cc}"` +if test -z "$CC" -o ! -x "$CC"; then + CC=`pathsearch "${CC:-gcc}"` +fi +assert "$CC" "not found" + +cat << EOF > .1.c +#include +int main(void) { +#if defined(_WIN32) +#if defined(__MINGW64__) + puts("mingw64"); + return (0); +#elif defined(__MINGW32__) && (__MINGW32_MAJOR_VERSION >= 3) + puts("mingw32"); + return (0); +#else + return (1); +#endif /* __MINGW32__ && __MINGW32_MAJOR_VERSION >= 3 */ +#elif defined(__clang__) && (__clang_major__ >= 3) + puts("clang"); + return (0); +#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x5110) + puts("suncc"); + return (0); +#elif defined(__GNUC__) && (__GNUC__ >= 4) + puts("gcc"); + return (0); +#else + return (1); +#endif +} +EOF + +$CC -o .1 .1.c +COMPILER=`./.1` +r=$? +rm -f .1.c .1 + +if test "$r" -ne 0; then + assert "" "update compiler" +else + echo "success [$CC]" +fi + +if test "$COMPILER" = "suncc"; then + LD=/bin/ld + LDFLAGS="-G -z text -h libck.so.$VERSION_MAJOR $LDFLAGS" + CFLAGS="-xO5 $CFLAGS" + PTHREAD_CFLAGS="-mt -lpthread" +elif test "$COMPILER" = "gcc" || test "$COMPILER" = "clang" || test "$COMPILER" = "mingw32" || test "$COMPILER" = "mingw64"; then + LD=$CC + SONAME="$LDNAME_MAJOR" + if test "$SYSTEM" = "darwin"; then + CC_WL_OPT="-install_name" + LDNAME="libck.dylib" + LDNAME_VERSION="libck.$VERSION.dylib" + LDNAME_MAJOR="libck.$VERSION_MAJOR.dylib" + SONAME="$LIBRARY/$LDNAME_MAJOR" + else + CC_WL_OPT="-soname" + fi + + LDFLAGS="-Wl,$CC_WL_OPT,$SONAME $LDFLAGS" + if test "$WANT_PIC" = "yes"; then + LDFLAGS="$LDFLAGS -shared -fPIC" + CFLAGS="$CFLAGS -fPIC" + ALL_LIBS="libck.so libck.a" + INSTALL_LIBS="install-so install-lib" + else + LDFLAGS="$LDFLAGS -fno-PIC" + CFLAGS="$CFLAGS -fno-PIC" + ALL_LIBS="libck.a" + INSTALL_LIBS="install-lib" + fi + + CFLAGS="-D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE -std=gnu99 -pedantic -Wall -W -Wundef -Wendif-labels -Wshadow -Wpointer-arith -Wcast-align -Wcast-qual -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wdisabled-optimization -fstrict-aliasing -O2 -pipe -Wno-parentheses $CFLAGS" + PTHREAD_CFLAGS="-pthread" + if test "$COMPILER" = "mingw64"; then + ENVIRONMENT=64 + PLATFORM=x86_64 + fi +else + assert "" "unknown compiler" +fi + +printf "Detecting VMA bits..............." +VMA="unknown" +if test "$VMA_BITS" = "unknown"; then + if test "$PLATFORM" = "x86" || test $PLATFORM = "x86_64"; then + case $SYSTEM in + darwin) + VMA=`sysctl -n machdep.cpu.address_bits.virtual` + ;; + linux) + VMA=`awk '/address sizes/ {print $7;exit}' /proc/cpuinfo` + ;; + *) + if test "$PLATFORM" = "x86"; then + VMA="32" + else + cat << EOF > .1.c + #include + + int main(int argc, char *argv[]) + { + unsigned long ret = 0x80000000; + + __asm __volatile("cpuid\n" + : "+a" (ret)); + if (ret >= 0x80000008) { + ret = 0x80000008; + __asm __volatile("cpuid\n" + : "+a" (ret)); + printf("%lu\n", (ret >> 8) & 0xff); + } else { + return (1); + } + return (0); + } +EOF + + $CC -o .1 .1.c 2>/dev/null + VMA=`./.1 2>/dev/null` + if test $? -ne 0; then *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Nov 28 20:11:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4D05C58580; Mon, 28 Nov 2016 20:11:14 +0000 (UTC) (envelope-from cognet@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 8A7A712D5; Mon, 28 Nov 2016 20:11:14 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASKBDZF047694; Mon, 28 Nov 2016 20:11:13 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASKBDa0047693; Mon, 28 Nov 2016 20:11:13 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201611282011.uASKBDa0047693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Mon, 28 Nov 2016 20:11:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r309261 - vendor-sys/ck/20161128 X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 20:11:14 -0000 Author: cognet Date: Mon Nov 28 20:11:13 2016 New Revision: 309261 URL: https://svnweb.freebsd.org/changeset/base/309261 Log: Tag CK as of commit 566bb28dba963a1904e0889b74fe7005a5bc5eb8 Added: vendor-sys/ck/20161128/ - copied from r309260, vendor-sys/ck/dist/ From owner-svn-src-all@freebsd.org Mon Nov 28 20:13:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C060C587B3; Mon, 28 Nov 2016 20:13:58 +0000 (UTC) (envelope-from dim@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 EAD0516AF; Mon, 28 Nov 2016 20:13:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASKDva0049930; Mon, 28 Nov 2016 20:13:57 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASKDux3049923; Mon, 28 Nov 2016 20:13:56 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201611282013.uASKDux3049923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 28 Nov 2016 20:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309262 - in head: release/packages usr.bin/clang usr.bin/clang/lld usr.bin/clang/lldb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 20:13:58 -0000 Author: dim Date: Mon Nov 28 20:13:56 2016 New Revision: 309262 URL: https://svnweb.freebsd.org/changeset/base/309262 Log: Fix packaging for clang, lldb and lld 3.9.0 During the upgrade of clang/llvm etc to 3.9.0 in r309124, the PACKAGE directive in the usr.bin/clang/*.mk files got dropped accidentally. Restore it, with a few minor changes and additions: * Correct license in clang.ucl to NCSA * Add PACKAGE=clang for clang and most of the "ll" tools * Put lldb in its own package * Put lld in its own package Reviewed by: gjb, jmallett X-MFC-With: 309124 Differential Revision: https://reviews.freebsd.org/D8666 Added: head/release/packages/lld.ucl (contents, props changed) head/release/packages/lldb.ucl (contents, props changed) Modified: head/release/packages/clang.ucl head/usr.bin/clang/clang.prog.mk head/usr.bin/clang/lld/Makefile head/usr.bin/clang/lldb/Makefile head/usr.bin/clang/llvm.prog.mk Modified: head/release/packages/clang.ucl ============================================================================== --- head/release/packages/clang.ucl Mon Nov 28 20:11:13 2016 (r309261) +++ head/release/packages/clang.ucl Mon Nov 28 20:13:56 2016 (r309262) @@ -11,7 +11,7 @@ maintainer = "re@FreeBSD.org" www = "https://www.FreeBSD.org" prefix = "/" licenselogic = "single" -licenses = [ BSD2CLAUSE ] +licenses = [ NCSA ] desc = < Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41D8DC58AB3; Mon, 28 Nov 2016 20:22:34 +0000 (UTC) (envelope-from cognet@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 E5BC71CA3; Mon, 28 Nov 2016 20:22:33 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASKMXO2053999; Mon, 28 Nov 2016 20:22:33 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASKMX4O053998; Mon, 28 Nov 2016 20:22:33 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201611282022.uASKMX4O053998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Mon, 28 Nov 2016 20:22:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r309264 - in vendor-sys/ck/dist: . build doc include regressions tools X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 20:22:34 -0000 Author: cognet Date: Mon Nov 28 20:22:32 2016 New Revision: 309264 URL: https://svnweb.freebsd.org/changeset/base/309264 Log: Remove files that won't be used during FreeBSD build. Deleted: vendor-sys/ck/dist/LICENSE vendor-sys/ck/dist/Makefile.in vendor-sys/ck/dist/README vendor-sys/ck/dist/build/ vendor-sys/ck/dist/configure vendor-sys/ck/dist/doc/ vendor-sys/ck/dist/include/ck_md.h.in vendor-sys/ck/dist/regressions/ vendor-sys/ck/dist/tools/ From owner-svn-src-all@freebsd.org Mon Nov 28 20:24:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 684F8C58B1A; Mon, 28 Nov 2016 20:24:10 +0000 (UTC) (envelope-from cognet@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 3779C1E14; Mon, 28 Nov 2016 20:24:10 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASKO9F8054107; Mon, 28 Nov 2016 20:24:09 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASKO9KZ054106; Mon, 28 Nov 2016 20:24:09 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201611282024.uASKO9KZ054106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Mon, 28 Nov 2016 20:24:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r309265 - in vendor-sys/ck/20161128: . build doc include regressions tools X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 20:24:10 -0000 Author: cognet Date: Mon Nov 28 20:24:09 2016 New Revision: 309265 URL: https://svnweb.freebsd.org/changeset/base/309265 Log: Re-tag ck as of commit 566bb28dba963a1904e0889b74fe7005a5bc5eb8 Replaced: vendor-sys/ck/20161128/ - copied from r309260, vendor-sys/ck/dist/ Deleted: vendor-sys/ck/20161128/LICENSE vendor-sys/ck/20161128/Makefile.in vendor-sys/ck/20161128/README vendor-sys/ck/20161128/build/ vendor-sys/ck/20161128/configure vendor-sys/ck/20161128/doc/ vendor-sys/ck/20161128/include/ck_md.h.in vendor-sys/ck/20161128/regressions/ vendor-sys/ck/20161128/tools/ From owner-svn-src-all@freebsd.org Mon Nov 28 20:26:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2701DC58CAF; Mon, 28 Nov 2016 20:26:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DBFBB1165; Mon, 28 Nov 2016 20:26:49 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id A582B6B7C; Mon, 28 Nov 2016 20:26:48 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Mon, 28 Nov 2016 20:26:45 +0000 From: Glen Barber To: Kyle Evans Cc: Dimitry Andric , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309124 - in head: . contrib/compiler-rt contrib/compiler-rt/include/sanitizer contrib/compiler-rt/lib/asan contrib/compiler-rt/lib/builtins contrib/compiler-rt/lib/builtins/arm contrib... Message-ID: <20161128202645.GI33978@FreeBSD.org> References: <201611242254.uAOMswkb081748@repo.freebsd.org> <0D261A71-8296-4CA7-8E6B-0E0B104E5142@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6cMF9JLEeZkfJjkP" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 11.0-STABLE amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer X-Spidey-Sense: Uh oh, Peter logged in User-Agent: Mutt/1.7.1 (2016-10-04) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 20:26:50 -0000 --6cMF9JLEeZkfJjkP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 28, 2016 at 01:50:44PM -0600, Kyle Evans wrote: > On Mon, Nov 28, 2016 at 1:44 PM, Dimitry Andric wrote: > > On 28 Nov 2016, at 03:20, Kyle Evans wrote: > >> > >> On Thu, Nov 24, 2016 at 4:54 PM, Dimitry Andric wrot= e: > >>> Author: dim > >>> Date: Thu Nov 24 22:54:55 2016 > >>> New Revision: 309124 > >>> URL: https://svnweb.freebsd.org/changeset/base/309124 > >>> > >>> Log: > >>> Upgrade our copies of clang, llvm, lldb, compiler-rt and libc++ to 3= =2E9.0 > >>> release, and add lld 3.9.0. Also completely revamp the build system= for > >>> clang, llvm, lldb and their related tools. > > ... > >> Unfortunately, this commit seems to have done away with the -clang > >> pkgbase pkg [1], and doesn't seem to have revived the PACKAGE=3D > >> elsewhere as FreeBSD-clang has disappeared from my newly built > >> repository. =3D( > > > > Sorry about that. I have submitted the following review to make amends: > > > > https://reviews.freebsd.org/D8666 > > >=20 > Thanks! I had a brief moment of panic where I thought perhaps this > meant clang would be omitted from the upgraded system as the old > -clang package got removed upon upgrade. >=20 > Of course, I was pleasantly surprised to find that the lack of > PACKAGE=3D just meant a fallback to the -runtime package -- this design > I like, even though the -clang package is desired. =3D) >=20 There is a small potential downside to this, however - you may need to manually install the clang package after upgrading again. This is being worked on, though. Glen --6cMF9JLEeZkfJjkP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCAAGBQJYPJMFAAoJEAMUWKVHj+KTPgAP/R1FYqoTJ1/++ceJ8NSsX9Gl 96K7+sYrJmXjfe0yjTdW6JyRzoq+b5p+ywbaqILOoUTqFIzzVu1rcKqVGDJnJSJ/ seuuvygoKqoB3KuNMkK3L/XyxzJ4T5XaP0+DwGPc5kZ9OJXVvOl950VmcpRZdI4x 3kPfd/6aXihx7IKsOFv+5fIge1FowEq/snECFJxe5FforiK3DJVjS3ITO4SvQBFV 7RnFgQqvBCf/n49kCdFtrSyBamkELMWX6CPlkyyV3/vcytcde14oFr/LSLoUDQYI DCbFSTN6Ld3nzH+qJqGxLFAVUry2M3OvqpkNQBlNmLjQrznrTvGMdRDGEVyW4dD+ 8AVov84ZWAzP5ZGAuOoAK803jy6PtIxw734Lv7J+W4+BPp2jDgEY6SjQgKq7AKYo 6CT4xffkK0J68jgu8krUn9qg0MDyWOwwy1Ck2MBMsN9/vYDVbC6U9RFxCnWUITmn /6dAoIEHJe7zEjSpMdZ5h+/l6VoLkd5bCIEGgdIr80pajhtPArMb4uqgLFeGF29Z muO+d5OgeX+sFAde4kHEqcwz5iflZucYVfloRNl4f7ZbE+GIAyvjcQV/BJgFb7hx KgMk4f8YczyNojLxQT6JN3cQMTMzoRo84W/A5oQ/4yux2JrFjlsoZCU4UF3wsBJR wUmVURoflnuDO6V/FXbI =9Eyd -----END PGP SIGNATURE----- --6cMF9JLEeZkfJjkP-- From owner-svn-src-all@freebsd.org Mon Nov 28 20:27:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEBFBC58D3D; Mon, 28 Nov 2016 20:27:59 +0000 (UTC) (envelope-from cognet@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 7586D1307; Mon, 28 Nov 2016 20:27:59 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASKRwUu054395; Mon, 28 Nov 2016 20:27:58 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASKRw2K054394; Mon, 28 Nov 2016 20:27:58 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201611282027.uASKRw2K054394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Mon, 28 Nov 2016 20:27:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309266 - head/sys/contrib/ck X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 20:27:59 -0000 Author: cognet Date: Mon Nov 28 20:27:58 2016 New Revision: 309266 URL: https://svnweb.freebsd.org/changeset/base/309266 Log: Import Concurrency Kit in the kernel. CK is a toolkit providing different lockfree algorithms/data structures. More information can be found here : www.concurrencykit.org Added: head/sys/contrib/ck/ - copied from r309265, vendor-sys/ck/dist/ From owner-svn-src-all@freebsd.org Mon Nov 28 20:33:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A286C5913C; Mon, 28 Nov 2016 20:33:32 +0000 (UTC) (envelope-from cognet@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 D65ED18EA; Mon, 28 Nov 2016 20:33:31 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASKXVA2058305; Mon, 28 Nov 2016 20:33:31 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASKXUqA058302; Mon, 28 Nov 2016 20:33:30 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201611282033.uASKXUqA058302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Mon, 28 Nov 2016 20:33:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309267 - in head/sys/contrib/ck/include: . gcc/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 20:33:32 -0000 Author: cognet Date: Mon Nov 28 20:33:30 2016 New Revision: 309267 URL: https://svnweb.freebsd.org/changeset/base/309267 Log: Add FreeBSD-specific files. Added: head/sys/contrib/ck/include/ck_md.h (contents, props changed) head/sys/contrib/ck/include/gcc/arm/ck_pr_armv4.h (contents, props changed) Modified: head/sys/contrib/ck/include/ck_pr.h Added: head/sys/contrib/ck/include/ck_md.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/ck/include/ck_md.h Mon Nov 28 20:33:30 2016 (r309267) @@ -0,0 +1,71 @@ +/* + * Copyright 2011-2012 Samy Al Bahra. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef CK_MD_H +#define CK_MD_H + +#ifndef CK_MD_CACHELINE +#define CK_MD_CACHELINE (64) +#endif + +#ifndef CK_MD_PAGESIZE +#define CK_MD_PAGESIZE (4096) +#endif + +#ifndef CK_MD_RTM_DISABLE +#define CK_MD_RTM_DISABLE +#endif /* CK_MD_RTM_DISABLE */ + +#ifndef CK_MD_POINTER_PACK_DISABLE +#define CK_MD_POINTER_PACK_DISABLE +#endif /* CK_MD_POINTER_PACK_DISABLE */ + +#ifndef CK_MD_VMA_BITS_UNKNOWN +#define CK_MD_VMA_BITS_UNKNOWN +#endif /* CK_MD_VMA_BITS_UNKNOWN */ + +#ifndef CK_MD_RMO +#define CK_MD_RMO +#endif /* CK_MD_RMO */ + +#define CK_VERSION "0.5.2" +#define CK_GIT_SHA "" + +/* + * CK expects those, which are normally defined by the build system. + */ +#if defined(__i386__) && !defined(__x86__) +#define __x86__ +#elif defined(__sparc64__) && !defined(__sparcv9__) +#define __sparcv9__ +#elif defined(__powerpc64__) && !defined(__ppc64__) +#define __ppc64__ +#elif defined(__powerpc__) && !defined(__ppc__) +#define __ppc__ +#endif +#endif /* CK_MD_H */ Modified: head/sys/contrib/ck/include/ck_pr.h ============================================================================== --- head/sys/contrib/ck/include/ck_pr.h Mon Nov 28 20:27:58 2016 (r309266) +++ head/sys/contrib/ck/include/ck_pr.h Mon Nov 28 20:33:30 2016 (r309267) @@ -46,7 +46,11 @@ #elif defined(__ppc__) #include "gcc/ppc/ck_pr.h" #elif defined(__arm__) +#if __ARM_ARCH >= 6 #include "gcc/arm/ck_pr.h" +#else +#include "gcc/arm/ck_pr_armv4.h" +#endif #elif defined(__aarch64__) #include "gcc/aarch64/ck_pr.h" #elif !defined(__GNUC__) Added: head/sys/contrib/ck/include/gcc/arm/ck_pr_armv4.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/ck/include/gcc/arm/ck_pr_armv4.h Mon Nov 28 20:33:30 2016 (r309267) @@ -0,0 +1,350 @@ +/* + * Copyright 2009-2016 Samy Al Bahra. + * Copyright 2016 Olivier Houchard. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef CK_PR_ARM_H +#define CK_PR_ARM_H + +#ifndef CK_PR_H +#error Do not include this file directly, use ck_pr.h +#endif + +#include +#include + +#include + +/* + * armv4/v5 CPUs lack any instruction that would let us implement an atomic CAS + * so we have to give atomicity by disabling interrupts. This only works in + * the kernel, obviously. + */ +#define __with_interrupts_disabled(expr) \ + do { \ + u_int cpsr_save, tmp; \ + \ + __asm __volatile( \ + "mrs %0, cpsr;" \ + "orr %1, %0, %2;" \ + "msr cpsr_fsxc, %1;" \ + : "=r" (cpsr_save), "=r" (tmp) \ + : "I" (PSR_I | PSR_F) \ + : "cc" ); \ + (expr); \ + __asm __volatile( \ + "msr cpsr_fsxc, %0" \ + : /* no output */ \ + : "r" (cpsr_save) \ + : "cc" ); \ + } while(0) +/* + * The following represent supported atomic operations. + * These operations may be emulated. + */ +#include "ck_f_pr.h" + +/* + * Minimum interface requirement met. + */ +#define CK_F_PR + +CK_CC_INLINE static void +ck_pr_stall(void) +{ + + __asm__ __volatile__("" ::: "memory"); + return; +} + +#define CK_PR_FENCE(T, I) \ + CK_CC_INLINE static void \ + ck_pr_fence_strict_##T(void) \ + { \ + I; \ + } + +/* + * ARM CPUs prior to armv6 didn't reorder instructions, and we don't + * support any SMP system, so a compiler barrier should be enough for fences + */ +CK_PR_FENCE(atomic, ck_pr_stall()) +CK_PR_FENCE(atomic_store, ck_pr_stall()) +CK_PR_FENCE(atomic_load, ck_pr_stall()) +CK_PR_FENCE(store_atomic, ck_pr_stall()) +CK_PR_FENCE(load_atomic, ck_pr_stall()) +CK_PR_FENCE(store, ck_pr_stall()) +CK_PR_FENCE(store_load, ck_pr_stall()) +CK_PR_FENCE(load, ck_pr_stall()) +CK_PR_FENCE(load_store, ck_pr_stall()) +CK_PR_FENCE(memory, ck_pr_stall()) +CK_PR_FENCE(acquire, ck_pr_stall()) +CK_PR_FENCE(release, ck_pr_stall()) +CK_PR_FENCE(acqrel, ck_pr_stall()) +CK_PR_FENCE(lock, ck_pr_stall()) +CK_PR_FENCE(unlock, ck_pr_stall()) + +#undef CK_PR_FENCE + +#define CK_PR_LOAD(S, M, T, C, I) \ + CK_CC_INLINE static T \ + ck_pr_md_load_##S(const M *target) \ + { \ + long r = 0; \ + __asm__ __volatile__(I " %0, [%1];" \ + : "=r" (r) \ + : "r" (target) \ + : "memory"); \ + return ((T)r); \ + } + +CK_PR_LOAD(ptr, void, void *, uint32_t, "ldr") + +#define CK_PR_LOAD_S(S, T, I) CK_PR_LOAD(S, T, T, T, I) + +CK_PR_LOAD_S(32, uint32_t, "ldr") +CK_PR_LOAD_S(16, uint16_t, "ldrh") +CK_PR_LOAD_S(8, uint8_t, "ldrb") +CK_PR_LOAD_S(uint, unsigned int, "ldr") +CK_PR_LOAD_S(int, int, "ldr") +CK_PR_LOAD_S(short, short, "ldrh") +CK_PR_LOAD_S(char, char, "ldrb") + +#undef CK_PR_LOAD_S +#undef CK_PR_LOAD + +#define CK_PR_STORE(S, M, T, C, I) \ + CK_CC_INLINE static void \ + ck_pr_md_store_##S(M *target, T v) \ + { \ + __asm__ __volatile__(I " %1, [%0]" \ + : \ + : "r" (target), \ + "r" (v) \ + : "memory"); \ + return; \ + } + +CK_PR_STORE(ptr, void, const void *, uint32_t, "str") + +#define CK_PR_STORE_S(S, T, I) CK_PR_STORE(S, T, T, T, I) + +CK_PR_STORE_S(32, uint32_t, "str") +CK_PR_STORE_S(16, uint16_t, "strh") +CK_PR_STORE_S(8, uint8_t, "strb") +CK_PR_STORE_S(uint, unsigned int, "str") +CK_PR_STORE_S(int, int, "str") +CK_PR_STORE_S(short, short, "strh") +CK_PR_STORE_S(char, char, "strb") + +#undef CK_PR_STORE_S +#undef CK_PR_STORE + +#define CK_PR_CAS(N, M, T) \ +CK_CC_INLINE static bool \ +ck_pr_cas_##N##_value(M *target, T compare, T set, M *value) \ +{ \ + bool ret; \ + __with_interrupts_disabled( \ + { \ + *(T *)value = *(T *)target; \ + if (*(T *)target == compare) { \ + *(T *)target = set; \ + ret = true; \ + } else \ + ret = false; \ + } \ + ); \ + return ret; \ +} \ +CK_CC_INLINE static bool \ +ck_pr_cas_##N(M *target, T compare, T set) \ +{ \ + bool ret; \ + __with_interrupts_disabled( \ + { \ + if (*(T *)target == compare) { \ + *(T *)target = set; \ + ret = true; \ + } else \ + ret = false; \ + } \ + ); \ + return ret; \ +} + +CK_PR_CAS(ptr, void, void *) + +#define CK_PR_CAS_S(N, T) CK_PR_CAS(N, T, T) +CK_PR_CAS_S(32, uint32_t) +CK_PR_CAS_S(uint, unsigned int) +CK_PR_CAS_S(int, int) +CK_PR_CAS_S(16, uint16_t) +CK_PR_CAS_S(8, uint8_t) +CK_PR_CAS_S(short, short) +CK_PR_CAS_S(char, char) + +#undef CK_PR_CAS_S +#undef CK_PR_CAS + +#define CK_PR_FAS(N, M, T, W) \ + CK_CC_INLINE static T \ + ck_pr_fas_##N(M *target, T v) \ + { \ + T previous = 0; \ + __with_interrupts_disabled( \ + { \ + previous = *(T *)target; \ + *(T *)target = v; \ + } \ + ); \ + return (previous); \ + } + +CK_PR_FAS(32, uint32_t, uint32_t, "") +CK_PR_FAS(ptr, void, void *, "") +CK_PR_FAS(int, int, int, "") +CK_PR_FAS(uint, unsigned int, unsigned int, "") +CK_PR_FAS(16, uint16_t, uint16_t, "h") +CK_PR_FAS(8, uint8_t, uint8_t, "b") +CK_PR_FAS(short, short, short, "h") +CK_PR_FAS(char, char, char, "b") + + +#undef CK_PR_FAS + +#define CK_PR_UNARY(O, N, M, T, I, W) \ + CK_CC_INLINE static void \ + ck_pr_##O##_##N(M *target) \ + { \ + __with_interrupts_disabled( \ + { \ + I; \ + } \ + ); \ + return; \ + } + +CK_PR_UNARY(inc, ptr, void, void *, (*(int *)target)++, "") +CK_PR_UNARY(dec, ptr, void, void *, (*(int *)target)--, "") +CK_PR_UNARY(not, ptr, void, void *, *(int *)target = !(*(int*)target), "") +CK_PR_UNARY(neg, ptr, void, void *, *(int *)target = -(*(int *)target), "") + +#define CK_PR_UNARY_S(S, T, W) \ + CK_PR_UNARY(inc, S, T, T, *target++, W) \ + CK_PR_UNARY(dec, S, T, T, *target--, W) \ + CK_PR_UNARY(not, S, T, T, *target = !*target, W) \ + CK_PR_UNARY(neg, S, T, T, *target = -*target, W) \ + +CK_PR_UNARY_S(32, uint32_t, "") +CK_PR_UNARY_S(uint, unsigned int, "") +CK_PR_UNARY_S(int, int, "") +CK_PR_UNARY_S(16, uint16_t, "h") +CK_PR_UNARY_S(8, uint8_t, "b") +CK_PR_UNARY_S(short, short, "h") +CK_PR_UNARY_S(char, char, "b") + +#undef CK_PR_UNARY_S +#undef CK_PR_UNARY + +#define CK_PR_BINARY(O, N, M, T, I, W) \ + CK_CC_INLINE static void \ + ck_pr_##O##_##N(M *target, T delta) \ + { \ + __with_interrupts_disabled( \ + { \ + I; \ + } \ + ); \ + return; \ + } + +CK_PR_BINARY(and, ptr, void, uintptr_t, *((uintptr_t *)target) &= delta, "") +CK_PR_BINARY(add, ptr, void, uintptr_t, *((uintptr_t *)target) += delta, "") +CK_PR_BINARY(or, ptr, void, uintptr_t, *((uintptr_t *)target) |= delta, "") +CK_PR_BINARY(sub, ptr, void, uintptr_t, *((uintptr_t *)target) -= delta, "") +CK_PR_BINARY(xor, ptr, void, uintptr_t, *((uintptr_t *)target) ^= delta, "") + +#define CK_PR_BINARY_S(S, T, W) \ + CK_PR_BINARY(and, S, T, T, *target &= delta, W) \ + CK_PR_BINARY(add, S, T, T, *target += delta, W) \ + CK_PR_BINARY(or, S, T, T, *target |= delta, W) \ + CK_PR_BINARY(sub, S, T, T, *target -= delta, W) \ + CK_PR_BINARY(xor, S, T, T, *target ^= delta, W) + +CK_PR_BINARY_S(32, uint32_t, "") +CK_PR_BINARY_S(uint, unsigned int, "") +CK_PR_BINARY_S(int, int, "") +CK_PR_BINARY_S(16, uint16_t, "h") +CK_PR_BINARY_S(8, uint8_t, "b") +CK_PR_BINARY_S(short, short, "h") +CK_PR_BINARY_S(char, char, "b") + +#undef CK_PR_BINARY_S +#undef CK_PR_BINARY + +CK_CC_INLINE static void * +ck_pr_faa_ptr(void *target, uintptr_t delta) +{ + uintptr_t previous; + __with_interrupts_disabled( + { + previous = *(uintptr_t *)target; + *(uintptr_t *)target += delta; + } + ); + return (void *)(previous); +} + +#define CK_PR_FAA(S, T, W) \ + CK_CC_INLINE static T \ + ck_pr_faa_##S(T *target, T delta) \ + { \ + T previous = 0; \ + __with_interrupts_disabled( \ + { \ + previous = *target; \ + *target += delta; \ + } \ + ); \ + return (previous); \ + } + +CK_PR_FAA(32, uint32_t, "") +CK_PR_FAA(uint, unsigned int, "") +CK_PR_FAA(int, int, "") +CK_PR_FAA(16, uint16_t, "h") +CK_PR_FAA(8, uint8_t, "b") +CK_PR_FAA(short, short, "h") +CK_PR_FAA(char, char, "b") + +#undef CK_PR_FAA + +#undef __with_interrupts_disabled + +#endif /* CK_PR_ARM_H */ + From owner-svn-src-all@freebsd.org Mon Nov 28 20:44:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DF15C59369; Mon, 28 Nov 2016 20:44:13 +0000 (UTC) (envelope-from cognet@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 1D7211DCA; Mon, 28 Nov 2016 20:44:13 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASKiCAY062270; Mon, 28 Nov 2016 20:44:12 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASKiCfZ062269; Mon, 28 Nov 2016 20:44:12 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201611282044.uASKiCfZ062269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Mon, 28 Nov 2016 20:44:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309268 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 20:44:13 -0000 Author: cognet Date: Mon Nov 28 20:44:12 2016 New Revision: 309268 URL: https://svnweb.freebsd.org/changeset/base/309268 Log: Hook CK to the kernel build. Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Nov 28 20:33:30 2016 (r309267) +++ head/sys/conf/files Mon Nov 28 20:44:12 2016 (r309268) @@ -305,6 +305,17 @@ compat/freebsd32/freebsd32_ioctl.c optio compat/freebsd32/freebsd32_misc.c optional compat_freebsd32 compat/freebsd32/freebsd32_syscalls.c optional compat_freebsd32 compat/freebsd32/freebsd32_sysent.c optional compat_freebsd32 +contrib/ck/src/ck_array.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_barrier_centralized.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_barrier_combining.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_barrier_dissemination.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_barrier_mcs.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_barrier_tournament.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_epoch.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_hp.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_hs.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_ht.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" +contrib/ck/src/ck_rhs.c standard compile-with "${NORMAL_C} -I$S/contrib/ck/include" contrib/dev/acpica/common/ahids.c optional acpi acpi_debug contrib/dev/acpica/common/ahuuids.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbcmds.c optional acpi acpi_debug From owner-svn-src-all@freebsd.org Mon Nov 28 21:00:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3B60C59ABA; Mon, 28 Nov 2016 21:00:20 +0000 (UTC) (envelope-from des@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 6620818F0; Mon, 28 Nov 2016 21:00:20 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASL0JPM066687; Mon, 28 Nov 2016 21:00:19 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASL0Jvb066685; Mon, 28 Nov 2016 21:00:19 GMT (envelope-from des@FreeBSD.org) Message-Id: <201611282100.uASL0Jvb066685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Mon, 28 Nov 2016 21:00:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309269 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 21:00:20 -0000 Author: des Date: Mon Nov 28 21:00:19 2016 New Revision: 309269 URL: https://svnweb.freebsd.org/changeset/base/309269 Log: Use malloc()ed buffers instead of stack buffers in gr_copy() and pw_copy(). This allows pw(8) to operate on passwd and group files with longer lines than could be accomodated by a stack buffer. It doesn't take more than a few hundred users to exceed 8192 bytes in /etc/group. MFC after: 3 weeks Sponsored by: The University of Oslo Modified: head/lib/libutil/gr_util.c head/lib/libutil/pw_util.c Modified: head/lib/libutil/gr_util.c ============================================================================== --- head/lib/libutil/gr_util.c Mon Nov 28 20:44:12 2016 (r309268) +++ head/lib/libutil/gr_util.c Mon Nov 28 21:00:19 2016 (r309269) @@ -164,11 +164,12 @@ gr_tmp(int mfd) int gr_copy(int ffd, int tfd, const struct group *gr, struct group *old_gr) { - char buf[8192], *end, *line, *p, *q, *r, t; + char *buf, *end, *line, *p, *q, *r, *tmp; struct group *fgr; const struct group *sgr; - size_t len; + size_t len, size; int eof, readlen; + char t; if (old_gr == NULL && gr == NULL) return(-1); @@ -186,6 +187,10 @@ gr_copy(int ffd, int tfd, const struct g if (sgr == NULL) sgr = gr; + /* initialize the buffer */ + if ((buf = malloc(size = 1024)) == NULL) + goto err; + eof = 0; len = 0; p = q = end = buf; @@ -199,10 +204,16 @@ gr_copy(int ffd, int tfd, const struct g if (q >= end) { if (eof) break; - if ((size_t)(q - p) >= sizeof(buf)) { - warnx("group line too long"); - errno = EINVAL; /* hack */ - goto err; + while ((size_t)(q - p) >= size) { + if ((tmp = realloc(buf, size * 2)) == NULL) { + warnx("group line too long"); + goto err; + } + p = tmp + (p - buf); + q = tmp + (q - buf); + end = tmp + (end - buf); + buf = tmp; + size = size * 2; } if (p < end) { q = memmove(buf, p, end -p); @@ -210,7 +221,7 @@ gr_copy(int ffd, int tfd, const struct g } else { p = q = end = buf; } - readlen = read(ffd, end, sizeof(buf) - (end -buf)); + readlen = read(ffd, end, size - (end - buf)); if (readlen == -1) goto err; else @@ -219,7 +230,7 @@ gr_copy(int ffd, int tfd, const struct g break; end += len; len = end - buf; - if (len < (ssize_t)sizeof(buf)) { + if (len < size) { eof = 1; if (len > 0 && buf[len -1] != '\n') ++len, *end++ = '\n'; @@ -281,7 +292,7 @@ gr_copy(int ffd, int tfd, const struct g if (write(tfd, q, end - q) != end - q) goto err; q = buf; - readlen = read(ffd, buf, sizeof(buf)); + readlen = read(ffd, buf, size); if (readlen == 0) break; else @@ -303,12 +314,12 @@ gr_copy(int ffd, int tfd, const struct g write(tfd, "\n", 1) != 1) goto err; done: - if (line != NULL) - free(line); + free(line); + free(buf); return (0); err: - if (line != NULL) - free(line); + free(line); + free(buf); return (-1); } Modified: head/lib/libutil/pw_util.c ============================================================================== --- head/lib/libutil/pw_util.c Mon Nov 28 20:44:12 2016 (r309268) +++ head/lib/libutil/pw_util.c Mon Nov 28 21:00:19 2016 (r309269) @@ -427,11 +427,12 @@ pw_make_v7(const struct passwd *pw) int pw_copy(int ffd, int tfd, const struct passwd *pw, struct passwd *old_pw) { - char buf[8192], *end, *line, *p, *q, *r, t; + char *buf, *end, *line, *p, *q, *r, *tmp; struct passwd *fpw; const struct passwd *spw; - size_t len; + size_t len, size; int eof, readlen; + char t; if (old_pw == NULL && pw == NULL) return (-1); @@ -449,6 +450,10 @@ pw_copy(int ffd, int tfd, const struct p if (spw == NULL) spw = pw; + /* initialize the buffer */ + if ((buf = malloc(size = 1024)) == NULL) + goto err; + eof = 0; len = 0; p = q = end = buf; @@ -462,10 +467,16 @@ pw_copy(int ffd, int tfd, const struct p if (q >= end) { if (eof) break; - if ((size_t)(q - p) >= sizeof(buf)) { - warnx("passwd line too long"); - errno = EINVAL; /* hack */ - goto err; + while ((size_t)(q - p) >= size) { + if ((tmp = realloc(buf, size * 2)) == NULL) { + warnx("passwd line too long"); + goto err; + } + p = tmp + (p - buf); + q = tmp + (q - buf); + end = tmp + (end - buf); + buf = tmp; + size = size * 2; } if (p < end) { q = memmove(buf, p, end - p); @@ -473,7 +484,7 @@ pw_copy(int ffd, int tfd, const struct p } else { p = q = end = buf; } - readlen = read(ffd, end, sizeof(buf) - (end - buf)); + readlen = read(ffd, end, size - (end - buf)); if (readlen == -1) goto err; else @@ -482,7 +493,7 @@ pw_copy(int ffd, int tfd, const struct p break; end += len; len = end - buf; - if (len < (ssize_t)sizeof(buf)) { + if (len < size) { eof = 1; if (len > 0 && buf[len - 1] != '\n') ++len, *end++ = '\n'; @@ -545,7 +556,7 @@ pw_copy(int ffd, int tfd, const struct p if (write(tfd, q, end - q) != end - q) goto err; q = buf; - readlen = read(ffd, buf, sizeof(buf)); + readlen = read(ffd, buf, size); if (readlen == 0) break; else @@ -567,12 +578,12 @@ pw_copy(int ffd, int tfd, const struct p write(tfd, "\n", 1) != 1) goto err; done: - if (line != NULL) - free(line); + free(line); + free(buf); return (0); err: - if (line != NULL) - free(line); + free(line); + free(buf); return (-1); } From owner-svn-src-all@freebsd.org Mon Nov 28 21:16:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8646EC59FA1; Mon, 28 Nov 2016 21:16:04 +0000 (UTC) (envelope-from cognet@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 55D6D1195; Mon, 28 Nov 2016 21:16:04 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASLG3P1074542; Mon, 28 Nov 2016 21:16:03 GMT (envelope-from cognet@FreeBSD.org) Received: (from cognet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASLG3hI074541; Mon, 28 Nov 2016 21:16:03 GMT (envelope-from cognet@FreeBSD.org) Message-Id: <201611282116.uASLG3hI074541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cognet set sender to cognet@FreeBSD.org using -f From: Olivier Houchard Date: Mon, 28 Nov 2016 21:16:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309270 - head/sys/contrib/ck X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 21:16:04 -0000 Author: cognet Date: Mon Nov 28 21:16:03 2016 New Revision: 309270 URL: https://svnweb.freebsd.org/changeset/base/309270 Log: Add a FREEBSD-Xlist file for CK. Added: head/sys/contrib/ck/FREEBSD-Xlist Added: head/sys/contrib/ck/FREEBSD-Xlist ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/ck/FREEBSD-Xlist Mon Nov 28 21:16:03 2016 (r309270) @@ -0,0 +1,10 @@ +#$FreeBSD$ +*/LICENSE +*/Makefile.in +*/README +*/build +*/configure +*/doc +*/regressions +*/tools +*/include/ck_md.h.in From owner-svn-src-all@freebsd.org Mon Nov 28 21:29:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CE9DC5A296; Mon, 28 Nov 2016 21:29:02 +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 6C9D41910; Mon, 28 Nov 2016 21:29:02 +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 uASLT1Xx078699; Mon, 28 Nov 2016 21:29:01 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASLT1G7078698; Mon, 28 Nov 2016 21:29:01 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201611282129.uASLT1G7078698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 28 Nov 2016 21:29:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309271 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 21:29:02 -0000 Author: imp Date: Mon Nov 28 21:29:01 2016 New Revision: 309271 URL: https://svnweb.freebsd.org/changeset/base/309271 Log: Trying to autodetect legacy setups lead to problems when people overrode the disk image creation routine. For now, just always bring in the legecy defines / routines. Modified: head/tools/tools/nanobsd/nanobsd.sh Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Mon Nov 28 21:16:03 2016 (r309270) +++ head/tools/tools/nanobsd/nanobsd.sh Mon Nov 28 21:29:01 2016 (r309271) @@ -44,9 +44,9 @@ do_installworld=true do_image=true do_copyout_partition=true do_native_xtools=false -# Don't do the legacy build unless we detect 'old' variables being -# set. -do_legacy=false + +# Pull in legacy stuff for now automatically +. "${topdir}/legacy.sh" set +e args=`getopt BKXWbc:fhiknqvw $*` @@ -134,15 +134,6 @@ if [ $# -gt 0 ] ; then usage fi -if [ -n "$NANO_HEADS" -o -n "$NANO_SECTS" ]; then - do_legacy=true -fi - -# If this uses the old, legacy image system, pull that in as well -if $do_legacy ; then - . "${topdir}/legacy.sh" -fi - ####################################################################### # And then it is as simple as that... From owner-svn-src-all@freebsd.org Mon Nov 28 22:19:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0513AC5A0DB; Mon, 28 Nov 2016 22:19:43 +0000 (UTC) (envelope-from bapt@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 C869D140F; Mon, 28 Nov 2016 22:19:42 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASMJfa2098731; Mon, 28 Nov 2016 22:19:41 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASMJfd9098730; Mon, 28 Nov 2016 22:19:41 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201611282219.uASMJfd9098730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 28 Nov 2016 22:19:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309272 - stable/11/usr.sbin/syslogd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 22:19:43 -0000 Author: bapt Date: Mon Nov 28 22:19:41 2016 New Revision: 309272 URL: https://svnweb.freebsd.org/changeset/base/309272 Log: MFC r309194, r309216 Properly initialize nextp Reported by: Coverity via cem MFC after: 2 days CID: 1365665 Modified: stable/11/usr.sbin/syslogd/syslogd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/syslogd/syslogd.c ============================================================================== --- stable/11/usr.sbin/syslogd/syslogd.c Mon Nov 28 21:29:01 2016 (r309271) +++ stable/11/usr.sbin/syslogd/syslogd.c Mon Nov 28 22:19:41 2016 (r309272) @@ -1835,6 +1835,7 @@ init(int signo) free((char *)f); } Files = NULL; + nextp = &Files; /* open the configuration file */ if ((cf = fopen(ConfFile, "r")) == NULL) { From owner-svn-src-all@freebsd.org Mon Nov 28 22:35:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 995E6C5A75E; Mon, 28 Nov 2016 22:35:11 +0000 (UTC) (envelope-from asomers@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 688201058; Mon, 28 Nov 2016 22:35:11 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uASMZAb3006351; Mon, 28 Nov 2016 22:35:10 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uASMZAWG006350; Mon, 28 Nov 2016 22:35:10 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201611282235.uASMZAWG006350@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 28 Nov 2016 22:35:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309273 - stable/11/sys/cam/scsi X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 22:35:11 -0000 Author: asomers Date: Mon Nov 28 22:35:10 2016 New Revision: 309273 URL: https://svnweb.freebsd.org/changeset/base/309273 Log: MFC r308780 Fix "camcontrol rescan" with SATA drives behind a SAS controller A bug in CAM's serial number hash logic resulted in SATA drives behind a SAS controller getting removed and readded anytime the drive was rescanned for any reason Modified: stable/11/sys/cam/scsi/scsi_xpt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_xpt.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_xpt.c Mon Nov 28 22:19:41 2016 (r309272) +++ stable/11/sys/cam/scsi/scsi_xpt.c Mon Nov 28 22:35:10 2016 (r309273) @@ -1600,8 +1600,8 @@ probe_device_check: sizeof(struct scsi_inquiry_data)); if (have_serialnum) - MD5Update(&context, serial_buf->serial_num, - serial_buf->length); + MD5Update(&context, path->device->serial_num, + path->device->serial_num_len); MD5Final(digest, &context); if (bcmp(softc->digest, digest, 16) == 0) From owner-svn-src-all@freebsd.org Tue Nov 29 00:16:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CA05C5848B; Tue, 29 Nov 2016 00:16:21 +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 D69A81C34; Tue, 29 Nov 2016 00:16:20 +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 uAT0GKjl045898; Tue, 29 Nov 2016 00:16:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAT0GKPi045897; Tue, 29 Nov 2016 00:16:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201611290016.uAT0GKPi045897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 29 Nov 2016 00:16:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309274 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 00:16:21 -0000 Author: jhb Date: Tue Nov 29 00:16:19 2016 New Revision: 309274 URL: https://svnweb.freebsd.org/changeset/base/309274 Log: Use the correct name for the GCC macro indicating max_align_t is defined. MFC after: 3 days Modified: head/include/stddef.h Modified: head/include/stddef.h ============================================================================== --- head/include/stddef.h Mon Nov 28 22:35:10 2016 (r309273) +++ head/include/stddef.h Tue Nov 29 00:16:19 2016 (r309274) @@ -66,7 +66,7 @@ typedef ___wchar_t wchar_t; #ifndef __CLANG_MAX_ALIGN_T_DEFINED typedef __max_align_t max_align_t; #define __CLANG_MAX_ALIGN_T_DEFINED -#define __GCC_MAX_ALIGN_T +#define _GCC_MAX_ALIGN_T #endif #endif From owner-svn-src-all@freebsd.org Tue Nov 29 01:08:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4ADEC5A3F5; Tue, 29 Nov 2016 01:08:10 +0000 (UTC) (envelope-from emaste@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 6E33F1905; Tue, 29 Nov 2016 01:08:10 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAT189SM066117; Tue, 29 Nov 2016 01:08:09 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAT1890L066116; Tue, 29 Nov 2016 01:08:09 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201611290108.uAT1890L066116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 29 Nov 2016 01:08:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309275 - stable/11/lib/libc/gen X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 01:08:10 -0000 Author: emaste Date: Tue Nov 29 01:08:09 2016 New Revision: 309275 URL: https://svnweb.freebsd.org/changeset/base/309275 Log: MFC r309006: remove unnecessary vm includes from setproctitle vm headers were needed only for the PS_STRINGS fallback, which was removed in r297888. Modified: stable/11/lib/libc/gen/setproctitle.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/setproctitle.c ============================================================================== --- stable/11/lib/libc/gen/setproctitle.c Tue Nov 29 00:16:19 2016 (r309274) +++ stable/11/lib/libc/gen/setproctitle.c Tue Nov 29 01:08:09 2016 (r309275) @@ -23,10 +23,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include - #include #include #include From owner-svn-src-all@freebsd.org Tue Nov 29 04:32:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 170A2C5B163; Tue, 29 Nov 2016 04:32:16 +0000 (UTC) (envelope-from jchandra@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 D3EF019DA; Tue, 29 Nov 2016 04:32:15 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAT4WFbv050561; Tue, 29 Nov 2016 04:32:15 GMT (envelope-from jchandra@FreeBSD.org) Received: (from jchandra@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAT4WF8c050560; Tue, 29 Nov 2016 04:32:15 GMT (envelope-from jchandra@FreeBSD.org) Message-Id: <201611290432.uAT4WF8c050560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jchandra set sender to jchandra@FreeBSD.org using -f From: "Jayachandran C." Date: Tue, 29 Nov 2016 04:32:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309276 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 04:32:16 -0000 Author: jchandra Date: Tue Nov 29 04:32:14 2016 New Revision: 309276 URL: https://svnweb.freebsd.org/changeset/base/309276 Log: Fix interrupt clear in pl011 uart receive function Clear the interrupt state before reading the input char from the input FIFO. In the current code there is a window between the read to the data register and the write to the the ICR, during which an input char will not cause an interrupt. This fixes the issue by which the serial port input on QEMU freezes when using the emulated pl011 serial port. Modified: head/sys/dev/uart/uart_dev_pl011.c Modified: head/sys/dev/uart/uart_dev_pl011.c ============================================================================== --- head/sys/dev/uart/uart_dev_pl011.c Tue Nov 29 01:08:09 2016 (r309275) +++ head/sys/dev/uart/uart_dev_pl011.c Tue Nov 29 04:32:14 2016 (r309276) @@ -443,6 +443,8 @@ uart_pl011_bus_receive(struct uart_softc sc->sc_rxbuf[sc->sc_rxput] = UART_STAT_OVERRUN; break; } + + __uart_setreg(bas, UART_ICR, (UART_RXREADY | RIS_RTIM)); xc = __uart_getreg(bas, UART_DR); rx = xc & 0xff; @@ -451,8 +453,6 @@ uart_pl011_bus_receive(struct uart_softc if (xc & DR_PE) rx |= UART_STAT_PARERR; - __uart_setreg(bas, UART_ICR, (UART_RXREADY | RIS_RTIM)); - uart_rx_put(sc, rx); ints = __uart_getreg(bas, UART_MIS); } From owner-svn-src-all@freebsd.org Tue Nov 29 08:12:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5702BC5BB44; Tue, 29 Nov 2016 08:12:19 +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 25FAD19DE; Tue, 29 Nov 2016 08:12:19 +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 uAT8CIv1040094; Tue, 29 Nov 2016 08:12:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAT8CIJW040093; Tue, 29 Nov 2016 08:12:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201611290812.uAT8CIJW040093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 29 Nov 2016 08:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309277 - stable/11/sys/fs/udf X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 08:12:19 -0000 Author: kib Date: Tue Nov 29 08:12:18 2016 New Revision: 309277 URL: https://svnweb.freebsd.org/changeset/base/309277 Log: MFC r308995: Do not dereference bp after bread(9) on error. Modified: stable/11/sys/fs/udf/udf_vnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/11/sys/fs/udf/udf_vnops.c Tue Nov 29 04:32:14 2016 (r309276) +++ stable/11/sys/fs/udf/udf_vnops.c Tue Nov 29 08:12:18 2016 (r309277) @@ -487,11 +487,11 @@ udf_read(struct vop_read_args *ap) } else { error = bread(vp, lbn, size, NOCRED, &bp); } - n = min(n, size - bp->b_resid); - if (error) { + if (error != 0) { brelse(bp); return (error); } + n = min(n, size - bp->b_resid); error = uiomove(bp->b_data + on, (int)n, uio); brelse(bp); From owner-svn-src-all@freebsd.org Tue Nov 29 08:15:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65BA9C5BCF0; Tue, 29 Nov 2016 08:15:13 +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 1B30F1BB6; Tue, 29 Nov 2016 08:15:13 +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 uAT8FC2N040331; Tue, 29 Nov 2016 08:15:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAT8FCiN040330; Tue, 29 Nov 2016 08:15:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201611290815.uAT8FCiN040330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 29 Nov 2016 08:15:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309278 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 08:15:13 -0000 Author: kib Date: Tue Nov 29 08:15:12 2016 New Revision: 309278 URL: https://svnweb.freebsd.org/changeset/base/309278 Log: MFC r308969: Restore vnode pager statistic for buffer pagers. Modified: stable/11/sys/kern/vfs_bio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_bio.c ============================================================================== --- stable/11/sys/kern/vfs_bio.c Tue Nov 29 08:12:18 2016 (r309277) +++ stable/11/sys/kern/vfs_bio.c Tue Nov 29 08:15:12 2016 (r309278) @@ -4727,7 +4727,7 @@ vfs_bio_getpages(struct vnode *vp, vm_pa daddr_t lbn, lbnp; vm_ooffset_t la, lb, poff, poffe; long bsize; - int bo_bs, br_flags, error, i; + int bo_bs, br_flags, error, i, pgsin, pgsin_a, pgsin_b; bool redo, lpart; object = vp->v_object; @@ -4737,17 +4737,26 @@ vfs_bio_getpages(struct vnode *vp, vm_pa return (VM_PAGER_BAD); lpart = la + PAGE_SIZE > object->un_pager.vnp.vnp_size; bo_bs = get_blksize(vp, get_lblkno(vp, IDX_TO_OFF(ma[0]->pindex))); - if (rbehind != NULL) { - lb = IDX_TO_OFF(ma[0]->pindex); - *rbehind = OFF_TO_IDX(lb - rounddown2(lb, bo_bs)); - } - if (rahead != NULL) { - *rahead = OFF_TO_IDX(roundup2(la, bo_bs) - la); - if (la + IDX_TO_OFF(*rahead) >= object->un_pager.vnp.vnp_size) { - *rahead = OFF_TO_IDX(roundup2(object->un_pager. - vnp.vnp_size, PAGE_SIZE) - la); - } - } + + /* + * Calculate read-ahead, behind and total pages. + */ + pgsin = count; + lb = IDX_TO_OFF(ma[0]->pindex); + pgsin_b = OFF_TO_IDX(lb - rounddown2(lb, bo_bs)); + pgsin += pgsin_b; + if (rbehind != NULL) + *rbehind = pgsin_b; + pgsin_a = OFF_TO_IDX(roundup2(la, bo_bs) - la); + if (la + IDX_TO_OFF(pgsin_a) >= object->un_pager.vnp.vnp_size) + pgsin_a = OFF_TO_IDX(roundup2(object->un_pager.vnp.vnp_size, + PAGE_SIZE) - la); + pgsin += pgsin_a; + if (rahead != NULL) + *rahead = pgsin_a; + PCPU_INC(cnt.v_vnodein); + PCPU_ADD(cnt.v_vnodepgsin, pgsin); + br_flags = (mp != NULL && (mp->mnt_kern_flag & MNTK_UNMAPPED_BUFS) != 0) ? GB_UNMAPPED : 0; VM_OBJECT_WLOCK(object); From owner-svn-src-all@freebsd.org Tue Nov 29 08:17:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D449C5BE03; Tue, 29 Nov 2016 08:17: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 F06851D79; Tue, 29 Nov 2016 08:17:25 +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 uAT8HPEO040505; Tue, 29 Nov 2016 08:17:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAT8HO2e040503; Tue, 29 Nov 2016 08:17:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201611290817.uAT8HO2e040503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 29 Nov 2016 08:17:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309279 - stable/11/sys/fs/nfsclient X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 08:17:26 -0000 Author: kib Date: Tue Nov 29 08:17:24 2016 New Revision: 309279 URL: https://svnweb.freebsd.org/changeset/base/309279 Log: MFC r308973: Minor cleanup. Modified: stable/11/sys/fs/nfsclient/nfs_clbio.c stable/11/sys/fs/nfsclient/nfs_clvnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clbio.c Tue Nov 29 08:15:12 2016 (r309278) +++ stable/11/sys/fs/nfsclient/nfs_clbio.c Tue Nov 29 08:17:24 2016 (r309279) @@ -96,8 +96,8 @@ ncl_getpages(struct vop_getpages_args *a vp = ap->a_vp; np = VTONFS(vp); - td = curthread; /* XXX */ - cred = curthread->td_ucred; /* XXX */ + td = curthread; + cred = curthread->td_ucred; nmp = VFSTONFS(vp->v_mount); pages = ap->a_m; npages = ap->a_count; Modified: stable/11/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clvnops.c Tue Nov 29 08:15:12 2016 (r309278) +++ stable/11/sys/fs/nfsclient/nfs_clvnops.c Tue Nov 29 08:17:24 2016 (r309279) @@ -105,15 +105,6 @@ extern int nfsrv_useacl; extern int nfscl_debuglevel; MALLOC_DECLARE(M_NEWNFSREQ); -/* - * Ifdef for FreeBSD-current merged buffer cache. It is unfortunate that these - * calls are not in getblk() and brelse() so that they would not be necessary - * here. - */ -#ifndef B_VMIO -#define vfs_busy_pages(bp, f) -#endif - static vop_read_t nfsfifo_read; static vop_write_t nfsfifo_write; static vop_close_t nfsfifo_close; From owner-svn-src-all@freebsd.org Tue Nov 29 08:20:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E53A2C5C013; Tue, 29 Nov 2016 08:20:56 +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 A7B231FEE; Tue, 29 Nov 2016 08:20:56 +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 uAT8Ktr3040781; Tue, 29 Nov 2016 08:20:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAT8KtG9040779; Tue, 29 Nov 2016 08:20:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201611290820.uAT8KtG9040779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 29 Nov 2016 08:20:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309280 - stable/11/sys/fs/nfsclient X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 08:20:57 -0000 Author: kib Date: Tue Nov 29 08:20:55 2016 New Revision: 309280 URL: https://svnweb.freebsd.org/changeset/base/309280 Log: MFC r308980: Use buffer pager for NFS. MFC note: really do not, by default. Modified: stable/11/sys/fs/nfsclient/nfs_clbio.c stable/11/sys/fs/nfsclient/nfs_clvnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clbio.c Tue Nov 29 08:17:24 2016 (r309279) +++ stable/11/sys/fs/nfsclient/nfs_clbio.c Tue Nov 29 08:20:55 2016 (r309280) @@ -78,6 +78,40 @@ static int nfs_directio_write(struct vno /* * Vnode op for VM getpages. */ +SYSCTL_DECL(_vfs_nfs); +static int use_buf_pager = 0; +SYSCTL_INT(_vfs_nfs, OID_AUTO, use_buf_pager, CTLFLAG_RWTUN, + &use_buf_pager, 0, + "Use buffer pager instead of direct readrpc call"); + +static daddr_t +ncl_gbp_getblkno(struct vnode *vp, vm_ooffset_t off) +{ + + return (off / vp->v_bufobj.bo_bsize); +} + +static int +ncl_gbp_getblksz(struct vnode *vp, daddr_t lbn) +{ + struct nfsnode *np; + u_quad_t nsize; + int biosize, bcount; + + np = VTONFS(vp); + mtx_lock(&np->n_mtx); + nsize = np->n_size; + mtx_unlock(&np->n_mtx); + + biosize = vp->v_bufobj.bo_bsize; + bcount = biosize; + if ((off_t)lbn * biosize >= nsize) + bcount = 0; + else if ((off_t)(lbn + 1) * biosize > nsize) + bcount = nsize - (off_t)lbn * biosize; + return (bcount); +} + int ncl_getpages(struct vop_getpages_args *ap) { @@ -126,6 +160,10 @@ ncl_getpages(struct vop_getpages_args *a } else mtx_unlock(&nmp->nm_mtx); + if (use_buf_pager) + return (vfs_bio_getpages(vp, pages, npages, ap->a_rbehind, + ap->a_rahead, ncl_gbp_getblkno, ncl_gbp_getblksz)); + /* * If the requested page is partially valid, just return it and * allow the pager to zero-out the blanks. Partially valid pages Modified: stable/11/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clvnops.c Tue Nov 29 08:17:24 2016 (r309279) +++ stable/11/sys/fs/nfsclient/nfs_clvnops.c Tue Nov 29 08:20:55 2016 (r309280) @@ -2569,13 +2569,20 @@ ncl_commit(struct vnode *vp, u_quad_t of static int nfs_strategy(struct vop_strategy_args *ap) { - struct buf *bp = ap->a_bp; + struct buf *bp; + struct vnode *vp; struct ucred *cr; + bp = ap->a_bp; + vp = ap->a_vp; + KASSERT(bp->b_vp == vp, ("missing b_getvp")); KASSERT(!(bp->b_flags & B_DONE), ("nfs_strategy: buffer %p unexpectedly marked B_DONE", bp)); BUF_ASSERT_HELD(bp); + if (vp->v_type == VREG && bp->b_blkno == bp->b_lblkno) + bp->b_blkno = bp->b_lblkno * (vp->v_bufobj.bo_bsize / + DEV_BSIZE); if (bp->b_iocmd == BIO_READ) cr = bp->b_rcred; else @@ -2587,8 +2594,8 @@ nfs_strategy(struct vop_strategy_args *a * otherwise just do it ourselves. */ if ((bp->b_flags & B_ASYNC) == 0 || - ncl_asyncio(VFSTONFS(ap->a_vp->v_mount), bp, NOCRED, curthread)) - (void) ncl_doio(ap->a_vp, bp, cr, curthread, 1); + ncl_asyncio(VFSTONFS(vp->v_mount), bp, NOCRED, curthread)) + (void) ncl_doio(vp, bp, cr, curthread, 1); return (0); } From owner-svn-src-all@freebsd.org Tue Nov 29 10:43:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0C93C5CD04; Tue, 29 Nov 2016 10:43:59 +0000 (UTC) (envelope-from oleg@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 6FD051897; Tue, 29 Nov 2016 10:43:59 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATAhwLh000758; Tue, 29 Nov 2016 10:43:58 GMT (envelope-from oleg@FreeBSD.org) Received: (from oleg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATAhwPj000757; Tue, 29 Nov 2016 10:43:58 GMT (envelope-from oleg@FreeBSD.org) Message-Id: <201611291043.uATAhwPj000757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oleg set sender to oleg@FreeBSD.org using -f From: Oleg Bulyzhin Date: Tue, 29 Nov 2016 10:43:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309281 - head/sbin/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 10:43:59 -0000 Author: oleg Date: Tue Nov 29 10:43:58 2016 New Revision: 309281 URL: https://svnweb.freebsd.org/changeset/base/309281 Log: Fix 'ipfw delete set N': do not emit meaningless 'rule 0 not found' warning if set was already empty. MFC after: 1 week Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Tue Nov 29 08:20:55 2016 (r309280) +++ head/sbin/ipfw/ipfw2.c Tue Nov 29 10:43:58 2016 (r309281) @@ -3221,7 +3221,7 @@ ipfw_delete(char *av[]) exitval = EX_UNAVAILABLE; warn("rule %u: setsockopt(IP_FW_XDEL)", rt.start_rule); - } else if (rt.new_set == 0) { + } else if (rt.new_set == 0 && do_set == 0) { exitval = EX_UNAVAILABLE; if (rt.start_rule != rt.end_rule) warnx("no rules rules in %u-%u range", From owner-svn-src-all@freebsd.org Tue Nov 29 11:13:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D029C59DE1; Tue, 29 Nov 2016 11:13:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C93F103B; Tue, 29 Nov 2016 11:13:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATBDhgH013300; Tue, 29 Nov 2016 11:13:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATBDh1T013298; Tue, 29 Nov 2016 11:13:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201611291113.uATBDh1T013298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 29 Nov 2016 11:13:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309282 - in head/sys/cam: . scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 11:13:44 -0000 Author: mav Date: Tue Nov 29 11:13:43 2016 New Revision: 309282 URL: https://svnweb.freebsd.org/changeset/base/309282 Log: Explicitly initialize cdai.flags. In SES driver uninitialized value caused unreliable physpath reporting. MFC after: 1 week Sponsored by: iXsystems, Inc. Modified: head/sys/cam/cam_xpt.c head/sys/cam/scsi/scsi_enc_ses.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Tue Nov 29 10:43:58 2016 (r309281) +++ head/sys/cam/cam_xpt.c Tue Nov 29 11:13:43 2016 (r309282) @@ -1124,6 +1124,7 @@ xpt_getattr(char *buf, size_t len, const memset(&cdai, 0, sizeof(cdai)); xpt_setup_ccb(&cdai.ccb_h, path, CAM_PRIORITY_NORMAL); cdai.ccb_h.func_code = XPT_DEV_ADVINFO; + cdai.flags = CDAI_FLAG_NONE; cdai.bufsiz = len; if (!strcmp(attr, "GEOM::ident")) Modified: head/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- head/sys/cam/scsi/scsi_enc_ses.c Tue Nov 29 10:43:58 2016 (r309281) +++ head/sys/cam/scsi/scsi_enc_ses.c Tue Nov 29 11:13:43 2016 (r309282) @@ -1066,6 +1066,7 @@ ses_set_physpath(enc_softc_t *enc, enc_e */ xpt_setup_ccb(&cdai.ccb_h, enc->periph->path, CAM_PRIORITY_NORMAL); cdai.ccb_h.func_code = XPT_DEV_ADVINFO; + cdai.flags = CDAI_FLAG_NONE; cdai.buftype = CDAI_TYPE_SCSI_DEVID; cdai.bufsiz = CAM_SCSI_DEVID_MAXLEN; cdai.buf = devid = malloc(cdai.bufsiz, M_SCSIENC, M_WAITOK|M_ZERO); From owner-svn-src-all@freebsd.org Tue Nov 29 12:13:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00CD2C58EC2; Tue, 29 Nov 2016 12:13:24 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com [IPv6:2607:f8b0:400e:c00::242]) (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 C35911231; Tue, 29 Nov 2016 12:13:23 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: by mail-pf0-x242.google.com with SMTP id 144so8286291pfv.0; Tue, 29 Nov 2016 04:13:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=EgPnju4ae8yNzcoC7X6fEZHb2St3Jxws4j161JmyOAg=; b=kH9Ux7Mv3jRqNwZ3JO2bBjtfTO5wNWtf/nFCazMBBwRkwv6cl0V2h64tLpZU7LxdXD W6qozNa7Ff4Np7QGTEWccuiHyX1Ypktk3fZdxMKXBCFetTYenBGWm4StFHPjErGKaO5Y wQMQJKB8vPGa7RdijRO4aW0ZNzOkL9l4v4Vk2N9yAJSd9dz7hp3TRqSf+Su1BMuRZboC FhO0Tjo6+PeJTUPKVRQmZ5UU79Nuf+DGWg5pRFGgoc1lMcSwqbN972YA69/ZXfSOfYxs OQrN9jKWYd0FecHDfsx2PaawfXFyQ9aXvEAKk5FEzBde3KZCLh+EGK1estCkRJqabqLb lasw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=EgPnju4ae8yNzcoC7X6fEZHb2St3Jxws4j161JmyOAg=; b=OiXUOQinBKasnLndBZ/nci+wvN30/I04hUXGjN3WPHRXCLffWOiG1eNnljD4OpHLhJ 8/87rhRcrkhwc2TNLv4/wtJAgpXlgatUfSOuBFnHsZ0W2+CL1RdVWUhR52n0MSrjnTjZ 5KxYfnafFbePJBYDKwLGHlXsA3jcUx++kSvm3UiqpZRXO5Xm1kvg0Aha9836xz5UFBXP Qh3KLa7YtiY4/eryL4NqHRk1J2jPNlCzIiEsaHtdyrW5r5RctWcpgKFn+ePpfGnx/Ece gDE3kyhSU2s+vAh4ERpqyaVrcnofiqzcD90hBYAjpVi7/Cu5IW9X0B2F5PklppLR8CRQ YKwg== X-Gm-Message-State: AKaTC00CZXVb0ikjAvF8+heZNhjsy3g1KycI/PnzZYUEQFd3ujGP0i120kM1iBATTyJdTA== X-Received: by 10.99.3.202 with SMTP id 193mr49297041pgd.157.1480421603366; Tue, 29 Nov 2016 04:13:23 -0800 (PST) Received: from ox ([2601:641:c000:b800:c070:29ff:2e7:9e08]) by smtp.gmail.com with ESMTPSA id i194sm77063704pgc.46.2016.11.29.04.13.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Nov 2016 04:13:22 -0800 (PST) Sender: Navdeep Parhar Date: Tue, 29 Nov 2016 04:13:18 -0800 From: Navdeep Parhar To: Slawa Olhovchenkov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r305852 - in head/sys: dev/cxgbe dev/cxgbe/firmware modules/cxgbe modules/cxgbe/if_cc modules/cxgbe/if_ccv Message-ID: <20161129121318.GB16760@ox> Mail-Followup-To: Slawa Olhovchenkov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201609160008.u8G08bWr033156@repo.freebsd.org> <20161118160937.GL57876@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161118160937.GL57876@zxy.spb.ru> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 12:13:24 -0000 On Fri, Nov 18, 2016 at 07:09:37PM +0300, Slawa Olhovchenkov wrote: > On Fri, Sep 16, 2016 at 12:08:37AM +0000, Navdeep Parhar wrote: > > > Author: np > > Date: Fri Sep 16 00:08:37 2016 > > New Revision: 305852 > > URL: https://svnweb.freebsd.org/changeset/base/305852 > > > > Log: > > cxgbe(4): Attach to cards with the Terminator 6 ASIC. T6 cards will > > come up as 't6nex' nexus devices with 'cc' ports hanging off them. > > > > The T6 firmware and configuration files will be added as soon as they > > are released. For now the driver will try to work with whatever > > firmware and configuration is on the card's flash. > > > > Sponsored by: Chelsio Communications > > No MFC planed? T6 support will be MFC'd late this week to 11-STABLE and 10-STABLE. Regards, Navdeep From owner-svn-src-all@freebsd.org Tue Nov 29 12:46:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E86B8C59FC4; Tue, 29 Nov 2016 12:46:43 +0000 (UTC) (envelope-from andrew@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 A98B51519; Tue, 29 Nov 2016 12:46:43 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATCkgww049138; Tue, 29 Nov 2016 12:46:42 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATCkgO1049137; Tue, 29 Nov 2016 12:46:42 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201611291246.uATCkgO1049137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 29 Nov 2016 12:46:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309283 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 12:46:44 -0000 Author: andrew Date: Tue Nov 29 12:46:42 2016 New Revision: 309283 URL: https://svnweb.freebsd.org/changeset/base/309283 Log: Mark the Broadcom code as FDT only, there is no ACPI support for the Raspberry Pi 3. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/files.arm64 Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Tue Nov 29 11:13:43 2016 (r309282) +++ head/sys/conf/files.arm64 Tue Nov 29 12:46:42 2016 (r309283) @@ -49,22 +49,22 @@ arm/arm/generic_timer.c standard arm/arm/gic.c standard arm/arm/gic_fdt.c optional fdt arm/arm/pmu.c standard -arm/broadcom/bcm2835/bcm2835_audio.c optional sound vchiq \ +arm/broadcom/bcm2835/bcm2835_audio.c optional sound vchiq fdt \ compile-with "${NORMAL_C} -DUSE_VCHIQ_ARM -D__VCCOREVER__=0x04000000 -I$S/contrib/vchiq" -arm/broadcom/bcm2835/bcm2835_bsc.c optional bcm2835_bsc soc_brcm_bcm2837 -arm/broadcom/bcm2835/bcm2835_cpufreq.c optional soc_brcm_bcm2837 -arm/broadcom/bcm2835/bcm2835_dma.c optional soc_brcm_bcm2837 -arm/broadcom/bcm2835/bcm2835_fbd.c optional vt soc_brcm_bcm2837 -arm/broadcom/bcm2835/bcm2835_ft5406.c optional evdev bcm2835_ft5406 soc_brcm_bcm2837 -arm/broadcom/bcm2835/bcm2835_gpio.c optional gpio soc_brcm_bcm2837 -arm/broadcom/bcm2835/bcm2835_intr.c optional soc_brcm_bcm2837 -arm/broadcom/bcm2835/bcm2835_mbox.c optional soc_brcm_bcm2837 -arm/broadcom/bcm2835/bcm2835_rng.c optional random soc_brcm_bcm2837 -arm/broadcom/bcm2835/bcm2835_sdhci.c optional sdhci soc_brcm_bcm2837 -arm/broadcom/bcm2835/bcm2835_spi.c optional bcm2835_spi soc_brcm_bcm2837 -arm/broadcom/bcm2835/bcm2835_vcio.c optional soc_brcm_bcm2837 -arm/broadcom/bcm2835/bcm2835_wdog.c optional soc_brcm_bcm2837 -arm/broadcom/bcm2835/bcm2836.c optional soc_brcm_bcm2837 +arm/broadcom/bcm2835/bcm2835_bsc.c optional bcm2835_bsc soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_cpufreq.c optional soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_dma.c optional soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_fbd.c optional vt soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_ft5406.c optional evdev bcm2835_ft5406 soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_gpio.c optional gpio soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_intr.c optional soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_mbox.c optional soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_rng.c optional random soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_sdhci.c optional sdhci soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_spi.c optional bcm2835_spi soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_vcio.c optional soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2835_wdog.c optional soc_brcm_bcm2837 fdt +arm/broadcom/bcm2835/bcm2836.c optional soc_brcm_bcm2837 fdt arm/broadcom/bcm2835/bcm283x_dwc_fdt.c optional dwcotg fdt soc_brcm_bcm2837 arm64/acpica/acpi_machdep.c optional acpi arm64/acpica/OsdEnvironment.c optional acpi From owner-svn-src-all@freebsd.org Tue Nov 29 12:49:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0C0AC5A173; Tue, 29 Nov 2016 12:49:21 +0000 (UTC) (envelope-from kadesai@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 AB50A172B; Tue, 29 Nov 2016 12:49:21 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATCnKoA049272; Tue, 29 Nov 2016 12:49:20 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATCnK0k049268; Tue, 29 Nov 2016 12:49:20 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201611291249.uATCnK0k049268@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Tue, 29 Nov 2016 12:49:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309284 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 12:49:21 -0000 Author: kadesai Date: Tue Nov 29 12:49:20 2016 New Revision: 309284 URL: https://svnweb.freebsd.org/changeset/base/309284 Log: Problem statement: MFI linked list in megaraid_sas driver is used for mfi-mpt pass-through commands. This list can be corrupted due to many possible race conditions in driver and eventually we may see kernel panic. One example - MFI frame is freed from calling process as driver send command via polling method and interrupt for that command comes after driver free mfi frame (actually even after some other context reuse the mfi frame). When driver receive MPT frame in ISR, driver will be using the index of MFI and access that MFI frame and finally in-used MFI frames list will be corrupted. High level description of new solution - Free MFI and MPT command from same context. Free both the command either from process (from where mfi-mpt pass-through was called) or from ISR context. Do not split freeing of MFI and MPT, because it creates the race condition which will do MFI/MPT list. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: Broadcom Limited/AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_cam.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:46:42 2016 (r309283) +++ head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:49:20 2016 (r309284) @@ -153,7 +153,6 @@ extern void mrsas_cam_detach(struct mrsa extern void mrsas_cmd_done(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd); extern void mrsas_free_frame(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd); extern int mrsas_alloc_mfi_cmds(struct mrsas_softc *sc); -extern void mrsas_release_mpt_cmd(struct mrsas_mpt_cmd *cmd); extern struct mrsas_mpt_cmd *mrsas_get_mpt_cmd(struct mrsas_softc *sc); extern int mrsas_passthru(struct mrsas_softc *sc, void *arg, u_long ioctlCmd); extern uint8_t MR_ValidateMapInfo(struct mrsas_softc *sc); @@ -674,16 +673,14 @@ mrsas_register_aen(struct mrsas_softc *s sc->aen_cmd); if (ret_val) { - printf("mrsas: Failed to abort " - "previous AEN command\n"); + printf("mrsas: Failed to abort previous AEN command\n"); return ret_val; } } } cmd = mrsas_get_mfi_cmd(sc); - if (!cmd) - return -ENOMEM; + return ENOMEM; dcmd = &cmd->frame->dcmd; @@ -953,8 +950,7 @@ mrsas_ich_startup(void *arg) /* * Intialize a counting Semaphore to take care no. of concurrent IOCTLs */ - sema_init(&sc->ioctl_count_sema, - MRSAS_MAX_MFI_CMDS - 5, + sema_init(&sc->ioctl_count_sema, MRSAS_MAX_IOCTL_CMDS, IOCTL_SEMA_DESCRIPTION); /* Create a /dev entry for mrsas controller. */ @@ -1070,7 +1066,7 @@ mrsas_detach(device_t dev) mtx_destroy(&sc->raidmap_lock); /* Wait for all the semaphores to be released */ - while (sema_value(&sc->ioctl_count_sema) != (MRSAS_MAX_MFI_CMDS - 5)) + while (sema_value(&sc->ioctl_count_sema) != MRSAS_MAX_IOCTL_CMDS) pause("mr_shutdown", hz); /* Destroy the counting semaphore created for Ioctl */ @@ -1592,9 +1588,16 @@ mrsas_complete_cmd(struct mrsas_softc *s break; case MRSAS_MPI2_FUNCTION_PASSTHRU_IO_REQUEST: /* MFI command */ cmd_mfi = sc->mfi_cmd_list[cmd_mpt->sync_cmd_idx]; - mrsas_complete_mptmfi_passthru(sc, cmd_mfi, status); - cmd_mpt->flags = 0; - mrsas_release_mpt_cmd(cmd_mpt); + /* + * Make sure NOT TO release the mfi command from the called + * function's context if it is fired with issue_polled call. + * And also make sure that the issue_polled call should only be + * used if INTERRUPT IS DISABLED. + */ + if (cmd_mfi->frame->hdr.flags & MFI_FRAME_DONT_POST_IN_REPLY_QUEUE) + mrsas_release_mfi_cmd(cmd_mfi); + else + mrsas_complete_mptmfi_passthru(sc, cmd_mfi, status); break; } @@ -2995,7 +2998,6 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, if (mpt_cmd->sync_cmd_idx != (u_int32_t)MRSAS_ULONG_MAX) { mfi_cmd = sc->mfi_cmd_list[mpt_cmd->sync_cmd_idx]; mrsas_release_mfi_cmd(mfi_cmd); - mrsas_release_mpt_cmd(mpt_cmd); } } @@ -3177,17 +3179,33 @@ out: * mrsas_release_mfi_cmd: Return a cmd to free command pool * input: Command packet for return to free cmd pool * - * This function returns the MFI command to the command list. + * This function returns the MFI & MPT command to the command list. */ void -mrsas_release_mfi_cmd(struct mrsas_mfi_cmd *cmd) +mrsas_release_mfi_cmd(struct mrsas_mfi_cmd *cmd_mfi) { - struct mrsas_softc *sc = cmd->sc; + struct mrsas_softc *sc = cmd_mfi->sc; + struct mrsas_mpt_cmd *cmd_mpt; + mtx_lock(&sc->mfi_cmd_pool_lock); - cmd->ccb_ptr = NULL; - cmd->cmd_id.frame_count = 0; - TAILQ_INSERT_TAIL(&(sc->mrsas_mfi_cmd_list_head), cmd, next); + /* + * Release the mpt command (if at all it is allocated + * associated with the mfi command + */ + if (cmd_mfi->cmd_id.context.smid) { + mtx_lock(&sc->mpt_cmd_pool_lock); + /* Get the mpt cmd from mfi cmd frame's smid value */ + cmd_mpt = sc->mpt_cmd_list[cmd_mfi->cmd_id.context.smid-1]; + cmd_mpt->flags = 0; + cmd_mpt->sync_cmd_idx = (u_int32_t)MRSAS_ULONG_MAX; + TAILQ_INSERT_HEAD(&(sc->mrsas_mpt_cmd_list_head), cmd_mpt, next); + mtx_unlock(&sc->mpt_cmd_pool_lock); + } + /* Release the mfi command */ + cmd_mfi->ccb_ptr = NULL; + cmd_mfi->cmd_id.frame_count = 0; + TAILQ_INSERT_HEAD(&(sc->mrsas_mfi_cmd_list_head), cmd_mfi, next); mtx_unlock(&sc->mfi_cmd_pool_lock); return; @@ -3253,8 +3271,6 @@ dcmd_timeout: if (do_ocr) sc->do_timedout_reset = MFI_DCMD_TIMEOUT_OCR; - else - mrsas_release_mfi_cmd(cmd); return (retcode); } @@ -3869,8 +3885,6 @@ megasas_sync_pd_seq_num(struct mrsas_sof dcmd_timeout: if (do_ocr) sc->do_timedout_reset = MFI_DCMD_TIMEOUT_OCR; - else - mrsas_release_mfi_cmd(cmd); return (retcode); } @@ -3947,8 +3961,6 @@ mrsas_get_ld_map_info(struct mrsas_softc retcode = mrsas_issue_polled(sc, cmd); if (retcode == ETIMEDOUT) sc->do_timedout_reset = MFI_DCMD_TIMEOUT_OCR; - else - mrsas_release_mfi_cmd(cmd); return (retcode); } @@ -3975,9 +3987,8 @@ mrsas_sync_map_info(struct mrsas_softc * cmd = mrsas_get_mfi_cmd(sc); if (!cmd) { - device_printf(sc->mrsas_dev, - "Cannot alloc for sync map info cmd\n"); - return 1; + device_printf(sc->mrsas_dev, "Cannot alloc for sync map info cmd\n"); + return ENOMEM; } map = sc->ld_drv_map[sc->map_id & 1]; num_lds = map->raidMap.ldCount; @@ -4077,7 +4088,11 @@ mrsas_get_pd_list(struct mrsas_softc *sc dcmd->sgl.sge32[0].phys_addr = pd_list_phys_addr; dcmd->sgl.sge32[0].length = MRSAS_MAX_PD * sizeof(struct MR_PD_LIST); - retcode = mrsas_issue_polled(sc, cmd); + if (!sc->mask_interrupts) + retcode = mrsas_issue_blocked_cmd(sc, cmd); + else + retcode = mrsas_issue_polled(sc, cmd); + if (retcode == ETIMEDOUT) goto dcmd_timeout; @@ -4108,7 +4123,8 @@ dcmd_timeout: if (do_ocr) sc->do_timedout_reset = MFI_DCMD_TIMEOUT_OCR; - else + + if (!sc->mask_interrupts) mrsas_release_mfi_cmd(cmd); return (retcode); @@ -4170,7 +4186,11 @@ mrsas_get_ld_list(struct mrsas_softc *sc dcmd->sgl.sge32[0].length = sizeof(struct MR_LD_LIST); dcmd->pad_0 = 0; - retcode = mrsas_issue_polled(sc, cmd); + if (!sc->mask_interrupts) + retcode = mrsas_issue_blocked_cmd(sc, cmd); + else + retcode = mrsas_issue_polled(sc, cmd); + if (retcode == ETIMEDOUT) goto dcmd_timeout; @@ -4196,7 +4216,7 @@ dcmd_timeout: if (do_ocr) sc->do_timedout_reset = MFI_DCMD_TIMEOUT_OCR; - else + if (!sc->mask_interrupts) mrsas_release_mfi_cmd(cmd); return (retcode); Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Tue Nov 29 12:46:42 2016 (r309283) +++ head/sys/dev/mrsas/mrsas.h Tue Nov 29 12:49:20 2016 (r309284) @@ -1256,7 +1256,8 @@ enum MR_EVT_ARGS { #define HOST_DIAG_WRITE_ENABLE 0x80 #define HOST_DIAG_RESET_ADAPTER 0x4 #define MRSAS_TBOLT_MAX_RESET_TRIES 3 -#define MRSAS_MAX_MFI_CMDS 32 +#define MRSAS_MAX_MFI_CMDS 16 +#define MRSAS_MAX_IOCTL_CMDS 3 /* * Invader Defines Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Tue Nov 29 12:46:42 2016 (r309283) +++ head/sys/dev/mrsas/mrsas_cam.c Tue Nov 29 12:49:20 2016 (r309284) @@ -679,7 +679,7 @@ mrsas_release_mpt_cmd(struct mrsas_mpt_c mtx_lock(&sc->mpt_cmd_pool_lock); cmd->sync_cmd_idx = (u_int32_t)MRSAS_ULONG_MAX; - TAILQ_INSERT_TAIL(&(sc->mrsas_mpt_cmd_list_head), cmd, next); + TAILQ_INSERT_HEAD(&(sc->mrsas_mpt_cmd_list_head), cmd, next); mtx_unlock(&sc->mpt_cmd_pool_lock); return; From owner-svn-src-all@freebsd.org Tue Nov 29 12:53:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76AF5C5A44D; Tue, 29 Nov 2016 12:53:07 +0000 (UTC) (envelope-from kadesai@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 38AE61C93; Tue, 29 Nov 2016 12:53:07 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATCr6s0053305; Tue, 29 Nov 2016 12:53:06 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATCr6pJ053301; Tue, 29 Nov 2016 12:53:06 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201611291253.uATCr6pJ053301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Tue, 29 Nov 2016 12:53:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309285 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 12:53:07 -0000 Author: kadesai Date: Tue Nov 29 12:53:05 2016 New Revision: 309285 URL: https://svnweb.freebsd.org/changeset/base/309285 Log: Use a variable to indicate Gen3 controllers and remove all PCI ids based checks used for gen3 controllers. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: Broadcom Limited/AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_cam.c head/sys/dev/mrsas/mrsas_fp.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:49:20 2016 (r309284) +++ head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:53:05 2016 (r309285) @@ -832,6 +832,15 @@ mrsas_attach(device_t dev) sc->mrsas_dev = dev; sc->device_id = pci_get_device(dev); + if ((sc->device_id == MRSAS_INVADER) || + (sc->device_id == MRSAS_FURY) || + (sc->device_id == MRSAS_INTRUDER) || + (sc->device_id == MRSAS_INTRUDER_24) || + (sc->device_id == MRSAS_CUTLASS_52) || + (sc->device_id == MRSAS_CUTLASS_53)) { + sc->mrsas_gen3_ctrl = 1; + } + mrsas_get_tunables(sc); /* @@ -1632,12 +1641,7 @@ mrsas_complete_cmd(struct mrsas_softc *s */ if (threshold_reply_count >= THRESHOLD_REPLY_COUNT) { if (sc->msix_enable) { - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) + if (sc->mrsas_gen3_ctrl) mrsas_write_reg(sc, sc->msix_reg_offset[MSIxIndex / 8], ((MSIxIndex & 0x7) << 24) | sc->last_reply_idx[MSIxIndex]); @@ -1658,12 +1662,7 @@ mrsas_complete_cmd(struct mrsas_softc *s /* Clear response interrupt */ if (sc->msix_enable) { - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) { + if (sc->mrsas_gen3_ctrl) { mrsas_write_reg(sc, sc->msix_reg_offset[MSIxIndex / 8], ((MSIxIndex & 0x7) << 24) | sc->last_reply_idx[MSIxIndex]); @@ -2461,12 +2460,7 @@ mrsas_ioc_init(struct mrsas_softc *sc) init_frame->flags |= MFI_FRAME_DONT_POST_IN_REPLY_QUEUE; /* driver support Extended MSIX */ - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) { + if (sc->mrsas_gen3_ctrl) { init_frame->driver_operations. mfi_capabilities.support_additional_msix = 1; } @@ -3512,12 +3506,7 @@ mrsas_build_mptmfi_passthru(struct mrsas io_req = mpt_cmd->io_request; - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) { + if (sc->mrsas_gen3_ctrl) { pMpi25IeeeSgeChain64_t sgl_ptr_end = (pMpi25IeeeSgeChain64_t)&io_req->SGL; sgl_ptr_end += sc->max_sge_in_main_msg - 1; Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Tue Nov 29 12:49:20 2016 (r309284) +++ head/sys/dev/mrsas/mrsas.h Tue Nov 29 12:53:05 2016 (r309285) @@ -2795,6 +2795,7 @@ struct mrsas_softc { LD_LOAD_BALANCE_INFO load_balance_info[MAX_LOGICAL_DRIVES_EXT]; LD_SPAN_INFO log_to_span[MAX_LOGICAL_DRIVES_EXT]; + u_int8_t mrsas_gen3_ctrl; u_int8_t secure_jbod_support; u_int8_t use_seqnum_jbod_fp; u_int8_t max256vdSupport; Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Tue Nov 29 12:49:20 2016 (r309284) +++ head/sys/dev/mrsas/mrsas_cam.c Tue Nov 29 12:53:05 2016 (r309285) @@ -877,12 +877,7 @@ mrsas_setup_io(struct mrsas_softc *sc, s cmd->request_desc->SCSIIO.RequestFlags = (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) { + if (sc->mrsas_gen3_ctrl) { if (io_request->RaidContext.regLockFlags == REGION_TYPE_UNUSED) cmd->request_desc->SCSIIO.RequestFlags = (MRSAS_REQ_DESCRIPT_FLAGS_NO_LOCK << @@ -911,12 +906,7 @@ mrsas_setup_io(struct mrsas_softc *sc, s cmd->request_desc->SCSIIO.RequestFlags = (MRSAS_REQ_DESCRIPT_FLAGS_LD_IO << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) { + if (sc->mrsas_gen3_ctrl) { if (io_request->RaidContext.regLockFlags == REGION_TYPE_UNUSED) cmd->request_desc->SCSIIO.RequestFlags = (MRSAS_REQ_DESCRIPT_FLAGS_NO_LOCK << @@ -1192,12 +1182,7 @@ mrsas_data_load_cb(void *arg, bus_dma_se io_request = cmd->io_request; sgl_ptr = (pMpi25IeeeSgeChain64_t)&io_request->SGL; - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) { + if (sc->mrsas_gen3_ctrl) { pMpi25IeeeSgeChain64_t sgl_ptr_end = sgl_ptr; sgl_ptr_end += sc->max_sge_in_main_msg - 1; @@ -1208,12 +1193,7 @@ mrsas_data_load_cb(void *arg, bus_dma_se sgl_ptr->Address = segs[i].ds_addr; sgl_ptr->Length = segs[i].ds_len; sgl_ptr->Flags = 0; - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) { + if (sc->mrsas_gen3_ctrl) { if (i == nseg - 1) sgl_ptr->Flags = IEEE_SGE_FLAGS_END_OF_LIST; } @@ -1223,12 +1203,7 @@ mrsas_data_load_cb(void *arg, bus_dma_se (nseg > sc->max_sge_in_main_msg)) { pMpi25IeeeSgeChain64_t sg_chain; - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) { + if (sc->mrsas_gen3_ctrl) { if ((cmd->io_request->IoFlags & MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH) != MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH) cmd->io_request->ChainOffset = sc->chain_offset_io_request; @@ -1237,12 +1212,7 @@ mrsas_data_load_cb(void *arg, bus_dma_se } else cmd->io_request->ChainOffset = sc->chain_offset_io_request; sg_chain = sgl_ptr; - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) + if (sc->mrsas_gen3_ctrl) sg_chain->Flags = IEEE_SGE_FLAGS_CHAIN_ELEMENT; else sg_chain->Flags = (IEEE_SGE_FLAGS_CHAIN_ELEMENT | MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR); Modified: head/sys/dev/mrsas/mrsas_fp.c ============================================================================== --- head/sys/dev/mrsas/mrsas_fp.c Tue Nov 29 12:49:20 2016 (r309284) +++ head/sys/dev/mrsas/mrsas_fp.c Tue Nov 29 12:53:05 2016 (r309285) @@ -747,15 +747,6 @@ mr_spanset_get_phy_params(struct mrsas_s u_int64_t *pdBlock = &io_info->pdBlock; u_int16_t *pDevHandle = &io_info->devHandle; u_int32_t logArm, rowMod, armQ, arm; - u_int8_t do_invader = 0; - - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) - do_invader = 1; /* Get row and span from io_info for Uneven Span IO. */ row = io_info->start_row; @@ -782,7 +773,7 @@ mr_spanset_get_phy_params(struct mrsas_s *pDevHandle = MR_PdDevHandleGet(pd, map); else { *pDevHandle = MR_PD_INVALID; - if ((raid->level >= 5) && ((!do_invader) || (do_invader && + if ((raid->level >= 5) && ((!sc->mrsas_gen3_ctrl) || (sc->mrsas_gen3_ctrl && raid->regTypeReqOnRead != REGION_TYPE_UNUSED))) pRAID_Context->regLockFlags = REGION_TYPE_EXCLUSIVE; else if (raid->level == 1) { @@ -965,12 +956,7 @@ MR_BuildRaidContext(struct mrsas_softc * regSize += stripSize; } pRAID_Context->timeoutValue = map->raidMap.fpPdIoTimeoutSec; - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) + if (sc->mrsas_gen3_ctrl) pRAID_Context->regLockFlags = (isRead) ? raid->regTypeReqOnRead : raid->regTypeReqOnWrite; else pRAID_Context->regLockFlags = (isRead) ? REGION_TYPE_SHARED_READ : raid->regTypeReqOnWrite; @@ -1453,15 +1439,6 @@ MR_GetPhyParams(struct mrsas_softc *sc, u_int64_t *pdBlock = &io_info->pdBlock; u_int16_t *pDevHandle = &io_info->devHandle; u_int32_t rowMod, armQ, arm, logArm; - u_int8_t do_invader = 0; - - if ((sc->device_id == MRSAS_INVADER) || - (sc->device_id == MRSAS_FURY) || - (sc->device_id == MRSAS_INTRUDER) || - (sc->device_id == MRSAS_INTRUDER_24) || - (sc->device_id == MRSAS_CUTLASS_52) || - (sc->device_id == MRSAS_CUTLASS_53)) - do_invader = 1; row = mega_div64_32(stripRow, raid->rowDataSize); @@ -1501,7 +1478,7 @@ MR_GetPhyParams(struct mrsas_softc *sc, *pDevHandle = MR_PdDevHandleGet(pd, map); else { *pDevHandle = MR_PD_INVALID; /* set dev handle as invalid. */ - if ((raid->level >= 5) && ((!do_invader) || (do_invader && + if ((raid->level >= 5) && ((!sc->mrsas_gen3_ctrl) || (sc->mrsas_gen3_ctrl && raid->regTypeReqOnRead != REGION_TYPE_UNUSED))) pRAID_Context->regLockFlags = REGION_TYPE_EXCLUSIVE; else if (raid->level == 1) { From owner-svn-src-all@freebsd.org Tue Nov 29 12:55:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDF31C5A4F4; Tue, 29 Nov 2016 12:55:02 +0000 (UTC) (envelope-from kadesai@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 839CD1E1D; Tue, 29 Nov 2016 12:55:02 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATCt1Yb053432; Tue, 29 Nov 2016 12:55:01 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATCt1uf053430; Tue, 29 Nov 2016 12:55:01 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201611291255.uATCt1uf053430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Tue, 29 Nov 2016 12:55:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309286 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 12:55:02 -0000 Author: kadesai Date: Tue Nov 29 12:55:01 2016 New Revision: 309286 URL: https://svnweb.freebsd.org/changeset/base/309286 Log: Add sanity check in IO and IOCTL path not to process command further if controller is in HW_CRITICAL_ERROR. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: Broadcom Limited/AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas_cam.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:53:05 2016 (r309285) +++ head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:55:01 2016 (r309286) @@ -1359,9 +1359,11 @@ mrsas_ioctl(struct cdev *dev, u_long cmd if (!sc) return ENOENT; - if (sc->remove_in_progress) { + if (sc->remove_in_progress || + (sc->adprecovery == MRSAS_HW_CRITICAL_ERROR)) { mrsas_dprint(sc, MRSAS_INFO, - "Driver remove or shutdown called.\n"); + "Either driver remove or shutdown called or " + "HW is in unrecoverable critical error state.\n"); return ENOENT; } mtx_lock_spin(&sc->ioctl_lock); Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Tue Nov 29 12:53:05 2016 (r309285) +++ head/sys/dev/mrsas/mrsas_cam.c Tue Nov 29 12:55:01 2016 (r309286) @@ -260,6 +260,17 @@ mrsas_action(struct cam_sim *sim, union struct ccb_hdr *ccb_h = &(ccb->ccb_h); u_int32_t device_id; + /* + * Check if the system going down + * or the adapter is in unrecoverable critical error + */ + if (sc->remove_in_progress || + (sc->adprecovery == MRSAS_HW_CRITICAL_ERROR)) { + ccb->ccb_h.status |= CAM_DEV_NOT_THERE; + xpt_done(ccb); + return; + } + switch (ccb->ccb_h.func_code) { case XPT_SCSI_IO: { From owner-svn-src-all@freebsd.org Tue Nov 29 12:56:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17BE4C5A5C0; Tue, 29 Nov 2016 12:56:55 +0000 (UTC) (envelope-from kadesai@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 DF0EE1FC3; Tue, 29 Nov 2016 12:56:54 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATCusrj053526; Tue, 29 Nov 2016 12:56:54 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATCurmi053524; Tue, 29 Nov 2016 12:56:53 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201611291256.uATCurmi053524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Tue, 29 Nov 2016 12:56:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309287 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 12:56:55 -0000 Author: kadesai Date: Tue Nov 29 12:56:53 2016 New Revision: 309287 URL: https://svnweb.freebsd.org/changeset/base/309287 Log: Update controller properties(read OCR capability bit) when MR_EVT_CTRL_PROP_CHANGED recieved. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: Broadcom Limited/AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:55:01 2016 (r309286) +++ head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:56:53 2016 (r309287) @@ -3250,7 +3250,11 @@ mrsas_get_ctrl_info(struct mrsas_softc * dcmd->sgl.sge32[0].phys_addr = sc->ctlr_info_phys_addr; dcmd->sgl.sge32[0].length = sizeof(struct mrsas_ctrl_info); - retcode = mrsas_issue_polled(sc, cmd); + if (!sc->mask_interrupts) + retcode = mrsas_issue_blocked_cmd(sc, cmd); + else + retcode = mrsas_issue_polled(sc, cmd); + if (retcode == ETIMEDOUT) goto dcmd_timeout; else @@ -3261,6 +3265,8 @@ mrsas_get_ctrl_info(struct mrsas_softc * sc->use_seqnum_jbod_fp = sc->ctrl_info->adapterOperations3.useSeqNumJbodFP; + sc->disableOnlineCtrlReset = + sc->ctrl_info->properties.OnOffProperties.disableOnlineCtrlReset; dcmd_timeout: mrsas_free_ctlr_info_cmd(sc); @@ -3268,6 +3274,9 @@ dcmd_timeout: if (do_ocr) sc->do_timedout_reset = MFI_DCMD_TIMEOUT_OCR; + if (!sc->mask_interrupts) + mrsas_release_mfi_cmd(cmd); + return (retcode); } @@ -4379,7 +4388,6 @@ mrsas_aen_handler(struct mrsas_softc *sc mrsas_bus_scan_sim(sc, sc->sim_1); else goto skip_register_aen; - doscan = 0; break; case MR_EVT_PD_REMOVED: fail_aen = mrsas_get_pd_list(sc); @@ -4387,13 +4395,11 @@ mrsas_aen_handler(struct mrsas_softc *sc mrsas_bus_scan_sim(sc, sc->sim_1); else goto skip_register_aen; - doscan = 0; break; case MR_EVT_LD_OFFLINE: case MR_EVT_CFG_CLEARED: case MR_EVT_LD_DELETED: mrsas_bus_scan_sim(sc, sc->sim_0); - doscan = 0; break; case MR_EVT_LD_CREATED: fail_aen = mrsas_get_ld_list(sc); @@ -4401,15 +4407,18 @@ mrsas_aen_handler(struct mrsas_softc *sc mrsas_bus_scan_sim(sc, sc->sim_0); else goto skip_register_aen; - doscan = 0; break; case MR_EVT_CTRL_HOST_BUS_SCAN_REQUESTED: case MR_EVT_FOREIGN_CFG_IMPORTED: case MR_EVT_LD_STATE_CHANGE: doscan = 1; break; + case MR_EVT_CTRL_PROP_CHANGED: + fail_aen = mrsas_get_ctrl_info(sc); + if (fail_aen) + goto skip_register_aen; + break; default: - doscan = 0; break; } } else { Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Tue Nov 29 12:55:01 2016 (r309286) +++ head/sys/dev/mrsas/mrsas.h Tue Nov 29 12:56:53 2016 (r309287) @@ -1449,6 +1449,7 @@ enum MR_PD_QUERY_TYPE { #define MR_EVT_LD_DELETED 0x008b #define MR_EVT_FOREIGN_CFG_IMPORTED 0x00db #define MR_EVT_LD_OFFLINE 0x00fc +#define MR_EVT_CTRL_PROP_CHANGED 0x012f #define MR_EVT_CTRL_HOST_BUS_SCAN_REQUESTED 0x0152 enum MR_PD_STATE { From owner-svn-src-all@freebsd.org Tue Nov 29 12:58:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C99F3C5A674; Tue, 29 Nov 2016 12:58:29 +0000 (UTC) (envelope-from kadesai@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 9935A11A1; Tue, 29 Nov 2016 12:58:29 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATCwS3X053622; Tue, 29 Nov 2016 12:58:28 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATCwSuV053621; Tue, 29 Nov 2016 12:58:28 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201611291258.uATCwSuV053621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Tue, 29 Nov 2016 12:58:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309288 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 12:58:29 -0000 Author: kadesai Date: Tue Nov 29 12:58:28 2016 New Revision: 309288 URL: https://svnweb.freebsd.org/changeset/base/309288 Log: Clean up reference to AEN command if abort AEN is succesful as the command is aborted. Did the same by setting sc->aen_cmd = NULL when aborting AEN is successful. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: Broadcom Limited/AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:56:53 2016 (r309287) +++ head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:58:28 2016 (r309288) @@ -675,7 +675,8 @@ mrsas_register_aen(struct mrsas_softc *s if (ret_val) { printf("mrsas: Failed to abort previous AEN command\n"); return ret_val; - } + } else + sc->aen_cmd = NULL; } } cmd = mrsas_get_mfi_cmd(sc); From owner-svn-src-all@freebsd.org Tue Nov 29 12:59:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D310C5A756; Tue, 29 Nov 2016 12:59:39 +0000 (UTC) (envelope-from kadesai@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 4CBC71346; Tue, 29 Nov 2016 12:59:39 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATCxcuK053701; Tue, 29 Nov 2016 12:59:38 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATCxci0053700; Tue, 29 Nov 2016 12:59:38 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201611291259.uATCxci0053700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Tue, 29 Nov 2016 12:59:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309289 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 12:59:39 -0000 Author: kadesai Date: Tue Nov 29 12:59:38 2016 New Revision: 309289 URL: https://svnweb.freebsd.org/changeset/base/309289 Log: Process outstanding reply descriptors from all the reply descriptor post queues before initiating OCR. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: Broadcom Limited/AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:58:28 2016 (r309288) +++ head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:59:38 2016 (r309289) @@ -3139,6 +3139,11 @@ mrsas_wait_for_outstanding(struct mrsas_ if (fw_state == MFI_STATE_FAULT) { mrsas_dprint(sc, MRSAS_OCR, "Found FW in FAULT state, will reset adapter.\n"); + count = sc->msix_vectors > 0 ? sc->msix_vectors : 1; + mtx_unlock(&sc->sim_lock); + for (MSIxIndex = 0; MSIxIndex < count; MSIxIndex++) + mrsas_complete_cmd(sc, MSIxIndex); + mtx_lock(&sc->sim_lock); retval = 1; goto out; } From owner-svn-src-all@freebsd.org Tue Nov 29 13:01:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A2DFC5A952; Tue, 29 Nov 2016 13:01:33 +0000 (UTC) (envelope-from kadesai@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 ACE9B1702; Tue, 29 Nov 2016 13:01:32 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATD1VLK054714; Tue, 29 Nov 2016 13:01:31 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATD1VZ6054711; Tue, 29 Nov 2016 13:01:31 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201611291301.uATD1VZ6054711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Tue, 29 Nov 2016 13:01:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309290 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 13:01:33 -0000 Author: kadesai Date: Tue Nov 29 13:01:31 2016 New Revision: 309290 URL: https://svnweb.freebsd.org/changeset/base/309290 Log: This patch will add task management support in driver. Below is high level description: If a SCSI IO times out, then before initiating OCR, now the driver will try to send a target reset to the particular target for which the IO is timed out. If that also fails, then the driver will initiate OCR. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: Broadcom Limited/AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_cam.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Tue Nov 29 12:59:38 2016 (r309289) +++ head/sys/dev/mrsas/mrsas.c Tue Nov 29 13:01:31 2016 (r309290) @@ -110,6 +110,7 @@ int mrsas_issue_polled(struct mrsas_soft int mrsas_reset_ctrl(struct mrsas_softc *sc, u_int8_t reset_reason); int mrsas_wait_for_outstanding(struct mrsas_softc *sc, u_int8_t check_reason); int mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex); +int mrsas_reset_targets(struct mrsas_softc *sc); int mrsas_issue_blocked_cmd(struct mrsas_softc *sc, struct mrsas_mfi_cmd *cmd); @@ -306,28 +307,11 @@ mrsas_enable_intr(struct mrsas_softc *sc static int mrsas_clear_intr(struct mrsas_softc *sc) { - u_int32_t status, fw_status, fw_state; + u_int32_t status; /* Read received interrupt */ status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status)); - /* - * If FW state change interrupt is received, write to it again to - * clear - */ - if (status & MRSAS_FW_STATE_CHNG_INTERRUPT) { - fw_status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, - outbound_scratch_pad)); - fw_state = fw_status & MFI_STATE_MASK; - if (fw_state == MFI_STATE_FAULT) { - device_printf(sc->mrsas_dev, "FW is in FAULT state!\n"); - if (sc->ocr_thread_active) - wakeup(&sc->ocr_chan); - } - mrsas_write_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status), status); - mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_intr_status)); - return (1); - } /* Not our interrupt, so just return */ if (!(status & MFI_FUSION_ENABLE_INTERRUPT_MASK)) return (0); @@ -882,6 +866,7 @@ mrsas_attach(device_t dev) TAILQ_INIT(&sc->mrsas_mfi_cmd_list_head); mrsas_atomic_set(&sc->fw_outstanding, 0); + mrsas_atomic_set(&sc->target_reset_outstanding, 0); sc->io_cmds_highwater = 0; @@ -1556,7 +1541,10 @@ mrsas_complete_cmd(struct mrsas_softc *s PLD_LOAD_BALANCE_INFO lbinfo; u_int32_t device_id; int threshold_reply_count = 0; - +#if TM_DEBUG + MR_TASK_MANAGE_REQUEST *mr_tm_req; + MPI2_SCSI_TASK_MANAGE_REQUEST *mpi_tm_req; +#endif /* If we have a hardware error, not need to continue */ if (sc->adprecovery == MRSAS_HW_CRITICAL_ERROR) @@ -1583,6 +1571,16 @@ mrsas_complete_cmd(struct mrsas_softc *s extStatus = scsi_io_req->RaidContext.exStatus; switch (scsi_io_req->Function) { + case MPI2_FUNCTION_SCSI_TASK_MGMT: +#if TM_DEBUG + mr_tm_req = (MR_TASK_MANAGE_REQUEST *) cmd_mpt->io_request; + mpi_tm_req = (MPI2_SCSI_TASK_MANAGE_REQUEST *) + &mr_tm_req->TmRequest; + device_printf(sc->mrsas_dev, "TM completion type 0x%X, " + "TaskMID: 0x%X", mpi_tm_req->TaskType, mpi_tm_req->TaskMID); +#endif + wakeup_one((void *)&sc->ocr_chan); + break; case MPI2_FUNCTION_SCSI_IO_REQUEST: /* Fast Path IO. */ device_id = cmd_mpt->ccb_ptr->ccb_h.target_id; lbinfo = &sc->load_balance_info[device_id]; @@ -2585,7 +2583,7 @@ mrsas_alloc_mpt_cmds(struct mrsas_softc memset(cmd, 0, sizeof(struct mrsas_mpt_cmd)); cmd->index = i + 1; cmd->ccb_ptr = NULL; - callout_init(&cmd->cm_callout, 0); + callout_init_mtx(&cmd->cm_callout, &sc->sim_lock, 0); cmd->sync_cmd_idx = (u_int32_t)MRSAS_ULONG_MAX; cmd->sc = sc; cmd->io_request = (MRSAS_RAID_SCSI_IO_REQUEST *) (io_req_base + offset); @@ -2780,6 +2778,7 @@ mrsas_ocr_thread(void *arg) { struct mrsas_softc *sc; u_int32_t fw_status, fw_state; + u_int8_t tm_target_reset_failed = 0; sc = (struct mrsas_softc *)arg; @@ -2802,20 +2801,57 @@ mrsas_ocr_thread(void *arg) fw_status = mrsas_read_reg(sc, offsetof(mrsas_reg_set, outbound_scratch_pad)); fw_state = fw_status & MFI_STATE_MASK; - if (fw_state == MFI_STATE_FAULT || sc->do_timedout_reset) { - device_printf(sc->mrsas_dev, "%s started due to %s!\n", - sc->disableOnlineCtrlReset ? "Kill Adapter" : "OCR", - sc->do_timedout_reset ? "IO Timeout" : - "FW fault detected"); - mtx_lock_spin(&sc->ioctl_lock); - sc->reset_in_progress = 1; - sc->reset_count++; - mtx_unlock_spin(&sc->ioctl_lock); + if (fw_state == MFI_STATE_FAULT || sc->do_timedout_reset || + mrsas_atomic_read(&sc->target_reset_outstanding)) { + + /* First, freeze further IOs to come to the SIM */ mrsas_xpt_freeze(sc); - mrsas_reset_ctrl(sc, sc->do_timedout_reset); - mrsas_xpt_release(sc); - sc->reset_in_progress = 0; - sc->do_timedout_reset = 0; + + /* If this is an IO timeout then go for target reset */ + if (mrsas_atomic_read(&sc->target_reset_outstanding)) { + device_printf(sc->mrsas_dev, "Initiating Target RESET " + "because of SCSI IO timeout!\n"); + + /* Let the remaining IOs to complete */ + msleep(&sc->ocr_chan, &sc->sim_lock, PRIBIO, + "mrsas_reset_targets", 5 * hz); + + /* Try to reset the target device */ + if (mrsas_reset_targets(sc) == FAIL) + tm_target_reset_failed = 1; + } + + /* If this is a DCMD timeout or FW fault, + * then go for controller reset + */ + if (fw_state == MFI_STATE_FAULT || tm_target_reset_failed || + (sc->do_timedout_reset == MFI_DCMD_TIMEOUT_OCR)) { + if (tm_target_reset_failed) + device_printf(sc->mrsas_dev, "Initiaiting OCR because of " + "TM FAILURE!\n"); + else + device_printf(sc->mrsas_dev, "Initiaiting OCR " + "because of %s!\n", sc->do_timedout_reset ? + "DCMD IO Timeout" : "FW fault"); + + mtx_lock_spin(&sc->ioctl_lock); + sc->reset_in_progress = 1; + mtx_unlock_spin(&sc->ioctl_lock); + sc->reset_count++; + + /* Try to reset the controller */ + mrsas_reset_ctrl(sc, sc->do_timedout_reset); + + sc->do_timedout_reset = 0; + sc->reset_in_progress = 0; + tm_target_reset_failed = 0; + mrsas_atomic_set(&sc->target_reset_outstanding, 0); + memset(sc->target_reset_pool, 0, + sizeof(sc->target_reset_pool)); + } + + /* Now allow IOs to come to the SIM */ + mrsas_xpt_release(sc); } } mtx_unlock(&sc->sim_lock); Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Tue Nov 29 12:59:38 2016 (r309289) +++ head/sys/dev/mrsas/mrsas.h Tue Nov 29 13:01:31 2016 (r309290) @@ -205,7 +205,9 @@ typedef struct _RAID_CONTEXT { #define MPI2_SCSIIO_EEDPFLAGS_CHECK_GUARD (0x0100) #define MPI2_SCSIIO_EEDPFLAGS_INSERT_OP (0x0004) #define MPI2_FUNCTION_SCSI_IO_REQUEST (0x00) /* SCSI IO */ -#define MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY (0x06) +#define MPI2_FUNCTION_SCSI_TASK_MGMT (0x01) +#define MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY (0x03) +#define MPI2_REQ_DESCRIPT_FLAGS_FP_IO (0x06) #define MPI2_REQ_DESCRIPT_FLAGS_SCSI_IO (0x00) #define MPI2_SGE_FLAGS_64_BIT_ADDRESSING (0x02) #define MPI2_SCSIIO_CONTROL_WRITE (0x01000000) @@ -314,6 +316,91 @@ typedef union { } MPI2_SCSI_IO_CDB_UNION, MPI2_POINTER PTR_MPI2_SCSI_IO_CDB_UNION, Mpi2ScsiIoCdb_t, MPI2_POINTER pMpi2ScsiIoCdb_t; +/**************************************************************************** + * * SCSI Task Management messages + * ****************************************************************************/ + +/*SCSI Task Management Request Message */ +typedef struct _MPI2_SCSI_TASK_MANAGE_REQUEST { + u_int16_t DevHandle; /*0x00 */ + u_int8_t ChainOffset; /*0x02 */ + u_int8_t Function; /*0x03 */ + u_int8_t Reserved1; /*0x04 */ + u_int8_t TaskType; /*0x05 */ + u_int8_t Reserved2; /*0x06 */ + u_int8_t MsgFlags; /*0x07 */ + u_int8_t VP_ID; /*0x08 */ + u_int8_t VF_ID; /*0x09 */ + u_int16_t Reserved3; /*0x0A */ + u_int8_t LUN[8]; /*0x0C */ + u_int32_t Reserved4[7]; /*0x14 */ + u_int16_t TaskMID; /*0x30 */ + u_int16_t Reserved5; /*0x32 */ +} MPI2_SCSI_TASK_MANAGE_REQUEST; + +/*SCSI Task Management Reply Message */ +typedef struct _MPI2_SCSI_TASK_MANAGE_REPLY { + u_int16_t DevHandle; /*0x00 */ + u_int8_t MsgLength; /*0x02 */ + u_int8_t Function; /*0x03 */ + u_int8_t ResponseCode; /*0x04 */ + u_int8_t TaskType; /*0x05 */ + u_int8_t Reserved1; /*0x06 */ + u_int8_t MsgFlags; /*0x07 */ + u_int8_t VP_ID; /*0x08 */ + u_int8_t VF_ID; /*0x09 */ + u_int16_t Reserved2; /*0x0A */ + u_int16_t Reserved3; /*0x0C */ + u_int16_t IOCStatus; /*0x0E */ + u_int32_t IOCLogInfo; /*0x10 */ + u_int32_t TerminationCount; /*0x14 */ + u_int32_t ResponseInfo; /*0x18 */ +} MPI2_SCSI_TASK_MANAGE_REPLY; + +typedef struct _MR_TM_REQUEST { + char request[128]; +} MR_TM_REQUEST; + +typedef struct _MR_TM_REPLY { + char reply[128]; +} MR_TM_REPLY; + +/* SCSI Task Management Request Message */ +typedef struct _MR_TASK_MANAGE_REQUEST { + /*To be type casted to struct MPI2_SCSI_TASK_MANAGE_REQUEST */ + MR_TM_REQUEST TmRequest; + union { + struct { + u_int32_t isTMForLD:1; + u_int32_t isTMForPD:1; + u_int32_t reserved1:30; + u_int32_t reserved2; + } tmReqFlags; + MR_TM_REPLY TMReply; + } uTmReqReply; +} MR_TASK_MANAGE_REQUEST; + +/* TaskType values */ +#define MPI2_SCSITASKMGMT_TASKTYPE_ABORT_TASK (0x01) +#define MPI2_SCSITASKMGMT_TASKTYPE_ABRT_TASK_SET (0x02) +#define MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET (0x03) +#define MPI2_SCSITASKMGMT_TASKTYPE_LOGICAL_UNIT_RESET (0x05) +#define MPI2_SCSITASKMGMT_TASKTYPE_CLEAR_TASK_SET (0x06) +#define MPI2_SCSITASKMGMT_TASKTYPE_QUERY_TASK (0x07) +#define MPI2_SCSITASKMGMT_TASKTYPE_CLR_ACA (0x08) +#define MPI2_SCSITASKMGMT_TASKTYPE_QRY_TASK_SET (0x09) +#define MPI2_SCSITASKMGMT_TASKTYPE_QRY_ASYNC_EVENT (0x0A) + +/* ResponseCode values */ +#define MPI2_SCSITASKMGMT_RSP_TM_COMPLETE (0x00) +#define MPI2_SCSITASKMGMT_RSP_INVALID_FRAME (0x02) +#define MPI2_SCSITASKMGMT_RSP_TM_NOT_SUPPORTED (0x04) +#define MPI2_SCSITASKMGMT_RSP_TM_FAILED (0x05) +#define MPI2_SCSITASKMGMT_RSP_TM_SUCCEEDED (0x08) +#define MPI2_SCSITASKMGMT_RSP_TM_INVALID_LUN (0x09) +#define MPI2_SCSITASKMGMT_RSP_TM_OVERLAPPED_TAG (0x0A) +#define MPI2_SCSITASKMGMT_RSP_IO_QUEUED_ON_IOC (0x80) + /* * RAID SCSI IO Request Message Total SGE count will be one less than * _MPI2_SCSI_IO_REQUEST @@ -584,7 +671,7 @@ Mpi2IOCInitRequest_t, MPI2_POINTER pMpi2 #define MAX_RAIDMAP_PHYSICAL_DEVICES (MAX_PHYSICAL_DEVICES) #define MR_DCMD_LD_MAP_GET_INFO 0x0300e101 #define MR_DCMD_SYSTEM_PD_MAP_GET_INFO 0x0200e102 - +#define MR_DCMD_PD_MFI_TASK_MGMT 0x0200e100 #define MRSAS_MAX_PD_CHANNELS 1 #define MRSAS_MAX_LD_CHANNELS 1 @@ -599,7 +686,7 @@ Mpi2IOCInitRequest_t, MPI2_POINTER pMpi2 #define VD_EXT_DEBUG 0 - +#define TM_DEBUG 1 /******************************************************************* * RAID map related structures @@ -659,7 +746,8 @@ typedef struct _MR_LD_RAID { u_int32_t fpWriteAcrossStripe:1; u_int32_t fpReadAcrossStripe:1; u_int32_t fpNonRWCapable:1; - u_int32_t reserved4:7; + u_int32_t tmCapable:1; + u_int32_t reserved4:6; } capability; u_int32_t reserved6; u_int64_t size; @@ -876,7 +964,11 @@ struct IO_REQUEST_INFO { struct MR_PD_CFG_SEQ { u_int16_t seqNum; u_int16_t devHandle; - u_int8_t reserved[4]; + struct { + u_int8_t tmCapable:1; + u_int8_t reserved:7; + } capability; + u_int8_t reserved[3]; } __packed; struct MR_PD_CFG_SEQ_NUM_SYNC { @@ -1396,6 +1488,7 @@ struct mrsas_mpt_cmd { union ccb *ccb_ptr; struct callout cm_callout; struct mrsas_softc *sc; + boolean_t tmCapable; TAILQ_ENTRY(mrsas_mpt_cmd) next; }; @@ -2472,8 +2565,7 @@ struct mrsas_irq_context { enum MEGASAS_OCR_REASON { FW_FAULT_OCR = 0, - SCSIIO_TIMEOUT_OCR = 1, - MFI_DCMD_TIMEOUT_OCR = 2, + MFI_DCMD_TIMEOUT_OCR = 1, }; /* Controller management info added to support Linux Emulator */ @@ -2748,6 +2840,9 @@ struct mrsas_softc { u_int8_t do_timedout_reset; u_int32_t reset_in_progress; u_int32_t reset_count; + mrsas_atomic_t target_reset_outstanding; +#define MRSAS_MAX_TM_TARGETS (MRSAS_MAX_PD + MRSAS_MAX_LD_IDS) + struct mrsas_mpt_cmd *target_reset_pool[MRSAS_MAX_TM_TARGETS]; bus_dma_tag_t jbodmap_tag[2]; bus_dmamap_t jbodmap_dmamap[2]; Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Tue Nov 29 12:59:38 2016 (r309289) +++ head/sys/dev/mrsas/mrsas_cam.c Tue Nov 29 13:01:31 2016 (r309290) @@ -95,6 +95,11 @@ static void mrsas_freeze_simq(struct mrs static void mrsas_cam_poll(struct cam_sim *sim); static void mrsas_action(struct cam_sim *sim, union ccb *ccb); static void mrsas_scsiio_timeout(void *data); +static int mrsas_track_scsiio(struct mrsas_softc *sc, target_id_t id, u_int32_t bus_id); +static void mrsas_tm_response_code(struct mrsas_softc *sc, + MPI2_SCSI_TASK_MANAGE_REPLY *mpi_reply); +static int mrsas_issue_tm(struct mrsas_softc *sc, + MRSAS_REQUEST_DESCRIPTOR_UNION *req_desc); static void mrsas_data_load_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error); @@ -105,6 +110,10 @@ struct mrsas_mpt_cmd *mrsas_get_mpt_cmd( MRSAS_REQUEST_DESCRIPTOR_UNION * mrsas_get_request_desc(struct mrsas_softc *sc, u_int16_t index); +extern void +mrsas_map_mpt_cmd_status(struct mrsas_mpt_cmd *cmd, u_int8_t status, + u_int8_t extStatus); +extern int mrsas_reset_targets(struct mrsas_softc *sc); extern u_int16_t MR_TargetIdToLdGet(u_int32_t ldTgtId, MR_DRV_RAID_MAP_ALL * map); extern u_int32_t MR_LdBlockSizeGet(u_int32_t ldTgtId, MR_DRV_RAID_MAP_ALL * map, @@ -125,6 +134,9 @@ extern u_int8_t megasas_get_best_arm(PLD_LOAD_BALANCE_INFO lbInfo, u_int8_t arm, u_int64_t block, u_int32_t count); extern int mrsas_complete_cmd(struct mrsas_softc *sc, u_int32_t MSIxIndex); +extern MR_LD_RAID *MR_LdRaidGet(u_int32_t ld, MR_DRV_RAID_MAP_ALL * map); +extern void mrsas_disable_intr(struct mrsas_softc *sc); +extern void mrsas_enable_intr(struct mrsas_softc *sc); /* @@ -386,6 +398,10 @@ mrsas_scsiio_timeout(void *data) { struct mrsas_mpt_cmd *cmd; struct mrsas_softc *sc; + u_int32_t target_id; + + if (!data) + return; cmd = (struct mrsas_mpt_cmd *)data; sc = cmd->sc; @@ -394,6 +410,7 @@ mrsas_scsiio_timeout(void *data) printf("command timeout with NULL ccb\n"); return; } + /* * Below callout is dummy entry so that it will be cancelled from * mrsas_cmd_done(). Now Controller will go to OCR/Kill Adapter based @@ -401,15 +418,25 @@ mrsas_scsiio_timeout(void *data) * context. */ #if (__FreeBSD_version >= 1000510) - callout_reset_sbt(&cmd->cm_callout, SBT_1S * 600, 0, + callout_reset_sbt(&cmd->cm_callout, SBT_1S * 180, 0, mrsas_scsiio_timeout, cmd, 0); #else - callout_reset(&cmd->cm_callout, (600000 * hz) / 1000, + callout_reset(&cmd->cm_callout, (180000 * hz) / 1000, mrsas_scsiio_timeout, cmd); #endif - sc->do_timedout_reset = SCSIIO_TIMEOUT_OCR; - if (sc->ocr_thread_active) - wakeup(&sc->ocr_chan); + + if (cmd->ccb_ptr->cpi.bus_id == 0) + target_id = cmd->ccb_ptr->ccb_h.target_id; + else + target_id = (cmd->ccb_ptr->ccb_h.target_id + (MRSAS_MAX_PD - 1)); + + /* Save the cmd to be processed for TM, if it is not there in the array */ + if (sc->target_reset_pool[target_id] == NULL) { + sc->target_reset_pool[target_id] = cmd; + mrsas_atomic_inc(&sc->target_reset_outstanding); + } + + return; } /* @@ -596,10 +623,10 @@ mrsas_startio(struct mrsas_softc *sc, st * Start timer for IO timeout. Default timeout value is 90 second. */ #if (__FreeBSD_version >= 1000510) - callout_reset_sbt(&cmd->cm_callout, SBT_1S * 600, 0, + callout_reset_sbt(&cmd->cm_callout, SBT_1S * 180, 0, mrsas_scsiio_timeout, cmd, 0); #else - callout_reset(&cmd->cm_callout, (600000 * hz) / 1000, + callout_reset(&cmd->cm_callout, (180000 * hz) / 1000, mrsas_scsiio_timeout, cmd); #endif mrsas_atomic_inc(&sc->fw_outstanding); @@ -788,8 +815,9 @@ mrsas_setup_io(struct mrsas_softc *sc, s struct ccb_scsiio *csio = &(ccb->csio); struct IO_REQUEST_INFO io_info; MR_DRV_RAID_MAP_ALL *map_ptr; + MR_LD_RAID *raid; u_int8_t fp_possible; - u_int32_t start_lba_hi, start_lba_lo, ld_block_size; + u_int32_t start_lba_hi, start_lba_lo, ld_block_size, ld; u_int32_t datalength = 0; start_lba_lo = 0; @@ -868,8 +896,8 @@ mrsas_setup_io(struct mrsas_softc *sc, s map_ptr = sc->ld_drv_map[(sc->map_id & 1)]; ld_block_size = MR_LdBlockSizeGet(device_id, map_ptr, sc); - if ((MR_TargetIdToLdGet(device_id, map_ptr) >= MAX_LOGICAL_DRIVES_EXT) || - (!sc->fast_path_io)) { + ld = MR_TargetIdToLdGet(device_id, map_ptr); + if ((ld >= MAX_LOGICAL_DRIVES_EXT) || (!sc->fast_path_io)) { io_request->RaidContext.regLockFlags = 0; fp_possible = 0; } else { @@ -877,6 +905,10 @@ mrsas_setup_io(struct mrsas_softc *sc, s fp_possible = io_info.fpOkForIo; } + raid = MR_LdRaidGet(ld, map_ptr); + /* Store the TM capability value in cmd */ + cmd->tmCapable = raid->capability.tmCapable; + cmd->request_desc->SCSIIO.MSIxIndex = sc->msix_vectors ? smp_processor_id() % sc->msix_vectors : 0; @@ -886,7 +918,7 @@ mrsas_setup_io(struct mrsas_softc *sc, s start_lba_lo, ld_block_size); io_request->Function = MPI2_FUNCTION_SCSI_IO_REQUEST; cmd->request_desc->SCSIIO.RequestFlags = - (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY << + (MPI2_REQ_DESCRIPT_FLAGS_FP_IO << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); if (sc->mrsas_gen3_ctrl) { if (io_request->RaidContext.regLockFlags == REGION_TYPE_UNUSED) @@ -948,12 +980,20 @@ mrsas_build_ldio_nonrw(struct mrsas_soft union ccb *ccb) { struct ccb_hdr *ccb_h = &(ccb->ccb_h); - u_int32_t device_id; + u_int32_t device_id, ld; + MR_DRV_RAID_MAP_ALL *map_ptr; + MR_LD_RAID *raid; MRSAS_RAID_SCSI_IO_REQUEST *io_request; io_request = cmd->io_request; device_id = ccb_h->target_id; + map_ptr = sc->ld_drv_map[(sc->map_id & 1)]; + ld = MR_TargetIdToLdGet(device_id, map_ptr); + raid = MR_LdRaidGet(ld, map_ptr); + /* Store the TM capability value in cmd */ + cmd->tmCapable = raid->capability.tmCapable; + /* FW path for LD Non-RW (SCSI management commands) */ io_request->Function = MRSAS_MPI2_FUNCTION_LD_IO_REQUEST; io_request->DevHandle = device_id; @@ -1003,8 +1043,6 @@ mrsas_build_syspdio(struct mrsas_softc * MRSAS_RAID_SCSI_IO_REQUEST *io_request; struct MR_PD_CFG_SEQ_NUM_SYNC *pd_sync; - pd_sync = (void *)sc->jbodmap_mem[(sc->pd_seq_map_id - 1) & 1]; - io_request = cmd->io_request; device_id = ccb_h->target_id; local_map_ptr = sc->ld_drv_map[(sc->map_id & 1)]; @@ -1018,6 +1056,8 @@ mrsas_build_syspdio(struct mrsas_softc * if (sc->use_seqnum_jbod_fp && sc->pd_list[device_id].driveType == 0x00) { //printf("Using Drv seq num\n"); + pd_sync = (void *)sc->jbodmap_mem[(sc->pd_seq_map_id - 1) & 1]; + cmd->tmCapable = pd_sync->seq[device_id].capability.tmCapable; io_request->RaidContext.VirtualDiskTgtId = device_id + 255; io_request->RaidContext.configSeqNum = pd_sync->seq[device_id].seqNum; io_request->DevHandle = pd_sync->seq[device_id].devHandle; @@ -1066,7 +1106,7 @@ mrsas_build_syspdio(struct mrsas_softc * io_request->IoFlags |= MPI25_SAS_DEVICE0_FLAGS_ENABLED_FAST_PATH; cmd->request_desc->SCSIIO.RequestFlags = - (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY << + (MPI2_REQ_DESCRIPT_FLAGS_FP_IO << MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); } @@ -1276,9 +1316,10 @@ mrsas_xpt_release(struct mrsas_softc *sc void mrsas_cmd_done(struct mrsas_softc *sc, struct mrsas_mpt_cmd *cmd) { - callout_stop(&cmd->cm_callout); mrsas_unmap_request(sc, cmd); + mtx_lock(&sc->sim_lock); + callout_stop(&cmd->cm_callout); xpt_done(cmd->ccb_ptr); cmd->ccb_ptr = NULL; mtx_unlock(&sc->sim_lock); @@ -1376,3 +1417,269 @@ mrsas_bus_scan_sim(struct mrsas_softc *s return (0); } + +/* + * mrsas_track_scsiio: Track IOs for a given target in the mpt_cmd_list + * input: Adapter instance soft state + * Target ID of target + * Bus ID of the target + * + * This function checks for any pending IO in the whole mpt_cmd_list pool + * with the bus_id and target_id passed in arguments. If some IO is found + * that means target reset is not successfully completed. + * + * Returns FAIL if IOs pending to the target device, else return SUCCESS + */ +static int +mrsas_track_scsiio(struct mrsas_softc *sc, target_id_t tgt_id, u_int32_t bus_id) +{ + int i; + struct mrsas_mpt_cmd *mpt_cmd = NULL; + + for (i = 0 ; i < sc->max_fw_cmds; i++) { + mpt_cmd = sc->mpt_cmd_list[i]; + + /* + * Check if the target_id and bus_id is same as the timeout IO + */ + if (mpt_cmd->ccb_ptr) { + /* bus_id = 1 denotes a VD */ + if (bus_id == 1) + tgt_id = (mpt_cmd->ccb_ptr->ccb_h.target_id - (MRSAS_MAX_PD - 1)); + + if (mpt_cmd->ccb_ptr->cpi.bus_id == bus_id && + mpt_cmd->ccb_ptr->ccb_h.target_id == tgt_id) { + device_printf(sc->mrsas_dev, + "IO commands pending to target id %d\n", tgt_id); + return FAIL; + } + } + } + + return SUCCESS; +} + +#if TM_DEBUG +/* + * mrsas_tm_response_code: Prints TM response code received from FW + * input: Adapter instance soft state + * MPI reply returned from firmware + * + * Returns nothing. + */ +static void +mrsas_tm_response_code(struct mrsas_softc *sc, + MPI2_SCSI_TASK_MANAGE_REPLY *mpi_reply) +{ + char *desc; + + switch (mpi_reply->ResponseCode) { + case MPI2_SCSITASKMGMT_RSP_TM_COMPLETE: + desc = "task management request completed"; + break; + case MPI2_SCSITASKMGMT_RSP_INVALID_FRAME: + desc = "invalid frame"; + break; + case MPI2_SCSITASKMGMT_RSP_TM_NOT_SUPPORTED: + desc = "task management request not supported"; + break; + case MPI2_SCSITASKMGMT_RSP_TM_FAILED: + desc = "task management request failed"; + break; + case MPI2_SCSITASKMGMT_RSP_TM_SUCCEEDED: + desc = "task management request succeeded"; + break; + case MPI2_SCSITASKMGMT_RSP_TM_INVALID_LUN: + desc = "invalid lun"; + break; + case 0xA: + desc = "overlapped tag attempted"; + break; + case MPI2_SCSITASKMGMT_RSP_IO_QUEUED_ON_IOC: + desc = "task queued, however not sent to target"; + break; + default: + desc = "unknown"; + break; + } + device_printf(sc->mrsas_dev, "response_code(%01x): %s\n", + mpi_reply->ResponseCode, desc); + device_printf(sc->mrsas_dev, + "TerminationCount/DevHandle/Function/TaskType/IOCStat/IOCLoginfo\n" + "0x%x/0x%x/0x%x/0x%x/0x%x/0x%x\n", + mpi_reply->TerminationCount, mpi_reply->DevHandle, + mpi_reply->Function, mpi_reply->TaskType, + mpi_reply->IOCStatus, mpi_reply->IOCLogInfo); +} +#endif + +/* + * mrsas_issue_tm: Fires the TM command to FW and waits for completion + * input: Adapter instance soft state + * reqest descriptor compiled by mrsas_reset_targets + * + * Returns FAIL if TM command TIMEDOUT from FW else SUCCESS. + */ +static int +mrsas_issue_tm(struct mrsas_softc *sc, + MRSAS_REQUEST_DESCRIPTOR_UNION *req_desc) +{ + int sleep_stat; + + mrsas_fire_cmd(sc, req_desc->addr.u.low, req_desc->addr.u.high); + sleep_stat = msleep(&sc->ocr_chan, &sc->sim_lock, PRIBIO, "tm_sleep", 50*hz); + + if (sleep_stat == EWOULDBLOCK) { + device_printf(sc->mrsas_dev, "tm cmd TIMEDOUT\n"); + return FAIL; + } + + return SUCCESS; +} + +/* + * mrsas_reset_targets : Gathers info to fire a target reset command + * input: Adapter instance soft state + * + * This function compiles data for a target reset command to be fired to the FW + * and then traverse the target_reset_pool to see targets with TIMEDOUT IOs. + * + * Returns SUCCESS or FAIL + */ +int mrsas_reset_targets(struct mrsas_softc *sc) +{ + struct mrsas_mpt_cmd *tm_mpt_cmd = NULL; + struct mrsas_mpt_cmd *tgt_mpt_cmd = NULL; + MR_TASK_MANAGE_REQUEST *mr_request; + MPI2_SCSI_TASK_MANAGE_REQUEST *tm_mpi_request; + MRSAS_REQUEST_DESCRIPTOR_UNION *req_desc; + int retCode = FAIL, count, i, outstanding; + u_int32_t MSIxIndex, bus_id; + target_id_t tgt_id; +#if TM_DEBUG + MPI2_SCSI_TASK_MANAGE_REPLY *mpi_reply; +#endif + + outstanding = mrsas_atomic_read(&sc->fw_outstanding); + + if (!outstanding) { + device_printf(sc->mrsas_dev, "NO IOs pending...\n"); + mrsas_atomic_set(&sc->target_reset_outstanding, 0); + retCode = SUCCESS; + goto return_status; + } else if (sc->adprecovery != MRSAS_HBA_OPERATIONAL) { + device_printf(sc->mrsas_dev, "Controller is not operational\n"); + goto return_status; + } else { + /* Some more error checks will be added in future */ + } + + /* Get an mpt frame and an index to fire the TM cmd */ + tm_mpt_cmd = mrsas_get_mpt_cmd(sc); + if (!tm_mpt_cmd) { + retCode = FAIL; + goto return_status; + } + + req_desc = mrsas_get_request_desc(sc, (tm_mpt_cmd->index) - 1); + if (!req_desc) { + device_printf(sc->mrsas_dev, "Cannot get request_descriptor for tm.\n"); + retCode = FAIL; + goto release_mpt; + } + memset(req_desc, 0, sizeof(MRSAS_REQUEST_DESCRIPTOR_UNION)); + + req_desc->HighPriority.SMID = tm_mpt_cmd->index; + req_desc->HighPriority.RequestFlags = + (MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY << + MRSAS_REQ_DESCRIPT_FLAGS_TYPE_SHIFT); + req_desc->HighPriority.MSIxIndex = 0; + req_desc->HighPriority.LMID = 0; + req_desc->HighPriority.Reserved1 = 0; + tm_mpt_cmd->request_desc = req_desc; + + mr_request = (MR_TASK_MANAGE_REQUEST *) tm_mpt_cmd->io_request; + memset(mr_request, 0, sizeof(MR_TASK_MANAGE_REQUEST)); + + tm_mpi_request = (MPI2_SCSI_TASK_MANAGE_REQUEST *) &mr_request->TmRequest; + tm_mpi_request->Function = MPI2_FUNCTION_SCSI_TASK_MGMT; + tm_mpi_request->TaskType = MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET; + tm_mpi_request->TaskMID = 0; /* smid task */ + tm_mpi_request->LUN[1] = 0; + + /* Traverse the tm_mpt pool to get valid entries */ + for (i = 0 ; i < MRSAS_MAX_TM_TARGETS; i++) { + if(!sc->target_reset_pool[i]) { + continue; + } else { + tgt_mpt_cmd = sc->target_reset_pool[i]; + } + + tgt_id = i; + + /* See if the target is tm capable or NOT */ + if (!tgt_mpt_cmd->tmCapable) { + device_printf(sc->mrsas_dev, "Task management NOT SUPPORTED for " + "CAM target:%d\n", tgt_id); + + retCode = FAIL; + goto release_mpt; + } + + tm_mpi_request->DevHandle = tgt_mpt_cmd->io_request->DevHandle; + + if (i < (MRSAS_MAX_PD - 1)) { + mr_request->uTmReqReply.tmReqFlags.isTMForPD = 1; + bus_id = 0; + } else { + mr_request->uTmReqReply.tmReqFlags.isTMForLD = 1; + bus_id = 1; + } + + device_printf(sc->mrsas_dev, "TM will be fired for " + "CAM target:%d and bus_id %d\n", tgt_id, bus_id); + + sc->ocr_chan = (void *)&tm_mpt_cmd; + retCode = mrsas_issue_tm(sc, req_desc); + if (retCode == FAIL) + goto release_mpt; + +#if TM_DEBUG + mpi_reply = + (MPI2_SCSI_TASK_MANAGE_REPLY *) &mr_request->uTmReqReply.TMReply; + mrsas_tm_response_code(sc, mpi_reply); +#endif + mrsas_atomic_dec(&sc->target_reset_outstanding); + sc->target_reset_pool[i] = NULL; + + /* Check for pending cmds in the mpt_cmd_pool with the tgt_id */ + mrsas_disable_intr(sc); + /* Wait for 1 second to complete parallel ISR calling same + * mrsas_complete_cmd() + */ + msleep(&sc->ocr_chan, &sc->sim_lock, PRIBIO, "mrsas_reset_wakeup", + 1 * hz); + count = sc->msix_vectors > 0 ? sc->msix_vectors : 1; + mtx_unlock(&sc->sim_lock); + for (MSIxIndex = 0; MSIxIndex < count; MSIxIndex++) + mrsas_complete_cmd(sc, MSIxIndex); + mtx_lock(&sc->sim_lock); + retCode = mrsas_track_scsiio(sc, tgt_id, bus_id); + mrsas_enable_intr(sc); + + if (retCode == FAIL) + goto release_mpt; + } + + device_printf(sc->mrsas_dev, "Number of targets outstanding " + "after reset: %d\n", mrsas_atomic_read(&sc->target_reset_outstanding)); + +release_mpt: + mrsas_release_mpt_cmd(tm_mpt_cmd); +return_status: + device_printf(sc->mrsas_dev, "target reset %s!!\n", + (retCode == SUCCESS) ? "SUCCESS" : "FAIL"); + + return retCode; +} + From owner-svn-src-all@freebsd.org Tue Nov 29 13:02:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAD96C5AA46; Tue, 29 Nov 2016 13:02:49 +0000 (UTC) (envelope-from kadesai@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 7D5FB1A4C; Tue, 29 Nov 2016 13:02:49 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATD2mju057707; Tue, 29 Nov 2016 13:02:48 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATD2mqi057706; Tue, 29 Nov 2016 13:02:48 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201611291302.uATD2mqi057706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Tue, 29 Nov 2016 13:02:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309291 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 13:02:49 -0000 Author: kadesai Date: Tue Nov 29 13:02:48 2016 New Revision: 309291 URL: https://svnweb.freebsd.org/changeset/base/309291 Log: Wait for AEN task to be completed(if in queue) before resetting the controller and return without processing event in AEN thread, if controller reset is in progress. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: Broadcom Limited/AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Tue Nov 29 13:01:31 2016 (r309290) +++ head/sys/dev/mrsas/mrsas.c Tue Nov 29 13:02:48 2016 (r309291) @@ -2839,6 +2839,14 @@ mrsas_ocr_thread(void *arg) mtx_unlock_spin(&sc->ioctl_lock); sc->reset_count++; + /* + * Wait for the AEN task to be completed if it is running. + */ + mtx_unlock(&sc->sim_lock); + taskqueue_drain(sc->ev_tq, &sc->ev_task); + mtx_lock(&sc->sim_lock); + + taskqueue_block(sc->ev_tq); /* Try to reset the controller */ mrsas_reset_ctrl(sc, sc->do_timedout_reset); @@ -2848,6 +2856,7 @@ mrsas_ocr_thread(void *arg) mrsas_atomic_set(&sc->target_reset_outstanding, 0); memset(sc->target_reset_pool, 0, sizeof(sc->target_reset_pool)); + taskqueue_unblock(sc->ev_tq); } /* Now allow IOs to come to the SIM */ @@ -3034,8 +3043,6 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, } } - sc->aen_cmd = NULL; - /* Reset load balance info */ memset(sc->load_balance_info, 0, sizeof(LD_LOAD_BALANCE_INFO) * MAX_LOGICAL_DRIVES_EXT); @@ -3050,17 +3057,6 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, megasas_setup_jbod_map(sc); - memset(sc->pd_list, 0, - MRSAS_MAX_PD * sizeof(struct mrsas_pd_list)); - if (mrsas_get_pd_list(sc) != SUCCESS) { - device_printf(sc->mrsas_dev, "Get PD list failed from OCR.\n" - "Will get the latest PD LIST after OCR on event.\n"); - } - memset(sc->ld_ids, 0xff, MRSAS_MAX_LD_IDS); - if (mrsas_get_ld_list(sc) != SUCCESS) { - device_printf(sc->mrsas_dev, "Get LD lsit failed from OCR.\n" - "Will get the latest LD LIST after OCR on event.\n"); - } mrsas_clear_bit(MRSAS_FUSION_IN_RESET, &sc->reset_flags); mrsas_enable_intr(sc); sc->adprecovery = MRSAS_HBA_OPERATIONAL; @@ -4422,6 +4418,11 @@ mrsas_aen_handler(struct mrsas_softc *sc printf("invalid instance!\n"); return; } + if (sc->remove_in_progress || sc->reset_in_progress) { + device_printf(sc->mrsas_dev, "Returning from %s, line no %d\n", + __func__, __LINE__); + return; + } if (sc->evt_detail_mem) { switch (sc->evt_detail_mem->code) { case MR_EVT_PD_INSERTED: @@ -4536,8 +4537,7 @@ mrsas_complete_aen(struct mrsas_softc *s sc->aen_cmd = NULL; mrsas_release_mfi_cmd(cmd); - if (!sc->remove_in_progress) - taskqueue_enqueue(sc->ev_tq, &sc->ev_task); + taskqueue_enqueue(sc->ev_tq, &sc->ev_task); return; } From owner-svn-src-all@freebsd.org Tue Nov 29 13:03:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD5F4C5AADF; Tue, 29 Nov 2016 13:03:44 +0000 (UTC) (envelope-from kadesai@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 B811F1BEC; Tue, 29 Nov 2016 13:03:44 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATD3hIF057783; Tue, 29 Nov 2016 13:03:43 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATD3hUh057780; Tue, 29 Nov 2016 13:03:43 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201611291303.uATD3hUh057780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Tue, 29 Nov 2016 13:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309292 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 13:03:45 -0000 Author: kadesai Date: Tue Nov 29 13:03:43 2016 New Revision: 309292 URL: https://svnweb.freebsd.org/changeset/base/309292 Log: This patch will unblock SYNCHRONIZE_CACHE command to firmware, i.e. don't block the SYNCHRONIZE_CACHE command at driver instead of passing it to firmware for all Gen3 controllers. For Thunderbolt controller, keep the legacy behavior i.e. return the SYNCHRONIZE_CACHE command with success status from driver itself. There is Sysctl parameter 'block_sync_cache' is provided to enable customers either to block/unblock these commands to facilitate legacy behavior if there is a compatibility issue. Default value for module parameter is to unblock this command. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: Broadcom Limited/AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c head/sys/dev/mrsas/mrsas.h head/sys/dev/mrsas/mrsas_cam.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Tue Nov 29 13:02:48 2016 (r309291) +++ head/sys/dev/mrsas/mrsas.c Tue Nov 29 13:03:43 2016 (r309292) @@ -432,6 +432,11 @@ mrsas_setup_sysctl(struct mrsas_softc *s OID_AUTO, "reset_in_progress", CTLFLAG_RD, &sc->reset_in_progress, 0, "ocr in progress status"); + SYSCTL_ADD_UINT(sysctl_ctx, SYSCTL_CHILDREN(sysctl_tree), + OID_AUTO, "block_sync_cache", CTLFLAG_RW, + &sc->block_sync_cache, 0, + "Block SYNC CACHE at driver. "); + } /* @@ -451,6 +456,7 @@ mrsas_get_tunables(struct mrsas_softc *s sc->mrsas_fw_fault_check_delay = 1; sc->reset_count = 0; sc->reset_in_progress = 0; + sc->block_sync_cache = 0; /* * Grab the global variables. @@ -2438,12 +2444,21 @@ mrsas_ioc_init(struct mrsas_softc *sc) u_int8_t max_wait = MRSAS_IOC_INIT_WAIT_TIME; bus_addr_t phys_addr; int i, retcode = 0; + u_int32_t scratch_pad_2; /* Allocate memory for the IOC INIT command */ if (mrsas_alloc_ioc_cmd(sc)) { device_printf(sc->mrsas_dev, "Cannot allocate IOC command.\n"); return (1); } + + if (!sc->block_sync_cache) { + scratch_pad_2 = mrsas_read_reg(sc, offsetof(mrsas_reg_set, + outbound_scratch_pad_2)); + sc->fw_sync_cache_support = (scratch_pad_2 & + MR_CAN_HANDLE_SYNC_CACHE_OFFSET) ? 1 : 0; + } + IOCInitMsg = (pMpi2IOCInitRequest_t)(((char *)sc->ioc_init_mem) + 1024); IOCInitMsg->Function = MPI2_FUNCTION_IOC_INIT; IOCInitMsg->WhoInit = MPI2_WHOINIT_HOST_DRIVER; Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Tue Nov 29 13:02:48 2016 (r309291) +++ head/sys/dev/mrsas/mrsas.h Tue Nov 29 13:03:43 2016 (r309292) @@ -1334,7 +1334,6 @@ enum MR_EVT_ARGS { MR_EVT_ARGS_GENERIC, }; - /* * Thunderbolt (and later) Defines */ @@ -2085,6 +2084,11 @@ struct mrsas_ctrl_info { #define MR_MAX_MSIX_REG_ARRAY 16 /* + * SYNC CACHE offset define + */ +#define MR_CAN_HANDLE_SYNC_CACHE_OFFSET 0X01000000 + +/* * FW reports the maximum of number of commands that it can accept (maximum * commands that can be outstanding) at any time. The driver must report a * lower number to the mid layer because it can issue a few internal commands @@ -2840,6 +2844,8 @@ struct mrsas_softc { u_int8_t do_timedout_reset; u_int32_t reset_in_progress; u_int32_t reset_count; + u_int32_t block_sync_cache; + u_int8_t fw_sync_cache_support; mrsas_atomic_t target_reset_outstanding; #define MRSAS_MAX_TM_TARGETS (MRSAS_MAX_PD + MRSAS_MAX_LD_IDS) struct mrsas_mpt_cmd *target_reset_pool[MRSAS_MAX_TM_TARGETS]; Modified: head/sys/dev/mrsas/mrsas_cam.c ============================================================================== --- head/sys/dev/mrsas/mrsas_cam.c Tue Nov 29 13:02:48 2016 (r309291) +++ head/sys/dev/mrsas/mrsas_cam.c Tue Nov 29 13:03:43 2016 (r309292) @@ -459,7 +459,8 @@ mrsas_startio(struct mrsas_softc *sc, st MRSAS_REQUEST_DESCRIPTOR_UNION *req_desc; u_int8_t cmd_type; - if ((csio->cdb_io.cdb_bytes[0]) == SYNCHRONIZE_CACHE) { + if ((csio->cdb_io.cdb_bytes[0]) == SYNCHRONIZE_CACHE && + (!sc->fw_sync_cache_support)) { ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); return (0); From owner-svn-src-all@freebsd.org Tue Nov 29 13:04:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DCABC5AB71; Tue, 29 Nov 2016 13:04:42 +0000 (UTC) (envelope-from kadesai@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 F2F811D61; Tue, 29 Nov 2016 13:04:41 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATD4fCi057859; Tue, 29 Nov 2016 13:04:41 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATD4fmU057858; Tue, 29 Nov 2016 13:04:41 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201611291304.uATD4fmU057858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Tue, 29 Nov 2016 13:04:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309293 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 13:04:42 -0000 Author: kadesai Date: Tue Nov 29 13:04:40 2016 New Revision: 309293 URL: https://svnweb.freebsd.org/changeset/base/309293 Log: This patch will add code to refire IOCTL commands after OCR. Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: Broadcom Limited/AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.c Modified: head/sys/dev/mrsas/mrsas.c ============================================================================== --- head/sys/dev/mrsas/mrsas.c Tue Nov 29 13:03:43 2016 (r309292) +++ head/sys/dev/mrsas/mrsas.c Tue Nov 29 13:04:40 2016 (r309293) @@ -2927,6 +2927,7 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, struct mrsas_mfi_cmd *mfi_cmd; struct mrsas_mpt_cmd *mpt_cmd; union mrsas_evt_class_locale class_locale; + MRSAS_REQUEST_DESCRIPTOR_UNION *req_desc; if (sc->adprecovery == MRSAS_HW_CRITICAL_ERROR) { device_printf(sc->mrsas_dev, @@ -3054,7 +3055,22 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, mpt_cmd = sc->mpt_cmd_list[j]; if (mpt_cmd->sync_cmd_idx != (u_int32_t)MRSAS_ULONG_MAX) { mfi_cmd = sc->mfi_cmd_list[mpt_cmd->sync_cmd_idx]; - mrsas_release_mfi_cmd(mfi_cmd); + /* If not an IOCTL then release the command else re-fire */ + if (!mfi_cmd->sync_cmd) { + mrsas_release_mfi_cmd(mfi_cmd); + } else { + req_desc = mrsas_get_request_desc(sc, + mfi_cmd->cmd_id.context.smid - 1); + mrsas_dprint(sc, MRSAS_OCR, + "Re-fire command DCMD opcode 0x%x index %d\n ", + mfi_cmd->frame->dcmd.opcode, j); + if (!req_desc) + device_printf(sc->mrsas_dev, + "Cannot build MPT cmd.\n"); + else + mrsas_fire_cmd(sc, req_desc->addr.u.low, + req_desc->addr.u.high); + } } } @@ -3081,6 +3097,7 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, class_locale.members.locale = MR_EVT_LOCALE_ALL; class_locale.members.class = MR_EVT_CLASS_DEBUG; + mtx_unlock(&sc->sim_lock); if (mrsas_register_aen(sc, sc->last_seq_num, class_locale.word)) { device_printf(sc->mrsas_dev, @@ -3090,6 +3107,8 @@ mrsas_reset_ctrl(struct mrsas_softc *sc, "or the controller does not support AEN.\n" "Please contact to the SUPPORT TEAM if the problem persists\n"); } + mtx_lock(&sc->sim_lock); + /* Adapter reset completed successfully */ device_printf(sc->mrsas_dev, "Reset successful\n"); retval = SUCCESS; @@ -3208,8 +3227,10 @@ mrsas_wait_for_outstanding(struct mrsas_ mrsas_dprint(sc, MRSAS_OCR, "[%2d]waiting for %d " "commands to complete\n", i, outstanding); count = sc->msix_vectors > 0 ? sc->msix_vectors : 1; + mtx_unlock(&sc->sim_lock); for (MSIxIndex = 0; MSIxIndex < count; MSIxIndex++) mrsas_complete_cmd(sc, MSIxIndex); + mtx_lock(&sc->sim_lock); } DELAY(1000 * 1000); } From owner-svn-src-all@freebsd.org Tue Nov 29 13:05:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9ED3C5ABDC; Tue, 29 Nov 2016 13:05:44 +0000 (UTC) (envelope-from kadesai@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 798041ED6; Tue, 29 Nov 2016 13:05:44 +0000 (UTC) (envelope-from kadesai@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATD5hZK057941; Tue, 29 Nov 2016 13:05:43 GMT (envelope-from kadesai@FreeBSD.org) Received: (from kadesai@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATD5hgU057940; Tue, 29 Nov 2016 13:05:43 GMT (envelope-from kadesai@FreeBSD.org) Message-Id: <201611291305.uATD5hgU057940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kadesai set sender to kadesai@FreeBSD.org using -f From: Kashyap D Desai Date: Tue, 29 Nov 2016 13:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309294 - head/sys/dev/mrsas X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 13:05:44 -0000 Author: kadesai Date: Tue Nov 29 13:05:43 2016 New Revision: 309294 URL: https://svnweb.freebsd.org/changeset/base/309294 Log: This patch upgrades driver version to 06.712.04.00-fbsd Submitted by: Sumit Saxena Reviewed by: Kashyap Desai MFC after: 3 days Sponsored by: Broadcom Limited/AVAGO Technologies Modified: head/sys/dev/mrsas/mrsas.h Modified: head/sys/dev/mrsas/mrsas.h ============================================================================== --- head/sys/dev/mrsas/mrsas.h Tue Nov 29 13:04:40 2016 (r309293) +++ head/sys/dev/mrsas/mrsas.h Tue Nov 29 13:05:43 2016 (r309294) @@ -106,7 +106,7 @@ __FBSDID("$FreeBSD$"); */ #define BYTE_ALIGNMENT 1 #define MRSAS_MAX_NAME_LENGTH 32 -#define MRSAS_VERSION "06.709.07.00-fbsd" +#define MRSAS_VERSION "06.712.04.00-fbsd" #define MRSAS_ULONG_MAX 0xFFFFFFFFFFFFFFFF #define MRSAS_DEFAULT_TIMEOUT 0x14 /* Temporarily set */ #define DONE 0 From owner-svn-src-all@freebsd.org Tue Nov 29 13:11:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEF25C5ADEA; Tue, 29 Nov 2016 13:11:01 +0000 (UTC) (envelope-from avg@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 8576112EB; Tue, 29 Nov 2016 13:11:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATDB0TR058191; Tue, 29 Nov 2016 13:11:00 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATDB05i058190; Tue, 29 Nov 2016 13:11:00 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201611291311.uATDB05i058190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 29 Nov 2016 13:11:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309295 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 13:11:01 -0000 Author: avg Date: Tue Nov 29 13:11:00 2016 New Revision: 309295 URL: https://svnweb.freebsd.org/changeset/base/309295 Log: bhyve: stability and performance improvement for dbgport The TCP server implementation in dbgport does not track clients, so it may try to write to a disconected socket resulting in SIGPIPE. Avoid that by setting SO_NOSIGPIPE socket option. Because dbgport emulates an I/O port to guest, the communication is done byte by byte. Reduce latency of the TCP/IP transfers by using TCP_NODELAY option. In my tests that change improves performance of kgdb commands with lots of output (e.g. info threads) by two orders of magnitude. A general note. Since we have a uart emulation in bhyve, that can be used for the console and gdb access to guests. So, bvmconsole and bvmdebug could be de-orbited now. But there are many existing deployments that still dependend on those. Discussed with: julian, jhb MFC after: 2 weeks Sponsored by: Panzura Modified: head/usr.sbin/bhyve/dbgport.c Modified: head/usr.sbin/bhyve/dbgport.c ============================================================================== --- head/usr.sbin/bhyve/dbgport.c Tue Nov 29 13:05:43 2016 (r309294) +++ head/usr.sbin/bhyve/dbgport.c Tue Nov 29 13:11:00 2016 (r309295) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -55,8 +56,9 @@ static int dbg_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, uint32_t *eax, void *arg) { - char ch; int nwritten, nread, printonce; + int on = 1; + char ch; if (bytes == 2 && in) { *eax = BVM_DBG_SIG; @@ -74,8 +76,16 @@ again: printonce = 1; } conn_fd = accept4(listen_fd, NULL, NULL, SOCK_NONBLOCK); - if (conn_fd < 0 && errno != EINTR) + if (conn_fd >= 0) { + /* Avoid EPIPE after the client drops off. */ + (void)setsockopt(conn_fd, SOL_SOCKET, SO_NOSIGPIPE, + &on, sizeof(on)); + /* Improve latency for one byte at a time tranfers. */ + (void)setsockopt(conn_fd, IPPROTO_TCP, TCP_NODELAY, + &on, sizeof(on)); + } else if (errno != EINTR) { perror("accept"); + } } if (in) { From owner-svn-src-all@freebsd.org Tue Nov 29 13:32:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0A97C5B793; Tue, 29 Nov 2016 13:32:24 +0000 (UTC) (envelope-from andrew@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 7031F1DDE; Tue, 29 Nov 2016 13:32:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATDWNcP069784; Tue, 29 Nov 2016 13:32:23 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATDWNEf069783; Tue, 29 Nov 2016 13:32:23 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201611291332.uATDWNEf069783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 29 Nov 2016 13:32:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309296 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 13:32:24 -0000 Author: andrew Date: Tue Nov 29 13:32:23 2016 New Revision: 309296 URL: https://svnweb.freebsd.org/changeset/base/309296 Log: We only use the cpu0 variable in the FDT code. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/mp_machdep.c Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Tue Nov 29 13:11:00 2016 (r309295) +++ head/sys/arm64/arm64/mp_machdep.c Tue Nov 29 13:32:23 2016 (r309296) @@ -106,12 +106,14 @@ struct pcb stoppcbs[MAXCPU]; static device_t cpu_list[MAXCPU]; +#ifdef FDT /* * Not all systems boot from the first CPU in the device tree. To work around * this we need to find which CPU we have booted from so when we later * enable the secondary CPUs we skip this one. */ static int cpu0 = -1; +#endif void mpentry(unsigned long cpuid); void init_secondary(uint64_t); From owner-svn-src-all@freebsd.org Tue Nov 29 13:48:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86C5BC5BD42; Tue, 29 Nov 2016 13:48:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 316AA151F; Tue, 29 Nov 2016 13:48:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATDmaef073975; Tue, 29 Nov 2016 13:48:36 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATDma5j073974; Tue, 29 Nov 2016 13:48:36 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201611291348.uATDma5j073974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 29 Nov 2016 13:48:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309297 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 13:48:37 -0000 Author: mav Date: Tue Nov 29 13:48:36 2016 New Revision: 309297 URL: https://svnweb.freebsd.org/changeset/base/309297 Log: Make SES status updates more aggressive. - On control request update all status pages, since they may also be affected if user enables/disables enclosure slots. - Periodically update element descriptors too, since there is some hardware where they are changed dynamically. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cam/scsi/scsi_enc_ses.c Modified: head/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- head/sys/cam/scsi/scsi_enc_ses.c Tue Nov 29 13:32:23 2016 (r309296) +++ head/sys/cam/scsi/scsi_enc_ses.c Tue Nov 29 13:48:36 2016 (r309297) @@ -550,6 +550,7 @@ static int ses_set_timed_completion(enc_ static int ses_putstatus(enc_softc_t *, int, struct ses_comstat *); #endif +static void ses_poll_status(enc_softc_t *); static void ses_print_addl_data(enc_softc_t *, enc_element_t *); /*=========================== SES cleanup routines ===========================*/ @@ -1475,11 +1476,7 @@ out: if (err) ses_cache_free(enc, enc_cache); else { - enc_update_request(enc, SES_UPDATE_GETSTATUS); - if (ses->ses_flags & SES_FLAG_DESC) - enc_update_request(enc, SES_UPDATE_GETELMDESCS); - if (ses->ses_flags & SES_FLAG_ADDLSTATUS) - enc_update_request(enc, SES_UPDATE_GETELMADDLSTATUS); + ses_poll_status(enc); enc_update_request(enc, SES_PUBLISH_CACHE); } ENC_DLOG(enc, "%s: exiting with err %d\n", __func__, err); @@ -1869,7 +1866,7 @@ ses_process_control_request(enc_softc_t * o Some SCSI status error. */ ses_terminate_control_requests(&ses->ses_pending_requests, error); - enc_update_request(enc, SES_UPDATE_GETSTATUS); + ses_poll_status(enc); return (0); } @@ -2801,6 +2798,8 @@ ses_poll_status(enc_softc_t *enc) ses = enc->enc_private; enc_update_request(enc, SES_UPDATE_GETSTATUS); + if (ses->ses_flags & SES_FLAG_DESC) + enc_update_request(enc, SES_UPDATE_GETELMDESCS); if (ses->ses_flags & SES_FLAG_ADDLSTATUS) enc_update_request(enc, SES_UPDATE_GETELMADDLSTATUS); } From owner-svn-src-all@freebsd.org Tue Nov 29 18:40:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34228C5CD6A; Tue, 29 Nov 2016 18:40:26 +0000 (UTC) (envelope-from emaste@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 DE2991C10; Tue, 29 Nov 2016 18:40:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATIePMU089834; Tue, 29 Nov 2016 18:40:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATIeO8R089831; Tue, 29 Nov 2016 18:40:24 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201611291840.uATIeO8R089831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 29 Nov 2016 18:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309298 - in head/lib/msun: arm mips riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 18:40:26 -0000 Author: emaste Date: Tue Nov 29 18:40:24 2016 New Revision: 309298 URL: https://svnweb.freebsd.org/changeset/base/309298 Log: libm: remove duplicate version script entries These symbols already appear in the common lib/msun/Symbol.map. Duplicate entries produce an error with LLVM's LLD linker. Reviewed by: br MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8627 Modified: head/lib/msun/arm/Symbol.map head/lib/msun/mips/Symbol.map head/lib/msun/riscv/Symbol.map Modified: head/lib/msun/arm/Symbol.map ============================================================================== --- head/lib/msun/arm/Symbol.map Tue Nov 29 13:48:36 2016 (r309297) +++ head/lib/msun/arm/Symbol.map Tue Nov 29 18:40:24 2016 (r309298) @@ -5,13 +5,8 @@ FBSD_1.0 { }; FBSD_1.3 { - feclearexcept; - fegetexceptflag; fesetexceptflag; feraiseexcept; - fetestexcept; - fegetround; - fesetround; fegetenv; feholdexcept; feupdateenv; Modified: head/lib/msun/mips/Symbol.map ============================================================================== --- head/lib/msun/mips/Symbol.map Tue Nov 29 13:48:36 2016 (r309297) +++ head/lib/msun/mips/Symbol.map Tue Nov 29 18:40:24 2016 (r309298) @@ -5,13 +5,8 @@ FBSD_1.0 { }; FBSD_1.3 { - feclearexcept; - fegetexceptflag; fesetexceptflag; feraiseexcept; - fetestexcept; - fegetround; - fesetround; fegetenv; feholdexcept; feupdateenv; Modified: head/lib/msun/riscv/Symbol.map ============================================================================== --- head/lib/msun/riscv/Symbol.map Tue Nov 29 13:48:36 2016 (r309297) +++ head/lib/msun/riscv/Symbol.map Tue Nov 29 18:40:24 2016 (r309298) @@ -5,13 +5,8 @@ FBSD_1.0 { }; FBSD_1.3 { - feclearexcept; - fegetexceptflag; fesetexceptflag; feraiseexcept; - fetestexcept; - fegetround; - fesetround; fegetenv; feholdexcept; feupdateenv; From owner-svn-src-all@freebsd.org Tue Nov 29 21:53:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D0E6C5C5FE; Tue, 29 Nov 2016 21:53:19 +0000 (UTC) (envelope-from mm@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 097071D80; Tue, 29 Nov 2016 21:53:18 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATLrInu071603; Tue, 29 Nov 2016 21:53:18 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATLrGGf071586; Tue, 29 Nov 2016 21:53:16 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201611292153.uATLrGGf071586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Tue, 29 Nov 2016 21:53:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r309299 - in vendor/libarchive/dist: . build build/cmake contrib/android/config libarchive libarchive/test tar/test X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 21:53:19 -0000 Author: mm Date: Tue Nov 29 21:53:16 2016 New Revision: 309299 URL: https://svnweb.freebsd.org/changeset/base/309299 Log: Update vendor/libarchive to git 256e52f073765a4ddad1e86fd4d0eda2a18147bf Important vendor bugfixes (relevant to FreeBSD): #821: tar -P cannot extract hardlinks through symlinks #825: Add sanity check of tar "uid, "gid" and "mtime" fields Added: vendor/libarchive/dist/libarchive/test/test_compat_gtar_2.tar.uu vendor/libarchive/dist/libarchive/test/test_compat_star_acl_posix1e.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_compat_star_acl_posix1e.tar.uu vendor/libarchive/dist/libarchive/test/test_read_format_raw.bufr.uu Deleted: vendor/libarchive/dist/build/cmake/FindLZMA.cmake Modified: vendor/libarchive/dist/.travis.yml vendor/libarchive/dist/CMakeLists.txt vendor/libarchive/dist/Makefile.am vendor/libarchive/dist/NEWS vendor/libarchive/dist/build/ci_build.sh vendor/libarchive/dist/configure.ac vendor/libarchive/dist/contrib/android/config/windows_host.h vendor/libarchive/dist/libarchive/archive_acl.c vendor/libarchive/dist/libarchive/archive_entry.c vendor/libarchive/dist/libarchive/archive_entry.h vendor/libarchive/dist/libarchive/archive_entry_acl.3 vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c vendor/libarchive/dist/libarchive/archive_read_support_filter_xz.c vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c vendor/libarchive/dist/libarchive/archive_read_support_format_xar.c vendor/libarchive/dist/libarchive/archive_write_disk_posix.c vendor/libarchive/dist/libarchive/config_freebsd.h vendor/libarchive/dist/libarchive/test/CMakeLists.txt vendor/libarchive/dist/libarchive/test/test_compat_gtar.c vendor/libarchive/dist/libarchive/test/test_read_format_raw.c vendor/libarchive/dist/libarchive/test/test_sparse_basic.c vendor/libarchive/dist/tar/test/test_symlink_dir.c Modified: vendor/libarchive/dist/.travis.yml ============================================================================== --- vendor/libarchive/dist/.travis.yml Tue Nov 29 18:40:24 2016 (r309298) +++ vendor/libarchive/dist/.travis.yml Tue Nov 29 21:53:16 2016 (r309299) @@ -8,6 +8,6 @@ env: - BUILD_SYSTEM=cmake - BUILD_SYSTEM=autotools install: - - sudo apt-get install -y libbz2-dev libzip-dev liblzma-dev + - sudo apt-get install -y libbz2-dev libzip-dev liblzma-dev liblzo2-dev script: - build/ci_build.sh Modified: vendor/libarchive/dist/CMakeLists.txt ============================================================================== --- vendor/libarchive/dist/CMakeLists.txt Tue Nov 29 18:40:24 2016 (r309298) +++ vendor/libarchive/dist/CMakeLists.txt Tue Nov 29 21:53:16 2016 (r309299) @@ -452,34 +452,28 @@ MARK_AS_ADVANCED(CLEAR BZIP2_LIBRARIES) # Find LZMA # IF(ENABLE_LZMA) - FIND_PACKAGE(LZMA) + FIND_PACKAGE(LibLZMA) ELSE() - SET(LZMA_FOUND FALSE) # Override cached value - SET(LZMADEC_FOUND FALSE) # Override cached value + SET(LIBZMA_FOUND FALSE) # Override cached value ENDIF() -IF(LZMA_FOUND) +IF(LIBLZMA_FOUND) SET(HAVE_LIBLZMA 1) SET(HAVE_LZMA_H 1) - INCLUDE_DIRECTORIES(${LZMA_INCLUDE_DIR}) - LIST(APPEND ADDITIONAL_LIBS ${LZMA_LIBRARIES}) + INCLUDE_DIRECTORIES(${LIBLZMA_INCLUDE_DIRS}) + LIST(APPEND ADDITIONAL_LIBS ${LIBLZMA_LIBRARIES}) # Test if a macro is needed for the library. TRY_MACRO_FOR_LIBRARY( - "${LZMA_INCLUDE_DIR}" "${LZMA_LIBRARIES}" + "${LIBLZMA_INCLUDE_DIRS}" "${LIBLZMA_LIBRARIES}" COMPILES "#include \nint main() {return (int)lzma_version_number(); }" "WITHOUT_LZMA_API_STATIC;LZMA_API_STATIC") IF(NOT WITHOUT_LZMA_API_STATIC AND LZMA_API_STATIC) ADD_DEFINITIONS(-DLZMA_API_STATIC) ENDIF(NOT WITHOUT_LZMA_API_STATIC AND LZMA_API_STATIC) -ELSEIF(LZMADEC_FOUND) - SET(HAVE_LIBLZMADEC 1) - SET(HAVE_LZMADEC_H 1) - INCLUDE_DIRECTORIES(${LZMADEC_INCLUDE_DIR}) - LIST(APPEND ADDITIONAL_LIBS ${LZMADEC_LIBRARIES}) -ELSE(LZMA_FOUND) +ELSE(LIBLZMA_FOUND) # LZMA not found and will not be used. -ENDIF(LZMA_FOUND) +ENDIF(LIBLZMA_FOUND) # # Find LZO2 # Modified: vendor/libarchive/dist/Makefile.am ============================================================================== --- vendor/libarchive/dist/Makefile.am Tue Nov 29 18:40:24 2016 (r309298) +++ vendor/libarchive/dist/Makefile.am Tue Nov 29 21:53:16 2016 (r309299) @@ -23,7 +23,7 @@ TESTS_ENVIRONMENT= $(libarchive_TESTS_EN DISTCHECK_CONFIGURE_FLAGS = --enable-bsdtar --enable-bsdcpio # The next line is commented out by default in shipping libarchive releases. # It is uncommented by default in trunk. -# DEV_CFLAGS=-Werror -Wextra -Wunused -Wshadow -Wmissing-prototypes -Wcast-qual -g +DEV_CFLAGS=-Werror -Wextra -Wunused -Wshadow -Wmissing-prototypes -Wcast-qual -g AM_CFLAGS=$(DEV_CFLAGS) PLATFORMCPPFLAGS = @PLATFORMCPPFLAGS@ AM_CPPFLAGS=$(PLATFORMCPPFLAGS) @@ -33,6 +33,7 @@ AM_CPPFLAGS=$(PLATFORMCPPFLAGS) # EXTRA_DIST= \ CMakeLists.txt \ + README.md \ build/autogen.sh \ build/bump-version.sh \ build/clean.sh \ @@ -371,6 +372,7 @@ libarchive_test_SOURCES= \ libarchive/test/test_compat_pax_libarchive_2x.c \ libarchive/test/test_compat_solaris_tar_acl.c \ libarchive/test/test_compat_solaris_pax_sparse.c \ + libarchive/test/test_compat_star_acl_posix1e.c \ libarchive/test/test_compat_tar_hardlink.c \ libarchive/test/test_compat_uudecode.c \ libarchive/test/test_compat_uudecode_large.c \ @@ -625,6 +627,7 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_compat_solaris_pax_sparse_1.pax.Z.uu \ libarchive/test/test_compat_solaris_pax_sparse_2.pax.Z.uu \ libarchive/test/test_compat_solaris_tar_acl.tar.uu \ + libarchive/test/test_compat_star_acl_posix1e.tar.uu \ libarchive/test/test_compat_tar_hardlink_1.tar.uu \ libarchive/test/test_compat_uudecode_large.tar.Z.uu \ libarchive/test/test_compat_xz_1.txz.uu \ Modified: vendor/libarchive/dist/NEWS ============================================================================== --- vendor/libarchive/dist/NEWS Tue Nov 29 18:40:24 2016 (r309298) +++ vendor/libarchive/dist/NEWS Tue Nov 29 21:53:16 2016 (r309299) @@ -1,3 +1,5 @@ +Oct 26, 2016: Remove liblzmadec support + Oct 23, 2016: libarchive 3.2.2 released Security release Modified: vendor/libarchive/dist/build/ci_build.sh ============================================================================== --- vendor/libarchive/dist/build/ci_build.sh Tue Nov 29 18:40:24 2016 (r309298) +++ vendor/libarchive/dist/build/ci_build.sh Tue Nov 29 21:53:16 2016 (r309299) @@ -89,8 +89,15 @@ for action in ${ACTIONS}; do ;; test) case "${BUILD_SYSTEM}" in - autotools) make ${MAKE_ARGS} check ;; - cmake) make ${MAKE_ARGS} test ;; + autotools) + if ! make ${MAKE_ARGS} check; then + cat test-suite.log + exit 1 + fi + ;; + cmake) + make ${MAKE_ARGS} test + ;; esac RET="$?" ;; Modified: vendor/libarchive/dist/configure.ac ============================================================================== --- vendor/libarchive/dist/configure.ac Tue Nov 29 18:40:24 2016 (r309298) +++ vendor/libarchive/dist/configure.ac Tue Nov 29 21:53:16 2016 (r309299) @@ -326,14 +326,6 @@ if test "x$with_bz2lib" != "xno"; then esac fi -AC_ARG_WITH([lzmadec], - AS_HELP_STRING([--without-lzmadec], [Don't build support for lzma through lzmadec])) - -if test "x$with_lzmadec" != "xno"; then - AC_CHECK_HEADERS([lzmadec.h]) - AC_CHECK_LIB(lzmadec,lzmadec_decode) -fi - AC_ARG_WITH([iconv], AS_HELP_STRING([--without-iconv], [Don't try to link against iconv])) @@ -711,7 +703,8 @@ if test "x$enable_acl" != "xno"; then # (It's a pretty obvious oversight; otherwise, there's no way to # test for specific permissions in a permset.) Linux uses the obvious # name, FreeBSD adds _np to mark it as "non-Posix extension." - # Test for both as a double-check that we really have POSIX-style ACL support. + # Test for both as a double-check that we really have POSIX-style ACL + # support. AC_CHECK_FUNCS(acl_get_perm_np acl_get_perm acl_get_link acl_get_link_np,,, [#if HAVE_SYS_TYPES_H #include @@ -721,6 +714,16 @@ if test "x$enable_acl" != "xno"; then #endif ]) + # Check for acl_is_trivial_np on FreeBSD + AC_CHECK_FUNCS(acl_is_trivial_np,,, + [#if HAVE_SYS_TYPES_H + #include + #endif + #if HAVE_SYS_ACL_H + #include + #endif + ]) + # MacOS has an acl.h that isn't POSIX. It can be detected by # checking for ACL_USER AC_CHECK_DECL([ACL_USER], Modified: vendor/libarchive/dist/contrib/android/config/windows_host.h ============================================================================== --- vendor/libarchive/dist/contrib/android/config/windows_host.h Tue Nov 29 18:40:24 2016 (r309298) +++ vendor/libarchive/dist/contrib/android/config/windows_host.h Tue Nov 29 21:53:16 2016 (r309299) @@ -427,9 +427,6 @@ /* Define to 1 if you have the `lzma' library (-llzma). */ /* #undef HAVE_LIBLZMA */ -/* Define to 1 if you have the `lzmadec' library (-llzmadec). */ -/* #undef HAVE_LIBLZMADEC */ - /* Define to 1 if you have the `lzo2' library (-llzo2). */ /* #undef HAVE_LIBLZO2 */ Modified: vendor/libarchive/dist/libarchive/archive_acl.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_acl.c Tue Nov 29 18:40:24 2016 (r309298) +++ vendor/libarchive/dist/libarchive/archive_acl.c Tue Nov 29 21:53:16 2016 (r309299) @@ -94,6 +94,7 @@ archive_acl_clear(struct archive_acl *ac acl->acl_text = NULL; } acl->acl_p = NULL; + acl->acl_types = 0; acl->acl_state = 0; /* Not counting. */ } @@ -284,8 +285,11 @@ acl_new_entry(struct archive_acl *acl, aq = NULL; while (ap != NULL) { if (ap->type == type && ap->tag == tag && ap->id == id) { - ap->permset = permset; - return (ap); + if (id != -1 || (tag != ARCHIVE_ENTRY_ACL_USER && + tag != ARCHIVE_ENTRY_ACL_GROUP)) { + ap->permset = permset; + return (ap); + } } aq = ap; ap = ap->next; Modified: vendor/libarchive/dist/libarchive/archive_entry.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_entry.c Tue Nov 29 18:40:24 2016 (r309298) +++ vendor/libarchive/dist/libarchive/archive_entry.c Tue Nov 29 21:53:16 2016 (r309299) @@ -1442,6 +1442,15 @@ archive_entry_acl_add_entry_w(struct arc } /* + * Return a bitmask of ACL types in an archive entry ACL list + */ +int +archive_entry_acl_types(struct archive_entry *entry) +{ + return ((&entry->acl)->acl_types); +} + +/* * Return a count of entries matching "want_type". */ int Modified: vendor/libarchive/dist/libarchive/archive_entry.h ============================================================================== --- vendor/libarchive/dist/libarchive/archive_entry.h Tue Nov 29 18:40:24 2016 (r309298) +++ vendor/libarchive/dist/libarchive/archive_entry.h Tue Nov 29 21:53:16 2016 (r309299) @@ -508,6 +508,9 @@ __LA_DECL const wchar_t *archive_entry_a __LA_DECL const char *archive_entry_acl_text(struct archive_entry *, int /* flags */); +/* Return bitmask of ACL types in an archive entry */ +__LA_DECL int archive_entry_acl_types(struct archive_entry *); + /* Return a count of entries matching 'want_type' */ __LA_DECL int archive_entry_acl_count(struct archive_entry *, int /* want_type */); Modified: vendor/libarchive/dist/libarchive/archive_entry_acl.3 ============================================================================== --- vendor/libarchive/dist/libarchive/archive_entry_acl.3 Tue Nov 29 18:40:24 2016 (r309298) +++ vendor/libarchive/dist/libarchive/archive_entry_acl.3 Tue Nov 29 21:53:16 2016 (r309299) @@ -33,7 +33,8 @@ .Nm archive_entry_acl_next , .Nm archive_entry_acl_next_w , .Nm archive_entry_acl_reset , -.Nm archive_entry_acl_text_w +.Nm archive_entry_acl_text_w , +.Nm archive_entry_acl_types .Nd functions for manipulating Access Control Lists in archive entry descriptions .Sh LIBRARY Streaming Archive Library (libarchive, -larchive) @@ -85,6 +86,8 @@ Streaming Archive Library (libarchive, - .Fn archive_entry_acl_reset "struct archive_entry *a" "int type" .Ft const wchar_t * .Fn archive_entry_acl_text_w "struct archive_entry *a" "int flags" +.Ft int +.Fn archive_entry_acl_types "struct archive_entry *a" .\" enum? .Sh DESCRIPTION An @@ -192,6 +195,11 @@ The returned long string is valid until .Fn archive_entry_acl_add_entry_w or .Fn archive_entry_acl_text_w . +.Pp +.Fn archive_entry_acl_types +get ACL entry types contained in an archive entry's ACL. As POSIX.1e and NFSv4 +ACL entries cannot be mixed, this function is a very efficient way to detect if +an ACL already contains POSIX.1e or NFSv4 ACL entries. .Sh RETURN VALUES .Fn archive_entry_acl_count and @@ -225,6 +233,9 @@ The returned long string is valid until .Fn archive_entry_acl_add_entry_w or .Fn archive_entry_acl_text_w . +.Pp +.Fn archive_entry_acl_types +returns a bitmask of ACL entry types or 0 if archive entry has no ACL entries. .Sh SEE ALSO .Xr archive_entry 3 .Xr libarchive 3 , Modified: vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c Tue Nov 29 18:40:24 2016 (r309298) +++ vendor/libarchive/dist/libarchive/archive_read_disk_entry_from_file.c Tue Nov 29 21:53:16 2016 (r309299) @@ -125,6 +125,10 @@ static int setup_xattrs(struct archive_r struct archive_entry *, int *fd); static int setup_sparse(struct archive_read_disk *, struct archive_entry *, int *fd); +#if defined(HAVE_LINUX_FIEMAP_H) +static int setup_sparse_fiemap(struct archive_read_disk *, + struct archive_entry *, int *fd); +#endif int archive_read_disk_entry_from_file(struct archive *_a, @@ -1125,7 +1129,7 @@ setup_xattrs(struct archive_read_disk *a #if defined(HAVE_LINUX_FIEMAP_H) /* - * Linux sparse interface. + * Linux FIEMAP sparse interface. * * The FIEMAP ioctl returns an "extent" for each physical allocation * on disk. We need to process those to generate a more compact list @@ -1140,7 +1144,7 @@ setup_xattrs(struct archive_read_disk *a */ static int -setup_sparse(struct archive_read_disk *a, +setup_sparse_fiemap(struct archive_read_disk *a, struct archive_entry *entry, int *fd) { char buff[4096]; @@ -1192,7 +1196,7 @@ setup_sparse(struct archive_read_disk *a /* When something error happens, it is better we * should return ARCHIVE_OK because an earlier * version(<2.6.28) cannot perfom FS_IOC_FIEMAP. */ - goto exit_setup_sparse; + goto exit_setup_sparse_fiemap; } if (fm->fm_mapped_extents == 0) { if (iters == 0) { @@ -1227,14 +1231,24 @@ setup_sparse(struct archive_read_disk *a } else break; } -exit_setup_sparse: +exit_setup_sparse_fiemap: return (exit_sts); } -#elif defined(SEEK_HOLE) && defined(SEEK_DATA) && defined(_PC_MIN_HOLE_SIZE) +#if !defined(SEEK_HOLE) || !defined(SEEK_DATA) +static int +setup_sparse(struct archive_read_disk *a, + struct archive_entry *entry, int *fd) +{ + return setup_sparse_fiemap(a, entry, fd); +} +#endif +#endif /* defined(HAVE_LINUX_FIEMAP_H) */ + +#if defined(SEEK_HOLE) && defined(SEEK_DATA) /* - * FreeBSD and Solaris sparse interface. + * SEEK_HOLE sparse interface (FreeBSD, Linux, Solaris) */ static int @@ -1242,8 +1256,8 @@ setup_sparse(struct archive_read_disk *a struct archive_entry *entry, int *fd) { int64_t size; - off_t initial_off; /* FreeBSD/Solaris only, so off_t okay here */ - off_t off_s, off_e; /* FreeBSD/Solaris only, so off_t okay here */ + off_t initial_off; + off_t off_s, off_e; int exit_sts = ARCHIVE_OK; int check_fully_sparse = 0; @@ -1269,8 +1283,10 @@ setup_sparse(struct archive_read_disk *a } if (*fd >= 0) { +#ifdef _PC_MIN_HOLE_SIZE if (fpathconf(*fd, _PC_MIN_HOLE_SIZE) <= 0) return (ARCHIVE_OK); +#endif initial_off = lseek(*fd, 0, SEEK_CUR); if (initial_off != 0) lseek(*fd, 0, SEEK_SET); @@ -1281,8 +1297,10 @@ setup_sparse(struct archive_read_disk *a if (path == NULL) path = archive_entry_pathname(entry); +#ifdef _PC_MIN_HOLE_SIZE if (pathconf(path, _PC_MIN_HOLE_SIZE) <= 0) return (ARCHIVE_OK); +#endif *fd = open(path, O_RDONLY | O_NONBLOCK | O_CLOEXEC); if (*fd < 0) { archive_set_error(&a->archive, errno, @@ -1293,6 +1311,19 @@ setup_sparse(struct archive_read_disk *a initial_off = 0; } +#ifndef _PC_MIN_HOLE_SIZE + /* Check if the underlying filesystem supports seek hole */ + off_s = lseek(*fd, 0, SEEK_HOLE); + if (off_s < 0) +#if defined(HAVE_LINUX_FIEMAP_H) + return setup_sparse_fiemap(a, entry, fd); +#else + goto exit_setup_sparse; +#endif + else if (off_s > 0) + lseek(*fd, 0, SEEK_SET); +#endif + off_s = 0; size = archive_entry_size(entry); while (off_s < size) { @@ -1342,7 +1373,7 @@ exit_setup_sparse: return (exit_sts); } -#else +#elif !defined(HAVE_LINUX_FIEMAP_H) /* * Generic (stub) sparse support. Modified: vendor/libarchive/dist/libarchive/archive_read_support_filter_xz.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_filter_xz.c Tue Nov 29 18:40:24 2016 (r309298) +++ vendor/libarchive/dist/libarchive/archive_read_support_filter_xz.c Tue Nov 29 21:53:16 2016 (r309299) @@ -43,8 +43,6 @@ __FBSDID("$FreeBSD$"); #endif #if HAVE_LZMA_H #include -#elif HAVE_LZMADEC_H -#include #endif #include "archive.h" @@ -82,19 +80,6 @@ static ssize_t xz_filter_read(struct arc static int xz_filter_close(struct archive_read_filter *); static int xz_lzma_bidder_init(struct archive_read_filter *); -#elif HAVE_LZMADEC_H && HAVE_LIBLZMADEC - -struct private_data { - lzmadec_stream stream; - unsigned char *out_block; - size_t out_block_size; - int64_t total_out; - char eof; /* True = found end of compressed data. */ -}; - -/* Lzma-only filter */ -static ssize_t lzma_filter_read(struct archive_read_filter *, const void **); -static int lzma_filter_close(struct archive_read_filter *); #endif /* @@ -178,8 +163,6 @@ archive_read_support_filter_lzma(struct bidder->free = NULL; #if HAVE_LZMA_H && HAVE_LIBLZMA return (ARCHIVE_OK); -#elif HAVE_LZMADEC_H && HAVE_LIBLZMADEC - return (ARCHIVE_OK); #else archive_set_error(_a, ARCHIVE_ERRNO_MISC, "Using external lzma program for lzma decompression"); @@ -763,175 +746,6 @@ xz_filter_close(struct archive_read_filt #else -#if HAVE_LZMADEC_H && HAVE_LIBLZMADEC - -/* - * If we have the older liblzmadec library, then we can handle - * LZMA streams but not XZ streams. - */ - -/* - * Setup the callbacks. - */ -static int -lzma_bidder_init(struct archive_read_filter *self) -{ - static const size_t out_block_size = 64 * 1024; - void *out_block; - struct private_data *state; - ssize_t ret, avail_in; - - self->code = ARCHIVE_FILTER_LZMA; - self->name = "lzma"; - - state = (struct private_data *)calloc(sizeof(*state), 1); - out_block = (unsigned char *)malloc(out_block_size); - if (state == NULL || out_block == NULL) { - archive_set_error(&self->archive->archive, ENOMEM, - "Can't allocate data for lzma decompression"); - free(out_block); - free(state); - return (ARCHIVE_FATAL); - } - - self->data = state; - state->out_block_size = out_block_size; - state->out_block = out_block; - self->read = lzma_filter_read; - self->skip = NULL; /* not supported */ - self->close = lzma_filter_close; - - /* Prime the lzma library with 18 bytes of input. */ - state->stream.next_in = (unsigned char *)(uintptr_t) - __archive_read_filter_ahead(self->upstream, 18, &avail_in); - if (state->stream.next_in == NULL) - return (ARCHIVE_FATAL); - state->stream.avail_in = avail_in; - state->stream.next_out = state->out_block; - state->stream.avail_out = state->out_block_size; - - /* Initialize compression library. */ - ret = lzmadec_init(&(state->stream)); - __archive_read_filter_consume(self->upstream, - avail_in - state->stream.avail_in); - if (ret == LZMADEC_OK) - return (ARCHIVE_OK); - - /* Library setup failed: Clean up. */ - archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC, - "Internal error initializing lzma library"); - - /* Override the error message if we know what really went wrong. */ - switch (ret) { - case LZMADEC_HEADER_ERROR: - archive_set_error(&self->archive->archive, - ARCHIVE_ERRNO_MISC, - "Internal error initializing compression library: " - "invalid header"); - break; - case LZMADEC_MEM_ERROR: - archive_set_error(&self->archive->archive, ENOMEM, - "Internal error initializing compression library: " - "out of memory"); - break; - } - - free(state->out_block); - free(state); - self->data = NULL; - return (ARCHIVE_FATAL); -} - -/* - * Return the next block of decompressed data. - */ -static ssize_t -lzma_filter_read(struct archive_read_filter *self, const void **p) -{ - struct private_data *state; - size_t decompressed; - ssize_t avail_in, ret; - - state = (struct private_data *)self->data; - - /* Empty our output buffer. */ - state->stream.next_out = state->out_block; - state->stream.avail_out = state->out_block_size; - - /* Try to fill the output buffer. */ - while (state->stream.avail_out > 0 && !state->eof) { - state->stream.next_in = (unsigned char *)(uintptr_t) - __archive_read_filter_ahead(self->upstream, 1, &avail_in); - if (state->stream.next_in == NULL && avail_in < 0) { - archive_set_error(&self->archive->archive, - ARCHIVE_ERRNO_MISC, - "truncated lzma input"); - return (ARCHIVE_FATAL); - } - state->stream.avail_in = avail_in; - - /* Decompress as much as we can in one pass. */ - ret = lzmadec_decode(&(state->stream), avail_in == 0); - switch (ret) { - case LZMADEC_STREAM_END: /* Found end of stream. */ - state->eof = 1; - /* FALL THROUGH */ - case LZMADEC_OK: /* Decompressor made some progress. */ - __archive_read_filter_consume(self->upstream, - avail_in - state->stream.avail_in); - break; - case LZMADEC_BUF_ERROR: /* Insufficient input data? */ - archive_set_error(&self->archive->archive, - ARCHIVE_ERRNO_MISC, - "Insufficient compressed data"); - return (ARCHIVE_FATAL); - default: - /* Return an error. */ - archive_set_error(&self->archive->archive, - ARCHIVE_ERRNO_MISC, - "Lzma decompression failed"); - return (ARCHIVE_FATAL); - } - } - - decompressed = state->stream.next_out - state->out_block; - state->total_out += decompressed; - if (decompressed == 0) - *p = NULL; - else - *p = state->out_block; - return (decompressed); -} - -/* - * Clean up the decompressor. - */ -static int -lzma_filter_close(struct archive_read_filter *self) -{ - struct private_data *state; - int ret; - - state = (struct private_data *)self->data; - ret = ARCHIVE_OK; - switch (lzmadec_end(&(state->stream))) { - case LZMADEC_OK: - break; - default: - archive_set_error(&(self->archive->archive), - ARCHIVE_ERRNO_MISC, - "Failed to clean up %s compressor", - self->archive->archive.compression_name); - ret = ARCHIVE_FATAL; - } - - free(state->out_block); - free(state); - return (ret); -} - -#else - /* * * If we have no suitable library on this system, we can't actually do @@ -953,9 +767,6 @@ lzma_bidder_init(struct archive_read_fil return (r); } -#endif /* HAVE_LZMADEC_H */ - - static int xz_bidder_init(struct archive_read_filter *self) { @@ -984,5 +795,4 @@ lzip_bidder_init(struct archive_read_fil return (r); } - #endif /* HAVE_LZMA_H */ Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c Tue Nov 29 18:40:24 2016 (r309298) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c Tue Nov 29 21:53:16 2016 (r309299) @@ -294,6 +294,46 @@ archive_read_format_tar_cleanup(struct a return (ARCHIVE_OK); } +static int +validate_number_field(const char* p_field, size_t i_size) +{ + unsigned char marker = (unsigned char)p_field[0]; + /* octal? */ + if ((marker >= '0' && marker <= '7') || marker == ' ') { + size_t i = 0; + int octal_found = 0; + for (i = 0; i < i_size; ++i) { + switch (p_field[i]) + { + case ' ': /* skip any leading spaces and trailing space*/ + if (octal_found == 0 || i == i_size - 1) { + continue; + } + break; + case '\0': /* null is allowed only at the end */ + if (i != i_size - 1) { + return 0; + } + break; + /* rest must be octal digits */ + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + ++octal_found; + break; + } + } + return octal_found > 0; + } + /* base 256 (i.e. binary number) */ + else if (marker == 128 || marker == 255 || marker == 0) { + /* nothing to check */ + return 1; + } + /* not a number field */ + else { + return 0; + } +} static int archive_read_format_tar_bid(struct archive_read *a, int best_bid) @@ -346,23 +386,23 @@ archive_read_format_tar_bid(struct archi return (0); bid += 2; /* 6 bits of variation in an 8-bit field leaves 2 bits. */ - /* Sanity check: Look at first byte of mode field. */ - switch (255 & (unsigned)header->mode[0]) { - case 0: case 255: - /* Base-256 value: No further verification possible! */ - break; - case ' ': /* Not recommended, but not illegal, either. */ - break; - case '0': case '1': case '2': case '3': - case '4': case '5': case '6': case '7': - /* Octal Value. */ - /* TODO: Check format of remainder of this field. */ - break; - default: - /* Not a valid mode; bail out here. */ - return (0); + /* + * Check format of mode/uid/gid/mtime/size/rdevmajor/rdevminor fields. + * These are usually octal numbers but GNU tar encodes "big" values as + * base256 and leading zeroes are sometimes replaced by spaces. + * Even the null terminator is sometimes omitted. Anyway, must be checked + * to avoid false positives. + */ + if (bid > 0 && + (validate_number_field(header->mode, sizeof(header->mode)) == 0 || + validate_number_field(header->uid, sizeof(header->uid)) == 0 || + validate_number_field(header->gid, sizeof(header->gid)) == 0 || + validate_number_field(header->mtime, sizeof(header->mtime)) == 0 || + validate_number_field(header->size, sizeof(header->size)) == 0 || + validate_number_field(header->rdevmajor, sizeof(header->rdevmajor)) == 0 || + validate_number_field(header->rdevminor, sizeof(header->rdevminor)) == 0)) { + bid = 0; } - /* TODO: Sanity test uid/gid/size/mtime/rdevmajor/rdevminor fields. */ return (bid); } Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_xar.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_xar.c Tue Nov 29 18:40:24 2016 (r309298) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_xar.c Tue Nov 29 21:53:16 2016 (r309299) @@ -43,8 +43,6 @@ __FBSDID("$FreeBSD$"); #endif #if HAVE_LZMA_H #include -#elif HAVE_LZMADEC_H -#include #endif #ifdef HAVE_ZLIB_H #include @@ -334,9 +332,6 @@ struct xar { #if HAVE_LZMA_H && HAVE_LIBLZMA lzma_stream lzstream; int lzstream_valid; -#elif HAVE_LZMADEC_H && HAVE_LIBLZMADEC - lzmadec_stream lzstream; - int lzstream_valid; #endif /* * For Checksum data. @@ -1526,34 +1521,6 @@ decompression_init(struct archive_read * xar->lzstream.total_in = 0; xar->lzstream.total_out = 0; break; -#elif defined(HAVE_LZMADEC_H) && defined(HAVE_LIBLZMADEC) - case LZMA: - if (xar->lzstream_valid) - lzmadec_end(&(xar->lzstream)); - r = lzmadec_init(&(xar->lzstream)); - if (r != LZMADEC_OK) { - switch (r) { - case LZMADEC_HEADER_ERROR: - archive_set_error(&a->archive, - ARCHIVE_ERRNO_MISC, - "Internal error initializing " - "compression library: " - "invalid header"); - break; - case LZMADEC_MEM_ERROR: - archive_set_error(&a->archive, - ENOMEM, - "Internal error initializing " - "compression library: " - "out of memory"); - break; - } - return (ARCHIVE_FATAL); - } - xar->lzstream_valid = 1; - xar->lzstream.total_in = 0; - xar->lzstream.total_out = 0; - break; #endif /* * Unsupported compression. @@ -1563,9 +1530,7 @@ decompression_init(struct archive_read * case BZIP2: #endif #if !defined(HAVE_LZMA_H) || !defined(HAVE_LIBLZMA) -#if !defined(HAVE_LZMADEC_H) || !defined(HAVE_LIBLZMADEC) case LZMA: -#endif case XZ: #endif switch (xar->entry_encoding) { @@ -1685,46 +1650,12 @@ decompress(struct archive_read *a, const *used = avail_in - xar->lzstream.avail_in; *outbytes = avail_out - xar->lzstream.avail_out; break; -#elif defined(HAVE_LZMADEC_H) && defined(HAVE_LIBLZMADEC) - case LZMA: - xar->lzstream.next_in = (unsigned char *)(uintptr_t)b; - xar->lzstream.avail_in = avail_in; - xar->lzstream.next_out = (unsigned char *)outbuff; - xar->lzstream.avail_out = avail_out; - r = lzmadec_decode(&(xar->lzstream), 0); - switch (r) { - case LZMADEC_STREAM_END: /* Found end of stream. */ - switch (lzmadec_end(&(xar->lzstream))) { - case LZMADEC_OK: - break; - default: - archive_set_error(&(a->archive), - ARCHIVE_ERRNO_MISC, - "Failed to clean up lzmadec decompressor"); - return (ARCHIVE_FATAL); - } - xar->lzstream_valid = 0; - /* FALLTHROUGH */ - case LZMADEC_OK: /* Decompressor made some progress. */ - break; - default: - archive_set_error(&(a->archive), - ARCHIVE_ERRNO_MISC, - "lzmadec decompression failed(%d)", - r); - return (ARCHIVE_FATAL); - } - *used = avail_in - xar->lzstream.avail_in; - *outbytes = avail_out - xar->lzstream.avail_out; - break; #endif #if !defined(HAVE_BZLIB_H) || !defined(BZ_CONFIG_ERROR) case BZIP2: #endif #if !defined(HAVE_LZMA_H) || !defined(HAVE_LIBLZMA) -#if !defined(HAVE_LZMADEC_H) || !defined(HAVE_LIBLZMADEC) case LZMA: -#endif case XZ: #endif case NONE: Modified: vendor/libarchive/dist/libarchive/archive_write_disk_posix.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_write_disk_posix.c Tue Nov 29 18:40:24 2016 (r309298) +++ vendor/libarchive/dist/libarchive/archive_write_disk_posix.c Tue Nov 29 21:53:16 2016 (r309299) @@ -336,14 +336,19 @@ struct archive_write_disk { #define HFS_BLOCKS(s) ((s) >> 12) -static int check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags); +static void fsobj_error(int *, struct archive_string *, int, const char *, + const char *); +static int check_symlinks_fsobj(char *, int *, struct archive_string *, + int); static int check_symlinks(struct archive_write_disk *); static int create_filesystem_object(struct archive_write_disk *); -static struct fixup_entry *current_fixup(struct archive_write_disk *, const char *pathname); +static struct fixup_entry *current_fixup(struct archive_write_disk *, + const char *pathname); #if defined(HAVE_FCHDIR) && defined(PATH_MAX) static void edit_deep_directories(struct archive_write_disk *ad); #endif -static int cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags); +static int cleanup_pathname_fsobj(char *, int *, struct archive_string *, + int); static int cleanup_pathname(struct archive_write_disk *); static int create_dir(struct archive_write_disk *, char *); static int create_parent_dir(struct archive_write_disk *, char *); @@ -374,11 +379,14 @@ static struct archive_vtable *archive_wr static int _archive_write_disk_close(struct archive *); static int _archive_write_disk_free(struct archive *); -static int _archive_write_disk_header(struct archive *, struct archive_entry *); +static int _archive_write_disk_header(struct archive *, + struct archive_entry *); static int64_t _archive_write_disk_filter_bytes(struct archive *, int); static int _archive_write_disk_finish_entry(struct archive *); -static ssize_t _archive_write_disk_data(struct archive *, const void *, size_t); -static ssize_t _archive_write_disk_data_block(struct archive *, const void *, size_t, int64_t); +static ssize_t _archive_write_disk_data(struct archive *, const void *, + size_t); +static ssize_t _archive_write_disk_data_block(struct archive *, const void *, + size_t, int64_t); static int lazy_stat(struct archive_write_disk *a) @@ -649,7 +657,8 @@ _archive_write_disk_header(struct archiv if (a->restore_pwd >= 0) { r = fchdir(a->restore_pwd); if (r != 0) { - archive_set_error(&a->archive, errno, "chdir() failure"); + archive_set_error(&a->archive, errno, + "chdir() failure"); ret = ARCHIVE_FATAL; } close(a->restore_pwd); @@ -697,7 +706,8 @@ _archive_write_disk_header(struct archiv } if (archive_entry_birthtime_is_set(entry)) { fe->birthtime = archive_entry_birthtime(entry); - fe->birthtime_nanos = archive_entry_birthtime_nsec(entry); + fe->birthtime_nanos = archive_entry_birthtime_nsec( + entry); } else { /* If birthtime is unset, use mtime. */ fe->birthtime = fe->mtime; @@ -723,7 +733,8 @@ _archive_write_disk_header(struct archiv return (ARCHIVE_FATAL); fe->mac_metadata = malloc(metadata_size); if (fe->mac_metadata != NULL) { - memcpy(fe->mac_metadata, metadata, metadata_size); + memcpy(fe->mac_metadata, metadata, + metadata_size); fe->mac_metadata_size = metadata_size; fe->fixup |= TODO_MAC_METADATA; } @@ -1480,7 +1491,8 @@ _archive_write_disk_data_block(struct ar return (r); if ((size_t)r < size) { archive_set_error(&a->archive, 0, - "Too much data: Truncating file at %ju bytes", (uintmax_t)a->filesize); + "Too much data: Truncating file at %ju bytes", + (uintmax_t)a->filesize); return (ARCHIVE_WARN); } #if ARCHIVE_VERSION_NUMBER < 3999000 @@ -2005,8 +2017,9 @@ restore_entry(struct archive_write_disk if (en) { /* Everything failed; give up here. */ - archive_set_error(&a->archive, en, "Can't create '%s'", - a->name); + if ((&a->archive)->error == NULL) + archive_set_error(&a->archive, en, "Can't create '%s'", + a->name); return (ARCHIVE_FAILED); } @@ -2043,19 +2056,32 @@ create_filesystem_object(struct archive_ if (linkname_copy == NULL) { return (EPERM); } - /* TODO: consider using the cleaned-up path as the link target? */ - r = cleanup_pathname_fsobj(linkname_copy, &error_number, &error_string, a->flags); + /* + * TODO: consider using the cleaned-up path as the link + * target? + */ + r = cleanup_pathname_fsobj(linkname_copy, &error_number, + &error_string, a->flags); if (r != ARCHIVE_OK) { - archive_set_error(&a->archive, error_number, "%s", error_string.s); + archive_set_error(&a->archive, error_number, "%s", + error_string.s); free(linkname_copy); - /* EPERM is more appropriate than error_number for our callers */ + /* + * EPERM is more appropriate than error_number for our + * callers + */ return (EPERM); } - r = check_symlinks_fsobj(linkname_copy, &error_number, &error_string, a->flags); + r = check_symlinks_fsobj(linkname_copy, &error_number, + &error_string, a->flags); if (r != ARCHIVE_OK) { - archive_set_error(&a->archive, error_number, "%s", error_string.s); + archive_set_error(&a->archive, error_number, "%s", + error_string.s); free(linkname_copy); - /* EPERM is more appropriate than error_number for our callers */ + /* + * EPERM is more appropriate than error_number for our + * callers + */ return (EPERM); } free(linkname_copy); @@ -2076,8 +2102,8 @@ create_filesystem_object(struct archive_ a->todo = 0; a->deferred = 0; } else if (r == 0 && a->filesize > 0) { - a->fd = open(a->name, - O_WRONLY | O_TRUNC | O_BINARY | O_CLOEXEC | O_NOFOLLOW); + a->fd = open(a->name, O_WRONLY | O_TRUNC | O_BINARY + | O_CLOEXEC | O_NOFOLLOW); __archive_ensure_cloexec_flag(a->fd); if (a->fd < 0) r = errno; @@ -2388,6 +2414,17 @@ current_fixup(struct archive_write_disk return (a->current_fixup); } +/* Error helper for new *_fsobj functions */ +static void +fsobj_error(int *a_eno, struct archive_string *a_estr, + int err, const char *errstr, const char *path) +{ + if (a_eno) + *a_eno = err; + if (a_estr) + archive_string_sprintf(a_estr, errstr, path); +} + /* * TODO: Someday, integrate this with the deep dir support; they both * scan the path and both can be optimized by comparing against other @@ -2400,7 +2437,8 @@ current_fixup(struct archive_write_disk *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Nov 29 21:57:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E529AC5C722; Tue, 29 Nov 2016 21:57:47 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (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 896141F95; Tue, 29 Nov 2016 21:57:47 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wm0-x244.google.com with SMTP id u144so26518586wmu.0; Tue, 29 Nov 2016 13:57:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=RkqzIjBOxahmndYm6LZCXmXe+UZ5Pj0V7O9543ixCMM=; b=Qv7W0Gsg0O1n2bjD4zTO/ZzqRvfpDljr16ekTHHsJdIbw6aEmsKmv49BuBL+X5ULzY cNBhjLsN8ugqTew9MWPITVtu7vHix98Ts/abHoWHuHmEg0YuYDW6r8GHwEM6k1vityXt xPhOgeoqKaNSqSYoWHHnbf4NOsC9B3CuEQH92+ymfOFDjAsuhB5b8udL9YM28ilVy4Cp LcAo9GyG5vxaWZ83FURHVODojCBD01PXP9ULOrUvG4/5TE4tsuaFmlCbnPQDfRJN0VuF plm5zFfj3Q9P9Xt/gOaJluV3VtXAeYiMaF3bqK6MOuPHQd48aaYRlJ0DsrCl1kd2EeaM XyCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=RkqzIjBOxahmndYm6LZCXmXe+UZ5Pj0V7O9543ixCMM=; b=Edp6de8Dvm2mAdH79DW7YV/ExLGCNI7nvRVbSl04Wkrt4yj/+enIFM1Lb6BuEBqI0p EIqX0QubPICb7vZJgLLz+ZGhzlB82ZVuVW+LE5DrUNcXq/3iDT5guGGpclKNAZQ0vaUy HTZGAt7//ghZj+1Rp68WK6GsXjuXXZbPhAeqA6NeqBRLJJUDCRUKcKB5xGzgP7XwL4DQ fYQQA8kbeg+IC5UzJ4rO+c1+wvJeN5iC491ysAxQ7tubq7o94RniaZSWCvqKi3pcWOmz fQoNRwQRhGvFJib5NVB1yB7sjBaNUQBPQAyEhz5DTwhUe4sYEiP6JLZodh9XBg/7QF2O fctg== X-Gm-Message-State: AKaTC03e9IrbJ0TS7pj/pW48GBuMHe5JAD8kIOwySlpzTLgTip7yDEHLbbuSoGitL42qkA== X-Received: by 10.28.4.200 with SMTP id 191mr24418166wme.23.1480456665854; Tue, 29 Nov 2016 13:57:45 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id d8sm4815265wmi.21.2016.11.29.13.57.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Nov 2016 13:57:45 -0800 (PST) Sender: Baptiste Daroussin Date: Tue, 29 Nov 2016 22:57:44 +0100 From: Baptiste Daroussin To: Martin Matuska Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: Re: svn commit: r309299 - in vendor/libarchive/dist: . build build/cmake contrib/android/config libarchive libarchive/test tar/test Message-ID: <20161129215744.vabosn7g4j52ubrt@ivaldir.etoilebsd.net> References: <201611292153.uATLrGGf071586@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6o2pgsnr7suatm27" Content-Disposition: inline In-Reply-To: <201611292153.uATLrGGf071586@repo.freebsd.org> User-Agent: NeoMutt/20161126 (1.7.1) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 21:57:48 -0000 --6o2pgsnr7suatm27 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 29, 2016 at 09:53:16PM +0000, Martin Matuska wrote: > Author: mm > Date: Tue Nov 29 21:53:16 2016 > New Revision: 309299 > URL: https://svnweb.freebsd.org/changeset/base/309299 >=20 > Log: > Update vendor/libarchive to git 256e52f073765a4ddad1e86fd4d0eda2a18147bf > =20 > Important vendor bugfixes (relevant to FreeBSD): > #821: tar -P cannot extract hardlinks through symlinks > #825: Add sanity check of tar "uid, "gid" and "mtime" fields >=20 This also fixes pkg register which rely on libarchive (same bug as -P) Please request an errata so pkg register can work properly on releases. Best regards, Bapt --6o2pgsnr7suatm27 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlg9+dQACgkQY4mL3PG3 PlrrGQ//RgAtichQEadXiiy2kvFJw/hWyr4OWIKlcdn0UgAsvbAKEpWpA2seW3F0 YjGMHpF0Mb9hWTXuz77mbecIc+dCo8mZ9KIYKdZuWgrolR4YHVvNeBM0FtkW7rjL G6B4dixid3mKwVj6Rwp6CYm8vfZ5sa6YjNWCed/Wb3ZNflt/NfLIJHlmWwZLNbz2 Lro6j3nEWCy4oAFozECtx1zbr1X53hK6gT0j0+zxw3VX/5DX7jtffww9EsnUSxOu bN7rMW6YAlZQ/kT3k99WDXIUWOMdpMn5iPfna4gF+LmiEWZ6J9CEbgB5UuSplB8b v+bCF+wqH7n1gwpTimi6J6sLZeRFwgRcvjyCK8/7ses1BVjV8qz0u94Ec5TAYMn+ xlw+FoDWRQya2hkT5WJ//Z0lOTJX2Jla247JD78iuPk5dxRB17En70+0GeIq7yv2 7YGD6ygufqqKNRWDnJ7bpX4jFsTQRAa1dXqPCI/to6i0/ulvkrYx3PyiguxpG3eN XhO+WIGfwZyjYmIOIgJBh7dudcLycq4nfORFUvelcoLoO6HTybE012hxoUL5Z8dI nILJp+16AJGQ2NFVSkLtWnvLvqMgaPTdU0GNA1WI27/Ch1tCMhZaHDBTazqwE6sy kYp9h5ImdOw5PLcy04WAQ3+LyR/ZBdRH1zfEWudZ6oWPHoU8LEY= =DO9D -----END PGP SIGNATURE----- --6o2pgsnr7suatm27-- From owner-svn-src-all@freebsd.org Tue Nov 29 22:14:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D522C5CC81; Tue, 29 Nov 2016 22:14:44 +0000 (UTC) (envelope-from mm@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 35A0B1AAC; Tue, 29 Nov 2016 22:14:44 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uATMEhM8079914; Tue, 29 Nov 2016 22:14:43 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uATMEgQH079904; Tue, 29 Nov 2016 22:14:42 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201611292214.uATMEgQH079904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Tue, 29 Nov 2016 22:14:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309300 - in head: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar/test lib/libarchive/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 22:14:44 -0000 Author: mm Date: Tue Nov 29 22:14:42 2016 New Revision: 309300 URL: https://svnweb.freebsd.org/changeset/base/309300 Log: MFV r309299: Sync libarchive with vendor. Important vendor bugfixes (relevant to FreeBSD): #821: tar -P cannot extract hardlinks through symlinks #825: Add sanity check of tar "uid, "gid" and "mtime" fields PR: 213255 Reported by: Tijl Coosemans MFC after: 1 week Added: head/contrib/libarchive/libarchive/test/test_compat_gtar_2.tar.uu - copied unchanged from r309299, vendor/libarchive/dist/libarchive/test/test_compat_gtar_2.tar.uu head/contrib/libarchive/libarchive/test/test_compat_star_acl_posix1e.c - copied unchanged from r309299, vendor/libarchive/dist/libarchive/test/test_compat_star_acl_posix1e.c head/contrib/libarchive/libarchive/test/test_compat_star_acl_posix1e.tar.uu - copied unchanged from r309299, vendor/libarchive/dist/libarchive/test/test_compat_star_acl_posix1e.tar.uu head/contrib/libarchive/libarchive/test/test_read_format_raw.bufr.uu - copied unchanged from r309299, vendor/libarchive/dist/libarchive/test/test_read_format_raw.bufr.uu Modified: head/contrib/libarchive/NEWS head/contrib/libarchive/libarchive/archive_acl.c head/contrib/libarchive/libarchive/archive_entry.c head/contrib/libarchive/libarchive/archive_entry.h head/contrib/libarchive/libarchive/archive_entry_acl.3 head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c head/contrib/libarchive/libarchive/archive_read_support_filter_xz.c head/contrib/libarchive/libarchive/archive_read_support_format_tar.c head/contrib/libarchive/libarchive/archive_read_support_format_xar.c head/contrib/libarchive/libarchive/archive_write_disk_posix.c head/contrib/libarchive/libarchive/test/test_compat_gtar.c head/contrib/libarchive/libarchive/test/test_read_format_raw.c head/contrib/libarchive/libarchive/test/test_sparse_basic.c head/contrib/libarchive/tar/test/test_symlink_dir.c head/lib/libarchive/tests/Makefile Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/NEWS ============================================================================== --- head/contrib/libarchive/NEWS Tue Nov 29 21:53:16 2016 (r309299) +++ head/contrib/libarchive/NEWS Tue Nov 29 22:14:42 2016 (r309300) @@ -1,3 +1,5 @@ +Oct 26, 2016: Remove liblzmadec support + Oct 23, 2016: libarchive 3.2.2 released Security release Modified: head/contrib/libarchive/libarchive/archive_acl.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_acl.c Tue Nov 29 21:53:16 2016 (r309299) +++ head/contrib/libarchive/libarchive/archive_acl.c Tue Nov 29 22:14:42 2016 (r309300) @@ -94,6 +94,7 @@ archive_acl_clear(struct archive_acl *ac acl->acl_text = NULL; } acl->acl_p = NULL; + acl->acl_types = 0; acl->acl_state = 0; /* Not counting. */ } @@ -284,8 +285,11 @@ acl_new_entry(struct archive_acl *acl, aq = NULL; while (ap != NULL) { if (ap->type == type && ap->tag == tag && ap->id == id) { - ap->permset = permset; - return (ap); + if (id != -1 || (tag != ARCHIVE_ENTRY_ACL_USER && + tag != ARCHIVE_ENTRY_ACL_GROUP)) { + ap->permset = permset; + return (ap); + } } aq = ap; ap = ap->next; Modified: head/contrib/libarchive/libarchive/archive_entry.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_entry.c Tue Nov 29 21:53:16 2016 (r309299) +++ head/contrib/libarchive/libarchive/archive_entry.c Tue Nov 29 22:14:42 2016 (r309300) @@ -1442,6 +1442,15 @@ archive_entry_acl_add_entry_w(struct arc } /* + * Return a bitmask of ACL types in an archive entry ACL list + */ +int +archive_entry_acl_types(struct archive_entry *entry) +{ + return ((&entry->acl)->acl_types); +} + +/* * Return a count of entries matching "want_type". */ int Modified: head/contrib/libarchive/libarchive/archive_entry.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_entry.h Tue Nov 29 21:53:16 2016 (r309299) +++ head/contrib/libarchive/libarchive/archive_entry.h Tue Nov 29 22:14:42 2016 (r309300) @@ -508,6 +508,9 @@ __LA_DECL const wchar_t *archive_entry_a __LA_DECL const char *archive_entry_acl_text(struct archive_entry *, int /* flags */); +/* Return bitmask of ACL types in an archive entry */ +__LA_DECL int archive_entry_acl_types(struct archive_entry *); + /* Return a count of entries matching 'want_type' */ __LA_DECL int archive_entry_acl_count(struct archive_entry *, int /* want_type */); Modified: head/contrib/libarchive/libarchive/archive_entry_acl.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_entry_acl.3 Tue Nov 29 21:53:16 2016 (r309299) +++ head/contrib/libarchive/libarchive/archive_entry_acl.3 Tue Nov 29 22:14:42 2016 (r309300) @@ -33,7 +33,8 @@ .Nm archive_entry_acl_next , .Nm archive_entry_acl_next_w , .Nm archive_entry_acl_reset , -.Nm archive_entry_acl_text_w +.Nm archive_entry_acl_text_w , +.Nm archive_entry_acl_types .Nd functions for manipulating Access Control Lists in archive entry descriptions .Sh LIBRARY Streaming Archive Library (libarchive, -larchive) @@ -85,6 +86,8 @@ Streaming Archive Library (libarchive, - .Fn archive_entry_acl_reset "struct archive_entry *a" "int type" .Ft const wchar_t * .Fn archive_entry_acl_text_w "struct archive_entry *a" "int flags" +.Ft int +.Fn archive_entry_acl_types "struct archive_entry *a" .\" enum? .Sh DESCRIPTION An @@ -192,6 +195,11 @@ The returned long string is valid until .Fn archive_entry_acl_add_entry_w or .Fn archive_entry_acl_text_w . +.Pp +.Fn archive_entry_acl_types +get ACL entry types contained in an archive entry's ACL. As POSIX.1e and NFSv4 +ACL entries cannot be mixed, this function is a very efficient way to detect if +an ACL already contains POSIX.1e or NFSv4 ACL entries. .Sh RETURN VALUES .Fn archive_entry_acl_count and @@ -225,6 +233,9 @@ The returned long string is valid until .Fn archive_entry_acl_add_entry_w or .Fn archive_entry_acl_text_w . +.Pp +.Fn archive_entry_acl_types +returns a bitmask of ACL entry types or 0 if archive entry has no ACL entries. .Sh SEE ALSO .Xr archive_entry 3 .Xr libarchive 3 , Modified: head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Tue Nov 29 21:53:16 2016 (r309299) +++ head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Tue Nov 29 22:14:42 2016 (r309300) @@ -125,6 +125,10 @@ static int setup_xattrs(struct archive_r struct archive_entry *, int *fd); static int setup_sparse(struct archive_read_disk *, struct archive_entry *, int *fd); +#if defined(HAVE_LINUX_FIEMAP_H) +static int setup_sparse_fiemap(struct archive_read_disk *, + struct archive_entry *, int *fd); +#endif int archive_read_disk_entry_from_file(struct archive *_a, @@ -1124,7 +1128,7 @@ setup_xattrs(struct archive_read_disk *a #if defined(HAVE_LINUX_FIEMAP_H) /* - * Linux sparse interface. + * Linux FIEMAP sparse interface. * * The FIEMAP ioctl returns an "extent" for each physical allocation * on disk. We need to process those to generate a more compact list @@ -1139,7 +1143,7 @@ setup_xattrs(struct archive_read_disk *a */ static int -setup_sparse(struct archive_read_disk *a, +setup_sparse_fiemap(struct archive_read_disk *a, struct archive_entry *entry, int *fd) { char buff[4096]; @@ -1191,7 +1195,7 @@ setup_sparse(struct archive_read_disk *a /* When something error happens, it is better we * should return ARCHIVE_OK because an earlier * version(<2.6.28) cannot perfom FS_IOC_FIEMAP. */ - goto exit_setup_sparse; + goto exit_setup_sparse_fiemap; } if (fm->fm_mapped_extents == 0) { if (iters == 0) { @@ -1226,14 +1230,24 @@ setup_sparse(struct archive_read_disk *a } else break; } -exit_setup_sparse: +exit_setup_sparse_fiemap: return (exit_sts); } -#elif defined(SEEK_HOLE) && defined(SEEK_DATA) && defined(_PC_MIN_HOLE_SIZE) +#if !defined(SEEK_HOLE) || !defined(SEEK_DATA) +static int +setup_sparse(struct archive_read_disk *a, + struct archive_entry *entry, int *fd) +{ + return setup_sparse_fiemap(a, entry, fd); +} +#endif +#endif /* defined(HAVE_LINUX_FIEMAP_H) */ + +#if defined(SEEK_HOLE) && defined(SEEK_DATA) /* - * FreeBSD and Solaris sparse interface. + * SEEK_HOLE sparse interface (FreeBSD, Linux, Solaris) */ static int @@ -1241,8 +1255,8 @@ setup_sparse(struct archive_read_disk *a struct archive_entry *entry, int *fd) { int64_t size; - off_t initial_off; /* FreeBSD/Solaris only, so off_t okay here */ - off_t off_s, off_e; /* FreeBSD/Solaris only, so off_t okay here */ + off_t initial_off; + off_t off_s, off_e; int exit_sts = ARCHIVE_OK; int check_fully_sparse = 0; @@ -1268,8 +1282,10 @@ setup_sparse(struct archive_read_disk *a } if (*fd >= 0) { +#ifdef _PC_MIN_HOLE_SIZE if (fpathconf(*fd, _PC_MIN_HOLE_SIZE) <= 0) return (ARCHIVE_OK); +#endif initial_off = lseek(*fd, 0, SEEK_CUR); if (initial_off != 0) lseek(*fd, 0, SEEK_SET); @@ -1280,8 +1296,10 @@ setup_sparse(struct archive_read_disk *a if (path == NULL) path = archive_entry_pathname(entry); +#ifdef _PC_MIN_HOLE_SIZE if (pathconf(path, _PC_MIN_HOLE_SIZE) <= 0) return (ARCHIVE_OK); +#endif *fd = open(path, O_RDONLY | O_NONBLOCK | O_CLOEXEC); if (*fd < 0) { archive_set_error(&a->archive, errno, @@ -1292,6 +1310,19 @@ setup_sparse(struct archive_read_disk *a initial_off = 0; } +#ifndef _PC_MIN_HOLE_SIZE + /* Check if the underlying filesystem supports seek hole */ + off_s = lseek(*fd, 0, SEEK_HOLE); + if (off_s < 0) +#if defined(HAVE_LINUX_FIEMAP_H) + return setup_sparse_fiemap(a, entry, fd); +#else + goto exit_setup_sparse; +#endif + else if (off_s > 0) + lseek(*fd, 0, SEEK_SET); +#endif + off_s = 0; size = archive_entry_size(entry); while (off_s < size) { @@ -1341,7 +1372,7 @@ exit_setup_sparse: return (exit_sts); } -#else +#elif !defined(HAVE_LINUX_FIEMAP_H) /* * Generic (stub) sparse support. Modified: head/contrib/libarchive/libarchive/archive_read_support_filter_xz.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_filter_xz.c Tue Nov 29 21:53:16 2016 (r309299) +++ head/contrib/libarchive/libarchive/archive_read_support_filter_xz.c Tue Nov 29 22:14:42 2016 (r309300) @@ -43,8 +43,6 @@ __FBSDID("$FreeBSD$"); #endif #if HAVE_LZMA_H #include -#elif HAVE_LZMADEC_H -#include #endif #include "archive.h" @@ -82,19 +80,6 @@ static ssize_t xz_filter_read(struct arc static int xz_filter_close(struct archive_read_filter *); static int xz_lzma_bidder_init(struct archive_read_filter *); -#elif HAVE_LZMADEC_H && HAVE_LIBLZMADEC - -struct private_data { - lzmadec_stream stream; - unsigned char *out_block; - size_t out_block_size; - int64_t total_out; - char eof; /* True = found end of compressed data. */ -}; - -/* Lzma-only filter */ -static ssize_t lzma_filter_read(struct archive_read_filter *, const void **); -static int lzma_filter_close(struct archive_read_filter *); #endif /* @@ -178,8 +163,6 @@ archive_read_support_filter_lzma(struct bidder->free = NULL; #if HAVE_LZMA_H && HAVE_LIBLZMA return (ARCHIVE_OK); -#elif HAVE_LZMADEC_H && HAVE_LIBLZMADEC - return (ARCHIVE_OK); #else archive_set_error(_a, ARCHIVE_ERRNO_MISC, "Using external lzma program for lzma decompression"); @@ -763,175 +746,6 @@ xz_filter_close(struct archive_read_filt #else -#if HAVE_LZMADEC_H && HAVE_LIBLZMADEC - -/* - * If we have the older liblzmadec library, then we can handle - * LZMA streams but not XZ streams. - */ - -/* - * Setup the callbacks. - */ -static int -lzma_bidder_init(struct archive_read_filter *self) -{ - static const size_t out_block_size = 64 * 1024; - void *out_block; - struct private_data *state; - ssize_t ret, avail_in; - - self->code = ARCHIVE_FILTER_LZMA; - self->name = "lzma"; - - state = (struct private_data *)calloc(sizeof(*state), 1); - out_block = (unsigned char *)malloc(out_block_size); - if (state == NULL || out_block == NULL) { - archive_set_error(&self->archive->archive, ENOMEM, - "Can't allocate data for lzma decompression"); - free(out_block); - free(state); - return (ARCHIVE_FATAL); - } - - self->data = state; - state->out_block_size = out_block_size; - state->out_block = out_block; - self->read = lzma_filter_read; - self->skip = NULL; /* not supported */ - self->close = lzma_filter_close; - - /* Prime the lzma library with 18 bytes of input. */ - state->stream.next_in = (unsigned char *)(uintptr_t) - __archive_read_filter_ahead(self->upstream, 18, &avail_in); - if (state->stream.next_in == NULL) - return (ARCHIVE_FATAL); - state->stream.avail_in = avail_in; - state->stream.next_out = state->out_block; - state->stream.avail_out = state->out_block_size; - - /* Initialize compression library. */ - ret = lzmadec_init(&(state->stream)); - __archive_read_filter_consume(self->upstream, - avail_in - state->stream.avail_in); - if (ret == LZMADEC_OK) - return (ARCHIVE_OK); - - /* Library setup failed: Clean up. */ - archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC, - "Internal error initializing lzma library"); - - /* Override the error message if we know what really went wrong. */ - switch (ret) { - case LZMADEC_HEADER_ERROR: - archive_set_error(&self->archive->archive, - ARCHIVE_ERRNO_MISC, - "Internal error initializing compression library: " - "invalid header"); - break; - case LZMADEC_MEM_ERROR: - archive_set_error(&self->archive->archive, ENOMEM, - "Internal error initializing compression library: " - "out of memory"); - break; - } - - free(state->out_block); - free(state); - self->data = NULL; - return (ARCHIVE_FATAL); -} - -/* - * Return the next block of decompressed data. - */ -static ssize_t -lzma_filter_read(struct archive_read_filter *self, const void **p) -{ - struct private_data *state; - size_t decompressed; - ssize_t avail_in, ret; - - state = (struct private_data *)self->data; - - /* Empty our output buffer. */ - state->stream.next_out = state->out_block; - state->stream.avail_out = state->out_block_size; - - /* Try to fill the output buffer. */ - while (state->stream.avail_out > 0 && !state->eof) { - state->stream.next_in = (unsigned char *)(uintptr_t) - __archive_read_filter_ahead(self->upstream, 1, &avail_in); - if (state->stream.next_in == NULL && avail_in < 0) { - archive_set_error(&self->archive->archive, - ARCHIVE_ERRNO_MISC, - "truncated lzma input"); - return (ARCHIVE_FATAL); - } - state->stream.avail_in = avail_in; - - /* Decompress as much as we can in one pass. */ - ret = lzmadec_decode(&(state->stream), avail_in == 0); - switch (ret) { - case LZMADEC_STREAM_END: /* Found end of stream. */ - state->eof = 1; - /* FALL THROUGH */ - case LZMADEC_OK: /* Decompressor made some progress. */ - __archive_read_filter_consume(self->upstream, - avail_in - state->stream.avail_in); - break; - case LZMADEC_BUF_ERROR: /* Insufficient input data? */ - archive_set_error(&self->archive->archive, - ARCHIVE_ERRNO_MISC, - "Insufficient compressed data"); - return (ARCHIVE_FATAL); - default: - /* Return an error. */ - archive_set_error(&self->archive->archive, - ARCHIVE_ERRNO_MISC, - "Lzma decompression failed"); - return (ARCHIVE_FATAL); - } - } - - decompressed = state->stream.next_out - state->out_block; - state->total_out += decompressed; - if (decompressed == 0) - *p = NULL; - else - *p = state->out_block; - return (decompressed); -} - -/* - * Clean up the decompressor. - */ -static int -lzma_filter_close(struct archive_read_filter *self) -{ - struct private_data *state; - int ret; - - state = (struct private_data *)self->data; - ret = ARCHIVE_OK; - switch (lzmadec_end(&(state->stream))) { - case LZMADEC_OK: - break; - default: - archive_set_error(&(self->archive->archive), - ARCHIVE_ERRNO_MISC, - "Failed to clean up %s compressor", - self->archive->archive.compression_name); - ret = ARCHIVE_FATAL; - } - - free(state->out_block); - free(state); - return (ret); -} - -#else - /* * * If we have no suitable library on this system, we can't actually do @@ -953,9 +767,6 @@ lzma_bidder_init(struct archive_read_fil return (r); } -#endif /* HAVE_LZMADEC_H */ - - static int xz_bidder_init(struct archive_read_filter *self) { @@ -984,5 +795,4 @@ lzip_bidder_init(struct archive_read_fil return (r); } - #endif /* HAVE_LZMA_H */ Modified: head/contrib/libarchive/libarchive/archive_read_support_format_tar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Tue Nov 29 21:53:16 2016 (r309299) +++ head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Tue Nov 29 22:14:42 2016 (r309300) @@ -294,6 +294,46 @@ archive_read_format_tar_cleanup(struct a return (ARCHIVE_OK); } +static int +validate_number_field(const char* p_field, size_t i_size) +{ + unsigned char marker = (unsigned char)p_field[0]; + /* octal? */ + if ((marker >= '0' && marker <= '7') || marker == ' ') { + size_t i = 0; + int octal_found = 0; + for (i = 0; i < i_size; ++i) { + switch (p_field[i]) + { + case ' ': /* skip any leading spaces and trailing space*/ + if (octal_found == 0 || i == i_size - 1) { + continue; + } + break; + case '\0': /* null is allowed only at the end */ + if (i != i_size - 1) { + return 0; + } + break; + /* rest must be octal digits */ + case '0': case '1': case '2': case '3': + case '4': case '5': case '6': case '7': + ++octal_found; + break; + } + } + return octal_found > 0; + } + /* base 256 (i.e. binary number) */ + else if (marker == 128 || marker == 255 || marker == 0) { + /* nothing to check */ + return 1; + } + /* not a number field */ + else { + return 0; + } +} static int archive_read_format_tar_bid(struct archive_read *a, int best_bid) @@ -346,23 +386,23 @@ archive_read_format_tar_bid(struct archi return (0); bid += 2; /* 6 bits of variation in an 8-bit field leaves 2 bits. */ - /* Sanity check: Look at first byte of mode field. */ - switch (255 & (unsigned)header->mode[0]) { - case 0: case 255: - /* Base-256 value: No further verification possible! */ - break; - case ' ': /* Not recommended, but not illegal, either. */ - break; - case '0': case '1': case '2': case '3': - case '4': case '5': case '6': case '7': - /* Octal Value. */ - /* TODO: Check format of remainder of this field. */ - break; - default: - /* Not a valid mode; bail out here. */ - return (0); + /* + * Check format of mode/uid/gid/mtime/size/rdevmajor/rdevminor fields. + * These are usually octal numbers but GNU tar encodes "big" values as + * base256 and leading zeroes are sometimes replaced by spaces. + * Even the null terminator is sometimes omitted. Anyway, must be checked + * to avoid false positives. + */ + if (bid > 0 && + (validate_number_field(header->mode, sizeof(header->mode)) == 0 || + validate_number_field(header->uid, sizeof(header->uid)) == 0 || + validate_number_field(header->gid, sizeof(header->gid)) == 0 || + validate_number_field(header->mtime, sizeof(header->mtime)) == 0 || + validate_number_field(header->size, sizeof(header->size)) == 0 || + validate_number_field(header->rdevmajor, sizeof(header->rdevmajor)) == 0 || + validate_number_field(header->rdevminor, sizeof(header->rdevminor)) == 0)) { + bid = 0; } - /* TODO: Sanity test uid/gid/size/mtime/rdevmajor/rdevminor fields. */ return (bid); } Modified: head/contrib/libarchive/libarchive/archive_read_support_format_xar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_xar.c Tue Nov 29 21:53:16 2016 (r309299) +++ head/contrib/libarchive/libarchive/archive_read_support_format_xar.c Tue Nov 29 22:14:42 2016 (r309300) @@ -43,8 +43,6 @@ __FBSDID("$FreeBSD$"); #endif #if HAVE_LZMA_H #include -#elif HAVE_LZMADEC_H -#include #endif #ifdef HAVE_ZLIB_H #include @@ -334,9 +332,6 @@ struct xar { #if HAVE_LZMA_H && HAVE_LIBLZMA lzma_stream lzstream; int lzstream_valid; -#elif HAVE_LZMADEC_H && HAVE_LIBLZMADEC - lzmadec_stream lzstream; - int lzstream_valid; #endif /* * For Checksum data. @@ -1526,34 +1521,6 @@ decompression_init(struct archive_read * xar->lzstream.total_in = 0; xar->lzstream.total_out = 0; break; -#elif defined(HAVE_LZMADEC_H) && defined(HAVE_LIBLZMADEC) - case LZMA: - if (xar->lzstream_valid) - lzmadec_end(&(xar->lzstream)); - r = lzmadec_init(&(xar->lzstream)); - if (r != LZMADEC_OK) { - switch (r) { - case LZMADEC_HEADER_ERROR: - archive_set_error(&a->archive, - ARCHIVE_ERRNO_MISC, - "Internal error initializing " - "compression library: " - "invalid header"); - break; - case LZMADEC_MEM_ERROR: - archive_set_error(&a->archive, - ENOMEM, - "Internal error initializing " - "compression library: " - "out of memory"); - break; - } - return (ARCHIVE_FATAL); - } - xar->lzstream_valid = 1; - xar->lzstream.total_in = 0; - xar->lzstream.total_out = 0; - break; #endif /* * Unsupported compression. @@ -1563,9 +1530,7 @@ decompression_init(struct archive_read * case BZIP2: #endif #if !defined(HAVE_LZMA_H) || !defined(HAVE_LIBLZMA) -#if !defined(HAVE_LZMADEC_H) || !defined(HAVE_LIBLZMADEC) case LZMA: -#endif case XZ: #endif switch (xar->entry_encoding) { @@ -1685,46 +1650,12 @@ decompress(struct archive_read *a, const *used = avail_in - xar->lzstream.avail_in; *outbytes = avail_out - xar->lzstream.avail_out; break; -#elif defined(HAVE_LZMADEC_H) && defined(HAVE_LIBLZMADEC) - case LZMA: - xar->lzstream.next_in = (unsigned char *)(uintptr_t)b; - xar->lzstream.avail_in = avail_in; - xar->lzstream.next_out = (unsigned char *)outbuff; - xar->lzstream.avail_out = avail_out; - r = lzmadec_decode(&(xar->lzstream), 0); - switch (r) { - case LZMADEC_STREAM_END: /* Found end of stream. */ - switch (lzmadec_end(&(xar->lzstream))) { - case LZMADEC_OK: - break; - default: - archive_set_error(&(a->archive), - ARCHIVE_ERRNO_MISC, - "Failed to clean up lzmadec decompressor"); - return (ARCHIVE_FATAL); - } - xar->lzstream_valid = 0; - /* FALLTHROUGH */ - case LZMADEC_OK: /* Decompressor made some progress. */ - break; - default: - archive_set_error(&(a->archive), - ARCHIVE_ERRNO_MISC, - "lzmadec decompression failed(%d)", - r); - return (ARCHIVE_FATAL); - } - *used = avail_in - xar->lzstream.avail_in; - *outbytes = avail_out - xar->lzstream.avail_out; - break; #endif #if !defined(HAVE_BZLIB_H) || !defined(BZ_CONFIG_ERROR) case BZIP2: #endif #if !defined(HAVE_LZMA_H) || !defined(HAVE_LIBLZMA) -#if !defined(HAVE_LZMADEC_H) || !defined(HAVE_LIBLZMADEC) case LZMA: -#endif case XZ: #endif case NONE: Modified: head/contrib/libarchive/libarchive/archive_write_disk_posix.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_disk_posix.c Tue Nov 29 21:53:16 2016 (r309299) +++ head/contrib/libarchive/libarchive/archive_write_disk_posix.c Tue Nov 29 22:14:42 2016 (r309300) @@ -336,14 +336,19 @@ struct archive_write_disk { #define HFS_BLOCKS(s) ((s) >> 12) -static int check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags); +static void fsobj_error(int *, struct archive_string *, int, const char *, + const char *); +static int check_symlinks_fsobj(char *, int *, struct archive_string *, + int); static int check_symlinks(struct archive_write_disk *); static int create_filesystem_object(struct archive_write_disk *); -static struct fixup_entry *current_fixup(struct archive_write_disk *, const char *pathname); +static struct fixup_entry *current_fixup(struct archive_write_disk *, + const char *pathname); #if defined(HAVE_FCHDIR) && defined(PATH_MAX) static void edit_deep_directories(struct archive_write_disk *ad); #endif -static int cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags); +static int cleanup_pathname_fsobj(char *, int *, struct archive_string *, + int); static int cleanup_pathname(struct archive_write_disk *); static int create_dir(struct archive_write_disk *, char *); static int create_parent_dir(struct archive_write_disk *, char *); @@ -374,11 +379,14 @@ static struct archive_vtable *archive_wr static int _archive_write_disk_close(struct archive *); static int _archive_write_disk_free(struct archive *); -static int _archive_write_disk_header(struct archive *, struct archive_entry *); +static int _archive_write_disk_header(struct archive *, + struct archive_entry *); static int64_t _archive_write_disk_filter_bytes(struct archive *, int); static int _archive_write_disk_finish_entry(struct archive *); -static ssize_t _archive_write_disk_data(struct archive *, const void *, size_t); -static ssize_t _archive_write_disk_data_block(struct archive *, const void *, size_t, int64_t); +static ssize_t _archive_write_disk_data(struct archive *, const void *, + size_t); +static ssize_t _archive_write_disk_data_block(struct archive *, const void *, + size_t, int64_t); static int lazy_stat(struct archive_write_disk *a) @@ -649,7 +657,8 @@ _archive_write_disk_header(struct archiv if (a->restore_pwd >= 0) { r = fchdir(a->restore_pwd); if (r != 0) { - archive_set_error(&a->archive, errno, "chdir() failure"); + archive_set_error(&a->archive, errno, + "chdir() failure"); ret = ARCHIVE_FATAL; } close(a->restore_pwd); @@ -697,7 +706,8 @@ _archive_write_disk_header(struct archiv } if (archive_entry_birthtime_is_set(entry)) { fe->birthtime = archive_entry_birthtime(entry); - fe->birthtime_nanos = archive_entry_birthtime_nsec(entry); + fe->birthtime_nanos = archive_entry_birthtime_nsec( + entry); } else { /* If birthtime is unset, use mtime. */ fe->birthtime = fe->mtime; @@ -723,7 +733,8 @@ _archive_write_disk_header(struct archiv return (ARCHIVE_FATAL); fe->mac_metadata = malloc(metadata_size); if (fe->mac_metadata != NULL) { - memcpy(fe->mac_metadata, metadata, metadata_size); + memcpy(fe->mac_metadata, metadata, + metadata_size); fe->mac_metadata_size = metadata_size; fe->fixup |= TODO_MAC_METADATA; } @@ -1480,7 +1491,8 @@ _archive_write_disk_data_block(struct ar return (r); if ((size_t)r < size) { archive_set_error(&a->archive, 0, - "Too much data: Truncating file at %ju bytes", (uintmax_t)a->filesize); + "Too much data: Truncating file at %ju bytes", + (uintmax_t)a->filesize); return (ARCHIVE_WARN); } #if ARCHIVE_VERSION_NUMBER < 3999000 @@ -2005,8 +2017,9 @@ restore_entry(struct archive_write_disk if (en) { /* Everything failed; give up here. */ - archive_set_error(&a->archive, en, "Can't create '%s'", - a->name); + if ((&a->archive)->error == NULL) + archive_set_error(&a->archive, en, "Can't create '%s'", + a->name); return (ARCHIVE_FAILED); } @@ -2043,19 +2056,32 @@ create_filesystem_object(struct archive_ if (linkname_copy == NULL) { return (EPERM); } - /* TODO: consider using the cleaned-up path as the link target? */ - r = cleanup_pathname_fsobj(linkname_copy, &error_number, &error_string, a->flags); + /* + * TODO: consider using the cleaned-up path as the link + * target? + */ + r = cleanup_pathname_fsobj(linkname_copy, &error_number, + &error_string, a->flags); if (r != ARCHIVE_OK) { - archive_set_error(&a->archive, error_number, "%s", error_string.s); + archive_set_error(&a->archive, error_number, "%s", + error_string.s); free(linkname_copy); - /* EPERM is more appropriate than error_number for our callers */ + /* + * EPERM is more appropriate than error_number for our + * callers + */ return (EPERM); } - r = check_symlinks_fsobj(linkname_copy, &error_number, &error_string, a->flags); + r = check_symlinks_fsobj(linkname_copy, &error_number, + &error_string, a->flags); if (r != ARCHIVE_OK) { - archive_set_error(&a->archive, error_number, "%s", error_string.s); + archive_set_error(&a->archive, error_number, "%s", + error_string.s); free(linkname_copy); - /* EPERM is more appropriate than error_number for our callers */ + /* + * EPERM is more appropriate than error_number for our + * callers + */ return (EPERM); } free(linkname_copy); @@ -2076,8 +2102,8 @@ create_filesystem_object(struct archive_ a->todo = 0; a->deferred = 0; } else if (r == 0 && a->filesize > 0) { - a->fd = open(a->name, - O_WRONLY | O_TRUNC | O_BINARY | O_CLOEXEC | O_NOFOLLOW); + a->fd = open(a->name, O_WRONLY | O_TRUNC | O_BINARY + | O_CLOEXEC | O_NOFOLLOW); __archive_ensure_cloexec_flag(a->fd); if (a->fd < 0) r = errno; @@ -2388,6 +2414,17 @@ current_fixup(struct archive_write_disk return (a->current_fixup); } +/* Error helper for new *_fsobj functions */ +static void +fsobj_error(int *a_eno, struct archive_string *a_estr, + int err, const char *errstr, const char *path) +{ + if (a_eno) + *a_eno = err; + if (a_estr) + archive_string_sprintf(a_estr, errstr, path); +} + /* * TODO: Someday, integrate this with the deep dir support; they both * scan the path and both can be optimized by comparing against other @@ -2400,7 +2437,8 @@ current_fixup(struct archive_write_disk * ARCHIVE_OK if there are none, otherwise puts an error in errmsg. */ static int -check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags) +check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr, + int flags) { #if !defined(HAVE_LSTAT) /* Platform doesn't have lstat, so we can't look for symlinks. */ @@ -2433,7 +2471,8 @@ check_symlinks_fsobj(char *path, int *er * - if it's a directory and it's not the last chunk, cd into it * As we go: * head points to the current (relative) path - * tail points to the temporary \0 terminating the segment we're currently examining + * tail points to the temporary \0 terminating the segment we're + * currently examining * c holds what used to be in *tail * last is 1 if this is the last tail */ @@ -2455,7 +2494,9 @@ check_symlinks_fsobj(char *path, int *er * Exiting the loop with break is okay; continue is not. */ while (!last) { - /* Skip the separator we just consumed, plus any adjacent ones */ + /* + * Skip the separator we just consumed, plus any adjacent ones + */ while (*tail == '/') ++tail; /* Skip the next path element. */ @@ -2474,19 +2515,20 @@ check_symlinks_fsobj(char *path, int *er if (errno == ENOENT) { break; } else { - /* Treat any other error as fatal - best to be paranoid here - * Note: This effectively disables deep directory - * support when security checks are enabled. - * Otherwise, very long pathnames that trigger - * an error here could evade the sandbox. - * TODO: We could do better, but it would probably - * require merging the symlink checks with the - * deep-directory editing. */ - if (error_number) *error_number = errno; - if (error_string) - archive_string_sprintf(error_string, - "Could not stat %s", - path); + /* + * Treat any other error as fatal - best to be + * paranoid here. + * Note: This effectively disables deep + * directory support when security checks are + * enabled. Otherwise, very long pathnames that + * trigger an error here could evade the + * sandbox. + * TODO: We could do better, but it would + * probably require merging the symlink checks + * with the deep-directory editing. + */ + fsobj_error(a_eno, a_estr, errno, + "Could not stat %s", path); res = ARCHIVE_FAILED; break; } @@ -2494,11 +2536,8 @@ check_symlinks_fsobj(char *path, int *er if (!last) { if (chdir(head) != 0) { tail[0] = c; - if (error_number) *error_number = errno; - if (error_string) - archive_string_sprintf(error_string, - "Could not chdir %s", - path); + fsobj_error(a_eno, a_estr, errno, + "Could not chdir %s", path); res = (ARCHIVE_FATAL); break; } @@ -2514,11 +2553,9 @@ check_symlinks_fsobj(char *path, int *er */ if (unlink(head)) { tail[0] = c; - if (error_number) *error_number = errno; - if (error_string) - archive_string_sprintf(error_string, - "Could not remove symlink %s", - path); + fsobj_error(a_eno, a_estr, errno, + "Could not remove symlink %s", + path); res = ARCHIVE_FAILED; break; } @@ -2529,13 +2566,14 @@ check_symlinks_fsobj(char *path, int *er * symlink with another symlink. */ tail[0] = c; - /* FIXME: not sure how important this is to restore + /* + * FIXME: not sure how important this is to + * restore + */ + /* if (!S_ISLNK(path)) { - if (error_number) *error_number = 0; - if (error_string) - archive_string_sprintf(error_string, - "Removing symlink %s", - path); + fsobj_error(a_eno, a_estr, 0, + "Removing symlink %s", path); } */ /* Symlink gone. No more problem! */ @@ -2545,22 +2583,60 @@ check_symlinks_fsobj(char *path, int *er /* User asked us to remove problems. */ if (unlink(head) != 0) { tail[0] = c; - if (error_number) *error_number = 0; - if (error_string) - archive_string_sprintf(error_string, - "Cannot remove intervening symlink %s", - path); + fsobj_error(a_eno, a_estr, 0, + "Cannot remove intervening " + "symlink %s", path); res = ARCHIVE_FAILED; break; } tail[0] = c; + } else if ((flags & + ARCHIVE_EXTRACT_SECURE_SYMLINKS) == 0) { + /* + * We are not the last element and we want to + * follow symlinks if they are a directory. + * + * This is needed to extract hardlinks over + * symlinks. + */ + r = stat(head, &st); + if (r != 0) { + tail[0] = c; + if (errno == ENOENT) { + break; + } else { + fsobj_error(a_eno, a_estr, + errno, + "Could not stat %s", path); + res = (ARCHIVE_FAILED); + break; + } + } else if (S_ISDIR(st.st_mode)) { + if (chdir(head) != 0) { + tail[0] = c; + fsobj_error(a_eno, a_estr, + errno, + "Could not chdir %s", path); + res = (ARCHIVE_FATAL); + break; + } + /* + * Our view is now from inside + * this dir: + */ + head = tail + 1; + } else { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Nov 30 00:21:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93EE7C5D8EB; Wed, 30 Nov 2016 00:21:58 +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 4744F1CB3; Wed, 30 Nov 2016 00:21:58 +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 uAU0LvlG031259; Wed, 30 Nov 2016 00:21:57 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU0Lv8w031258; Wed, 30 Nov 2016 00:21:57 GMT (envelope-from np@FreeBSD.org) Message-Id: <201611300021.uAU0Lv8w031258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 30 Nov 2016 00:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r309301 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 00:21:58 -0000 Author: np Date: Wed Nov 30 00:21:57 2016 New Revision: 309301 URL: https://svnweb.freebsd.org/changeset/base/309301 Log: Raise my limit so that I can new firmwares to cxgbe(4). Modified: svnadmin/conf/sizelimit.conf Modified: svnadmin/conf/sizelimit.conf ============================================================================== --- svnadmin/conf/sizelimit.conf Tue Nov 29 22:14:42 2016 (r309300) +++ svnadmin/conf/sizelimit.conf Wed Nov 30 00:21:57 2016 (r309301) @@ -23,6 +23,7 @@ imp jb jeff mm +np obrien peter rwatson From owner-svn-src-all@freebsd.org Wed Nov 30 00:26:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4993C5DAA2; Wed, 30 Nov 2016 00:26:37 +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 1F2E61EEC; Wed, 30 Nov 2016 00:26:37 +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 uAU0QaW8032342; Wed, 30 Nov 2016 00:26:36 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU0QaOi032337; Wed, 30 Nov 2016 00:26:36 GMT (envelope-from np@FreeBSD.org) Message-Id: <201611300026.uAU0QaOi032337@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 30 Nov 2016 00:26:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309302 - in head/sys: conf dev/cxgbe dev/cxgbe/common dev/cxgbe/firmware modules/cxgbe modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware modules/cxgbe/t6_firmware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 00:26:37 -0000 Author: np Date: Wed Nov 30 00:26:35 2016 New Revision: 309302 URL: https://svnweb.freebsd.org/changeset/base/309302 Log: cxgbe(4): Include firmware for T6 cards in the driver. Update all firmwares to 1.16.12.0. Obtained from: Chelsio Communications MFC after: 3 days Sponsored by: Chelsio Communications Added: head/sys/dev/cxgbe/firmware/t4fw-1.16.12.0.bin.uu (contents, props changed) head/sys/dev/cxgbe/firmware/t5fw-1.16.12.0.bin.uu (contents, props changed) head/sys/dev/cxgbe/firmware/t6fw-1.16.12.0.bin.uu (contents, props changed) head/sys/dev/cxgbe/firmware/t6fw_cfg.txt (contents, props changed) head/sys/dev/cxgbe/firmware/t6fw_cfg_fpga.txt (contents, props changed) head/sys/dev/cxgbe/firmware/t6fw_cfg_uwire.txt (contents, props changed) head/sys/modules/cxgbe/t6_firmware/ head/sys/modules/cxgbe/t6_firmware/Makefile (contents, props changed) Deleted: head/sys/dev/cxgbe/firmware/t4fw-1.15.37.0.bin.uu head/sys/dev/cxgbe/firmware/t5fw-1.15.37.0.bin.uu Modified: head/sys/conf/files head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/firmware/t4fw_interface.h head/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt head/sys/dev/cxgbe/t4_main.c head/sys/modules/cxgbe/Makefile head/sys/modules/cxgbe/t4_firmware/Makefile head/sys/modules/cxgbe/t5_firmware/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Nov 30 00:21:57 2016 (r309301) +++ head/sys/conf/files Wed Nov 30 00:26:35 2016 (r309302) @@ -1381,7 +1381,7 @@ t4fw.fwo optional cxgbe \ no-implicit-rule \ clean "t4fw.fwo" t4fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t4fw-1.15.37.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t4fw-1.16.12.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t4fw.fw" @@ -1405,10 +1405,34 @@ t5fw.fwo optional cxgbe \ no-implicit-rule \ clean "t5fw.fwo" t5fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t5fw-1.15.37.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t5fw-1.16.12.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t5fw.fw" +t6fw_cfg.c optional cxgbe \ + compile-with "${AWK} -f $S/tools/fw_stub.awk t6fw_cfg.fw:t6fw_cfg t6fw.fw:t6fw -mt6fw_cfg -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "t6fw_cfg.c" +t6fw_cfg.fwo optional cxgbe \ + dependency "t6fw_cfg.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "t6fw_cfg.fwo" +t6fw_cfg.fw optional cxgbe \ + dependency "$S/dev/cxgbe/firmware/t6fw_cfg.txt" \ + compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ + no-obj no-implicit-rule \ + clean "t6fw_cfg.fw" +t6fw.fwo optional cxgbe \ + dependency "t6fw.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "t6fw.fwo" +t6fw.fw optional cxgbe \ + dependency "$S/dev/cxgbe/firmware/t6fw-1.16.12.0.bin.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "t6fw.fw" dev/cy/cy.c optional cy dev/cy/cy_isa.c optional cy isa dev/cy/cy_pci.c optional cy pci Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Wed Nov 30 00:21:57 2016 (r309301) +++ head/sys/dev/cxgbe/common/common.h Wed Nov 30 00:26:35 2016 (r309302) @@ -578,7 +578,8 @@ int t4_config_rss_range(struct adapter * int t4_config_glbl_rss(struct adapter *adapter, int mbox, unsigned int mode, unsigned int flags); int t4_config_vi_rss(struct adapter *adapter, int mbox, unsigned int viid, - unsigned int flags, unsigned int defq); + unsigned int flags, unsigned int defq, unsigned int skeyidx, + unsigned int skey); int t4_read_rss(struct adapter *adapter, u16 *entries); void t4_fw_tp_pio_rw(struct adapter *adap, u32 *vals, unsigned int nregs, unsigned int start_index, unsigned int rw); Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Wed Nov 30 00:21:57 2016 (r309301) +++ head/sys/dev/cxgbe/common/t4_hw.c Wed Nov 30 00:26:35 2016 (r309302) @@ -4754,7 +4754,7 @@ int t4_config_glbl_rss(struct adapter *a c.u.manual.mode_pkd = cpu_to_be32(V_FW_RSS_GLB_CONFIG_CMD_MODE(mode)); } else if (mode == FW_RSS_GLB_CONFIG_CMD_MODE_BASICVIRTUAL) { - c.u.basicvirtual.mode_pkd = + c.u.basicvirtual.mode_keymode = cpu_to_be32(V_FW_RSS_GLB_CONFIG_CMD_MODE(mode)); c.u.basicvirtual.synmapen_to_hashtoeplitz = cpu_to_be32(flags); } else @@ -4769,11 +4769,14 @@ int t4_config_glbl_rss(struct adapter *a * @viid: the VI id * @flags: RSS flags * @defq: id of the default RSS queue for the VI. + * @skeyidx: RSS secret key table index for non-global mode + * @skey: RSS vf_scramble key for VI. * * Configures VI-specific RSS properties. */ int t4_config_vi_rss(struct adapter *adapter, int mbox, unsigned int viid, - unsigned int flags, unsigned int defq) + unsigned int flags, unsigned int defq, unsigned int skeyidx, + unsigned int skey) { struct fw_rss_vi_config_cmd c; @@ -4784,6 +4787,10 @@ int t4_config_vi_rss(struct adapter *ada c.retval_len16 = cpu_to_be32(FW_LEN16(c)); c.u.basicvirtual.defaultq_to_udpen = cpu_to_be32(flags | V_FW_RSS_VI_CONFIG_CMD_DEFAULTQ(defq)); + c.u.basicvirtual.secretkeyidx_pkd = cpu_to_be32( + V_FW_RSS_VI_CONFIG_CMD_SECRETKEYIDX(skeyidx)); + c.u.basicvirtual.secretkeyxor = cpu_to_be32(skey); + return t4_wr_mbox(adapter, mbox, &c, sizeof(c), NULL); } @@ -4902,11 +4909,11 @@ void t4_write_rss_key(struct adapter *ad if (idx >= 0 && idx < rss_key_addr_cnt) { if (rss_key_addr_cnt > 16) t4_write_reg(adap, A_TP_RSS_CONFIG_VRT, - V_KEYWRADDRX(idx >> 4) | + vrt | V_KEYWRADDRX(idx >> 4) | V_T6_VFWRADDR(idx) | F_KEYWREN); else t4_write_reg(adap, A_TP_RSS_CONFIG_VRT, - V_KEYWRADDR(idx) | F_KEYWREN); + vrt| V_KEYWRADDR(idx) | F_KEYWREN); } } @@ -5794,8 +5801,10 @@ const char *t4_get_port_type_description "KR4_100G", "CR4_QSFP", "CR_QSFP", - "CR2_QSFP", + "CR_SFP28", "SFP28", + "KR_SFP28", + "CR2_QSFP", }; if (port_type < ARRAY_SIZE(port_type_description)) Added: head/sys/dev/cxgbe/firmware/t4fw-1.16.12.0.bin.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/cxgbe/firmware/t4fw-1.16.12.0.bin.uu Wed Nov 30 00:26:35 2016 (r309302) @@ -0,0 +1,9594 @@ +/*- + * Copyright (c) 2016 Chelsio Communications, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +begin-base64 644 t4fw +AAAEKQEQDAAAAQkEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAABAwEGwQjAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAENoZWxzaW8gRlcgUlVOTUVNIERFQlVHPTAgKEJ1aWx0IFR1ZSBOb3YgIDggMDk6 +MjI6MzEgUFNUIDIwMTYgb24gdm5jNC5hc2ljZGVzaWduZXJzLmNvbTovaG9tZS9maXJtd2FyZS9j +dnMvZnctcmVsZWFzZSksIFZlcnNpb24gVDR4eCAwMS4xMC4wYy4wMAAAAAAAAAAAAAAAAIf/EtRg +AMgA4QB78AAQAADhADC4eP///x/84UCAAAAB4QB7cAAAEAAf//2U4QGUcCAAAADhAZwE4QB5AAAC +AEDhAHmAAAYAQAACAAoABgAK4QB5BAAMAACAAAEC4QB7POEAe0ThAHvk4gAAAAABAADhAHuQIAAA +AAAAgADhAHsAAABAAeEAe5wAAEAAREREQuAAAADjAARzREREQOMACAAgAAJcAAAAAB//kuAAAAAA +H/+S5AAAAAAf/5LoAAAAAB//kuwf/8AAAAAAAAAAAADAABL/zRP/zZMgEv/NE//NhCAEMwGTIBH/ +zBL/zJIQEf/MEv/MkhAR/8wB9DER/8siCv+SEADkMQAFMQECABL/yALnMQIWABH/x4EQAQFfwCEC +EQHJERH/xBL/xJIQEf/EEv/EkhBgAA8R/78S/8OSEBH/vxL/wpIQgRAR/8HAIJIREv/AkhLAIJIT +Ev+/khCCEALyUGUv9xH/vccvkhAR/7ySEBL/vBP/vJMgwDKTIRP/u5MigiIS/7oT/7qTICMiIRT/ +uQQzAck4E/+4gzADgxQIMxEU/7akM5MhE/+qkyJgAAjCMJMhE/+nkyIS/7GQIJAhkCKQI5AkkCWQ +JpAnkCiQKZAqkCuQLJAtkC6QLyAmECAmEYIiEv+kwDAtNzAtNzQtNzgtNzwjPQFyM+0AAgAS/6HA +MC83AC83EC83IC83MCM9AXIz7QACABL/l8AwKDcwKDc0KDc4KDc8Iz0BcjPtEv+VwDAnNwAnNxAn +NyAnNzAjPQFyM+0S/5AV/5AW/5HAMNcgBWYBYAAZAAAAAAAAAAQ2BQACANMP0w8FMwxuOxQHRxQH +BEN2MeYENgUFMwxvO+0AAgAS/4MV/4EjCgACJwIHBEMEPgUFMwwHRxRvO/ADAgAS/33JLoMghCGF +IrwidDsOhlC0VZYwtDN0M/Rj/+YAZT/iZV/fEv9xwDIDLgUDAgAS/2jAMCg3QCg3RCg3SCg3TCM9 +AXIz7QACABL/ay0nAMARAUkxAEgxAQIAwAAU/2gE0jEV/2eUUBT/ZwTTMRX/ZpRQFP9mBNQxFf9m +lFAU/2UE1TEV/2WUUBD/ZQMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/AAA +H/wAAOMACfgf/AAAH/wAAOMACfgf/AAAH/wAAOMACfgf/4AAH/+KUOMACfgf/4pQH/+KUOMAFEgf +/4pQH/+KUOMAFEgf/4pQH/+L8OMAFEgf/4vwH/+S3OMAFegf/5LgH/+0AOMAHNgf/7QAH/+0AOMA +Pfgf/8AAH//+geMAPfggAAAAIAABauMAfHwgAAF4IAABfOMAfeggAAF8IAABheMAfewgAAGYIAAB +nOMAffggAAGcIAABpeMAffwgAAG4IAABvOMAfgggAAG8IAABxeMAfgwgAAHYIAAB2OMAfhggAAHc +IAAB4uMAfhggAAH4IAAB+OMAfiAgAAH8IAAB/OMAfiAgAAIYIAACGOMAfiAgAAIcIAACHOMAfiAg +AAI4IAACOOMAfiAgAAI8IAACPOMAfiAgAAJYIAACWOMAfiAgAAJcIAACYuMAfiAgAAJ4IAACeOMA +figgAAJ8IAACguMAfiggAAKYIAHy6eMAfjAgAwAAIAMVhOMCboQgAxWEIAMVhOMChAggAxWIIAbc +NOMChAwgBtxAIAbfsOMGSsQgCAAAIAgOYOMGTjQgCA5gIAkofuMGXJQgCSiAIAkpTOMHdrQgCwAA +IAsAAOMHd4AgCwAAIAsAAOMHd4AgCwAAIAufuOMHd4AAAAAAAAAAAAAAAAAgABOGIAATeCAAF2Ig +ABN4IAAW3SAAE3ggABQqIAAWdSAAFfogABN4IAAVqSAAFWIgABT1IAATZSAAFJ8gABN4IAATeCAA +E3ggABRKAAAAAP///////w/8///w////APwgAKuTIACs+iAArSogAKzwIACssSAArKcgAKxxIACs +ZyAArFYgAKwCIACtKCAAq/ggAKvLIACtKiAAq8EAAAAAARAYAQAEAAAAAAAAAAAAAAAAAAoAAAAK +AAAAFAAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEA +AQACAAMABAAFAAYABwAIAAkACgAOABEAFQAZAB4AIwAtADwAUABkAMgBLAGQAfQAAAAAAAAAAAAA +AAAAAAAAAAAAAQABAAIAAgADAAMAAwADAAQABAAEAAQABAAFAAUABQAFAAUABQAGAAYABwAHAAAA +AgAAAAYAAAAKAAAADgAAABQAAAAcAAAAKAAAADgAAABQAAAAcAAAAKAAAADgAAABQAAAAcAAAAKA +AAADgAAABQEAAAcAAAAKAAAADgAAABQAAAAcAAAAKAAAADgAAABQAAAAcAAAAKAAAADgAAABQAAA +AcAAAAKAAAADgAD/AAECAgAAAAAAAAAAAAAAECBAAAAAAAAAAAAAAAAAAAQAAgABAACAAEAAIAAQ +AAggQIAAAAAAAAAAAAAAAAAAIAipByAIqQcgCKjDIAiokCAIqGIgCKg2IAioNiAIqdAgCKnQIAio +NiAIqdAgCKnQIAioNiAIqDYgCKfrIAip0CAIqdAgCKnQIAip0CAIqdAgCKnQIAip0CAIqdAgCKnQ +IAip0CAIqdAgCKnQIAip0CAIqdAgCKnQIAip0CAIqBkgAwrQAAAAASADCtgAAAACIAMO+AAAAP8g +AwgwAAAA/yADCrwAAAACIAMKwAAAAAMgAwrIAAAABwAAAAAAAAAAIAMKoAAAAAEgAwqkAAAAAiAD +CqwAAAAEIAMO+AAAAP8gAwgwAAAA/wAAAAAAAAAAIAMIMAAAAAAgAw74AAAAACADCWwAAAABIAMJ +dAAAAAQgAwl8AAAACCADCYgAAAAgIAMJmAAAAEAgAwmgAAAAgCADCagAAAEAIAMJsAAAAgAgAwnE +AAAEACADCdgAAAgAIAMJ8AAAEAAgAwoEAAAgACADChQAAEAAIAMKIAAAgAAgAwo0AAEAACADCkQA +AgAAIAMKVAAQAAAgAwpsACAAACADCoQAQAAAIAMKjACAAAAgAwlYAAAAECADCWAAAAARIAMJQAAA +AAAgAwlEAAAAASADCUgAAAACIAMJUAAAAAMAAAAAAAD//wAAAAAAAP//IAMIwAAAAQAgAwjMAAAA +gCADCNwAAABAIAMI7AAAACAgAwj8AAAAECADCQwAAAAIIAMJGAAAAAQgAwkkAAAAAiADCTAAAAAB +AAAAAAAAAAAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEA +AAABAAAAAQAAAAEAAAABAAAABwAAAAcAAAAGAAAABgAMNQAAEEaqABRYVQAYagAAACtoAAAjgwAA +GGoAAA0GAAALKgAAAAAAAAAAAAAAAAAAaCsAAGgrAABsggAAb5wAAEpoAABKaAAATSkAAEpoAABO +6gAATJgAAFI9AABPuAABhqAAAYagAAII1gACCNYAAgjVAAII1QACiwsAAosLAAII1QACtnIAArZy +AAMNQAAEBgcAAAAAAAAAAAAAAAAAAgIFBQgICwsODhERFBQXFxoaHR0gICMjJiYpKSwsLy8yMjU1 +ODg7OwAAAAAAAAABAxERCAgQCQMBAAAAAAAAIATAsCABrUwgADdAIAF9CCABqZggAaQMIAFd8CAE +Lqwf/+o8IACXYCAAregf/90QIABmYCAAV8AAAAAAAAAAACABfsAgAIYYAAAAAAAAAAAf/9X0H//F +fB//wpQf/8AwIABSwCAARhwgAENIIACjAB//4/AgBq8AAAAAAAAAAAAgAEnQAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAACABtKwgAZTQIAC4OCAAt2wf//EQH//QoB//zDggAIOQIAVB6CABLmAg +AQ50IAD1oCAA6hAgAN2MIADQBCAAuxggBMSoIAMmUCABI2ggA1R4IAHgrCAAZiAAAAAAIAC4nCAF +uqQgAKsAIAGHZCAAApggAJzAAAAAAAAAAAAf//RYIAC4VCADKQAAAAAAAAAAACADprQgACeEIAAJ +aCAAJoAAAAAAIAAyeCAAMBAgAC1AAAAAACAANwAgAScoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAIAA0nCAEwFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAANkAg +A6+oIAA1UAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAQAAAAICwAAACADEtgIAAAAIAMS +5AgAAAAgAxLwCgAAACADEvwMAAAAIAMTCBIAAAAgAxMYDQAAACADEywOAAAAIAMTPBMAAAAgAxNM +CgAAACADE2AOAAAAIAMTbBgAAAAgAxN8DQAAACADE5gOAAAAIAMTqBAAAAAgAxO4EgAAACADE8wO +AAAAIAMT4BAAAAAgAxPwEQAAACADFAQKAAAAIAMUGAsAAAAgAxQkDQAAACADFDAUAAAAIAMUQAoA +AAAgAxRYDwAAACADFGQGAAAAIAMUdAYAAAAgAxR8BgAAACADFIQGAAAAIAMUjAYAAAAgAxSUCQAA +ACADFJwGAAAAIAMUqAQAAAAgAxSwBgAAACADFLgLAAAAIAMUwAsAAAAgAxTMBAAAACADFLAEAAAA +IAMU2AkAAAAgAxTgCQAAACADFOwAAAAAAAAAAA0AAAAgAxT4CgAAACADFQgGAAAAIAMVFAIAAAAg +AxUcAwAAACADDswBAAAAIAMVIAAAAAAAAAAA12qkeOjHt1YkIHDbwb3O7vV8D69Hh8YqqDBGE/1G +lQFpgJjYi0T3r///W7GJXNe+a5ARIv2YcZOmeUOOSbQIIfYeJWLAQLNAJl5aUem2x6rWLxBdAkQU +U9ih5oHn0/vIIeHN5sM3B9b01Q2HRVoU7anj6QX876P4Z28C2Y0qTIr/+jlCh3H2gW2dYSL95TgM +pL7qREvez6n2u0tgvr+8cCibfsbqoSf61O8whQSIHQXZ1NA55tuZ5R+ifPjErFZl9CkiREMq/5er +lCOn/JOgOWVbWcOPDMyS/+/0fYWEXdFvqH5P/izm4KMBQxROCBGh91N+gr068jUq19K764bTkQcM +ERYHDBEWBwwRFgcMERYFCQ4UBQkOFAUJDhQFCQ4UBAsQFwQLEBcECxAXBAsQFwYKDxUGCg8VBgoP +FQYKDxUf/8AAAAQAICAG37AgBuRgH/zeACAG3/Af/6wkH/+tNB//sKADgAAAgQAAAB//sJAA//gA +AQAAAAAQAACBBAEAgQQAAAEEAAABBAEAgAAAAAAF//8f/4VABgAAACoAAAAf/8/4IARBvAIAAACA +EAAAQUAAAEFAAQCDAAAB//+//7////8f/5jcBAAACCADDOiBgAAADAAAAB//kzD//wAA//8A/wAB +AAAAAP//H/+xkB//qNQP///////QZP//02Af/2acH/zg6CAG3Yz//770H/9mkB//ZxT//8FgH/+t +7B//nuQf/OIAAAAIuOD//gDhAZIAH/+ZUAD///8f/64MH/+dhARBAAgEAQAIpQAAAMAAAADABAAA +MAAAAB//rpAAAB1AAAD/gCAG3EAgC2Ag4QAuAB//roQf/6pMH/+vQB//qrAAABeA4AAAoOEAMLgA +AIAA4QBgEAAAQADhAhAA4QIwAOECUADhAnAA4QAQCB/84UDhAHtwH/+zwB//s7gf/OAIH/+zvB// +s9gf/7PQH/+z1B//s/Af/7PoH/+z7CAG3/Af/7GQH/+sJB/83gAf/600H/+tMB//rdAf/52UH/+w +3B//qjggCwBgH/+vXAAA/4AAAB4gH/+TMB//r2gf/69kH/+vyCALBnAEAAAIBQAAAIP/AACBAAAA +ABAAACoAAAAgAAmsIAMMCB//iZAf/4VAH/+HRB//sKBnRSMB782riZi63P4QMlR2H/+AAAAAPygg +Aw7Mz////yALB2AQAAAAP////wIAAABAAAAA//9//yALCIAf/7CQIAAjuCALCLAgCwkgCAAAAAD/ +//8gCwmQ9////yALC4AgACBg//7//yALFmCAAAAAIAMM4AwAAAAAAEAAAAD//wAAgAD/+///D/aA +ACALGdAgCxoAAAEAAAAEAAAgC3QwH/+t4CAAMnggADRYIAAwECALGpAgAC1AIAsbICALG3AgCxwA +BAEACOAAAAAgCxyAIAscQFMAAAAgCxygUgAAACALHOBRAAAAIAHp3B//qqQgCx9wIAsf0CALH6Ag +CyJQH/+uDCALIqAf/52MH/+tsCALJJAUAAAAgAAAAngAAACAAAAGgACwAAAACgAA4zCS///wAIAA +sQDhAZoAAAIAACALJFAf/5sEAAB+QB//reQA/8AAH/+t8B//k7QBAAAAKAAAACYAAAAgCyTAH/+T +8AYAAAAFgAAAH/+p/CsAAAAgAE04IAt24B//q5gDgAAAB////zUAAAADAAAAAD///4BAAAAID/// +H////yAAAAAAAMAAH/+tyD0AAAAf/5l8BwAAAIEEAQCBBAAAH/+sFAAAOpjDAAAAAAAP/wBDAAAA +AAgABAAAAB//q8wgC3dAH/+zNB//sbAf/5jcAAYAAOEAegAf/5lMH/+t1CCgAAAf/6wsH/+dnB// +nYggC3dwAAMHgCALd+Af/5toACAAAABAAAAAAAkAAAAwAv/8+H/AAAAAo/+7AKP/ugANAAAA4AMA +AIP/tgAP////D//4AP8AAAAgC3ggIAsmICALJlAgC3iwAA8AAAAKAAD//wAPA//AAIP/wAAgC3kw +IAt5oB//rrAf/7Ig/2DwAB//sgAf/5LwBIAACB//gFAARAAA/x///wDAAAABgMIAAACBAPAAAACB +gAAA/3///x/84HQf/6jU/7//////AAAAgAAAAACG3R//ntwf/OIAH/+T4O4AAAAAAAm8H/ziDA8A +AAAgCyaQH/+uUAAACLwf/69UH/+fWB//mXgf/4BgIAbd4AAAMAAAACcQH//cgCALgXAgC4FAH/+u +tB//mXAAAP/+H/+dfN6tvu8gAwfgNAAAAD8AAAAf/69wAACJBgCZAAAf/7D4EAAHAgHAgACZAAAA +H/+v4ACIAAiCgAABH/+xSAMVAAADEQAAAA8D/yALKwAf/620IAuBwCALK2AgCyuwIAssQCALKzAg +AOS0IAssECALLeAgCy4QIAsuYCALLsAgAOpYKQAAAAAAiRQgAPC8IAuCMCALgpAgAPqwH/+vAPDw +8PD/AP8AqqqqqszMzMwf/7JAAAAfEB//sEgAA///AAAn/yABAzAgC4MAAA9CQCADW5gf/66IAAkA +AAAASACCAAAAIAEnMCALg3Af/640OwAACA4AAADQAAAAH/+AoAAAH8oAAAhQAAAfQCALOBAgCzgw +IAs4UAAJAAgf/7FEMAAAAP//9/8gCzqgIANh3AAAg/8gBuMoFaAAACAG5CAf/7EIH/+t3AAACAYA +AIjMfwAAAAAAD/4gC4gwIAuIwAAA4AAgC4YQIAuIkB//mxwABAP/CgAAACAG4Ggf/62gIAbgsB// +njCD/7cAg/+2ICALOtDhAAAAMwAAAB//sRAf/7IEA//gAH///wAAP/aQAAAf2AP/8AAgC2WgIAtl +YCALZcAf/7MQIAs7UBoAAAAgCzugIAF1UB//sQwAD///H/+vMB//rewgC4lQH/+dvB//qlAf/6xE +IABqiCAG3WggAAWIH/+pMB//mpgf/5kYH/+qqCALPrDABAAAH/+sOB//rFAf/7HwH/+xZCALimAg +Cz7wIAMNkCAAa2jgAQAAH/+e4CALi7AgCz8wIACn2B//ntggAKTYIAuLMCALi4Af/5s8IAtBQOD/ +/gAgC2hAH/+e5CALTNAf/63oH/+VbCALVvAgC1eAH/+xtCALWjAgC1pgSAAAACABvIAf/6uoIAG+ +hB//mcwf/6pMH/+pRB//rDQf/6lsAAAYMAAAFjwf/6x0IAbf5B//qfQf/5lQ4QAuAB//rIDhAF4A +4QIOAP//v//hAA4A4QGOAP//vv8f/52EH/+qgCABw7AgAc/c4AUAAAP/AAAf/6m0IAMM6B/8v/88 +AAAAAAX//4MAAAAf/6lMIAHlcCALY+Af/67EAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIGAAAAAAAAA//// +/////////////////x///Igf//yIH//8UB///FAf//xQH//8UB//9dAf//j4H//3VB//91Qf//dU +IAaw8AAAAAAAAAAAAAAAAAAAAAAgBrQ4IAa0OAAAAAAAAAAAAAAAAAAAAAAgBrDwIAaw8B//+fAf +//nwH//58B//+fAf//nwH//58AAAAAAgAcTIAAAAAAAAAAAAAAAAAAAAAAIBAAAAAAAAAAAAAAAA +AAAEAAAAAAAAAIGAAAAAAAAQBQAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAgQAAAAAAABgFAAAAgAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAIAoAEfKTE/KT0w8D5jEBAgAW8pEX8pJ3awaQYLRmd2P4VA8zVcbW +DxQAY//5AAAAbBAIKCAFJyAHKTEF+CCGFeAZRQD5AA6FYXcBAIoiFvKE/eUIBeAMlQDxV7wN4A+l +AOrygRvHAoAApogrgp4KeQopkr/9YA2DogCdACiCnQmIAegWBSQNUYAAKNII9wANqJIAnQArYq7s +8nUVirmAACpirSzCf+yrAQRz/QAA/UAKHiIAnQAu1gj9QAoeIgCdAC8gFKT/Dw9HLyQU9eAMXdIA +nQAZ8mcuIhYsISmIFR/yZa7Mn4DqIh4uZ8KAAP0AZhWgDSUA/QBGFeALZQDt8l4dVgKAAAuqAosU +moHpABUEQEEAAIkVCACKKDwQ/SDGFeBMBQD9IOYVoAxFAOy7NgTIgQAAbbkFCACGCQJh7vJPFaCH +gACIFe4ABQ3PAoAAqYjojCAlpDUAAAvJDG2ZAggCYS0hKdMP6iEoJugFAAANDU8tJSn9QAd0YgCd +AP/kgAXgDBUA+iCoFeAe5QDqIh4uzUKAAPggJhXgCAUA+CAGFaANBQDoFgIl2YEAAFiE4P7gABc3 +xQEA98AARzANlQDt5p0oBAqAAPmABVlSAJ0AwCDRDwAAAOokAAnYBIAA7EQACugEgABYhsnSoNEP +AAAAAMCwD4k06dYILfYuAAD6QGgdoBvFAPwAAh2gDRUAWIt1Y//BAADqJAAK2ASAAFiIStKg0Q8A +//lYDaAIBQDqJAAD2GEAAPwAAh2gDZUAWItpY/+RwKBZwEwd8gaI2Pkf8giQD6UAY/+k2iBYC4xj +/nAAAAAAAPwAAh3gCgUA+kUkHa/8KgCKJ+tEAApoBIAA+0QAFaAMBQBYgFnSoNEPAAAAbBAGLiIQ +lBHlIRoq0ASAACYgB/ZBKBXgH8UA6hYAKsfCgAD/AlIN4WYBAAcJQvEgcA3ihQEAZIHy1PApIAX8 +QEgVoBuFAP6eAA2wGkUA+yAPlSIAnQDn8d8eC9YAAOXx2xtPAoAA9MAMEhIAnQClmS2SngdqCiqi +v/egEbtSAJ0AKZKdCpkB7pQABI5JgACMKYsqDAc+DLsM92AJA+IAnQAqIE4tIEyxqPugDewgCxUA +KCROKjABKSIY80AN9pIAnQArIActIST4YCQVoAxVAP1ABAUwuxEA4KoRDdqCgAALqgIb8cMKiAIq +IQcsIQkL3QL7BgAMeqoBAOvxvh1TAoAACswCKiEimOCIIJzjneQLqgKa4v0AABQwCmUACogCmOEt +IhCd5SwgOBvxs/gAIh2gTRUA+cEmFaDMGQAM2Dkd8a+U6Ay9OfmmAA6wCwUAm+cY8aKd5u3xoxTg +BQAALCYYm+uZ6ugAFQdIwQAACQCK7eYOIchBAADv5g8neQEAAAkghg8CYwkAhg8CYQxuEaXu6uad +I4CxgACIKS8gOKeIKCYJ8+AIF5IAnQCJEAkJR/kgBwFSAJ0AwCDRD54S6iQAC9gEgABYiSCOEv9N +EA3gH8UA7BIBKVAEgADtEgAp2ASAAFiGJdKg0Q8AHvF5iuj3QAY4kgCdAAxpEaWZK5Ke92AGi1IA +nQApkp0Haworsr8LmQFkkL+wrJzo7pQADPN+AABgACwAAAAAAPPf8EhSAJ0ACVQM9J0AFa/4AgAA +AAAAAOsSAClQBIAAWIea0qDRDwDqJAADWGEAAPwAIh2gDWUAWIq7Y/9pjSLA5A7dAvxARhXv/X4A +AAAA+EOoFaTZAQAA0QQAvBoMiAL4Q6YVr/jGAIonjRHAwOqsIC7YBIAAWH+u0qDRD9ogWIW7Y/75 +AAD/9zwNoAkFAMCgWb+KHvFDiuj5X/l4kB/FAP/9KA2gCQUAwJDAugurNPvBBhXv/O4AAAAAbBAO +lRwoIhAuIgknITUpIAcjFg4qMgL+YIgV4A0VAPxgaB2ntQEA4yEaJdv5AAAL2zn6IaYV4ZkBAOf/ +Ngm3woAA/sJSDeOqAQAODkLxwHAN4tMBAGTUYyYgBcHo+f4ADzAXRQD2wCQdYgCdAIciix705fwN +4A6FACuwAZ8R82AhJxIAnQCZEJkamhQY8Rbt8RcSKA0AAOUWCyyvAoAA6FUIDN+CgACtu+sWCSJw +BQAAiRqeGI0b9SAGqhIAnQArUp6GGf1gCiPiAJ0AL1KdJmK/Bv8BZPQ5GfEEiZj3IAmYkgCdACqC +rmShUhrxASOCrSqifx3w/Qo7AesWBSTb/QAA+mAJ5iIAnQCb2PpgH2YiAJ0AhymGKgwDPgdmDPLA +CaviAJ0AKRoA8yIyDeD69QArIBacE/tgCf0iAJ0AixGGwyogOPfg5hWgBgUA9+EmFaBHBQD74QYV +4KoZAAp2ORfw75YWLSIXFvDsnfotIhud+4nECnY5lhf5YBFK4gCdAIYdnh/sFgMjDdmAAGABCBnw +1omYapEuixsqUp6PGXujSy1SnS/yvw/dAZ0VhhXr8M4U0/0AAO9kAAMB6YAAmrhl/xNgA0qeH/wg +ZhWgCgUAWb8LGfDFiZgY8MKME+4SDySO2wAA//9cDaAPBQDAoPogphWv/uYAHfC8wLoLmzT7oQYV +7/72AAAAAAD/+xQNoA8FAJ4fLxYQ/CBmFaAKBQBZvvcZ8LGMEy8SEImYjh8Y8K35P/VwkgCdAGAC +vcCgmhWLFRbwqcDaDZ007WYILfYmAABgAqSeHy8WEJwT6iQACdgEgABYiD6MEy8SEO4SDyV1oYAA +YAJanh8vFhD6QPAVoAwFAFiIF4wTLxIQ7hIPLXVmAABgA8eOF4sTiBSMEfYgyBWvigUAKiQ7DJkM +CGYCmbSs2AbuAi0iEOgmGylQBIAAWIbEjh+MExjwhvqzphWhCQUAc5sNKyAWKgr/+2AETSIAnQCK +KSsgOA8CAKOq6iYJKAQKgADzYAQ/kgCdACYhNS/CBCshGikiEOb/Ng3vwoAAf9sLCgpCZKAFCw1C +ZNBz/iAmFeAdhQD5/gAO8AoVAPohphWgBjUA9iGGFa/1xgCKJy8WEIse6qwgKmAEgABYg2wvEhCa +Ey0iG/lAiBXv/N4AAAAAAAAA6iAHKeAEgABYh7EY8FuME/4h6BWv/Z4A2iBYhMsY8FaME44f+kEo +Fa/9tgBxnogKvwz//QAV7/4KAIsUihYtIhAZ8FwLqgIb8FwKaAKGHRrwUwmIAunwUhsLPgAAIxYR +JRYSJiAHhcAjIQf2QSQV4GYRAOtVAQsygoAA9qYACrozAQDmISIpmwKAAAN3AgpVAiMhJAlmApXw +hSCX85by/eCmFeOYAQDo9gYsygKAAAk5AuMSESJT+QAA6fYEKq4CgADl5QIGQIEAAOX2ASfIwQAA +5RISIhQ1AABtqQUIAIYJAmEmIBSkZgYGRyYkFPTACDXSAJ0AiBj4s6YVoQcFAPLh8g3g+fUAKyAW ++WAIzWIAnQAqIhexquomFyGAqYAAjCkrIDijzJwp82AHn5IAnQCNHWXQz8Ag0Q8vIE5k+9kOeAL4 +QEYVoACGAAAAAAAA8x/cwFIAnQAOPwz//QAV7+42AAAAAAAA6xIOKVAEgADtEgwqYASAAFiEq9Kg +0Q8A6xIMKVAEgABYhjbSoNEPAPpAaB2gG8UA/AAiHaANFQBYiVdj/8GLEPpAaB2gDBUA7RILJdhh +AABYiVFj/6kAACYgO2RgceokAA5YBIAA/CAoFa+JBQDpJDsscASAAFiGI/ohBhWgCwUAKyYb+kdm +He/7zgAAAAAA6xIFKVAEgABYCWlj/u+KJ+tEAApoBIAA+0QAFaAMBQBYfjvSoNEPANogWIRJY/8I +6iAHKeAEgABYhydj/twAACchCSUWEiMWESQWEyYgB4TAIyEk9EDkFeBmEQDrRAELMoKAAAZEAgpE +AvZERBWqtQEA6yIHLdMCgAAKdwIJZgIqsRWaEpTwhSCX85by/eCmFeNIAQDo9gYqIgKAAAQzAuP2 +BCXYgQAA9CJoFa/DBQADuwEjEhHrqQgKrgKAAAXlAuX2ASZggQAA5RISJMkBAADpy0N+QASAAC1M +/gzWEaaG5pM7d+DBAAD0n+/xEgCdAG3ZBQgAhgwCYWP97YsQ+kBoHaAMFQD7YkAV4A0FAFiI/mP+ +WgAAAPuPAAw//vYACJ0MDUkUbZkFCCCGDAJj79oIBcEBAADpTAwFSMEAAPWf7UESAJ0AK8z+bbkF +CECGCQJlY/2UAABsEAYoIAUc74n33w4F4BpFAPsACp0iAJ0AKyBOiciwuyskTvcgCMiSAJ0ALnKu +7e+BFxFxgAArcq0t0n8NuwHmtAAFkSmAALCe7sYIJYg5gAAvIBSz/w8PRy8kFPXgEMXSAJ0ALiBz ++EOoFe/69QD7wAQA0AsVAOC4GgdoBQAA+xcADTTdAQAtJHMJiAEIuDkKmQHpJh0sBw4AAIoifKcE +KCBOyY99pwgrIEwpIE57kxTMbCwgFO0iAi5YHAAAZNHJwCDRDwCOJ8fzD68B7yYCJ1DBAABYdTrj +72UVATmAACigANMP0w8DiAooghDsoActWASAAPpAaB2gDUUAC4AAZa/ciSfTD2SfpiqZFMqniplk +r5wooAADiAooghDsoActWASAAPpAaB2gDTUAC4AAZa/gY/96AAD//1QNoAoFAMCgWb2AHO85icj5 +P/bokgCdAMBgKSAUs5n4QoYd7/weAAAAAAAAAADqJAAK2ASAAFiFaNKg0Q8AKiAFKyAHwdT9QA5l +YbsBAAUFR/igDnlSAJ0AkxCNNp0S7e8lHZgEgAD1YAmKEgCdAAy6EaeqLqKe98ANnNIAnQAqop0N +vAoswr8MqgFkoT36QAgV4AwVAFgh3x3vGSkhCRjvGSshIi8gBx7vIywhJPlmAA2w/xEA6BICL/qC +gAAPzAIOzAIspgCOIJui+UCmFaAPJQDppgMvdgKAAA/uAv9AJhWgCQUA7QAVBVBhAACxmeqDHgyP +6AAADDkR9yAARPAIpQAolp30v/K5EgCdAIon60QACmgEgAD7RAAVoAwFAFh9V2P+Ov/3bA2gCwUA +wLoLmzTrxggrbwYAAGP+2+okAAtYBIAAWAh1/d3UBa/3dgCKJ8Cw+0QAFaAMFQBYhewZ7vaZoP5A +CBWgG8UA+d3oBaAMFQD5QEYVoA0VAP3AABcwCBUA6O4CDXgEgADu9gEpUASAAFiIOMAg0Q+JyPcg +BKCSAJ0ADDoRp6ouop73wAVU0gCdACqinQ0+Ci7ivw6qAWSgmLCfn8hlrsGIIusWASQE4YAA+L/s +OVIAnQCKJysKAPtEABWgDBUAWIHIixAe7tKeoIwgHe7SnaL9gAAWMA0VAA3MApyhi7b7QGYV7/VK +AAAAAOtUAAlQBIAAWITuY/08jzP+IEYV7/jWAP/5ZA2gCgUA+iAmFeAKBQBZvPIc7qyJyIsRHe6r ++T/6uJIAnQD//cgNoAoFAADAoMCKCJg0+YEGFa/9igAAAADqJAAF2GEAAPwAIh2gDaUAWIf9Y/9R +AABsEAQoIBTvix5qGASAAIon+mBoHeAMBQDqrCAp6ASAAFh89dKg0Q8AiyJzvksU7o+KSGqhRxvu +jCyyrsrHHe6NLLKtLdJ/DcsBfcAbsK6eSH3AIS8gFO8kFC/a0AAA2iBYCA1j/6fAsMCKCKg06EYI +Lf8WAACJIsmVwCDRD8CgWbzBikhroa1j/+oAAAAAAAD6QGgdoBvFAPwAIh2gDRUAWIfTwCDRDwBs +EAgsIg8vIAcoITQnMgf+Q0QVp9UBAPm/wBXgCxUA6bk5CbAEgADrIgkqUASAAPgghhXgBBUA6Hc2 +D0/CgAD3IlIN4f8BAAsJQvEgcA3ijgEAZIJywbTsex8OlHQAACwgT+kgTSZgBQAADAxHLCRP/SAU +o6IAnQAsIAX7gBL9YgCdAI0i+iAGFa/7NQD9YA5Y4gCdACgiGY4y+cAU1SIAnQCJOBjuSxzuSOSS +Ym/fgoAAmhCYEay76O5CFUgNAACZE+sWAi+nAoAAqET14A0iEgCdAIsTKkKe+0AbG+IAnQCKEilC +ndMPKqK/CpkB7pQABJJxgACMKYsqDAU+0w8Muwz1YAnb4gCdAC0aAPWh8g3g+PUAKyAW+WAZdSIA +nQAsISIZ7j0oIQcqISQrIQn8QPAV6ogBAOmqAgxDAoAACLsCGe42GO4nDS1A6cwCDuqCgAAI3QKd +4IkgnOKa5PvAZhXgClUA6+4uHM4CgAAKmQKZ4YgvmOUsIDj3wQYV4A0FAP3A5hXgCiUA/dxMBeBJ +JQD4wIgVoMwZAAyaOZjpDNs5jWWd6h3uIPzAyBWgCQUA7OYLI4fhgAAKnBANzAKc7IwRiWiX75nu +iGko5hCNai3mEewAFQdJIQAACQCKiGf44AujogCdAB/uBQq9Ag/dAp3mwMX8k6YVoQkFAPUh8g3g ++PUAKyAW+WATpSIAnQAsIhmKKSsgTykgOOWqCAZgBQAA7CYZJdv9AAArJE+aKfMgD4+SAJ0AixRl +se/AINEPnxWfFp4X6iQACtgEgABYhXuOF+8SBSV1kYAAjBRlz9uKJ9sw7BIAJVDBAABYgKLAINEP +Gu3Uiqj3QBCIkgCdAIwTK0Ke/WARQ6IAnQCLEilCnSuyvx3tywuZAeSSFGVj/QAAnNjulAAM8mYA +AGAAjiggOfEf+A4SAJ0A//vkDaAJFQAAAAAA85/sSFIAnQAJ5wz2/YAV7/X6AAAAAMGze8kUKSA6 +mhD+IMYV4Az1AP0gEP0iAJ0A6iQACtgEgABYg+rSoNEPAPAAGA2gGtUAwKGMNyshCY04jjLrrxEN +3QKAAA+7AuS7AglQBIAAWIPOwCDRDwAAAP//WA2gGoUA6iQAB9hhAAD8IGgV4AwVAFiG/WP/BQAA +CrgCmObA1fyTphXhDAUAdcsNKyAWKQr/+WAONWIAnQCKFGShXYtqjGeKaat7B8wMnGf3YNIN4A4F +ALGqjGWbaotmmmms6qt7d7sBsaqOKZtmmmUtIDil7p4p86AKN5IAnQCJJyiZFMqCi5nJvhntjyiw +AJ8VnxYJiAooghAssAf6QGgdoA01AAuAAI8ViyLHo/tf8oDiAJ0AKCE0h2cuIRqKL4sp6Hc2D2fC +gAB3ywoLCULIlA4LQmSwtMHU+v4ADrAMFQD8IIYVr/KuANogWIHaY/4KiifqrDArWASAAFhsGdKg +0Q8AAP/yqA2gCQUAAACfFZ8Wnhf6QPAVoAwFAFiE2Y4X7xIFLWX+AADqJAAH2EkAAPwAIh2gDQUA +WIa0Y/3gAAAAAADqIAcq4ASAAFiEo2P9gZ8V/iDGFeAKBQBZu5Aa7UqKqI8V+V/u2JIAnQD/9+AN +oAkFAMCQHO1EwLoLqzT7gQYV7/eaAAAAAADzX/o4UgCdAAnnDPb9gBXv/PIAiiefFe8WBinYBIAA +7BIAJVDBAABYgALWoP4gqBXv+hYAnxXvFgYpUASAAFiBov4gqBXv+rYAAADBU/pAaB2gCwUA/AAC +HaANNQBYei8rIAWPFooQ9X/ahWIAnQBj/SGfFZ8W6iAHKuAEgABYhHT+IKgV7/iuAAAAAGwQDpMc +lRqIL4opLiEaJyE0LzIE+EDwFee1AQD7f8AV4A0VAAvbOesWCyngBIAA9+EAD/GZAQDnIAUvN8KA +AP7B8g3iqgEA8UBwDeJuAQBkZEHBpAj6jfrgI00iAJ0AjiKLHPXEXA3gCoUAK7ABnxLzYCBXEgCd +AJkR6Oz8ElgNAACbGRvs/OkWCCyvAoAA6FUIDNeCgACrquoWByJwBQAAhhieFosZ9MAF6hIAnQAq +Up6GF/tACWPiAJ0AL1KdJmK/Bv8BZPQhGezqiZj3IAjgkgCdACqCrmShORrs5yOCrSqifx3s4wo7 +AesWAyTb/QAA+mAJHiIAnQCb2PpgHqYiAJ0AhymGKgwDPgdmDPLACOPiAJ0AKRoA8yIyDeD69QAr +IBacEPtgCSUiAJ0AG+zoKSA4+9nMBaAGBQD34OYVoEcFAP2AiBXgmRkACXY5Cbo5ixKaFJYV/WAR +0uIAnQCGG2Rh02ABAxnswomYapEuixkqUp6PF3ujSy1SnS/yvw/dAZ0ThhPr7LoU0/0AAO9kAAMB +6YAAmrhl/ytgA0qeHfwgBhWgCgUAWbr3GeyxiZiMEBjsru4SDSSO2wAA//9cDaAPBQDAoPogZhWv +/uYAHeyowLoLmzT7oQYV7/72AAAAAAD/+3QNoA8FAACeHZ8e/CAGFaAKBQBZuuMZ7J2MEI8eiZiO +HRjsmfk/9jiSAJ0AYAK+wKCaE4sTFuyVwNoNnTTtZggt9u4AAGACpZ4dnx6cEOokAAnYBIAAWIQq +jBCPHu4SDSV2eYAAYAJdnh2fHvpA8BWgDAUAWIQEjBCPHu4SDS12TgAAYAPEnBD+IaYVr4kFAOkk +OyY4QQAABwCG5xICJ7CBAAAGAmGNx5f4isSJxq19B6oMmsR32wmeHewWACTIBQAAjBKLEIYVjhSZ +tp23Bu4C7SIPKVAEgABYgqiOHRjsaowQ+rOmFaEHBQBzewgrIBYpCv95uX6KKSsgOKOq6iYJKAQK +gADzYAQnkgCdACYhNI/EKyEaiS/m/zYN78KAAH/bCgoKQsikCw1CZNBz/iBGFeAdRQD5/gAO8AoV +APohZhWgBjUA9iFGFa/1xgAAAAAAAJ4diiefHosc6qwgKmAEgABYf1DvEg4tYASAAP4hqBWv/FIA +6iAHKeAEgABYg5eMEBjsQP4hqBWv/bYA2iBYgLGMEBjsPI4d+kEoFa/9wgBxnogKvwz//YAV7/4K +ABfsPhvsPh3sQwapAoYbGuxC7ZkCBkBBAADlYVRn6IEAACUWEJMfJSAHg8AFJUDqMwEKqoKAAAUz +AgczAichByohIiYhCfRB6BXqdwEA66oCC7sCgAAHZgInISST8IMglvOZ9pry9eCmFeOpAQDlEhAt +UgKAAAp3Auf2BCmeAoAAA+MC4/YBIlP9AADjEg8iDDUAAG2pBQgAhg0CYSYgFKRmBgZHJiQU9MAI +HdIAnQCIFvizphWhBwUA8uHyDeD59QArIBb5YAi1YgCdAMg/iykqIDiju5sp80AH35IAnQCMG2XA +18Ag0Q8tIE5k2/MK6AL4QEYVoACGAAAAAAAA8x/d0FIAnQAK7wz//YAV7+6+AAAAAAAA6xIMKVAE +gADtEgoqYASAAFiAl9Kg0Q8A6xIKKVAEgABYgiLSoNEPAPpAaB2gG8UA/AAiHaANFQBYhUNj/8GL +EfpAaB2gDBUA7RIJJdhhAABYhT1j/6kAAAAAACYgO2Rgdyv6gCskO+wSAi5YBIAACCCGDQJj7PYI +LPAEgADtIg8pUASAAFiCC/ogxhWgDAUA/EdmHa/7ygDrEgMpUASAAFgFU2P+8oon60QACmgEgAD7 +RAAVoAwFAFh6JdKg0Q8A2iBYgDNj/wDqIAcp4ASAAFiDEWP+3wAAACchByQWESYgB4TAkx/yREQV +4GYRAOpEAQsygoAABkQCFuu6LCEkiicGRAImIQn6ZgAJ+ncBAOuhFSu7AoAAB2YChy+U8IQgl/WT +8vfgZhWjOQEA6fYGKZoCgAADzALjEg8qJgKAAATkAuz2BCVQgQAA9eAmFa/MBQAMqgGqvOQSESZh +AQAA7Is9fEgEgACwSAyGEaaWdsM29J/wiJIAnQBtiQUJQIYNAmVj/gCLEfpAaB2gDBUA+2JAFeAN +BQBYhOxj/mIAAAD7DwAM//8OAAnMDAxIFG2JBQlghg0CZ+/NCAVJAQAA6EwMBsCBAAD1n+3YkgCd +ALDObekFCYCGCAJpY/2oAAAAbBAGKCAFIyAHJAoD/Q9ARFEzAQAoICJkgG8CKgJYd+j9TMCA0A0V +ACwgIRjrbQ8CAOwzEQZ9VoAAqDMpMp4PAgBuk0UrMp1ksD/6QAgVoP7lAA7OAf3GAA7wDwUA/EQm +HeAJBQD4IAYV4AwFAPggJhXgDpUA+CBGFeANBQBYfgz0c6YVoAIFANEPwCDRDwAAbBAKKiAF+EDw +FeAMFQD4YGgdp7UBAOgWACXb+QAA68s5ChgEgADrFgUsIASAAP1BwARRmQEAwcP9QCAlIgCdAI0i +7+tFHpwWAADr60ERsBEAAOYWBCz3goAAr+7uFgMs1wKAAKuq6hYHLMAEgACHF/UABCISAJ0AihQn +cp6GE48X+uAHW6IAnQAmYr8v8p0G/wHvFgYnmhGAACUhG4pChymGKgWlNvVPAA5xCwUAfLMB1aCY +GgdmDPTABePiAJ0AKhoA9UIyDeD89QArIBaYGv1gBf0iAJ0AikL6oA56ogCdAIwVG+s2h0OYGut3 +AQYI+YAAYAC2AAAa6xeKqOgWCiUM34AAixeMFIYTK7KejxcmYr98s0Mv8p0c6w4G/wHk8DllW/0A +AJvI7xYGL/tuAABgAqMAAAAA+CFmFeAKBQBZuUoa6wSKqIkb6BIKJQ7fAAD//0wNoA8FAMDwHOr+ +wLoLqzT7gQYV7/8GAAAAAAD//HgNoA8FAJkb6iQACtgEgABYgpKJG+gSCiV5qYAAYAI1AJkb+kDw +FaAMBQBYgmyJG+gSCi15lgAAYAMa8OAEiFIAnQAtIRqMKZcY+CFGFaLtAQDpFgsvBBYAAJcY+CFG +FaLsAQDpFgsnA4GAAJga6RYLLv/CgAB1+14O1Qz51egFoLfpAOZCAy3cgoAAC3kCmRgIZgH2gGYV +oAECAIonmRsrEgDqrCAp4ASAAFh91Ikb+CFIFaALJQDrpAItIASAAOqiAigECoAA8v/7uFIAnQCM +KZcYmBqZG44YjxblrQwKWASAAOXMCAlQBIAA7UYCKugEgADsJgkp4ASAAFh974gaiRuPF/vzphWh +DgUAdesIKyAWJgr/drkMwKH6IKYVr/d2AAAAAOogByrgBIAAWIIBiRv4IUgVr/+KAI8pGOrFiRal +/58pjEOLQI0V58QABMiBAAD8DgAFN+sBAO4WAS6I5gAAJyAHBwdBCHcKJ3Kf7q0QDVPCgADtqgIC +QEEAAOp3AQHT/QAA58cCAYw9AABtqQUIAIYJAmGLQMCAmBIZ6rAa6q8vIRqGFh7qrCQhBxjqqfwg +KBWh1zEA/6AARrpEAQDt0IAqJwKAAOzMDyZwQQAA+IYACjTMHQDkZgAmYAUAAAw8DBTqhA1dDOgi +AC/6AoAAn2aXZ55jnWUMpDkJiQLpZgQsRgKAAORmAiHQBQAACKgCmGEmIBTjZggNIASAAOYkFCgE +CoAA82AEGpIAnQCIF/UTphWhBwUA9OHyDeD59QArIBb5YAUdYgCdAIgS0oDRDwCKFWSgo8Ag0Q8A +AAAAAAAA6iQABNhhAAD8IIgV4AwVAFiDu2P/2Yon/CEmFafbQQDqrCAoBAqAAPWgBGHSAJ0AjBYr +CgHszCAp6ASAAFh4spoS+oAIFe/7zgAAixbsTREJUASAAP1gAEXwDBUAWHaQ9IBgFa/9ogBlu/z5 +X9/I0gCdAC8gIPH/33eSAJ0AY/9zAAAAAAAAAOogByrgBIAAWIGPiBLSgNEPiifcMOsSACVQgQAA +WH08wLL7QEYd4AIFANEPAAAAAOs0AA44BIAA/GBoHeAMBQBYeI/bQOw0AAroBIAA6hYCK/AEgADv +EgYpUASAAFh9W/qACBXv+xYA6iQABNhJAAD8ACIdoA0FAFiDf2P+6QAAbBAIkhSTFRnqK4hA+CBG +Fa/LBQDrKgECcCEAAPogZhWniEEA5IHAYlARAACPEy0hBamMLMAAr98EzAvv/EAuWASAAP+ADYri +AJ0A+iAmFaBoAQD+ACId4A0FAAb9OAvfC+vdCgfYIQAAghWeEPkAAEVwDCUA8kEAFeAPBQDyQIAV +oAIOAI0UDlUM/+AgFaADBQDv5AAEQAUAAPEOYA3gfgEAhhMioAAt0QUEIgvm1ggJWASAAOIWBiMx +AQAA9kAGeqIAnQAIBkDyACIdoA0FAAYtOAvSC+vdCgFYIQAA9yAQFaACFQAHIziHFQdmCxfqAqc3 +J3CgBjIKBjML7HwIAZghAACO0AsAiQXuNi4mAAMAiyLSAOqsASTIBQAA9F/7I+IAnQAFKQwOKgz7 +oAYVoAcVAPVgKBXgBgUACXY4CGgIIrIABeUIJbYBflsCIiwB4rYAJn0SgAAW6emLEh7p6Oa2AQeQ +BQAABiIChhXuuwEMbgKAAA27ApJg+oAGFeEsHQDRD4sQ/CAoFe/9UgAAAPxPAA3//MYAhRUZ6bkF +xQv4AAoV4AIFALEi5YMeCQ/oAAAd6dKGEhrp0u1tAQfYBQAADbsCjRXqZgEMTgKAAAlmAuvWACYQ +BQAA9oAGFaEiHQDRDwAAAADqFgEtaASAAPvAaB3v+dYA/Y8ADf/5PgBsEAz4QEgVoAoFAOsgBynI +BIAA8oBoHefFAQD9n8AVoAQVAOxMOQy4BIAA/CEmFaG7AQDzG1wN4AwFAJoWnBWZE5sUmxsuIBYV +6Yod6Ysf6a3vFggtx4KAAO2ICA2nAoAApUQd6akoFgr50wQFoP/1AH/hEwIqAlgsnhjpfh3pouoW +CCUqEYAAYAAXAABmY8v4wB8okPr1ACkgFvsgGU0iAJ0AiYj3IAYQkgCdACtSrhzpc2Sw0SzCfytS +rQy7AWSwx7CZmYgc6ZFks0sswIAszDf+IWgVpMwdAKw86xYCJmAdAAD1wAWCEgCdAC5Cnv3ACCui +AJ0AjBorQp0swr8MuwHrFgAlmVGAACpxDIl3mRH9QA6sYgCdACxwEOtyAyYJQYAA+Z/7KNIAnQAu +cgNk4NCPFmXxsIYRjxiNFO4SAClQBIAA5v82C9gEgADvFgEp4ASAAFgqVBjpRx3pa+evLm0wBIAA +YALyAADAoFm3hxjpQYmIHelk+T/5iJIAnQD//QgNoAsFAMCwwKoKmTT5AQYV7/zOAABqkSQrQp58 +s0GMGitCnSzCvwy7AeSwNWTz/QAA/wEGFa/9KgAAAAAA/CGmFaAKBQBZt3AY6SqJiB3pTuwSDSSP +EwAA//yMDaALBQDAsMD6D580/wEGFe/8UgAAAAAAAAD//BgNoAsFAAAAAIoYwLGbFvlf+SriAJ0A +wOCeFvlf+MriAJ0A63QACVAEgADtEgkp4ASAAFgqkP4AIh3gBxUA5xYJLTgEgAD/QGYV7/u6AGSw +SY8V/gAiHaAMBQAP7DhkwIyIEYYY6iQAC9gEgADtEgQp4ASAAOhmNgjwBIAA5hYBIPgRAABYKxzo +6PwdMASAAP3SPgXv9/4AAAAAixgPAgAPAgD5YTYN4AwFAHmjAcDB+AAiHeAOBQAMnjjsFgUnfJGA +AOt0AAlQBIAA7RIJKeAEgABYK7r3QGgd4AsVAPohJhXgChUA+uBmFa/9ngCLEBXpASohB4lwHOj9 +/9HIBeqqAQD/QAAVOJkBAOyqAgTAPQAA/CEoFaSIHQDqtgAkQAkAAAg4DI4gmbPoXzkBs/0AAO+2 +Ai92AoAA7m4CBahBAADutgEuDuYAAIgT6IwgIZRVAADqPP4qyASAAG2pBQgAhgkCYSs8/gy7Eatb +mxAoIBQsIASjiPWACJkSAJ0ACAlHKSQU9SAKLlIAnQCIcigmHIlx6BYHLagEgADzIAowUgCdAPE1 ++A3gBwUAp2YmRp0qIBYrCv97oQrrEgEpUASAAFguiIwZZcDjwCDRD+sSASlQBIAAWC6DLiAWGOin +/dGWBeD/9QD/3+UcYgCdAGP8h4gZZY/SKnAQ23D8YGgdoAkVAPtf4BWgDQUA6p04CVAEgABYKUbA +INEPAAAA+kBoHaAbxQD8ACIdoA0VAFiB82P/vQAAHei3LdCA6xIEJujdAAD6QGgdpN0dAPxgAEbw +DBUA7dwHJdhhAABYgehj/48uIBYvCv//3/r0YgCdAOsSASlQBIAAWC5bwCDRD4sQDGwRrLv6IAYV +7/uWACgkFI1w8b/4upIAnQD6QGgdoAwFAFh0vvbAYBWv/BIAiifrNAAJ6ASAAPtEABWgDAUAWHbR +0qDRDwAAAAAAAADrEgIpUASAAFgB8/ogCBXv+sIAAAAAAADqJAAMYASAAFgDdogXiXGaHOekAA1f +AoAA61UIBPVNgADrVAAJUASAAP0AaB3gDAUAWAM790AAQ//6OgCKJ/ygaB2gCyUA6qwgKegEgABY +KTgrcBD5f/E40gCdAClwFQkIRWSOGStxCRzocCpxDC9wEY4nDKoMq/8PiAn9wqQVr80FAO7sICR4 +iQAA7e4BBEBJAAAK+Dmofa7O7uxAJuiBAADu21p+0ASAAA7qMBvoYC2hAf1ABBWh+TEAC/8KKyIX +7/KfLmQCgAAM3QIL7gwP7iyu3ahe/cAkHe/dgQD9wAQd7/Z2AIsU+kBoHaAMFQD7YkAV4A0FAFiB +h2P+DQAA/a8ADT/+mgBsEAQjIAAkCu10MQYiIQO8ItEPhCGGIPJAaBWgCCUA92QAArCUcQD5DwAM +czYBAPRgAEHzZoEA5eg9HAEKgAAAZhr2YAEBvUQBAOUiAQGoOQAA5SIMAZhpAAAEJCwEMyijItEP +bBAIiiInIAeJMJUV+ELQFaF3AQDxXUwN6JkBAPggJhXg/PUAfIEdBQtH+3/AFeAJFQDrmzkJUASA +AFguAfNTMA3g/PUAGuf4iKgW5/b3AA2YkgCdAC5irhnn9mTh2ymSfyVirQlVAWRR0SiM/yimCOlU +AAKNgYAAG+gSJbCA7efrEqjdAAD4IAYV5FUdAOVFCAvPAoAA5pkIAqgNAAD04AiSEgCdACiSnvUA +EzviAJ0AJZKdDXgKKIK/CFUBZFGIKSAW/SMmDaDr1QAqMBD7QBJUYgCdACsxC7y72iBYLa0oIBQs +IASkiPWADEEXmAEAKSQU9SAOLlIAnQCKFR7n6Y0RKCEHHOfNGefl/6HgFeqIAQD/AAAUNP8dAOmI +Agf4BQAAD08MmFCLIA/sOfygZhXnqgEA7FYCLd4CgADrSwICyEEAAOtWASHAQQAA+UAJcVIAnQDo +QQ1iU/0AAG2pBQgAhgkCYcCAmBTpIAQiW/0AAAy7Eatb9SAJCRIAnQCIMigmHOkyASXYQQAAmxMo +FgLzIAm4UAUFAGaRUKVMiBQMfRGm3ezWnSwQBIAA0Q8AAAAAAPcADpCSAJ0ADHkRppkukp71wA77 +4gCdACWSnQ17CiuyvwtVAWRRzbCNnahlXt1gAGMAAAAAAAAA6iQACdgEgADtEgUqYASAAFh8NdKg +0Q8AwKBZtc4a54eIqPkf8hiQ/PUA//lYDaAFBQAAAAAAAAD6QGgdoBvFAPwAIh2gDRUAWIDdY/+x +wFDA6g6INPlBBhWv+K4AHeedLdCALdw3+uMAFeTdHQDtTQgJUASAAP2gYBXgDBUAWIDQY/97AAAA +APhChh2v+g4AAAAAiif9IGgdoAsVAOqsICpoBIAAWHXI+iCGFa/7SgCLMPNgCKKSAJ0A4hIEK+cC +gACmzCTGndEPAAAAAAAAAOsSAClQBIAAWADjY/4wAADqJAAMYASAAFgCaIkxixOIEuysEQ0oBIAA +7LsIBPWdgADaIP0AaB3gDAUAWAIviBSlpaVMDH0Rpt3s1p0sEASAANEPAAAAAAD/9pQNoAUFAI01 +jDQe52r6YOgV4AklAPxwAAewrXEA+y8ADLuMIQD7IAQA08wBAOjMCA/4CoAA/4ABBn3dAQDuuwEG +cDkAAO67DAZgaQAADb0sDcwo/WAARb/1ugAAAADqJAAD2EkAAPwAIh2gDQUAWICJY/5hwKBZtWwa +5yaIqB3nJvkf8QiQ/PUA//jwDaAFBQDAUMC6C4s0+0EGFe/4tgCwSwy7EetbCAlQBIAA+2IAFeAM +BQBYc2CzTOISBCvvAoAApt0s1p3RDwBsEASJNxfnOSswFvnOYAWjKgUACiooC7YJ6KgICzcCgACo +ZhjnM6dn5HK/KQEKgAD++AgVoAwVAOhmCA5oCoAA5kEYdMAhAACLMpjgnpOWkg27Aih2wJsy0Q8A +AB/nJq+vKfK9ALEE7fLBLnAKgAAOmQL596YV7/71AA7dAw2ZAR7nHuVywClvAoAArt2Z0I8ymFDm +hgApAQqAAOWGAS4gCoAABP8CKHbAnzLRDwAAAGwQChnnEgkpCiiSf+IWCCloBIAA+wAEANAGFQDm +FgorKAqAAPgghhXgVU0AEucJG+cJHOb6GObX9c4QBaMqBQDq2igOvwKAAOmSfybruQAAnRWkpKh3 +rKycFihyuSRCn+uqCATL/QAA+iDmFaOZAQD4ISYV4GMFAPiABAIwAGoAihrAsP3/4h2gYwUA7FUD +BQLhgACbGi1yuAReAQ7dAZ0QAQCHAzZgaD7VihiLF40VHObriBbjOQkB8oEAAO4WCSzPAoAAqYj9 +AABGP//1AOKICA8BCoAA6IKfK0gKgAAPmQMJRAELgABj/6oAihmLFLGqCgpDKrZ/0Q8AAGwQBBvm +2IogK7J/HubX+08ADXMvBQAPrygO/ggp4r8o4r79zaQF7/v1AAuZA+mLAQ1nAoAA/YAARn/09QD9 +gAgVoAMVAPkO4B3gDQUAGebIGOa0+QAARn8sAQDs/AgF/USAAMspCOowKcK/L+LACYgM6PsTfoEK +gAAv4r4AOBoEiAMI/wEv5r79oCAV4bsdAOSwLGZgwQAAf7cUY//EAAAJ6jD5l+YV7/+GAAAAAAAA +/aAgFeG7HQDlv9xmYMEAAFguXMAg0Q8AbBAEJiEJ+EKQFe/4BQAnIBXomAELNgKAAOiZDAu5AoAA +B2YC+EKGHeAHBQAnNAD4YGYdoAQVAARmApYxFeZlJFat0Q8AAAAAbBAEFuaYFeZv0w+mIgU1AiUm +gCQigGdAC20IBSgigGeAAmP/89EPAGwQBBPmjyI2imP//AAAAABsEAQoIAUlIAf6YKgVr/TVAPpA +SBXgAyUA/QEgEdFVAQDAINEPAIgpmisPAgD7AAg8IgCdABrmfwpaCemh/CVQCwAAKqEA+yAEs6IA +nQDzYARwEgCdAAIqAlhypisiAg8CAAO6AWSvuIonBLsB6yYCJVDBAABYbBzj5kcVATmAACigANMP +0w8DiAooghDsoActWASAAPpAaB2gDUUAC4AAZa/ciSfTD2SfdiqZFMqniplkr2wooAADiAooghDs +oActWASAAPpAaB2gDTUAC4AAZa/gY/9KAAD//1QNoAoFANogWHKTKyAi6rsMCVAEgABYc93aUPoA +Ih3gDAUAWHWQiyIDugHzf/rmYgCdAC8gB9og/AAiHaANBQD1YAQHMb8BAO4mAiXYfQAAWH9rwCDR +DwAAAAAAAADrICIpUASAAFhzySogBcGDeKEMaKgpiyLzYAQFf/xGACkgOsC/e5nq+kBoHaALBQD8 +AAIdoA0lAFhzAGP/1wAA+kBoHaALBQD8AAIdoA0lAFhyeWP/vwAAbBAKiCsd5hcuICGLN/xgyBWg +/+UAD+4BLiQhDcwBDLsM64kIeMgEgADAINEPAwCGCQJhmxUoIAUlIAf4IQYV7/TVAPxASBXgAyUA +/RtAQdFVAQCKKRzmE5sr+0AIFGIAnQAMXAnrwfwmYAsAACzBAP1gBKOiAJ0A86AEYBIAnQDaIFhy +OIsiA7oBZK+biicEuwHrJgIlUMEAAFhrrwqrAuPl2RUBKYAAKLAA0w8DiAooghAssAf6QGgdoA1F +AAuAAOukAA1/HgAAiSdkn1oqmRQrkgnKqGS/TyiwAAOICiiCECywB/pAaB2gDTUAC4AA66QADX8u +AABj/y0AAAAAAP//SA2gCwUA2iBYciUrICLquwwJUASAAFhzb9pQ+gAiHeAMBQBYdSKLIgO6AfN/ ++s5iAJ0ALyAH2iD8ACIdoA0FAPVgBAcxvwEA7iYCJdh9AABYfv3AINEPAAAAAAAAAOsgIilQBIAA +WHNbKiAFwYN4oQxoqCmLIvNgBAV//DoAKSA6wL97mer6QGgdoAsFAPwAAh2gDSUAWHKSY//XAAD6 +QGgdoAsFAPwAAh2gDSUAWHILY/+/AABsEAQc5buLNCkwFv1gBAW1mR0A9SAICJIAnQDu5bYUiImA +APvLagWv/eUA5OWIFKS5AABplSIsoX7sswx2UBEAAPtgCJuiAJ0AKyAGsLsLC0frJAYlgsmAAMAg +0Q8soX7TD+yzDHZ4EQAA/2AH0+IAnQAoIAawiAgIR+gkBix+3gAAiSeLIiqZFA27AZsii5lkoLQo +sAAEiAooghDaIP1g8BWgDTUAC4AAwCDRDwCLIoonDwIADbsB6yYCJVDBAABYazfJrSigAASICiiC +EOygBy1YBIAA+kBoHaANRQALgABlr+CJJ2SfbyqZFGSgYIqZZK9kKKAABIgKKIIQ7KAHLVgEgAD6 +QGgdoA01AAuAAGWv4GP/QgAA6iQACdgEgADsRAAK6ASAAFhzE8Ag0Q8A6iQACdgEgADsRAAK6ASA +AFv/QcAg0Q8A//0cDaALBQD//nQNoAoFAIg3IuJ/CYgR+EAAQT/7lgCINyLifwmIEfhAAEE/+/oA +bBAEGuVFKKLbZIALCeowK6LcC5kMZ5AB0Q9YdTjRDwBsEAQd5VgnIAcc5Vf+QQQV4OcRAA7cOZww +iCD7yjYF4AolAPpgRhXgGQUA6TYDLEYCgAAKiQL4YCYV4XcBAOYgeSu8AoAA9+YAD3ANBQD8BAId +oAs1AOnlRRMCOYAAnTWcMwuKAhblQpoxGuVCBu4CJiEJnjSaNgRmAiIgB505lTv4xgALcSIBAOY2 +CikUAoAAAv8CCf8C7zYILZAEgADRDywhCCshCZ01lTcHzAIEuwIJuwIJzAKcNOs2Bi0QBIAA0Q8A +bBAEGOURHuUmLCAHHeUmGeUp+kEEFeD8EQD/zQAO8cwBAO02AC5kAoAADLsCCbsC44CAKbAEgAAd +5OP8QAgVoA4FAJ5l7WYCIbjdAAD6wIYV5HcdAOp8/y5mAoAA7HwCDVcCgADsZgElU+EAAJpjAgSJ +mWYjZgcGIIslIQn0wWYVpDMdAOVmCiuQBIAA6IAFAyjBAABtOQIFAmHRDwAAAGwQBh3lBQsrEa2z +KjJ/GeUDF+TgiKDAQPjgAETwBhUA6bkIBAGpgAAsMngvMnv5gAV8YgCdAGXxFCw2fCsyeSs2e91A +DeQWAQIAlKAN5BbAyfxABdwiAJ0ALzJ7wcDt5PAXg5GAACIyfCohBI4g8+H+Daa6AQAkNnz0b2YV +oAAeAC42fO2vAQXD/QAACP8C7yUEJYxZAAAiMnywzO8yeyEA8YAAycZj/7/aIFh1U2WgwiohBP9B +AAwWmgEAyJfRD9ogWHVG0Q/aIFh1CNEPAAAAAAAA+kBoHaALBQBYddfRDy4s+OrSiC8BCoAA/MAB +Bd/89QAMuwMLqgEq1ohZuPYkNnwkNnv6b+gVr/ziAAAAFeSAL1BhZPBqWa47WHS/KHLb0w/IgVh0 +lClQYWSfKVh0jsiuFeS8LFJrsMzsVmsmAsmAAFh0FWP/DgAAAAAc5Lb+b4gVoApVAPxvSBXgC0UA +7RYAIWvlAABZtyb6b+gVr/syAC4ye+I2fC96HgAAIjZ70Q8f5Kov8q5x9ov2rCYdr/4iAAAAAABZ +rgL6rWYVr/6SAGwQBBTkohnknOjkeRlewoAApLQjQn+piOi4CAGCIYAAKjIAeKkCKkJ7HOSUKzEE +KkZ/DLoB6jUEKdAEgABYdQXOqSkxBP8hAAwW2QEAyNfRD9owWHT50Q/aMFh0u9EPAPpAaB2gCwUA +WHWL0Q8jRn/RDwAAbBAE8GDgDe/59QCIIgk5AwmIAZgiiicqrDBYahzj5EYVARmAACigAAOICiiC +EOygBy1YBIAA+kBoHaANRQALgABlr+CJJ8uSKpkUyqWKmcmtKKAAA4gKKIIQ7KAHLVgEgAD6QGgd +oA01AAuAAGWv4NEPAAD//1wNoAoFANEPAAAAAAAAbBAIFuRlG+RlHeQ79cgyBaAYxQDjLOgl04EA +APhADewnMwEADDURpFXoUp4pZsKAAKbEKUB/+QAQs+IAnQAoUp1kggubEeoLHg1IBIAAmRAKIIYL +AmULAmMNAIcJAmEJAmEW5FAf5E7twwgJAQqAAPIgphXgDhUA4+QPH3AKgACeE6/P/iCGFe//9QD/ +1wAPcAdFAP4gRhWgALoAAIqZya0ooAADiAooghDsoActWASAAPpAaB2gDTUAC4AAZa/gKUIgZJDv +LUB8HuQsjBUN2wmu3gy7CixAfaa7irIu4IBkoTz9yD4NoAgVAC8KAA2POCgSBQ//CQj/Ci/9Fy/8 +HC/yG/HhkA3gDAUAKwoBC9sDCwtHK0R8C7sJCLsKBrsI/I+mHaAMBQCNsO9Snibz/wAALuD//+AE +e6IAnQAvUp32/+AV4Pj1APHnwA3ndwEAeHF06hIEJkAFAADoRH0m4+EAAFh0iIkT0qDrEgIkgGGA +AIqiC6oBKiYCiicqrDBYaaLJrSigAAOICiiCEOygBy1YBIAA+kBoHaANRQALgABlr+CJJ2SfFyqZ +FGWu7v/7tA2gCgUAjBGLEAyAhgxghgsCaQsCZ9EPjxGNEC5Efw/Ahg+ghg0CbQ0Ca9EPmxHqBx4N +QASAAJgQCgCGCwJjCwJhDeCHCAJv6OwACdAEgABZrWNkr6/t47wZrwKAAORVCAlmwoAA94AAQj/5 +IgAAAP4gqBWgCxUA+7cADfAMBQD8j6Ydp7sBACtEfAu7Cf9gAQWwDAUA92AARb/7egAAAAtghgtA +hgoCZwoCZdEPAABsEAQY44MCA0cMMxGoMysyhBnjkCiwAIqxCYgKCiGMAgo+KIIQAwI+/EBoHaAN +JQALgAAiNoTRD2wQBBTjdQIDRwwzEQQzCCQyhCpCASZAAChACPqYaB2gqSUAAgU+AwI+eYEjGON8 +CGgKKIIQ6lQAClgEgAD8QGgdoA0lAAuAACI2hNEPAAAA6yQAClAEgABYdE3zQGgdr/82AAAAAAAA +bBAEWbDHEuNaE+N7DAIAKSKCCRqOA6gKiIQLgABj/+sS46ID6DAE7jAFsTCTIJQhlSIS454T412E +IAQzApMgEuOcwDAoN0AoN0QoN0goN0wjPQFyM+0S45fAMJMgxy8T45YDIwMS45WEIAQ0AZQgEuOU +hCAENAGUIBLjkoQgBDQBlCAS45GEIAQ0AZQgxy/AMQMjAxLjjoQgBDQBlCBj//wAAAAS44uDIAMT +FA8zEZMgEuOIwDAjJgBX/9kQ44eRAJIBkwKUAxHjhYIQAeowohEB8DHAQATkFgACABHjgYIQIxoA +AyICkhAR437AIZIQBOQxhAODAoIBgQAA0jABIwAAAAAQ43mRAJIBkwKUAxHjd4IQAeowohEB8THA +QATkFgACABHjb4IQIyoAAyICkhAR42/AIZIQBOQxhAODAoIBgQAA0zABMwAAAAAQ42qRAJIBkwKU +AxHjaIIQAeowohEB8jHAQATkFgACABHjXYIQI0oAAyICkhAR42DAIZIQBOQxhAODAoIBgQAA1DAB +QwAAAAAAXJQBXZQCXpQDX5QAQwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAFyQAV2QAl6QA1+QAFMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAACclAAdkAGdlAKelAOflAQIlAUJlAYKlAcLlABDAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAnJABnZACnpAHHZADn5AEeJAFeZAGepAHe5AAUwAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANyUAB2QAd2UAt6UA9+UBASUBQWUBgaU +BweUCAiUCQmUCgqUCwuUAEMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADckAHdkALekAsdkAPfkAS0 +kAW1kAa2kAe3kAi4kAm5kAq6kAu7kABTAAAAH//9rADSMRD//goAAAAAAB///fQA0zEQ//4KAAAA +AAAf//48ANQxEP/+CgAAAAAAAPQwCgAAAAAA9DAKAAAAAAD0MAoAAAAAbBAIJyAHiCIW4lf9xKYF +4XcBAOWA8WvXAoAAGOJQLoCA5qoIB3DdAAD9U8gVpO4dAK5O6+JLF3AJAAD/gAhLoAmlACqinQt8 +CizCvwyqAeoWAiUH+YAAiNj3AAjwkgCdAC9iruziQReFwYAAKmKtLMJ/7KsBBHP9AAD9QAUmIgCd +AJ7Y/UAFLiIAnQAvIBSk/w8PRy8kFPXgB65SAJ0A+CBIFeeFAQD5AAdxUgCdAOg8ECIMPQAAsEpt +qQUIAIYJAmHAUIgSjTLtJhwiS/0AAOsyASzPAoAAqYiYE/NgCkBQCgUA6hYALYtKAACLEOtLCAvn +AoAA5swIBdv9AADrxp0qkASAANEP6iQACdgEgADsRAAK6ASAAFh2V9Kg0Q8AwLAJjDTs1ggt+x4A +AI0iZd/V+kBoHaAbxQD8ACIdoA0VAFh7A2P/v//8DA2gCgUAAACOImXvsC2AgC3cN/rjABXk3R0A +7U0ICVAEgAD9oEAV4AwVAFh69mP/jMCgWa/ZHeH2iNj5H/bAkAmlAGP/nNogW/sZY/8GAI4nnhGI +6fvCpBXvyQUA5ekUJ2CBAAAJyQHpvQgKVwKAAOpVDARAQQAAmOkIVTLl5RQm6QEAAP0ACDriAJ0A +aKs9qKsrvPD7oATT4gCdAO8SAiIMdQAAsE5t6QUIAIYPAmErwgELqwjlyQQl28EAAP1gBsxiAJ0A +68YBLcAEgABkUKn1AGgd7/qWAAAAAAAA6iQADuAEgADsFgQsWASAAFv8eIsxiBONFOoWAC1nAoAA +7IgIBfT9gADaIPsAaB3gDAUAW/w/jRDtrQgKkASAAO1NCAv3AoAA5u4IBuv9AAAt5p3RDwjdDPog +SBXk/R0A0w9t+QUIIIYLAmMrEgLvTwwEwQEAAO27CAeMQQAALvz/bekFCECGCwJlL8kEDagMqJgo +jDDoxgEv+tYAACqcQJrB+4AGFaAIBQD5gIQdr/0WAAuIDPnBJhWv+9oAKJxA+YAmFa/8sgBsEAQd +4Z4a4Z8c4Z0t0pgqoX4swo6j3eo6DA7uQoAA/YAARnALBQArxAQrxAVZEFD6QGgdoAsFAFv86tEP +AAAAbBAEGOGRKYJ/KjAHLZECLpEE/SCkFaAPBQDrkgAmiRGAAO7s/yaT/QAA4pUCL3cCgADuuwgO +ZwKAAP1vAA2wAMYAK5EFLZEEsbv/v+AVr7sBAOuVBS93AoAA/WAGvGIAnQCMkO7MCA3fAoAAC8sM +CwCHD99g6wAHBvMngAAe4XMpkQUr4n8JmRGp2e3ifSWGEYAAjNGL0JvAi9CcsZ/Qn9Er4n+wuyvm +f/WgBhwfuQEAjNn5owAVr8kFAPkABAR/EgUAotIrJjr/ogQd5UkFAOnVESQhAQAA5NYHLS8CgADk +1gYqWASAAPWABOQiAJ0AJdUQ6FgIBHgbAADsjEAn+gEAAP3gBGOiAJ0AyTLpRAAFAIGAAG2pBQMA +hgkCYSsiQqtY/wAFjGIAnQDoJkImk+EAANEPL5UF//yYDaALBQDApf3ChgWgOyUAWbORwCDRDy3i +gIzRi9CbwIvQnLGf0J/RK+KCsLv70EYV7/z6AADAwPsP6BWgDRUAWG6wwCDRDwAAAAAAAADv1gkm +k+EAANEPAMsw+mBoHeBcxQDsrDYKcASAAG3JBQsghg4CY/hgAEXwXkUAfqENL6ys0w9t+QULQIYE +AmUpjfvpJkImk+EAANEPAAAAAOQmQiaT4QAA0Q8AAGwQBIIjAgJB0Q8AAGwQBIUjgyAU4Rf4QIQV +oVUBAOrhFRquwoAA5FQIAYC5gAD7AAQENpg5AAmIAiglBCJCf9EPHeEME+ENH+ENJkJ+KyEELkJ/ +kmCWIaP//WAEBfbLOQAMuwKvX+8mACcoBQAAJUZ/IkZ+6yUEKpAEgADRDwAAbBAEiiBloFAd4P7q +IgMp9sKAAK7d/a/oFeAMFQD8gEAGMaoBAAaqAg3ILAjdKCclBe3MDARYBQAA/W0ADD/7xQDrqgEM +TkKAAAlZAgOqApojCYgCKCUE0Q+PIxvg6g8PQQv+EavrLbJ/GeDkLLJ+ctkZ2cDzI94NoAwFAMDA +LLZ/LLZ++kAIFaAARgDYwPMMRg2gDAUActEcjSGa0I4gKbJ9neGcIOwmASTL/QAA+W+mFe/9WgAZ +4NAY4NCpiKjoeKEg6rZ/L4EuAADNrSqyfWqiGC2ye/1v5hXgAEoAAAAAAAAA7LZ/J/8pgAD6QAgV +r/6mABzgwYghrJmp6fkPAAzwDAUACcg4+W/GFa/+KgBsEAT1wXoF4AYVAPRAaB2gAjUA9oBAAzAA +HgAAsCIoUn/oY/dyq4EAANEPAGwQBCgiHOs0AApgBIAA7VQACVAEgAALgADSoNEPAAAAbBAE9EJI +FaQjQQDyWgAJP1OBAAQiCoQmgiEFRCgKRBGkItEPbBAEKiISIyAH+j4ABDAGNQD1AAkQkTMBAArI +UfUACSiSAJ0A+igABrA7BQD9wTAFoApVAFmy3RfghuTghBnPAoAA9GAGEhIAnQCnmSqSnvdACInS +AJ0AKpKdBDsKK7K/C6oB8U7gDedFAQAoIQcZ4Ij/wRAFqogBAOvghxxHAoAACYgCmKAY4IX8QAgV +4DwFAJyn+0CmFeAZhQCZo/lARhWgCAUAmKbu3QIO/gKAAJ2kBv8Cn6EvIhIPj0Hopggv/wKAAJ+p +7eB2GfcCgACn7ibmnSwiEioiEA3MAuwmEilYBIAAWOQnaEIZiif6ACId4AwFAPtEABWgDRUAWG5R +0qDRDwDAINEPHOBPi8hqsVsMORGnmS2Snm7TZiqSnQQ9Ci3Svw2qAeSgWWXz/QAA/4EGFa/8wgAv +GgAPqgL6QkYVr/tiACgqAAiqAvpCRhWv+1YAAACJIsuZaEJNwCDRDwAAAAD/++wNoAoFAMCgWa4Y +HOA0i8hrsZb/+5gNoAoFAADAoMDaDb00/YEGFe/7WgAAAADqJAAB2GEAAPwAAh2gDTUAWHklaUKx +jCcvyRSKyf+EABWvyAUA6O4BB/hBAADvxRQlU8EAAOrGCSdxAQAAfqsqKcEVHeAzqpqayZ2gjCD7 +wGIF4A0VAOumAi5mAoAADcwC/UAmFaACBQDRDx3gKZ2gjCD7wFAF4A0VAOumAi5mAoAADcwC/UAm +FaACBQDRDwBsEBgU4CKSEI4gGeAfiyMtIgEsIgIsFiItFiQrFiP4IMYV4AgVAPgg5hWgDzUA/iEm +FeAKBQD6IKYVoA+1AP4iJhXgCnUA+iGmFaAIlQD4IeYVoAmFAPghxhXgC2UA+iGGFeANRQD8IUYV +4AxVAPwhZhWgDcUA/CJGFeAM1QD8ImYVoAvlAPoihhXgCfUA+CKmFeAIRQCYFBrf//okphWgAiUA +8iEGFaACpQAiFhAS3/iFFisSJCkSBSZRfiwSIidRfwaZKC9AgKl5+F6IFaOZAQADmQrukgAvUASA +ACVSPi0SIwjuCAtQAI4XLBIkLRIiBu4oL0CBrn74XqgVo+4BAAPuCo7gKhYW6hIjLVgEgACo7gtQ +AI4YLBIWLRIkBu4oL0CCrn74XsgVo+4BAAPuCo7gKhYX6hIiLVgEgAAI7ggLUACOGSwSFy0SFgbu +KC9Ag65++F7oFaPuAQAD7gqO4CoWGOoSJC1YBIAAqO4LUACOGiwSGC0SFwbuKC9AhK5++F8IFaPu +AQAD7gqO4CoWGeoSFi1YBIAAqO4LUACOGywSGS0SGAbuKC9Aha5++F8oFaPuAQAD7gqO4CoWGuoS +Fy1YBIAACO4IC1AAjhwsEhotEhkG7igvQIaufvhfSBWj7gEAA+4KjuAqFhvqEhgtWASAAKjuC1AA +jh0sEhstEhoG7igvQIeufvhfaBWj7gEAA+4KjuAqFhzqEhktWASAAKjuC1AAjh4sEhwtEhsG7igv +QIgOfgj4X4gVo+4BAAPuCi7iACoWHeoSGi1YBIAAqO4LUACOHywSHS0SHAbuKC9AiQ5+CPhfqBWj +7gEAA+4KLuIAKhYe6hIbLVgEgAAI7ggLUAAuEhAsEh4tEh0G7igvQIqufvhfyBWj7gEAA+4KjuAq +Fh/qEhwtWASAAKjuC1AALhIRLBIfLRIeBu4oL0CLrn74X+gVo+4BAAPuCo7gKhYg6hIdLVgEgACo +7gtQACwSIC4SEi0SHygSJQbuKC9AjK5++Q/oFaPuAQAD7gou4gAqFiHqEh4tWASAAAjuCAtQACwS +IS0SIC4SEy9AjSgSJQbuKJoTrn75EAgVo+4BAAPuCo7g6hIfLVgEgACbEajuC1AAjBEtEiEuEhQv +QI4oEiUG7iiaEq5++RAoFaPuAQAD7gqO4OoSIC1YBIAAKxYjqO4LUAAsEiMuEhWNEygSJQbuKC9A +j65++RBIFaPuAQAD7gqO4OoSIS0wBIAAJhYi6O4IC1gEgAALUACOESoWJCkSEisSEygSJS0SFY8V +7BIUJEEBAADoFiUm6EEAAO0WFSf4QQAA7xYFJmBBAADsFhQl2EEAAOsWEyTIQQAAKRYSix2JHIwe +LxIQjR/oEhEmYEEAAOwWDif4QQAA7xYQJuhBAADtFg8kQEEAAOgWESTIQQAA6RYMJdhBAACbHYkW +ixeIG40Z7xIKIREBAADsEggkQEEAAOgWCyboQQAA7RYJJ/hBAADvFgoiIEEAAO8SBCZgQQAA7BYI +JdhBAADrFgckyCEAAOkWBif7/QAA7xYEL+FmAACLEIgTjBKPsImzjbKOsayZpt2q7qj/n7CesZ2y +mbPRDwAAAGwQBCkiFfigAATwOHUA6YwMASBBAADzIABFP4sFAOukECVQRQAA+QAF02IAnQArCgBZ +qc8sIhUrIhTtzREJQASAAPxCRhXugD0A/WsADbAJNQD6QmYV4AolAG2qDI6EDg6O7oYEJEARAAAP +AgDTD9MPbZoh6YIEJEBBAACKgYuCjIMJCY4KCo4LC44MDI6ZgJqBm4Kcg+tEAAlQBIAAW/6tiiCI +IokhjyMICI4JCY4PD44KCo6aIJ8jKSYB6CYCKUAEgAAZ3soCAIYDAmH4AAoV4Am1AG2aAggAitEP +AAAAAAAAAP2BABWgCwUAWamg+EBoHaAJRQDTD22aIemCBCRAQQAAioGLgoyDCQmOCgqOCwuODAyO +mYCagZuCnIPqJAAKWASAAFv+i9pA//v8DaA8hQAAbBAGKSIV+EKIFaBGBQDTD/iAAEV1mQEACWYM +dKsBsYgqJhUGKgzoJhQlUUEAAPaAB7OiAJ0A6zQAC2AEgABZqXT4QGgdoAlFANMP0w9tmiHpggQk +QEEAAIqBi4KMgwkJjgoKjgsLjgwMjpmAmoGbgpyDJSwQ6iQACtgEgABb/mgGRwz24AWO0gCdAOY0 +CArQBIAA9uBoHaADBQDkFgAqQASAAPjIaB2gCUUACgJnCECGCgJlCCCGCgJjCACG6gwACUAEgABt +miHpggQkQEEAAIqBi4KMgwkJjgoKjgsLjgwMjpmAmoGbgpyD6iQACtgEgABb/kvqVAABmAUAAOZs +wCIhAQAA722aakAEgACLEAo8EQvLCOx8DArQBIAAWak80Q8AAAAAAADrNAAKYASAAFmpN9EPAAAA +9mAARjADBQD8IAYVr/8mAGwQBBjeXhneXBreWhPeXZMjmCKZIfpABhWgCwUAKyYVKyYU0Q8AAABs +EAbeIOTiECpgBIAA50IHK9AEgAD7vJQF4Bg1AONCFSmQBIAA53IOIvvpAAB4+ycY3ksI+AqIgJoT +nBLuFgEsACKAAACTECqypexUAAlYBIAAWar1ZKXH8oKmFeACBQDRDwAAAAAr4hILm1LuFgEl/0GA +ABreM+MWAClYBIAA6qLHKuAEgABZquhkpXoa3izbIOqiySrgBIAAWarjI30F5KbPYZoBAAAa3ibb +IOqiyyrgBIAAWarc90fgDeOGBQAa3iDbIOqizSrgBIAAWarWZKbEGt4b2yDqos8q4ASAAFmq0ftA +QogSAJ0AKzDlwVj1YCvgYgCdAGm3ISU05YsQ+oKmFeACBQDRD5MQKrKd7FQACVgEgABZqsRkpwKL +EPqCphXgAgUA0Q8AkxAqsqvsVAAJWASAAFmqvGWvGvogaB2gC7UAWOAr+gAiHeADBQDqszgFAOGA +AOoSAitYBIAAWalAyKkc3f6NEQysNizWF2UzJY0Q/IKmFeACBQDRDy5AbmTu0pMQKrLB7FQACVgE +gABZqqVlrr/6IGgdoBtlAFjgFPoAIh3gAgUA6rI4BQCpgADqEgIrWASAAFmpKix9AyrFKGUi0Y0Q +/IKmFeACBQDRDwAAkxAqsrPsVAAJWASAAFmqkWSitxrd1tsg0w/qop8q4ASAAFmqjGWuWvogaB2g +C1UAWN/7+gAiHeACBQDqsjgFJ+mAAOoSAitYBIAAWakQLEBv8YAnPtIAnQBkpN+KE/oAoh3gDNUA +WN/Y0qDRD5MQKrK57FQACVgEgABZqnZlrsf6IGgdoBslAFjf5WSiNStAbmS3b+oSAitYBIAAWaj8 +LEIWCsw2LEYWixD6gqYV4AIFANEPkxAqsrfsVAAJWASAAFmqZGSiMxrdqdsg6qKxKuAEgABZql9l +rm36IGgdoAvlAFjfz2Sh2+oSAitYBIAAWajnK30CKrUUixD6gqYV4AIFANEPkxAqsqnsVAAJWASA +AFmqUGSiKhrdlNsg6qK1KuAEgABZqktko4ca3ZDbINMP6qKjKuAEgABZqkZlrgf6IGgdoAt1AFjf +tWShdStAbmS24xrdhYsS6qLvK2AEgABZqjxlpkYrQG/AyAy7AitEb4sQ+oKmFeACBQDRDwAAkxAq +sr/sVAAJWASAAFmqMWSh7xrddtsg0w/qoqEq4ASAAFmqLGWtn/ogaB2gC2UAWN+bZKENK0BuZLZq +Gt1rixLqou8rYASAAFmqImSmeStAbywK/Qy7AStEb4sQ+oKmFeACBQDRDwCTECqyp+xUAAlYBIAA +WaoXZKG3Gt1c2yDTD+qimyrgBIAAWaoSZKLaGt1W2yDqorsq4ASAAFmqDWSsXxrdUtsg6qLDKuAE +gABZqghlrEwa3U2LEuqi3StgBIAAWaoDZaRSixErshILmVLImWiSB/kgD2HSAJ0AjBErxhLygqYV +4AIFANEPkxAqspfsVAAJWASAAFmp9mShehrdOtsg6qKZKuAEgABZqfFlrLT6IGgdoAslAFjfYMqi +Gt0yixLqou8rYASAAFmp6WWslIoT+gBCHeAM1QBY30LSoNEPwCDRDwAAAPogaB2gC/UAWN9SZK/q +6hICK1gEgABZqGvrEgAj4AsAACrFFfqCphXgAgUA0Q8AAPogaB2gGxUAWN9GZK+6LUBuZNUGKUBv +8T/hl5IAnQDxP+FX0gCdAOoSAitYBIAAWahZLkIXCu42LkYXixD6gqYV4AIFANEPAPogaB2gC6UA +WN80ZK9yL0Bu0w9k9HbqEgIrWASAAFmoSyhBNPsADwKiAJ0AihP6AUId4AzVAFjfE9Kg0Q8AAAD6 +IGgdoBtVAFjfJGSvMuoSASpYBIAA7BICK2gEgABY3qyLEPqCphXgAgUA0Q8AAAD6IGgdoAuVAFjf +GGSvAilAbmSUGRrc6YsS6qLvK2AEgABZqZ9lolwrQG+NEPyCphXgDBUADLsC+o3mHeACBQDRDwAA +AAAAAAD6IGgdoAsVAFjfBmSuuhrc2IsS0w/qou8rYASAAFmpjmWrKYoT+gAiHeAM1QBY3ufSoNEP +AAAAAOoSAitYBIAAWagU9UAV8pIAnQDHL9EPAPogaB2gC4UAWN7y+gAiHeACBQDqsjgFAUmAACxA +bg8CAGTDgxrcyOsSAitgBIAAWal2ZaJuLUBvwOgO3QItRG9lLjWPEP6CphXgAgUA0Q8A6hIBKlgE +gABY3udlr5wrMOVj+nMAAAAA+iBoHaAbBQBY3thkrgIoQG7TD2SC9eoSAitYBIAAWafvKUIYixAr +RhUKmTb4gwYV4AIFANEPAAD6IGgdoAs1AFjeymStyhrcnIsS0w/qotUrYASAAFmpUuPcoh0HLgAA +ixErshILyVHImWiSB/k/+RHSAJ0AjhGMEAO9AS3mEvyCphWgAgUA0Q9lLYSPEP6CphXgAgUA0Q/q +EgIrWASAAFmnzipFNIIQ8oKmFaACBQDRDyV9BPSwABXgCwUA+qBoHaCMBQBZp1/qEgIq2ASAAFje +/ysw5cDEDLsC+nwmHae7AQD6fKYd7+X+AC0w5fogSBWgDiUADt0C7TTlK1gEgABZp7YrMOX6fIYd +r+VuAACKElmbPS8w4n+pFIoSWZs63KDqEgIj2BMAAFmpHWSht8Ci/bjYBaA7BQBZrp3HL9EPGtxd +ixLqotcrYASAAFmpFGWuPosRK7ISC8lRaJEKaJIH+T/xadIAnQAe3F8DvQEO3QKOEYwQLeYS/IKm +FaACBQDRD4oT+gEiHeAM1QBY3mHSoNEPAAAA+iBoHaALRQBY3nJkrGoa3ESLEtMP6qLVK2AEgABZ +qPrj3E0dBWYAAIsRK7ISC+lRyJlokgf5P+4R0gCdAI4RjBADvQEt5hL8gqYVoAIFANEPGtwzixLq +ot8rYASAAFmo6mWtlosRK7ISC5lSaJEKaJIH+T/sKdIAnQAf3DeCEe+/AgPoFwAA7yYSJuoBAAAs +0OXA4Q7MAizU5fKCphXgAgUA0Q+KE/oBAh3gDNUAWN4z0qDRDyN9BSM8gCsw5cDBDLsCCwtH+nym +He/gEgAAABrcFIsS6qLXK2AEgABZqMplrReLESuyEgvpUWiRCmiSB/k/6DHSAJ0AHdwYA7wBDcwC +jREs1hKLEPqCphXgAgUA0Q8AAAAAAPbgAEMwCwUA+sBoHaCMBQBZpuDBUOoSAitYBIAAWN6AKzDl +BbsC+nwmHae7AQD6fKYd794SAAAAKzDlwMgMuwILC0f6fKYd792+AIoT+gDiHeAM1QBY3gPSoNEP +ihP6AgId4AzFAFjd/9Kg0Q+KE/oBQh3gDMUAWN370qDRD4oT+gEiHeAMxQBY3fbSoNEPAIoT+gEC +HeAMxQBY3fLSoNEPihP6AkId4AzFAFjd7tKg0Q8AihP6AiId4AzFAFjd6dKg0Q+KE/oAwh3gDMUA +WN3l0qDRD4oT+gDiHeAMxQBY3eHSoNEPihP6AMId4AzVAFjd3NKg0Q8AbBAEJCIQZEBsKTAQKjAR +LDAa6zASLM4CgAAKmQLqMBMszgKAAAuZAuswGSzOAoAACpkC6jAYJIURAAAIqhELqgLrMBstVgKA +AAyqAgiqEQuqArGq6iYWJISNAAApIhLr27wUwCiAAAubASsmEixABS0KlX3BScAg0Q8ALjAULzAV +6DAWL3YCgAAP7gLvMBcvdgKAAAjuAgjuEQ/uAv3XYABQjQUALyISePckwKX9t1IFoDsFAFmt1MAg +0Q8AAAAA+oBoHaALZQBY+MjAINEPAIwnKckUi8n5hAAVr8oFAOqIAQTJAQAA6cUUJdsBAADrxgkk +QQEAAHi7Bi7BFavrm8kY25XZsPgACB2gD0UAbfoCCQJhHNt7nLCKIP1AABUwDEUADKoCmrEpMBQq +MBUe24vvMBYszgKAAAqZAuowFyzOAoAAD5kC7rYCLM4CgAAKmQLptgQhwCEAAOgGAAX4YQAADwCK +KiISiSINqgLqJhIs9+YAAPpAaB2gDTUAC+AAY/7pAGwQBiggBCkKGHmBA8Ag0Q8qIhIkIhDTD/NA +CkfSAJ0AL0Bu0w8PAgD95wCA0JxVACtABXyx1RzbafxACBXgCiUA/oAIFaA7BQBZrY76gGgdoA0l +APxMph3gCxUAWPiCwCDRDwAc21+NII42LzEL+GPwFaAKVQD4IAYVoDsFAFmtgRrbWCQiGCwxC4gs +iUqFR/0AAEQwCwUA+EGGFaANBQDlUg4kkEqAAC1GHgqeAv6BRhWgAB4AK0Ie61oIAdiBAABZpgov +Qh4uMQuNQK/uLkYeKlAELFAFGNtE61AGLVYCgAAMqgLpUActVgKAAAuqAuzbPx0uAoAACVUCCFUB +9KBgFe/4xQD4oAQCsDsFAP6gaB3gClUAWa1bKiITKTELK0IeDwIACpkI6SYTIsDBAAD5f/bFIgCd +AB3bLixCCg3MAexGCilQBIAAWPWJ+kBoHaALBQD8AAIdoA0lAFg2n8Ag0Q8ALyITLjEL+kBoHaAL +BQD/wABHcAwFAP5CZhWgDSUAWDaWwCDRDwAAAGwQBhzbGS0iAC4yBfRA6BWnVQEA/r/AFeAIFQAP +jzn0goIVoApVAPQgBhWgO0UAWa0yiSJlkJgmIAcX2tgGBkHqMgUrRwKAAKeIK4KeJKwf+bWkBeRE +HQB0s3wogp0Jaworsr8LiAHthAAEA6mAABza9gwAh21JAggCYYg0HtrXntCJIBza2erWAybYQQAA +7NYCLM4CgADpSQIB4IEAAOnWASlQBIAAC4AADG8Rp//k9p0ilHUAAIon+gFCHeAMBQD7RAAVoA2l +AFhosdKg0Q/AINEPAAAAAP/+LA2gCAUA6iQACmgEgAD6wwAV4AwFAFhzpcAg0Q8AbBAEhycqeRQf +2tL44qQV780FAOhyCCVQBwAA7HILJVKBAADqk3dz2IEAAA27AauZ6MF0dMkBAAAujQHqdRQnUoEA +AOqTcXwwBIAAeaF9mnjvAAULOASAAAcCYQcCYQcCYQcCYQcCYQcCYQcCYQcCYQcCYQcCYRfaoJdg +hSCTZZRk87V4BaAHpQDiZgIqrgKAAAdVAuVmASsQBIAA0Q/AINEPAAAAAAAA94BoHaAIBQD44WYV +r/5yAAiaDAq6DCqtASqs4PrhBhWv/iIALLxA/OEGFa/99gAAbBAEx48IWAMIOAIISAOoaOgiCAuB +CoAAAiIYojLRDwBsEAQEOAMIWAOoaOgiCAuBCoAAAiIYojLRDwAAbBAEBDgDCFgBCEgDqGjoIggL +gQqAAAIiGKIy0Q8AAABsEAQFSAMIOAEIWAOoaOgiCAuBCoAAAiIYojLRDwAAAGwQBCMiECgwBfhC +SBXglCUAdIlI/yigAxCNBQB4nz1wnxnq2oAUvViAAAqaAfpCRhWgAgUA0Q8AAAAAAP209gWgClUA +/GAIFeA7BQBZrJcrMG7TD2mxBSwwBXTBBsAg0Q8AAAD6YGgdoA0lAPxMph3gCxUAWPeGwCDRDwCM +Jy/JFIvJ/4QAFa/IBQDo7gEH+QEAAO/FFCXbAQAA68YJJ3EBAAB+uwYpwRWrm5vJHNpT2bD8AAgd +oApFAG2qAgkCYRzaOZywiSAe2k77/+IdoAxFAOq2BCzOAoAADJkCmbEoIhKPIp6yDYgC6CYSL/uG +AAD6QGgdoA01AAvgAMAg0Q9sEAQT2koDIgLRDwBsEAYmIAeIIhzaD/RCCBXhZgEA5YJ7a08CgACs +mSiSnhraCPcAE4rSAJ0AJJKdCmgKKIK/CEQB6NocEhLpgAAnIhKKKfhBSBXgd0EAlxAIdwoncpDq +mQwD2MEAAPsgD7PiAJ0AKyAWKAr/eLES+kDwFaAMBQBYcQzs2fMVEaGAACshBx3aAPm0TgXquwEA +79oAHd8CgAANuwKbQIgg+7RGBeBKBQD6gGYVoAZVAO9GAix2AoAABu4CnkEtIhKOEC8hGvu0MgWi +3VEA6u4RDu2CgAAN7gIL7gL7BgAMMd4xAKndLdCA6EYEL/oCgACfRg19DO5GBybowQAAnUUqIhWL +KfdAAEV/6QUA57sIBVDBAADqJhUl2MEAAOsmCSJQgQAA+IALbGIAnQAb2fHEkPoACB3gDQUACgJh +CgJhCgJhKUQgLUQkLUQnLUQm/ISmHe+KBQAqRCEvUhH+h2Yd6P8dAP6HRh3o/x0A/ocmHej/HQAv +RDguIhb+h+YdqO4dAP6Hxh2o7h0A/oemHajuHQAuRDyKNBjZ5+/Z2xHwYQAA9UAGGBD59QDuBgAC +UKEAAAoAiilEMChEMf6GRh3v/vUALkQzijQtRCP6huYdqP0dAP6ERh3o6h0A/obGHajuHQD+hqYd +qO4dAC5ENOsABQJJAQAACQJhKCAHCAhBDIgRrIgmhp0rIBYvCv9/sQr6QPAVoDwFAFhweog0aIAn +iif6AIId4AwFAPtEABWgDUUAWGeCKyISLPp/DLsB+kJGFeACBQDRDx7Zuy0iEg7dAvxCRhXv/y4A +2iBYcLLs2XoVcCmAAGAAK4heGdmusYiYXgmIAviGZh2o+B0A/oZGHej/HQD+hiYd6P8dAP6GBh3v +/N4AwCDRDwAA62wYKVAEgAD8ACIdoA1VAFhyYcAg0Q8A62wSKVAEgAD8ACIdoA0FAFhyW8Ag0Q8A +bBAGJCISKgqO6SITInxsgAAoMQupiPhCZhWgCQUA6SYRLJAEgADRDy8iGC/wdHrxVCggBRrZj+nZ +jxQCWYAAKzELCkQBJCYSjTksIhN9mD8uIhGrzOwmEyJlnoAAZOCSjex91yCI6/vAaB2gCwUA/AAC +HaANJQALgADAkOkmESyQBIAA0Q/AINEPAAAAAAAA/bL0BaAKJQD+QAgVoDsFAFmrjSoiECmgBSsK +lXuR1sDC/EymHaALFQBY9oDAINEPHNlvjeD/wLAVoApVAPQgBhWgOwUAWauALSISwJD4QiYV7771 +AA7dAe0mEiyQBIAA0Q8A2iBY87PAkOkmESyQBIAA0Q9sEAgqIhIPAgDzQA8n0IjlAC0iGCvQdPlg +DrQiAJ0AKSAFHNlW79lWFI5BgAAMqgIqJhLzQCc7UgCdAI4sKDIGJDAg/GFEFa/1xQD/ACetJUQB +AAwMTv2bYBWgJlUA9YAEBnCFtQD1YBLUYCcVAA+oAqzp+EGGFeA7FQD4QkYVoCwlAPaCRg3gCgUA +dkEKe0EH/IAoPSIAnQAtMDAqIhAuMDEvMDLqoHAu7gKAAA7dAu4wMy7uAoAAD90C6N0RBXgZAADu +3QIPggqAAA0OGfXAI9dV/QEACuURBfUClRH6IAYVoDsFAP2yTgWgClUAWas5HNjjG9klLMKgLyIY +K7KKpczv8HQuZkKAAKy7+kImFeCItQDqsAUt6ASAAPngGDUgnqUA/0AX9CCYtQD5QBe0IgCdAPVA +F3CQmZUA+UAgpWAPRQD2gAV8YgCdAPaABTwiAJ0AKTBBLDBALjA8KjA96DA+LmYCgADpzAIPdgKA +AAruAikwP+owQi92AoAACO4C6DBDLmYCgADqzAIPdgKAAOnuAg5mAoAACMwCDsgM6iIQJASLgAAl +ohJ+UQgF6AxmgAIuphIuohN84QgOyQxmkAIsphOKvA+qApq8dkE9w8H8gAl8IgCdAPaAD4xiAJ0A +wuL+gBd0IgCdAC8QEGXzEsAg0Q8AACgwI8CRCJg5KLRBKBQQ9p/6XSIAnQAqMCF/p7spMEEsMEAu +MDwqMD3oMD4uZgKAAOnMAg92AoAACu4CKTA/6jBCL3YCgAAI7gLoMEMuZgKAAOrMAg92AoAA6e4C +DmYCgAAIzAIOyAzqIhAkBIuAACSiEn5BCAToDGaAAi6mEi6iE3zhCA7JDGaQAiymEy4wOCgwOYy8 +6TA6L3YCgAAI7gLoMDsvdgKAAAnuAurYuh92AoAACO4C78wCB3AFAAAuJhacvPthZhWv/LYAAAD4 +AGIdo5rhAPkf7PZiAJ0AKDAkKTAl6zAmLEYCgAAJiALpMCcsRgKAAAuIAgiIEemIAgZYEQAA+W0A +Dj/1vgAAKTAh8SAHzhIAnQAqMCQsMCXuMCYtVgKAAAyqAuwwJy1WAoAADqoCCKoRDKoCZaDPLDBM +LjBN7zBOLmYCgAAOzALuME8uZgKAAA/MAgjMEQ7MAuoiECYFaYAALqIY/cAFE6IAnQAsthIqMEgu +MEnvMEotVgKAAA6qAu4wSy1WAoAAD6oCCKoRDqoCKrYUKTA0LjA16jA2LM4CgAAOmQLo2HsczgKA +AAqZAvpm8BWgDgUALrYVLrYT6LYLLM4CgAAKmQL5YaYV7/iGAC4wOC8wOegwOi92AoAAD+4C7zA7 +L3YCgAAI7gII7hEP7gLs2GkXcAUAAC4mFv1hZhWv97IAACoiEC+gBSgKlfn/7wQiAJ0AwJL4TKYd +4AsVAFj1ZsAg0Q8c2FztsgAtcASAAPpCSBWgOwUA+iAGFaAKVQBZqmQtIhL6QggVoE4FAA7dAi0m +Ei4wQSswQCwwPC8wPe0wPi3eAoAA7rsCDmYCgAAPzAIuMD/vMEIuZgKAAA3MAu0wQy3eAoAA77sC +DmYCgADuzAIN3gKAAA27Agy9DPe/6mgSAJ0ALaISfNEIDc8MZvACLKYSLKIT+5/pnGIAnQAMuAxm +jSj7QmYV4AIFANEPAAAAKjA4LDA57jA6LVYCgAAMqgLsMDstVgKAAA6qAgiqEQyqAunYKRVQBQAA +KiYWmbuK1yk8IPtByBWgCzUAbboFCQCGCgJhwCDRDykiEWSQf4mXiZ75JgAV4AtlACo8INMPbbkF +CiCGCQJjwCDRDwAAKiIQY/68AAD/7jANr/X1ABzYEy8wMCkwMY6w6DAyL/4CgAAJ/wLpMDMv/gKA +AOj/Ag1oBIAA6DAgL/4CgAD55gAP8AolAPggBhWgOwUAWaoQwCDRDwAAAPpCJhWv/ZIAidcrMQuJ +nr+7C0tL5b98ZMjBAABj/DUAbBAGKyIHJiAHDwIAKLkUBQ1H9WHIFaFmAQDjsgkkDlGAAPmgEFFS +AJ0AHNfvKCIA/2BIFaAKVQD9v8AV4AkVAO2dOQl4BIAA+CAGFaA7BQBZqfEc1+b8YBAV4ApVAP5K +EBWgOwUAWansF9eU5deTG08CgAD0wAvCEgCdAKeZKpKe90APWlIAnQAqkp0Faworsr8LqgFkoaUr +IQcpIEAvIAf1rzIF6rsBAO3X0R3fAoAA9SALmJHvAQD1IAkZEgCdAPWACNqSAJ0AwMD5r5QFoP8R +AOkhCC/6goAAD7sC7bsCD3QCgAAOmQIImQKboI4gmKb1QEYV4D8FAPlAhhXgDUUA/0BmFeAJBQDp +pgUlWIEAAOmmBy92AoAA/cYAD3APJQDupgEudgKAAO/uAgVJAQAAAyCGCwJjAwCGCwJh/0EmFa+V +dQAEgIYJAmkEYIYJAmcEQIYJAmXoIhIrTwKAAKeZ7ZadISEhAAD1DEYNr2eFABbXoSMiEg8CAAc5 +CCqSJyWUfSySJiymACuSJvtgJhWgCAUA6JYmIZuBAADolicp0ASAAFmnmPoAoh2gOwUA7GQACegE +gABZqZcvIhLA4dMP9e8AD7ANBQAP7Thk36TlJAUpUASAAFmni8Ag0Q8A/IBQFa/7ngD/+NgNoAMF +ABzXMIvIarF/DGkRp5kokp73AARyUgCdACqSnQVtCi3Svw2qAWSgfLC+nshlrnlgABwAAAAAAAAA +/BBCHa/6fgAvIEAI/xD+YAYV7/fCAI8iZPBfHNdu7iIAKWgEgAD54GgdoAkVAP8tAAxwClUA+CAG +FaA7BQBZqWzAINEPAAAA//iEDaAKBQDAoFmk8BzXDIvI+X/7kJIAnQD//jQNoAoFAMCgwNoNvTT9 +gQYV7/36AAAAjzDqJAADWGEAAP+uqAWn/8EA/kgGHeAMFQD+YAYVoA1FAFhv+P5ASBXv/d4AbBAI +iScrIAcomRT04AAGcbsBAOaSCSQICYAA+YAJ4VIAnQAtIEEc1vDk1vAdmASAAPGzTA3gBUUA9gAC +HeANBQD1YAbaEgCdAAy6EaSqLqKe9cANG+IAnQApop0Mvgou4r8OmQHqlAAEiemAAC8gQWXxZhzW +8RnXKighBy0gBx7XKf5BBBXqiAEA/CAABfDdEQDq3RAMRwKAAO2IAg3cAoAAC/8CDv8CCYgCmKCI +IJ+k/0DGFaANBQCdpf1A5hXgOwUA/UBGFaAJRQDrpgMsRgKAAAmIAuimASVIgQAABiCGCQJjBgCG +CQJh/OAAFbAMJQAMuwKbqQw6EQSqCPVTphXvmXUA6SQFKVAEgABZpwrAINEPAAAAAP/7/A2gBgUA +H9awjvj3wAa4kgCdAAw6EaSqKKKe9QAHg+IAnQAqop0MOAoogr8IqgHkoN5nS/0AAJn4+UBoHe/8 +OgAqIEAIqhD6wAYVr/r6AI+eLfAEJ/AFHtbO5fAGLu4CgAAH3QLv8Acu7gKAAAXdAgjdEQ/dAg7d +ASXcZ/SOAArwh5UA9KCAFe/6fgCPIusWBCeEeYAAHNbh7iIAKWgEgAD54GgdoAkVAP8tAAxwClUA ++CAGFaA7BQBZqN3AINEPLNxI69xnKXAEgAD+wGgd5LsdAFmnwmP+fwAAAAAA//mkDaAJBQCbFPwg +phXgCgUAWaRYH9Z0jRWO+IsUHNZ0+d/4gJIAnQD//LgNoAoFAMCgwMoM7DT94QYVr/x+AAAAAI1g +6iQABdhhAAD9rXgFp93BAO0kQCroBIAA/MAGFaAMFQBYb17+QEgV7/0yAGwQBoknIyAHKJkUAwNB +5pIJJAcxgAAU1lv1rLIF54UBAPkACKFSAJ0A9GAGmhIAnQAMORGkmSqSngU7Ciuyv/dACepSAJ0A +KpKdC6oBZKD3KSAHKyEHHNaY+0AABfDZEQDq3RAN3wKAAA27Agy7ApugjiD5rK4FoD8FAP9AZhXg +DUUA6KYCL3YCgAAN7gKeoSwgQfoAAh3gDwUA+UQAFeHpAQDlwNFvdAKAACwhCJ+lDswCHtaCn6ee +pg7MApykBiCGCQJjBgCGCQJh/WAAFbAMJQAMuwKbqQw5EaSZ/TOmFe+YdQDoJAUpUASAAFmmeMAg +0Q8AAAAA//xoDaAGBQAX1h6LeGqxfww5EaSZLZKeBTwK7MK/KAQKgAD3oAQKUgCdACqSnQyqAeSg +dWXr/QAAnXhlrxlgAA4uIEAI7hD+wAYVr/uaAACPImTwZRzWYe4iACloBIAA+eBoHaAJFQD/LQAM +cApVAPggBhWgOwUAWahbwCDRDwD6ESId7/y+AP/7JA2gCgUAwKBZo96LePl/+6iSAJ0A//5gDaAK +BQAAwKDAygy8NPzhBhWv/iIAAAAAAI9g6iQAAdhhAAD/rIwFp//BAP5IBh3gDBUA/sAGFaANRQBY +bub+QEgV7/3GAGwQBIoqjq8Y1j3oJgshSIEAAOnmACV44QAA7yYIKVgEgAD+QSYVoAwFAPlB5hXv +mIUA+ECmHaANJQBYbVLAINEPAAAAbBAEG9YuKjEM0w8rsn8c1g/4YhAV4BRlAPtD9g3gBQUAfKEX +6iQACtgEgADsNAAKaASAAFjydMAg0Q8AaJFBaJIhaJQJwED//2QNoAUFAHyh0XurztowWPKi1aD/ +/xANoAQFAP1A5g2gFGUAe6MCYAABwEDaMFjyuf/+nA2gBQUA2jBY8s3lpAAFARGAAP2sGAWgClUA +/GAoFeA7BQBZqAf//fwNoAQFAAAAAP/90A2gBMUAbBAEKTAT8SYADeD1hQBokQPAINEPhCeEThzV +/e0wESJAFwAALYRi/mJQFaAKVQD/DGYdoDsFAFmn9CpNBOwwESHYYQAAWPLe5TsIAlAXAADsMBIl +U4EAAFjy2eokAApYBIAAWPQvwCDRD4QnDwIADwIAhE4c1egtMBEtRAL+YlAVoApVAP6AZh2gOwUA +Wafe6zwYIlALAADsMBElUyEAAFjyx+U7CAJQDwAA7DASJVKhAABY8sPAINEPAABsEAT0QGAl6LMd +ACNUV/qqxh3gRDUA9KqmHaAIdQD4qoYdoAkFAPiqZh3gSgUAKlRS0Q8AbBAEjzj9q5AFoApVAPxi +EBXgOwUA/+BoHaH/8QBZp74pMBDq1cIUjJEAAGiSWWmUEog2IqJ/CYgRqCIoIAUpCpV5gV7AINEP +AAAA2jBY9Qb/XwAN4Al1AIuni74sso4MnVb9I0Ad6Oy5AMDTftAQ+2BAJeAMBQBY9NDAINEPAABY +8+vAINEPAIs2KqJ/CbsR+0AARXALBQBY83jAINEPAAAAAMCl/atEBaA7BQBZp5r6QGgdoAslAFjy +kMAg0Q8AbBAEiC4jLDhziQXAINEPAACLLoiz7EQACugEgADrvOApUASAAAuAAIwi7SAFLn7uAABk +39WOLnPp1mP/zQAAAGwQFisgB4c1IxYaiDTlFhcqSASAAJkc6hIXKfgEgAD/4eQV4AMVAPIh5hXg +yFkA/CNmFaG7AQArFhb8I0gVoL95APoiZhXnqgEAKhYVG9V5LsE9LcIf/CIGFeP29QD7b8QV4Hf5 +AP4iRhWgSFEA/YOwFaw4HQDrOwwEVD6AAA8ISfghxhWgABoAlh78IAYdr7sBACsWFPVAPCESAJ0A +jyL74EGgkgCdAPDlcA3gCgUA6hYRI4BJgADaMFj9afQAAh3gBgUALRIb2nD6AGId4AwlAO28OQpY +BIAAWP1R90AAQzAO9QB24FT0IWYVpPYdAOMWCif4BQAA/iMGFeABOgAAAAAoEhJkh2IpEhqJlX2W +nisSEiwSEPwgaB3gChUA6hYRKdAEgABY/X9mp5L6AGId4AUFAAq1OmRXfMNglBvyIUYV5MYdACwW +GC0SFhzU2B7U2uPU2h6gBIAA9aAJOhIAnQDpEhgutwKAAKNmKGKe+QBBI+IAnQAmYp0O2Aoogr8I +ZgHbYOa0AAW9gYAAj8ibFffgPeiSAJ0AKTKu6tUmFLuBgAAuMq0tomDt6wEH0/0AAP3AOuZiAJ0A +msj9wDr+YgCdAI0cLCAUDwIArcwMDEcsJBT1gDx+UgCdAC4SGykSFPHAwA3gCDUA+QA9iOIAnQBk +UM6KGw8CAMihZFBj62QACVAEgAD8AGIdoB2FAFj9c+4SDi14BIAA5hIKIq+ZgAAc1QYtEhP5qWoF +4AoFAJrymvOa9Jr16WkCD0QCgADp9gAu6IKAAOjdAgr2woAA/6YADrAbxQD94CYV4ApVAFmm7SsS +FflgOClSAJ0AwCDsEhgqbwKAAKPdLNad0Q8AAAAAAACPyPfgOOCSAJ0A6RIYKjcCgACjZihinvkA +OTviAJ0AK2KdDk0KLdK/DbsB5rQABbjZgACw/p7I+sBoHe/7FgAvEhHTD2Twd+sSBSlQBIAA/ABi +HaAdhQBY/UAZ1NgW1NWOGigQACZinwnuAhnUqQgfFOaGCw/7AoAA6f8CBHyggAAsEhDtEhIjW/8A +ACiyPyuxfZ6gn6Gdopyjm6T5QKYVoAByAAAsEhAtEhIrYQWIY56gn6GbopijnaScpSasGC0SE4we +At0Q7RYHLmQCgADsFggrpv4AABrUaPghSBWgDwUA/iDGFeAPJQCfHQqIAigWCetkAAlQBIAA/ABi +HaAdhQBY/RWNGS8SGokWKxIaj/XxNdAN4/71ABzUqYu0/0BGFaCPmQD9QAYV4G+JAP1AJhWg36EA +8NAAEzDPkQDu1KEe6UKAAO6mAyxBAoAA/QYADHm7AQDrpgQuYMKAAAxmAghmAiamBSwSDemcASUw +YQAA6RYGJmP9AADsFg0ue6YAAOtkAAlQBIAA/ABiHaAdhQBY/PEW1IyJF48Y+iEoFeANBQCdEZ0S +nROdFJ2k/UCmFe/+9QCeop6jm6AuEhrp/wIKxsKAAOj/AgDgMQAA5v8CANghAADtHBAlMGEAAO+m +ASDQEQAAWPvA+UBoHeAMFQDqyTkNKASAAOkWHiUgCYAAJBYf/gAiHaANBQAJ7TjlFiAm6uGAABPU +bIgYjBca1GsrEhuEGhXUOvF4ABSwDhUA6+s5CieCgAD0hgAKdg8FAAuvOf0mAAywDTUA+SYADDAM +JQAL3DksFh0J+QIpFhn55gAPsAUFAP4jhhXgAwoAAA9WUP4YAAXwz8kA/CEoFeCPsQD9QAYV4O95 +AOzuEQxEAoAA68wQDdqCgADsuwILM8KAAPjGAAswz4EA/YgAFjGPaQDs7gIMRQKAAAjuAhzUFJyh +KBAABu4C+8YAD3BvuQD0yAATO78BAPfGAA8wBiUA5u4CDd0CgADupgQsQgKAAAuIApilG9Q2m6IY +1Db5QGYVr/mOAJmhlKCeop6jnqSepZ2mnaedqJ2pLxId5VwBJTChAAD+oBGcYgCdAOtkAAlQBIAA +/ACCHaAthQBY/IbkUFFqzsKAAPSgCmCSAJ0AKxIcx+/7JgAM8A0FAOOZAgv9LgAAjRMsEhqOEo8R +i8wswhCZoZup9UAGFaAIBQCYopimn6OepJ2nnKWMFP1BBhWv/iYALRIbLBIZG9QPDJkC65kCBoQZ +gADw4kAN7/71AJmhlKCeop6jnqT/QKYVoA0FAJ2mnaedqP1BJhXv/TYALxIaIhYhK/IWJvE4IvE6 +LPIV6PE5KzQCgAAGIgIm8Tst8hvu8hosRAKAAAhmAijyFy/yGZ+inqOdpJymm6eYqJalmaGUoJKp +8iQoFa/79gAAAAAAAAAA8OJADe/79QCZoZSgm6Kbo5uk+0CmFeAIBQCYppinmKj5QSYVr/s6ACwS +Go0SL8E7JsE5KME4LsE668IYKzQCgADm/wIMRAKAAAjuAibCFIjMLMIQm6SYp5aomaGdopSgnKOf +pZ6pjBT9QMYVr/oaACsSG+wSGSWDUYAAG9PNx+/9JgAMsA0FAOuZAgOA8YAAmaGUoJ6inqOepJ6l +naadp52o/UEmFe/5MgAuEhoiFiEt4hIs4hMr4hiI7YbuL+IUgu8u4hGeop2jnKSbpZimlqefqZmh +lKCSqPIkKBWv+FYAKxIcx9/7JgAM8AwFAOOZAgOA8YAAmaGUoJ2inaOdpJ2lnKacp5yo/UEmFa/3 +mgCZoZSgjhP+ICgV4AgFAJiimKOYpJimmKeYqJ+l/0EmFa/3CgAqEhoZ05+KpRPTNCUSIOQSHyVM +MIAA49MwE4O5gAAc05mLGgy7Avs/RhXv56IAhR/A0vetAAr/6CYAwKX9pyYFoBvFAO4+EQnoBIAA +WaV5Y/hnAAD6IogVoA4FAJ4RnhKeE54UWPrEJBYf5RYgJWJhgAD6IogVoAsFAFj6tyQWH/QkBhXv +8NoALxIQZfiWY/g6GtNSiBoKiAL5P0YVr+XWAMCgWV6iyKcb03krsIBksFoqEhRY+rDpEh4tX04A +APoiiBWgCxUAWPqk+CPIFe/vWgAAAP/gJA2gNgUA6xISKdAEgADsEhAo6ASAAFj7c2P4VgAAKxIa +jBztEhcpUASAAFhnOtKg0Q8AAAAA+6bCBaFLFQBZjl8sGgAMrAL7prgFoUsVAFmOX2P/hQAAwLDA +2g39NO3GCC3FTgAA+kBoHaAbxQD8AAIdoA0VAFhr3WP/oQAAAAArEhb6QGgdoAwFAO0SGCXYYQAA +WGvWY/+EwKBZoLkc0taPyPn/wciSAJ0AY/+32iBb6/lj+GyKJ40cwMDqrCAu2ASAAFhgzNKg6xIY +KmcCgACjzCvGndEPAAAAAAAA/9+gDaAGBQD/4UgNoAVFAMCgWaCkHNLAj8ge0sH5/8a4kgCdAP/j +8A2gBgUAAAAA/+OUDaALBQDA2g39NP2BBhXv45IAAAAAbBAEFNMlgiAkQn8T0yQEIgwDIgLRDwAA *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Nov 30 01:17:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B35C7C5B9C2; Wed, 30 Nov 2016 01:17:03 +0000 (UTC) (envelope-from brooks@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 8266B15CA; Wed, 30 Nov 2016 01:17:03 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU1H2WZ053017; Wed, 30 Nov 2016 01:17:02 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU1H2Yx053016; Wed, 30 Nov 2016 01:17:02 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201611300117.uAU1H2Yx053016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 30 Nov 2016 01:17:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309303 - stable/11/sbin/dhclient X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 01:17:03 -0000 Author: brooks Date: Wed Nov 30 01:17:02 2016 New Revision: 309303 URL: https://svnweb.freebsd.org/changeset/base/309303 Log: MFC r309027: Allocate a struct ifreq rather than using a (wrong) computed size for the BIOCSETIF ioctl. The kernel always copies an entire struct ifreq and IPv4 addresses will always fit in an ifreq. On systems with pointers larger than 64-bits, the computed size will be less than the size of struct ifreq, potentially resulting in the kernel attempting to copyin memory from outside the allocation. Reviewed by: jhb Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D8445 Modified: stable/11/sbin/dhclient/dispatch.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/dhclient/dispatch.c ============================================================================== --- stable/11/sbin/dhclient/dispatch.c Wed Nov 30 00:26:35 2016 (r309302) +++ stable/11/sbin/dhclient/dispatch.c Wed Nov 30 01:17:02 2016 (r309303) @@ -105,8 +105,8 @@ discover_interfaces(struct interface_inf if (foo.sin_addr.s_addr == htonl(INADDR_LOOPBACK)) continue; if (!iface->ifp) { - int len = IFNAMSIZ + ifa->ifa_addr->sa_len; - if ((tif = malloc(len)) == NULL) + if ((tif = calloc(1, sizeof(struct ifreq))) + == NULL) error("no space to remember ifp"); strlcpy(tif->ifr_name, ifa->ifa_name, IFNAMSIZ); memcpy(&tif->ifr_addr, ifa->ifa_addr, From owner-svn-src-all@freebsd.org Wed Nov 30 01:22:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5819CC5BC02; Wed, 30 Nov 2016 01:22:13 +0000 (UTC) (envelope-from brooks@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 275BB19D8; Wed, 30 Nov 2016 01:22:13 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU1MCc3056869; Wed, 30 Nov 2016 01:22:12 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU1MCxu056868; Wed, 30 Nov 2016 01:22:12 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201611300122.uAU1MCxu056868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 30 Nov 2016 01:22:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309304 - stable/10/sbin/dhclient X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 01:22:13 -0000 Author: brooks Date: Wed Nov 30 01:22:12 2016 New Revision: 309304 URL: https://svnweb.freebsd.org/changeset/base/309304 Log: MFC r309027: Allocate a struct ifreq rather than using a (wrong) computed size for the BIOCSETIF ioctl. The kernel always copies an entire struct ifreq and IPv4 addresses will always fit in an ifreq. On systems with pointers larger than 64-bits, the computed size will be less than the size of struct ifreq, potentially resulting in the kernel attempting to copyin memory from outside the allocation. Reviewed by: jhb Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D8445 Modified: stable/10/sbin/dhclient/dispatch.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/dhclient/dispatch.c ============================================================================== --- stable/10/sbin/dhclient/dispatch.c Wed Nov 30 01:17:02 2016 (r309303) +++ stable/10/sbin/dhclient/dispatch.c Wed Nov 30 01:22:12 2016 (r309304) @@ -105,8 +105,8 @@ discover_interfaces(struct interface_inf if (foo.sin_addr.s_addr == htonl(INADDR_LOOPBACK)) continue; if (!iface->ifp) { - int len = IFNAMSIZ + ifa->ifa_addr->sa_len; - if ((tif = malloc(len)) == NULL) + if ((tif = calloc(1, sizeof(struct ifreq))) + == NULL) error("no space to remember ifp"); strlcpy(tif->ifr_name, ifa->ifa_name, IFNAMSIZ); memcpy(&tif->ifr_addr, ifa->ifa_addr, From owner-svn-src-all@freebsd.org Wed Nov 30 01:41:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6808AC5BF40; Wed, 30 Nov 2016 01:41:41 +0000 (UTC) (envelope-from brooks@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 3716C11C9; Wed, 30 Nov 2016 01:41:41 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU1feuf065107; Wed, 30 Nov 2016 01:41:40 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU1fejq065106; Wed, 30 Nov 2016 01:41:40 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201611300141.uAU1fejq065106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 30 Nov 2016 01:41:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r309305 - stable/9/sbin/dhclient X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 01:41:41 -0000 Author: brooks Date: Wed Nov 30 01:41:40 2016 New Revision: 309305 URL: https://svnweb.freebsd.org/changeset/base/309305 Log: MFC r309027: Allocate a struct ifreq rather than using a (wrong) computed size for the BIOCSETIF ioctl. The kernel always copies an entire struct ifreq and IPv4 addresses will always fit in an ifreq. On systems with pointers larger than 64-bits, the computed size will be less than the size of struct ifreq, potentially resulting in the kernel attempting to copyin memory from outside the allocation. Reviewed by: jhb Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D8445 Modified: stable/9/sbin/dhclient/dispatch.c Directory Properties: stable/9/sbin/dhclient/ (props changed) Modified: stable/9/sbin/dhclient/dispatch.c ============================================================================== --- stable/9/sbin/dhclient/dispatch.c Wed Nov 30 01:22:12 2016 (r309304) +++ stable/9/sbin/dhclient/dispatch.c Wed Nov 30 01:41:40 2016 (r309305) @@ -105,8 +105,8 @@ discover_interfaces(struct interface_inf if (foo.sin_addr.s_addr == htonl(INADDR_LOOPBACK)) continue; if (!iface->ifp) { - int len = IFNAMSIZ + ifa->ifa_addr->sa_len; - if ((tif = malloc(len)) == NULL) + if ((tif = calloc(1, sizeof(struct ifreq))) + == NULL) error("no space to remember ifp"); strlcpy(tif->ifr_name, ifa->ifa_name, IFNAMSIZ); memcpy(&tif->ifr_addr, ifa->ifa_addr, From owner-svn-src-all@freebsd.org Wed Nov 30 02:00:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45109C5C761; Wed, 30 Nov 2016 02:00:31 +0000 (UTC) (envelope-from emaste@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 14B3F1BD0; Wed, 30 Nov 2016 02:00:31 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU20Utl069283; Wed, 30 Nov 2016 02:00:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU20UGb069282; Wed, 30 Nov 2016 02:00:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201611300200.uAU20UGb069282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 30 Nov 2016 02:00:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309306 - head/sys/dev/netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 02:00:31 -0000 Author: emaste Date: Wed Nov 30 02:00:30 2016 New Revision: 309306 URL: https://svnweb.freebsd.org/changeset/base/309306 Log: netmap: add cast to fix powerpc64 LINT kernel Attempt to fix powerpc64 LINT kernel broken by r308000. Netmap's use of a uint64_t wchan seems odd, but in the interest of minimizing this change just cast through uintptr_t to silence the compiler warning. Reviewed by: jhb Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8669 Modified: head/sys/dev/netmap/netmap_freebsd.c Modified: head/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- head/sys/dev/netmap/netmap_freebsd.c Wed Nov 30 01:41:40 2016 (r309305) +++ head/sys/dev/netmap/netmap_freebsd.c Wed Nov 30 02:00:30 2016 (r309306) @@ -1024,7 +1024,7 @@ nm_os_kthread_wakeup_worker(struct nm_kt mtx_lock(&nmk->worker_lock); nmk->scheduled++; if (nmk->worker_ctx.cfg.wchan) { - wakeup((void *)nmk->worker_ctx.cfg.wchan); + wakeup((void *)(uintptr_t)nmk->worker_ctx.cfg.wchan); } mtx_unlock(&nmk->worker_lock); } @@ -1090,8 +1090,8 @@ nm_kthread_worker(void *data) continue; } else if (nmk->run) { /* wait on event with one second timeout */ - msleep_spin((void *)ctx->cfg.wchan, &nmk->worker_lock, - "nmk_ev", hz); + msleep_spin((void *)(uintptr_t)ctx->cfg.wchan, + &nmk->worker_lock, "nmk_ev", hz); nmk->scheduled++; } mtx_unlock(&nmk->worker_lock); From owner-svn-src-all@freebsd.org Wed Nov 30 02:14:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD2F5C5CC81; Wed, 30 Nov 2016 02:14:54 +0000 (UTC) (envelope-from mjg@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 AD18113C4; Wed, 30 Nov 2016 02:14:54 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU2Erf8077245; Wed, 30 Nov 2016 02:14:53 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU2Er5q077244; Wed, 30 Nov 2016 02:14:53 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201611300214.uAU2Er5q077244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 30 Nov 2016 02:14:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309307 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 02:14:55 -0000 Author: mjg Date: Wed Nov 30 02:14:53 2016 New Revision: 309307 URL: https://svnweb.freebsd.org/changeset/base/309307 Log: vfs: avoid VOP_ISLOCKED in the common case in lookup Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Wed Nov 30 02:00:30 2016 (r309306) +++ head/sys/kern/vfs_lookup.c Wed Nov 30 02:14:53 2016 (r309307) @@ -807,10 +807,9 @@ unionlookup: * If we have a shared lock we may need to upgrade the lock for the * last operation. */ - if (dp != vp_crossmp && - VOP_ISLOCKED(dp) == LK_SHARED && - (cnp->cn_flags & ISLASTCN) && (cnp->cn_flags & LOCKPARENT)) - vn_lock(dp, LK_UPGRADE|LK_RETRY); + if ((cnp->cn_flags & LOCKPARENT) && (cnp->cn_flags & ISLASTCN) && + dp != vp_crossmp && VOP_ISLOCKED(dp) == LK_SHARED) + vn_lock(dp, LK_UPGRADE|LK_RETRY); if ((dp->v_iflag & VI_DOOMED) != 0) { error = ENOENT; goto bad; From owner-svn-src-all@freebsd.org Wed Nov 30 02:17:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32822C5CD39; Wed, 30 Nov 2016 02:17:05 +0000 (UTC) (envelope-from mjg@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 0254A15D7; Wed, 30 Nov 2016 02:17:04 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU2H4Sa077367; Wed, 30 Nov 2016 02:17:04 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU2H4ht077366; Wed, 30 Nov 2016 02:17:04 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201611300217.uAU2H4ht077366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 30 Nov 2016 02:17:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309308 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 02:17:05 -0000 Author: mjg Date: Wed Nov 30 02:17:03 2016 New Revision: 309308 URL: https://svnweb.freebsd.org/changeset/base/309308 Log: vfs: fix a whitespace nit in r309307 Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Wed Nov 30 02:14:53 2016 (r309307) +++ head/sys/kern/vfs_lookup.c Wed Nov 30 02:17:03 2016 (r309308) @@ -809,7 +809,7 @@ unionlookup: */ if ((cnp->cn_flags & LOCKPARENT) && (cnp->cn_flags & ISLASTCN) && dp != vp_crossmp && VOP_ISLOCKED(dp) == LK_SHARED) - vn_lock(dp, LK_UPGRADE|LK_RETRY); + vn_lock(dp, LK_UPGRADE|LK_RETRY); if ((dp->v_iflag & VI_DOOMED) != 0) { error = ENOENT; goto bad; From owner-svn-src-all@freebsd.org Wed Nov 30 02:35:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24F4BC5C7FF; Wed, 30 Nov 2016 02:35:53 +0000 (UTC) (envelope-from jhibbits@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 E1929121D; Wed, 30 Nov 2016 02:35:52 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU2ZqMu085003; Wed, 30 Nov 2016 02:35:52 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU2ZqvM085002; Wed, 30 Nov 2016 02:35:52 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201611300235.uAU2ZqvM085002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 30 Nov 2016 02:35:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309309 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 02:35:53 -0000 Author: jhibbits Date: Wed Nov 30 02:35:51 2016 New Revision: 309309 URL: https://svnweb.freebsd.org/changeset/base/309309 Log: Bring the powerpc DDB disassembler into the 21st century Bring in the most recent copy of NetBSD's db_disasm, to fix bugs and add more instructions. * Fix several bugs in the disassembler, most notably the disassembly of the rlwi* instructions, the original reason for bringing in this change. * Add more registers to the SPR list * Add more instructions to the opcode table Obtained from: NetBSD MFC after: 2 weeks Modified: head/sys/powerpc/powerpc/db_disasm.c Modified: head/sys/powerpc/powerpc/db_disasm.c ============================================================================== --- head/sys/powerpc/powerpc/db_disasm.c Wed Nov 30 02:17:03 2016 (r309308) +++ head/sys/powerpc/powerpc/db_disasm.c Wed Nov 30 02:35:51 2016 (r309309) @@ -1,13 +1,14 @@ -/* $FreeBSD$ */ -/* $NetBSD: db_disasm.c,v 1.12 2002/01/05 22:07:26 jhawk Exp $ */ +/* $NetBSD: db_disasm.c,v 1.28 2013/07/04 23:00:23 joerg Exp $ */ /* $OpenBSD: db_disasm.c,v 1.2 1996/12/28 06:21:48 rahnds Exp $ */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include #include -#include #include #include @@ -20,11 +21,13 @@ enum function_mask { Op_B = 0x00000002, Op_BI = 0x00000004, Op_BO = 0x00000008, + Op_BC = Op_BI | Op_BO, Op_CRM = 0x00000010, - Op_D = 0x00000020, /* yes, Op_S and Op_D are the same */ - Op_S = 0x00000020, - Op_FM = 0x00000040, - Op_IMM = 0x00000080, + Op_D = 0x00000020, + Op_ST = 0x00000020, /* Op_S for store-operations, same as D */ + Op_S = 0x00000040, /* S-field is swapped with A-field */ + Op_FM = Op_D | Op_S, /* kludge (reduce Op_s) */ + Op_dA = 0x00000080, Op_LK = 0x00000100, Op_Rc = 0x00000200, Op_AA = Op_LK | Op_Rc, /* kludge (reduce Op_s) */ @@ -37,10 +40,10 @@ enum function_mask { Op_const = 0x00004000, Op_SIMM = Op_const | Op_sign, Op_UIMM = Op_const, - Op_d = Op_const | Op_sign, Op_crbA = 0x00008000, Op_crbB = 0x00010000, Op_WS = Op_crbB, /* kludge, same field as crbB */ + Op_rSH = Op_crbB, /* kludge, same field as crbB */ Op_crbD = 0x00020000, Op_crfD = 0x00040000, Op_crfS = 0x00080000, @@ -50,7 +53,7 @@ enum function_mask { Op_dcr = Op_spr, /* out of bits - cheat with Op_spr */ Op_tbr = 0x00800000, - Op_L = 0x01000000, + Op_BP = 0x01000000, Op_BD = 0x02000000, Op_LI = 0x04000000, Op_C = 0x08000000, @@ -67,7 +70,7 @@ enum function_mask { }; struct opcode { - char *name; + const char *name; u_int32_t mask; u_int32_t code; enum function_mask func; @@ -78,7 +81,7 @@ typedef void (op_class_func) (instr_t, v u_int32_t extract_field(u_int32_t value, u_int32_t base, u_int32_t width); void disasm_fields(const struct opcode *popcode, instr_t instr, vm_offset_t loc, - char *disasm_str); + char *disasm_str, size_t slen); void dis_ppc(const struct opcode *opcodeset, instr_t instr, vm_offset_t loc); op_class_func op_ill, op_base; @@ -89,7 +92,7 @@ op_class_func op_cl_x3e, op_cl_x3f; op_class_func *opcodes_base[] = { /*x00*/ op_ill, op_ill, op_base, op_ill, /*x04*/ op_ill, op_ill, op_ill, op_base, -/*x08*/ op_base, op_base, op_ill, op_base, +/*x08*/ op_base, op_base, op_base, op_base, /*x0C*/ op_base, op_base, op_base/*XXX*/, op_base/*XXX*/, /*x10*/ op_base, op_base, op_base, op_cl_x13, /*x14*/ op_base, op_base, op_ill, op_base, @@ -118,14 +121,16 @@ const struct opcode opcodes[] = { { "twi", 0xfc000000, 0x0c000000, Op_TO | Op_A | Op_SIMM }, { "mulli", 0xfc000000, 0x1c000000, Op_D | Op_A | Op_SIMM }, { "subfic", 0xfc000000, 0x20000000, Op_D | Op_A | Op_SIMM }, - { "cmpli", 0xfc000000, 0x28000000, Op_crfD | Op_L | Op_A | Op_SIMM }, - { "cmpi", 0xfc000000, 0x2c000000, Op_crfD | Op_L | Op_A | Op_SIMM }, + { "cmplwi", 0xfc200000, 0x28000000, Op_crfD | Op_A | Op_SIMM }, + { "cmpldi", 0xfc200000, 0x28200000, Op_crfD | Op_A | Op_SIMM }, + { "cmpwi", 0xfc200000, 0x2c000000, Op_crfD | Op_A | Op_SIMM }, + { "cmpdi", 0xfc200000, 0x2c200000, Op_crfD | Op_A | Op_SIMM }, { "addic", 0xfc000000, 0x30000000, Op_D | Op_A | Op_SIMM }, { "addic.", 0xfc000000, 0x34000000, Op_D | Op_A | Op_SIMM }, { "addi", 0xfc000000, 0x38000000, Op_D | Op_A | Op_SIMM }, { "addis", 0xfc000000, 0x3c000000, Op_D | Op_A | Op_SIMM }, - { "bc", 0xfc000000, 0x40000000, Op_BO | Op_BI | Op_BD | Op_AA | Op_LK }, - { "sc", 0xffffffff, 0x44000002, Op_BO | Op_BI | Op_BD | Op_AA | Op_LK }, + { "b", 0xfc000000, 0x40000000, Op_BC | Op_BD | Op_AA | Op_LK }, /* bc */ + { "sc", 0xffffffff, 0x44000002, 0 }, { "b", 0xfc000000, 0x48000000, Op_LI | Op_AA | Op_LK }, { "rlwimi", 0xfc000000, 0x50000000, Op_S | Op_A | Op_SH | Op_MB | Op_ME | Op_Rc }, @@ -140,33 +145,33 @@ const struct opcode opcodes[] = { { "andi.", 0xfc000000, 0x70000000, Op_S | Op_A | Op_UIMM }, { "andis.", 0xfc000000, 0x74000000, Op_S | Op_A | Op_UIMM }, - { "lwz", 0xfc000000, 0x80000000, Op_D | Op_A | Op_d }, - { "lwzu", 0xfc000000, 0x84000000, Op_D | Op_A | Op_d }, - { "lbz", 0xfc000000, 0x88000000, Op_D | Op_A | Op_d }, - { "lbzu", 0xfc000000, 0x8c000000, Op_D | Op_A | Op_d }, - { "stw", 0xfc000000, 0x90000000, Op_S | Op_A | Op_d }, - { "stwu", 0xfc000000, 0x94000000, Op_S | Op_A | Op_d }, - { "stb", 0xfc000000, 0x98000000, Op_S | Op_A | Op_d }, - { "stbu", 0xfc000000, 0x9c000000, Op_S | Op_A | Op_d }, - - { "lhz", 0xfc000000, 0xa0000000, Op_D | Op_A | Op_d }, - { "lhzu", 0xfc000000, 0xa4000000, Op_D | Op_A | Op_d }, - { "lha", 0xfc000000, 0xa8000000, Op_D | Op_A | Op_d }, - { "lhau", 0xfc000000, 0xac000000, Op_D | Op_A | Op_d }, - { "sth", 0xfc000000, 0xb0000000, Op_S | Op_A | Op_d }, - { "sthu", 0xfc000000, 0xb4000000, Op_S | Op_A | Op_d }, - { "lmw", 0xfc000000, 0xb8000000, Op_D | Op_A | Op_d }, - { "stmw", 0xfc000000, 0xbc000000, Op_S | Op_A | Op_d }, - - { "lfs", 0xfc000000, 0xc0000000, Op_D | Op_A | Op_d }, - { "lfsu", 0xfc000000, 0xc4000000, Op_D | Op_A | Op_d }, - { "lfd", 0xfc000000, 0xc8000000, Op_D | Op_A | Op_d }, - { "lfdu", 0xfc000000, 0xcc000000, Op_D | Op_A | Op_d }, - - { "stfs", 0xfc000000, 0xd0000000, Op_S | Op_A | Op_d }, - { "stfsu", 0xfc000000, 0xd4000000, Op_S | Op_A | Op_d }, - { "stfd", 0xfc000000, 0xd8000000, Op_S | Op_A | Op_d }, - { "stfdu", 0xfc000000, 0xdc000000, Op_S | Op_A | Op_d }, + { "lwz", 0xfc000000, 0x80000000, Op_D | Op_dA }, + { "lwzu", 0xfc000000, 0x84000000, Op_D | Op_dA }, + { "lbz", 0xfc000000, 0x88000000, Op_D | Op_dA }, + { "lbzu", 0xfc000000, 0x8c000000, Op_D | Op_dA }, + { "stw", 0xfc000000, 0x90000000, Op_ST | Op_dA }, + { "stwu", 0xfc000000, 0x94000000, Op_ST | Op_dA }, + { "stb", 0xfc000000, 0x98000000, Op_ST | Op_dA }, + { "stbu", 0xfc000000, 0x9c000000, Op_ST | Op_dA }, + + { "lhz", 0xfc000000, 0xa0000000, Op_D | Op_dA }, + { "lhzu", 0xfc000000, 0xa4000000, Op_D | Op_dA }, + { "lha", 0xfc000000, 0xa8000000, Op_D | Op_dA }, + { "lhau", 0xfc000000, 0xac000000, Op_D | Op_dA }, + { "sth", 0xfc000000, 0xb0000000, Op_ST | Op_dA }, + { "sthu", 0xfc000000, 0xb4000000, Op_ST | Op_dA }, + { "lmw", 0xfc000000, 0xb8000000, Op_D | Op_dA }, + { "stmw", 0xfc000000, 0xbc000000, Op_ST | Op_dA }, + + { "lfs", 0xfc000000, 0xc0000000, Op_D | Op_dA }, + { "lfsu", 0xfc000000, 0xc4000000, Op_D | Op_dA }, + { "lfd", 0xfc000000, 0xc8000000, Op_D | Op_dA }, + { "lfdu", 0xfc000000, 0xcc000000, Op_D | Op_dA }, + + { "stfs", 0xfc000000, 0xd0000000, Op_ST | Op_dA }, + { "stfsu", 0xfc000000, 0xd4000000, Op_ST | Op_dA }, + { "stfd", 0xfc000000, 0xd8000000, Op_ST | Op_dA }, + { "stfdu", 0xfc000000, 0xdc000000, Op_ST | Op_dA }, { "", 0x0, 0x0, 0 } }; @@ -174,10 +179,10 @@ const struct opcode opcodes[] = { const struct opcode opcodes_13[] = { /* 0x13 << 2 */ { "mcrf", 0xfc0007fe, 0x4c000000, Op_crfD | Op_crfS }, - { "bclr", 0xfc0007fe, 0x4c000020, Op_BO | Op_BI | Op_LK }, + { "b", 0xfc0007fe, 0x4c000020, Op_BC | Op_LK }, /* bclr */ { "crnor", 0xfc0007fe, 0x4c000042, Op_crbD | Op_crbA | Op_crbB }, { "rfi", 0xfc0007fe, 0x4c000064, 0 }, - { "crandc", 0xfc0007fe, 0x4c000102, Op_BO | Op_BI | Op_LK }, + { "crandc", 0xfc0007fe, 0x4c000102, Op_crbD | Op_crbA | Op_crbB }, { "isync", 0xfc0007fe, 0x4c00012c, 0 }, { "crxor", 0xfc0007fe, 0x4c000182, Op_crbD | Op_crbA | Op_crbB }, { "crnand", 0xfc0007fe, 0x4c0001c2, Op_crbD | Op_crbA | Op_crbB }, @@ -185,7 +190,7 @@ const struct opcode opcodes_13[] = { { "creqv", 0xfc0007fe, 0x4c000242, Op_crbD | Op_crbA | Op_crbB }, { "crorc", 0xfc0007fe, 0x4c000342, Op_crbD | Op_crbA | Op_crbB }, { "cror", 0xfc0007fe, 0x4c000382, Op_crbD | Op_crbA | Op_crbB }, - { "bcctr", 0xfc0007fe, 0x4c000420, Op_BO | Op_BI | Op_LK }, + { "b", 0xfc0007fe, 0x4c000420, Op_BC | Op_LK }, /* bcctr */ { "", 0x0, 0x0, 0 } }; @@ -203,12 +208,16 @@ const struct opcode opcodes_1e[] = { /* 1f * 4 = 7c */ const struct opcode opcodes_1f[] = { /* 1f << 2 */ - { "cmp", 0xfc0007fe, 0x7c000000, Op_S | Op_A | Op_B | Op_me | Op_Rc }, + { "cmpw", 0xfc2007fe, 0x7c000000, Op_crfD | Op_A | Op_B }, + { "cmpd", 0xfc2007fe, 0x7c200000, Op_crfD | Op_A | Op_B }, { "tw", 0xfc0007fe, 0x7c000008, Op_TO | Op_A | Op_B }, { "subfc", 0xfc0003fe, 0x7c000010, Op_D | Op_A | Op_B | Op_OE | Op_Rc }, { "mulhdu", 0xfc0007fe, 0x7c000012, Op_D | Op_A | Op_B | Op_Rc }, { "addc", 0xfc0003fe, 0x7c000014, Op_D | Op_A | Op_B | Op_OE | Op_Rc }, { "mulhwu", 0xfc0007fe, 0x7c000016, Op_D | Op_A | Op_B | Op_Rc }, + { "isellt", 0xfc0007ff, 0x7c00001e, Op_D | Op_A | Op_B }, + { "iselgt", 0xfc0007ff, 0x7c00005e, Op_D | Op_A | Op_B }, + { "iseleq", 0xfc0007ff, 0x7c00009e, Op_D | Op_A | Op_B }, { "mfcr", 0xfc0007fe, 0x7c000026, Op_D }, { "lwarx", 0xfc0007fe, 0x7c000028, Op_D | Op_A | Op_B }, @@ -218,7 +227,8 @@ const struct opcode opcodes_1f[] = { { "cntlzw", 0xfc0007fe, 0x7c000034, Op_D | Op_A | Op_Rc }, { "sld", 0xfc0007fe, 0x7c000036, Op_D | Op_A | Op_B | Op_Rc }, { "and", 0xfc0007fe, 0x7c000038, Op_D | Op_A | Op_B | Op_Rc }, - { "cmpl", 0xfc0007fe, 0x7c000040, Op_crfD | Op_L | Op_A | Op_B }, + { "cmplw", 0xfc2007fe, 0x7c000040, Op_crfD | Op_A | Op_B }, + { "cmpld", 0xfc2007fe, 0x7c200040, Op_crfD | Op_A | Op_B }, { "subf", 0xfc0003fe, 0x7c000050, Op_D | Op_A | Op_B | Op_OE | Op_Rc }, { "ldux", 0xfc0007fe, 0x7c00006a, Op_D | Op_A | Op_B }, { "dcbst", 0xfc0007fe, 0x7c00006c, Op_A | Op_B }, @@ -240,24 +250,24 @@ const struct opcode opcodes_1f[] = { { "adde", 0xfc0003fe, 0x7c000114, Op_D | Op_A | Op_B | Op_OE | Op_Rc }, { "mtcrf", 0xfc0007fe, 0x7c000120, Op_S | Op_CRM }, { "mtmsr", 0xfc0007fe, 0x7c000124, Op_S }, - { "stdx", 0xfc0007fe, 0x7c00012a, Op_S | Op_A | Op_B }, - { "stwcx.", 0xfc0007ff, 0x7c00012d, Op_S | Op_A | Op_B }, - { "stwx", 0xfc0007fe, 0x7c00012e, Op_S | Op_A | Op_B }, - { "wrteei", 0xfc0003fe, 0x7c000146 }, /* XXX: out of flags! */ - { "stdux", 0xfc0007fe, 0x7c00016a, Op_S | Op_A | Op_B }, - { "stwux", 0xfc0007fe, 0x7c00016e, Op_S | Op_A | Op_B }, + { "stdx", 0xfc0007fe, 0x7c00012a, Op_ST | Op_A | Op_B }, + { "stwcx.", 0xfc0007ff, 0x7c00012d, Op_ST | Op_A | Op_B }, + { "stwx", 0xfc0007fe, 0x7c00012e, Op_ST | Op_A | Op_B }, + { "wrteei", 0xfc0003fe, 0x7c000146, 0 }, /* XXX: out of flags! */ + { "stdux", 0xfc0007fe, 0x7c00016a, Op_ST | Op_A | Op_B }, + { "stwux", 0xfc0007fe, 0x7c00016e, Op_ST | Op_A | Op_B }, { "subfze", 0xfc0003fe, 0x7c000190, Op_D | Op_A | Op_OE | Op_Rc }, { "addze", 0xfc0003fe, 0x7c000194, Op_D | Op_A | Op_OE | Op_Rc }, { "mtsr", 0xfc0007fe, 0x7c0001a4, Op_S | Op_SR }, - { "stdcx.", 0xfc0007ff, 0x7c0001ad, Op_S | Op_A | Op_B }, - { "stbx", 0xfc0007fe, 0x7c0001ae, Op_S | Op_A | Op_B }, + { "stdcx.", 0xfc0007ff, 0x7c0001ad, Op_ST | Op_A | Op_B }, + { "stbx", 0xfc0007fe, 0x7c0001ae, Op_ST | Op_A | Op_B }, { "subfme", 0xfc0003fe, 0x7c0001d0, Op_D | Op_A | Op_OE | Op_Rc }, { "mulld", 0xfc0003fe, 0x7c0001d2, Op_D | Op_A | Op_B | Op_OE | Op_Rc }, { "addme", 0xfc0003fe, 0x7c0001d4, Op_D | Op_A | Op_OE | Op_Rc }, { "mullw", 0xfc0003fe, 0x7c0001d6, Op_D | Op_A | Op_B | Op_OE | Op_Rc }, { "mtsrin", 0xfc0007fe, 0x7c0001e4, Op_S | Op_B }, { "dcbtst", 0xfc0007fe, 0x7c0001ec, Op_A | Op_B }, - { "stbux", 0xfc0007fe, 0x7c0001ee, Op_S | Op_A | Op_B }, + { "stbux", 0xfc0007fe, 0x7c0001ee, Op_ST | Op_A | Op_B }, { "add", 0xfc0003fe, 0x7c000214, Op_D | Op_A | Op_B | Op_OE | Op_Rc }, { "dcbt", 0xfc0007fe, 0x7c00022c, Op_A | Op_B }, { "lhzx", 0xfc0007ff, 0x7c00022e, Op_D | Op_A | Op_B }, @@ -274,11 +284,11 @@ const struct opcode opcodes_1f[] = { { "mftb", 0xfc0007fe, 0x7c0002e6, Op_D | Op_tbr }, { "lwaux", 0xfc0007fe, 0x7c0002ea, Op_D | Op_A | Op_B }, { "lhaux", 0xfc0007fe, 0x7c0002ee, Op_D | Op_A | Op_B }, - { "sthx", 0xfc0007fe, 0x7c00032e, Op_S | Op_A | Op_B }, + { "sthx", 0xfc0007fe, 0x7c00032e, Op_ST | Op_A | Op_B }, { "orc", 0xfc0007fe, 0x7c000338, Op_S | Op_A | Op_B | Op_Rc }, - { "ecowx", 0xfc0007fe, 0x7c00036c, Op_S | Op_A | Op_B | Op_Rc }, + { "ecowx", 0xfc0007fe, 0x7c00036c, Op_ST | Op_A | Op_B | Op_Rc }, { "slbie", 0xfc0007fc, 0x7c000364, Op_B }, - { "sthux", 0xfc0007fe, 0x7c00036e, Op_S | Op_A | Op_B }, + { "sthux", 0xfc0007fe, 0x7c00036e, Op_ST | Op_A | Op_B }, { "or", 0xfc0007fe, 0x7c000378, Op_S | Op_A | Op_B | Op_Rc }, { "mtdcr", 0xfc0007fe, 0x7c000386, Op_S | Op_dcr }, { "divdu", 0xfc0003fe, 0x7c000392, Op_D | Op_A | Op_B | Op_OE | Op_Rc }, @@ -304,27 +314,27 @@ const struct opcode opcodes_1f[] = { { "lfdx", 0xfc0007fe, 0x7c0004ae, Op_D | Op_A | Op_B }, { "lfdux", 0xfc0007fe, 0x7c0004ee, Op_D | Op_A | Op_B }, { "mfsrin", 0xfc0007fe, 0x7c000526, Op_D | Op_B }, - { "stswx", 0xfc0007fe, 0x7c00052a, Op_S | Op_A | Op_B }, - { "stwbrx", 0xfc0007fe, 0x7c00052c, Op_S | Op_A | Op_B }, - { "stfsx", 0xfc0007fe, 0x7c00052e, Op_S | Op_A | Op_B }, - { "stfsux", 0xfc0007fe, 0x7c00056e, Op_S | Op_A | Op_B }, - { "stswi", 0xfc0007fe, 0x7c0005aa, Op_S | Op_A | Op_NB }, - { "stfdx", 0xfc0007fe, 0x7c0005ae, Op_S | Op_A | Op_B }, - { "stfdux", 0xfc0007fe, 0x7c0005ee, Op_S | Op_A | Op_B }, + { "stswx", 0xfc0007fe, 0x7c00052a, Op_ST | Op_A | Op_B }, + { "stwbrx", 0xfc0007fe, 0x7c00052c, Op_ST | Op_A | Op_B }, + { "stfsx", 0xfc0007fe, 0x7c00052e, Op_ST | Op_A | Op_B }, + { "stfsux", 0xfc0007fe, 0x7c00056e, Op_ST | Op_A | Op_B }, + { "stswi", 0xfc0007fe, 0x7c0005aa, Op_ST | Op_A | Op_NB }, + { "stfdx", 0xfc0007fe, 0x7c0005ae, Op_ST | Op_A | Op_B }, + { "stfdux", 0xfc0007fe, 0x7c0005ee, Op_ST | Op_A | Op_B }, { "lhbrx", 0xfc0007fe, 0x7c00062c, Op_D | Op_A | Op_B }, { "sraw", 0xfc0007fe, 0x7c000630, Op_S | Op_A | Op_B }, { "srad", 0xfc0007fe, 0x7c000634, Op_S | Op_A | Op_B | Op_Rc }, - { "srawi", 0xfc0007fe, 0x7c000670, Op_S | Op_A | Op_B | Op_Rc }, + { "srawi", 0xfc0007fe, 0x7c000670, Op_S | Op_A | Op_rSH | Op_Rc }, { "sradi", 0xfc0007fc, 0x7c000674, Op_S | Op_A | Op_sh }, { "eieio", 0xfc0007fe, 0x7c0006ac, 0 }, { "tlbsx", 0xfc0007fe, 0x7c000724, Op_S | Op_A | Op_B | Op_Rc }, - { "sthbrx", 0xfc0007fe, 0x7c00072c, Op_S | Op_A | Op_B }, - { "extsh", 0xfc0007fe, 0x7c000734, Op_S | Op_A | Op_B | Op_Rc }, + { "sthbrx", 0xfc0007fe, 0x7c00072c, Op_ST | Op_A | Op_B }, + { "extsh", 0xfc0007fe, 0x7c000734, Op_S | Op_A | Op_Rc }, { "tlbre", 0xfc0007fe, 0x7c000764, Op_D | Op_A | Op_WS }, { "extsb", 0xfc0007fe, 0x7c000774, Op_S | Op_A | Op_Rc }, { "icbi", 0xfc0007fe, 0x7c0007ac, Op_A | Op_B }, { "tlbwe", 0xfc0007fe, 0x7c0007a4, Op_S | Op_A | Op_WS }, - { "stfiwx", 0xfc0007fe, 0x7c0007ae, Op_S | Op_A | Op_B }, + { "stfiwx", 0xfc0007fe, 0x7c0007ae, Op_ST | Op_A | Op_B }, { "extsw", 0xfc0007fe, 0x7c0007b4, Op_S | Op_A | Op_Rc }, { "dcbz", 0xfc0007fe, 0x7c0007ec, Op_A | Op_B }, { "", 0x0, 0x0, 0 } @@ -354,8 +364,8 @@ const struct opcode opcodes_3b[] = { }; /* 3e * 4 = f8 */ const struct opcode opcodes_3e[] = { - { "std", 0xfc000003, 0xf8000000, Op_S | Op_A | Op_ds }, - { "stdu", 0xfc000003, 0xf8000001, Op_S | Op_A | Op_ds }, + { "std", 0xfc000003, 0xf8000000, Op_ST | Op_A | Op_ds }, + { "stdu", 0xfc000003, 0xf8000001, Op_ST | Op_A | Op_ds }, { "", 0x0, 0x0, 0 } }; @@ -384,7 +394,7 @@ const struct opcode opcodes_3f[] = { { "mcrfs", 0xfc0007fe, 0xfc000080, Op_D | Op_B | Op_Rc }, { "mtfsb0", 0xfc0007fe, 0xfc00008c, Op_crfD | Op_Rc }, { "fmr", 0xfc0007fe, 0xfc000090, Op_D | Op_B | Op_Rc }, - { "mtfsfi", 0xfc0007fe, 0xfc00010c, Op_crfD | Op_IMM | Op_Rc }, + { "mtfsfi", 0xfc0007fe, 0xfc00010c, 0 }, /* XXX: out of flags! */ { "fnabs", 0xfc0007fe, 0xfc000110, Op_D | Op_B | Op_Rc }, { "fabs", 0xfc0007fe, 0xfc000210, Op_D | Op_B | Op_Rc }, @@ -399,10 +409,11 @@ const struct opcode opcodes_3f[] = { struct specialreg { int reg; - char *name; + const char *name; }; const struct specialreg sprregs[] = { + { 0x000, "mq" }, { 0x001, "xer" }, { 0x008, "lr" }, { 0x009, "ctr" }, @@ -412,7 +423,11 @@ const struct specialreg sprregs[] = { { 0x019, "sdr1" }, { 0x01a, "srr0" }, { 0x01b, "srr1" }, +#ifdef BOOKE_PPC4XX { 0x100, "usprg0" }, +#else + { 0x100, "vrsave" }, +#endif { 0x110, "sprg0" }, { 0x111, "sprg1" }, { 0x112, "sprg2" }, @@ -442,6 +457,22 @@ const struct specialreg sprregs[] = { { 0x21d, "dbat2l" }, { 0x21e, "dbat3u" }, { 0x21f, "dbat3l" }, + { 0x230, "ibat4u" }, + { 0x231, "ibat4l" }, + { 0x232, "ibat5u" }, + { 0x233, "ibat5l" }, + { 0x234, "ibat6u" }, + { 0x235, "ibat6l" }, + { 0x236, "ibat7u" }, + { 0x237, "ibat7l" }, + { 0x238, "dbat4u" }, + { 0x239, "dbat4l" }, + { 0x23a, "dbat5u" }, + { 0x23b, "dbat5l" }, + { 0x23c, "dbat6u" }, + { 0x23d, "dbat6l" }, + { 0x23e, "dbat7u" }, + { 0x23f, "dbat7l" }, { 0x3b0, "zpr" }, { 0x3b1, "pid" }, { 0x3b3, "ccr0" }, @@ -463,12 +494,22 @@ const struct specialreg sprregs[] = { { 0x3db, "pit" }, { 0x3de, "srr2" }, { 0x3df, "srr3" }, +#ifdef BOOKE_PPC4XX { 0x3f0, "dbsr" }, { 0x3f2, "dbcr0" }, { 0x3f4, "iac1" }, { 0x3f5, "iac2" }, { 0x3f6, "dac1" }, { 0x3f7, "dac2" }, +#else + { 0x3f0, "hid0" }, + { 0x3f1, "hid1" }, + { 0x3f2, "iabr" }, + { 0x3f3, "hid2" }, + { 0x3f5, "dabr" }, + { 0x3f6, "msscr0" }, + { 0x3f7, "msscr1" }, +#endif { 0x3f9, "l2cr" }, { 0x3fa, "dccr" }, { 0x3fb, "iccr" }, @@ -553,6 +594,11 @@ const struct specialreg dcrregs[] = { { 0, NULL } }; +static const char *condstr[8] = { + "ge", "le", "ne", "ns", "lt", "gt", "eq", "so" +}; + + void op_ill(instr_t instr, vm_offset_t loc) { @@ -570,154 +616,264 @@ const struct opcode * search_op(const st void disasm_fields(const struct opcode *popcode, instr_t instr, vm_offset_t loc, - char *disasm_str) + char *disasm_str, size_t slen) { char * pstr; enum function_mask func; + int len; + +#define ADD_LEN(s) do { \ + len = (s); \ + slen -= len; \ + pstr += len; \ + } while(0) +#define APP_PSTR(fmt, arg) ADD_LEN(snprintf(pstr, slen, (fmt), (arg))) +#define APP_PSTRS(fmt) ADD_LEN(snprintf(pstr, slen, "%s", (fmt))) pstr = disasm_str; func = popcode->func; + if (func & Op_BC) { + u_int BO, BI; + BO = extract_field(instr, 31 - 10, 5); + BI = extract_field(instr, 31 - 15, 5); + func &= ~Op_BC; + if (BO & 4) { + /* standard, no decrement */ + if (BO & 16) { + if (popcode->code == 0x40000000) { + APP_PSTRS("c"); + func |= Op_BO | Op_BI; + } + } + else { + APP_PSTRS(condstr[((BO & 8) >> 1) + (BI & 3)]); + if (BI >= 4) + func |= Op_crfS; + } + } + else { + /* decrement and branch */ + if (BO & 2) + APP_PSTRS("dz"); + else + APP_PSTRS("dnz"); + if ((BO & 24) == 0) + APP_PSTRS("f"); + else if ((BO & 24) == 8) + APP_PSTRS("t"); + else + func |= Op_BI; + } + if (popcode->code == 0x4c000020) + APP_PSTRS("lr"); + else if (popcode->code == 0x4c000420) + APP_PSTRS("ctr"); + if ((BO & 20) != 20 && (func & Op_BO) == 0) + func |= Op_BP; /* branch prediction hint */ + } if (func & Op_OE) { u_int OE; - /* also for Op_S (they are the same) */ OE = extract_field(instr, 31 - 21, 1); if (OE) { - pstr += sprintf(pstr, "o"); + APP_PSTRS("o"); } func &= ~Op_OE; } switch (func & Op_LKM) { case Op_Rc: - if (instr & 0x1) { - pstr += sprintf(pstr, "."); - } + if (instr & 0x1) + APP_PSTRS("."); break; case Op_AA: + if (instr & 0x1) + APP_PSTRS("l"); if (instr & 0x2) { - pstr += sprintf(pstr, "a"); + APP_PSTRS("a"); loc = 0; /* Absolute address */ } + break; case Op_LK: - if (instr & 0x1) { - pstr += sprintf(pstr, "l"); - } + if (instr & 0x1) + APP_PSTRS("l"); break; default: func &= ~Op_LKM; } - pstr += sprintf(pstr, "\t"); + if (func & Op_BP) { + int y; + y = (instr & 0x200000) != 0; + if (popcode->code == 0x40000000) { + int BD; + BD = extract_field(instr, 31 - 29, 14); + BD = BD << 18; + BD = BD >> 16; + BD += loc; + if ((vm_offset_t)BD < loc) + y ^= 1; + } + APP_PSTR("%c", y ? '+' : '-'); + func &= ~Op_BP; + } + APP_PSTRS("\t"); /* XXX: special cases here, out of flags in a 32bit word. */ if (strcmp(popcode->name, "wrteei") == 0) { int E; E = extract_field(instr, 31 - 16, 5); - pstr += sprintf(pstr, "%d", E); + APP_PSTR("%d", E); return; } + else if (strcmp(popcode->name, "mtfsfi") == 0) { + u_int UI; + UI = extract_field(instr, 31 - 8, 3); + APP_PSTR("crf%u, ", UI); + UI = extract_field(instr, 31 - 19, 4); + APP_PSTR("0x%x", UI); + } /* XXX: end of special cases here. */ - if (func & Op_D) { + if ((func & Op_FM) == Op_FM) { + u_int FM; + FM = extract_field(instr, 31 - 14, 8); + APP_PSTR("0x%x, ", FM); + func &= ~Op_FM; + } + if (func & Op_D) { /* Op_ST is the same */ u_int D; - /* also for Op_S (they are the same) */ D = extract_field(instr, 31 - 10, 5); - pstr += sprintf(pstr, "r%d, ", D); + APP_PSTR("r%d, ", D); func &= ~Op_D; } if (func & Op_crbD) { u_int crbD; crbD = extract_field(instr, 31 - 10, 5); - pstr += sprintf(pstr, "crb%d, ", crbD); + APP_PSTR("crb%d, ", crbD); func &= ~Op_crbD; } if (func & Op_crfD) { u_int crfD; crfD = extract_field(instr, 31 - 8, 3); - pstr += sprintf(pstr, "crf%d, ", crfD); + APP_PSTR("crf%d, ", crfD); func &= ~Op_crfD; } - if (func & Op_L) { - u_int L; - L = extract_field(instr, 31 - 10, 1); - if (L) { - pstr += sprintf(pstr, "L, "); - } - func &= ~Op_L; - } - if (func & Op_FM) { - u_int FM; - FM = extract_field(instr, 31 - 10, 8); - pstr += sprintf(pstr, "%d, ", FM); - func &= ~Op_FM; - } if (func & Op_TO) { u_int TO; TO = extract_field(instr, 31 - 10, 1); - pstr += sprintf(pstr, "%d, ", TO); + APP_PSTR("%d, ", TO); func &= ~Op_TO; } if (func & Op_crfS) { u_int crfS; crfS = extract_field(instr, 31 - 13, 3); - pstr += sprintf(pstr, "%d, ", crfS); + APP_PSTR("crf%d, ", crfS); func &= ~Op_crfS; } + if (func & Op_CRM) { + u_int CRM; + CRM = extract_field(instr, 31 - 19, 8); + APP_PSTR("0x%x, ", CRM); + func &= ~Op_CRM; + } if (func & Op_BO) { u_int BO; BO = extract_field(instr, 31 - 10, 5); - pstr += sprintf(pstr, "%d, ", BO); + APP_PSTR("%d, ", BO); func &= ~Op_BO; } + if (func & Op_BI) { + u_int BI; + BI = extract_field(instr, 31 - 15, 5); + APP_PSTR("%d, ", BI); + func &= ~Op_BI; + } + if (func & Op_dA) { /* register A indirect with displacement */ + u_int A; + A = extract_field(instr, 31 - 31, 16); + if (A & 0x8000) { + APP_PSTRS("-"); + A = 0x10000-A; + } + APP_PSTR("0x%x", A); + A = extract_field(instr, 31 - 15, 5); + APP_PSTR("(r%d)", A); + func &= ~Op_dA; + } + if (func & Op_spr) { + u_int spr; + u_int sprl; + u_int sprh; + const struct specialreg *regs; + int i; + sprl = extract_field(instr, 31 - 15, 5); + sprh = extract_field(instr, 31 - 20, 5); + spr = sprh << 5 | sprl; + + /* ugly hack - out of bitfields in the function mask */ + if (popcode->name[2] == 'd') /* m.Dcr */ + regs = dcrregs; + else + regs = sprregs; + for (i = 0; regs[i].name != NULL; i++) + if (spr == regs[i].reg) + break; + if (regs[i].name == NULL) + APP_PSTR("[unknown special reg (%d)]", spr); + else + APP_PSTR("%s", regs[i].name); + + if (popcode->name[1] == 't') /* spr is destination */ + APP_PSTRS(", "); + func &= ~Op_spr; + } + if (func & Op_SR) { + u_int SR; + SR = extract_field(instr, 31 - 15, 3); + APP_PSTR("sr%d", SR); + if (popcode->name[1] == 't') /* SR is destination */ + APP_PSTRS(", "); + func &= ~Op_SR; + } if (func & Op_A) { u_int A; A = extract_field(instr, 31 - 15, 5); - pstr += sprintf(pstr, "r%d, ", A); + APP_PSTR("r%d, ", A); func &= ~Op_A; } - if (func & Op_B) { - u_int B; - B = extract_field(instr, 31 - 20, 5); - pstr += sprintf(pstr, "r%d, ", B); - func &= ~Op_B; + if (func & Op_S) { + u_int D; + D = extract_field(instr, 31 - 10, 5); + APP_PSTR("r%d, ", D); + func &= ~Op_S; } if (func & Op_C) { u_int C; C = extract_field(instr, 31 - 25, 5); - pstr += sprintf(pstr, "r%d, ", C); + APP_PSTR("r%d, ", C); func &= ~Op_C; } - if (func & Op_BI) { - u_int BI; - BI = extract_field(instr, 31 - 10, 5); - pstr += sprintf(pstr, "%d, ", BI); - func &= ~Op_BI; + if (func & Op_B) { + u_int B; + B = extract_field(instr, 31 - 20, 5); + APP_PSTR("r%d", B); + func &= ~Op_B; } if (func & Op_crbA) { u_int crbA; crbA = extract_field(instr, 31 - 15, 5); - pstr += sprintf(pstr, "%d, ", crbA); + APP_PSTR("%d, ", crbA); func &= ~Op_crbA; } if (func & Op_crbB) { u_int crbB; crbB = extract_field(instr, 31 - 20, 5); - pstr += sprintf(pstr, "%d, ", crbB); + APP_PSTR("%d, ", crbB); func &= ~Op_crbB; } - if (func & Op_CRM) { - u_int CRM; - CRM = extract_field(instr, 31 - 19, 8); - pstr += sprintf(pstr, "0x%x, ", CRM); - func &= ~Op_CRM; - } if (func & Op_LI) { - int LI; + u_int LI; LI = extract_field(instr, 31 - 29, 24); - /* Need to sign extend and shift up 2, then add addr */ - LI = LI << 8; - LI = LI >> 6; - LI += loc; - pstr += sprintf (pstr, "0x%x, ", LI); + APP_PSTR("0x%x", LI); func &= ~Op_LI; } switch (func & Op_SIMM) { @@ -725,7 +881,7 @@ disasm_fields(const struct opcode *popco case Op_SIMM: /* same as Op_d */ IMM = extract_field(instr, 31 - 31, 16); if (IMM & 0x8000) { - pstr += sprintf(pstr, "-"); + APP_PSTRS("-"); IMM = 0x10000-IMM; } func &= ~Op_SIMM; @@ -735,95 +891,71 @@ disasm_fields(const struct opcode *popco func &= ~Op_UIMM; goto common; common: - pstr += sprintf(pstr, "0x%x", IMM); + APP_PSTR("0x%x", IMM); break; default: - break; + ; } if (func & Op_BD) { u_int BD; BD = extract_field(instr, 31 - 29, 14); - pstr += sprintf(pstr, "0x%x, ", BD); + /* Need to sign extend and shift up 2, then add addr */ + APP_PSTR("0x%x", BD); func &= ~Op_BD; } if (func & Op_ds) { u_int ds; ds = extract_field(instr, 31 - 29, 14) << 2; - pstr += sprintf(pstr, "0x%x, ", ds); + APP_PSTR("0x%x", ds); func &= ~Op_ds; } - if (func & Op_spr) { - u_int spr; - u_int sprl; - u_int sprh; - const struct specialreg *regs; - int i; - sprl = extract_field(instr, 31 - 15, 5); - sprh = extract_field(instr, 31 - 20, 5); - spr = sprh << 5 | sprl; - - /* ugly hack - out of bitfields in the function mask */ - if (popcode->name[2] == 'd') /* m.Dcr */ - regs = dcrregs; - else - regs = sprregs; - for (i = 0; regs[i].name != NULL; i++) - if (spr == regs[i].reg) - break; - if (regs[i].reg == 0) - pstr += sprintf(pstr, "[unknown special reg (%d)]", spr); - else - pstr += sprintf(pstr, "%s", regs[i].name); - func &= ~Op_spr; - } - if (func & Op_me) { u_int me, mel, meh; mel = extract_field(instr, 31 - 25, 4); meh = extract_field(instr, 31 - 26, 1); me = meh << 4 | mel; - pstr += sprintf(pstr, ", 0x%x", me); + APP_PSTR(", 0x%x", me); func &= ~Op_me; } - if ((func & Op_MB) && (func & Op_sh_mb_sh)) { - u_int MB; - u_int ME; - MB = extract_field(instr, 31 - 20, 5); - pstr += sprintf(pstr, ", %d", MB); - ME = extract_field(instr, 31 - 25, 5); - pstr += sprintf(pstr, ", %d", ME); - } if ((func & Op_SH) && (func & Op_sh_mb_sh)) { u_int SH; SH = extract_field(instr, 31 - 20, 5); - pstr += sprintf(pstr, ", %d", SH); + APP_PSTR("%d", SH); + } + if ((func & Op_MB) && (func & Op_sh_mb_sh)) { + u_int MB; + u_int ME; + MB = extract_field(instr, 31 - 25, 5); + APP_PSTR(", %d", MB); + ME = extract_field(instr, 31 - 30, 5); + APP_PSTR(", %d", ME); } if ((func & Op_sh) && ! (func & Op_sh_mb_sh)) { u_int sh, shl, shh; shl = extract_field(instr, 31 - 19, 4); shh = extract_field(instr, 31 - 20, 1); sh = shh << 4 | shl; - pstr += sprintf(pstr, ", %d", sh); + APP_PSTR(", %d", sh); } if ((func & Op_mb) && ! (func & Op_sh_mb_sh)) { u_int mb, mbl, mbh; mbl = extract_field(instr, 31 - 25, 4); mbh = extract_field(instr, 31 - 26, 1); mb = mbh << 4 | mbl; - pstr += sprintf(pstr, ", %d", mb); + APP_PSTR(", %d", mb); } if ((func & Op_me) && ! (func & Op_sh_mb_sh)) { u_int me, mel, meh; mel = extract_field(instr, 31 - 25, 4); meh = extract_field(instr, 31 - 26, 1); me = meh << 4 | mel; - pstr += sprintf(pstr, ", %d", me); + APP_PSTR(", %d", me); } if (func & Op_tbr) { u_int tbr; u_int tbrl; u_int tbrh; - char *reg; + const char *reg; tbrl = extract_field(instr, 31 - 15, 5); tbrh = extract_field(instr, 31 - 20, 5); tbr = tbrh << 5 | tbrl; @@ -836,34 +968,25 @@ disasm_fields(const struct opcode *popco reg = "tbu"; break; default: - reg = NULL; + reg = 0; } - if (reg == NULL) - pstr += sprintf(pstr, ", [unknown tbr %d ]", tbr); + if (reg == 0) + APP_PSTR(", [unknown tbr %d ]", tbr); else - pstr += sprintf(pstr, ", %s", reg); + APP_PSTR(", %s", reg); func &= ~Op_tbr; } - if (func & Op_SR) { - u_int SR; - SR = extract_field(instr, 31 - 15, 3); - pstr += sprintf(pstr, ", sr%d", SR); - func &= ~Op_SR; - } if (func & Op_NB) { u_int NB; NB = extract_field(instr, 31 - 20, 5); if (NB == 0) NB = 32; - pstr += sprintf(pstr, ", %d", NB); - func &= ~Op_SR; - } - if (func & Op_IMM) { - u_int IMM; - IMM = extract_field(instr, 31 - 19, 4); - pstr += sprintf(pstr, ", %d", IMM); + APP_PSTR(", %d", NB); func &= ~Op_SR; } +#undef ADD_LEN +#undef APP_PSTR +#undef APP_PSTRS } void @@ -920,14 +1043,15 @@ dis_ppc(const struct opcode *opcodeset, const struct opcode *op; int found = 0; int i; - char disasm_str[30]; + char disasm_str[80]; for (i = 0, op = &opcodeset[0]; found == 0 && op->mask != 0; i++, op = &opcodeset[i]) { if ((instr & op->mask) == op->code) { found = 1; - disasm_fields(op, instr, loc, disasm_str); + disasm_fields(op, instr, loc, disasm_str, + sizeof disasm_str); db_printf("%s%s\n", op->name, disasm_str); return; } From owner-svn-src-all@freebsd.org Wed Nov 30 05:12:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A64EC5C3BE; Wed, 30 Nov 2016 05:12:00 +0000 (UTC) (envelope-from sephe@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 39EC913AC; Wed, 30 Nov 2016 05:12:00 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU5BxEq047027; Wed, 30 Nov 2016 05:11:59 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU5BxNO047026; Wed, 30 Nov 2016 05:11:59 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611300511.uAU5BxNO047026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 30 Nov 2016 05:11:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309310 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 05:12:00 -0000 Author: sephe Date: Wed Nov 30 05:11:59 2016 New Revision: 309310 URL: https://svnweb.freebsd.org/changeset/base/309310 Log: hyperv/hn: Nuke the unused TX taskqueue CPU binding tunable. It was an experimental tunable, and is now deemed to be road blocker for further changes. Time to retire it. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8654 Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Wed Nov 30 02:35:51 2016 (r309309) +++ head/sys/dev/hyperv/netvsc/if_hn.c Wed Nov 30 05:11:59 2016 (r309310) @@ -424,11 +424,6 @@ static int hn_use_txdesc_bufring = 1; SYSCTL_INT(_hw_hn, OID_AUTO, use_txdesc_bufring, CTLFLAG_RD, &hn_use_txdesc_bufring, 0, "Use buf_ring for TX descriptors"); -/* Bind TX taskqueue to the target CPU */ -static int hn_bind_tx_taskq = -1; -SYSCTL_INT(_hw_hn, OID_AUTO, bind_tx_taskq, CTLFLAG_RDTUN, - &hn_bind_tx_taskq, 0, "Bind TX taskqueue to the specified cpu"); - #ifdef HN_IFSTART_SUPPORT /* Use ifnet.if_start instead of ifnet.if_transmit */ static int hn_use_if_start = 0; @@ -906,20 +901,8 @@ hn_attach(device_t dev) if (hn_tx_taskq == NULL) { sc->hn_tx_taskq = taskqueue_create("hn_tx", M_WAITOK, taskqueue_thread_enqueue, &sc->hn_tx_taskq); - if (hn_bind_tx_taskq >= 0) { - int cpu = hn_bind_tx_taskq; - cpuset_t cpu_set; - - if (cpu > mp_ncpus - 1) - cpu = mp_ncpus - 1; - CPU_SETOF(cpu, &cpu_set); - taskqueue_start_threads_cpuset(&sc->hn_tx_taskq, 1, - PI_NET, &cpu_set, "%s tx", - device_get_nameunit(dev)); - } else { - taskqueue_start_threads(&sc->hn_tx_taskq, 1, PI_NET, - "%s tx", device_get_nameunit(dev)); - } + taskqueue_start_threads(&sc->hn_tx_taskq, 1, PI_NET, "%s tx", + device_get_nameunit(dev)); } else { sc->hn_tx_taskq = hn_tx_taskq; } @@ -5360,18 +5343,7 @@ hn_tx_taskq_create(void *arg __unused) hn_tx_taskq = taskqueue_create("hn_tx", M_WAITOK, taskqueue_thread_enqueue, &hn_tx_taskq); - if (hn_bind_tx_taskq >= 0) { - int cpu = hn_bind_tx_taskq; - cpuset_t cpu_set; - - if (cpu > mp_ncpus - 1) - cpu = mp_ncpus - 1; - CPU_SETOF(cpu, &cpu_set); - taskqueue_start_threads_cpuset(&hn_tx_taskq, 1, PI_NET, - &cpu_set, "hn tx"); - } else { - taskqueue_start_threads(&hn_tx_taskq, 1, PI_NET, "hn tx"); - } + taskqueue_start_threads(&hn_tx_taskq, 1, PI_NET, "hn tx"); } SYSINIT(hn_txtq_create, SI_SUB_DRIVERS, SI_ORDER_SECOND, hn_tx_taskq_create, NULL); From owner-svn-src-all@freebsd.org Wed Nov 30 05:28:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FE6CC5C8F4; Wed, 30 Nov 2016 05:28:41 +0000 (UTC) (envelope-from sephe@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 0B7AC1950; Wed, 30 Nov 2016 05:28:40 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU5Se2D053574; Wed, 30 Nov 2016 05:28:40 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU5Sec8053572; Wed, 30 Nov 2016 05:28:40 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611300528.uAU5Sec8053572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 30 Nov 2016 05:28:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309311 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 05:28:41 -0000 Author: sephe Date: Wed Nov 30 05:28:39 2016 New Revision: 309311 URL: https://svnweb.freebsd.org/changeset/base/309311 Log: hyperv/hn: Allow multiple TX taskqueues. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8655 Modified: head/sys/dev/hyperv/netvsc/if_hn.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Wed Nov 30 05:11:59 2016 (r309310) +++ head/sys/dev/hyperv/netvsc/if_hn.c Wed Nov 30 05:28:39 2016 (r309311) @@ -416,6 +416,10 @@ static int hn_share_tx_taskq = 0; SYSCTL_INT(_hw_hn, OID_AUTO, share_tx_taskq, CTLFLAG_RDTUN, &hn_share_tx_taskq, 0, "Enable shared TX taskqueue"); +static int hn_tx_taskq_cnt = 1; +SYSCTL_INT(_hw_hn, OID_AUTO, tx_taskq_cnt, CTLFLAG_RDTUN, + &hn_tx_taskq_cnt, 0, "# of TX taskqueues"); + #ifndef HN_USE_TXDESC_BUFRING static int hn_use_txdesc_bufring = 0; #else @@ -465,7 +469,7 @@ SYSCTL_INT(_hw_hn, OID_AUTO, tx_agg_pkts &hn_tx_agg_pkts, 0, "Packet transmission aggregation packet limit"); static u_int hn_cpu_index; /* next CPU for channel */ -static struct taskqueue *hn_tx_taskq; /* shared TX taskqueue */ +static struct taskqueue **hn_tx_taskque;/* shared TX taskqueues */ static const uint8_t hn_rss_key_default[NDIS_HASH_KEYSIZE_TOEPLITZ] = { @@ -898,13 +902,21 @@ hn_attach(device_t dev) /* * Setup taskqueue for transmission. */ - if (hn_tx_taskq == NULL) { - sc->hn_tx_taskq = taskqueue_create("hn_tx", M_WAITOK, - taskqueue_thread_enqueue, &sc->hn_tx_taskq); - taskqueue_start_threads(&sc->hn_tx_taskq, 1, PI_NET, "%s tx", - device_get_nameunit(dev)); + if (hn_tx_taskque == NULL) { + int i; + + sc->hn_tx_taskqs = + malloc(hn_tx_taskq_cnt * sizeof(struct taskqueue *), + M_DEVBUF, M_WAITOK); + for (i = 0; i < hn_tx_taskq_cnt; ++i) { + sc->hn_tx_taskqs[i] = taskqueue_create("hn_tx", + M_WAITOK, taskqueue_thread_enqueue, + &sc->hn_tx_taskqs[i]); + taskqueue_start_threads(&sc->hn_tx_taskqs[i], 1, PI_NET, + "%s tx%d", device_get_nameunit(dev), i); + } } else { - sc->hn_tx_taskq = hn_tx_taskq; + sc->hn_tx_taskqs = hn_tx_taskque; } /* @@ -1204,8 +1216,13 @@ hn_detach(device_t dev) hn_destroy_rx_data(sc); hn_destroy_tx_data(sc); - if (sc->hn_tx_taskq != hn_tx_taskq) - taskqueue_free(sc->hn_tx_taskq); + if (sc->hn_tx_taskqs != hn_tx_taskque) { + int i; + + for (i = 0; i < hn_tx_taskq_cnt; ++i) + taskqueue_free(sc->hn_tx_taskqs[i]); + free(sc->hn_tx_taskqs, M_DEVBUF); + } taskqueue_free(sc->hn_mgmt_taskq0); if (sc->hn_xact != NULL) { @@ -3295,7 +3312,7 @@ hn_tx_ring_create(struct hn_softc *sc, i M_WAITOK, &txr->hn_tx_lock); #endif - txr->hn_tx_taskq = sc->hn_tx_taskq; + txr->hn_tx_taskq = sc->hn_tx_taskqs[id % hn_tx_taskq_cnt]; #ifdef HN_IFSTART_SUPPORT if (hn_use_if_start) { @@ -5334,6 +5351,15 @@ hn_chan_callback(struct vmbus_channel *c static void hn_tx_taskq_create(void *arg __unused) { + int i; + + /* + * Fix the # of TX taskqueues. + */ + if (hn_tx_taskq_cnt <= 0) + hn_tx_taskq_cnt = 1; + else if (hn_tx_taskq_cnt > mp_ncpus) + hn_tx_taskq_cnt = mp_ncpus; if (vm_guest != VM_GUEST_HV) return; @@ -5341,9 +5367,14 @@ hn_tx_taskq_create(void *arg __unused) if (!hn_share_tx_taskq) return; - hn_tx_taskq = taskqueue_create("hn_tx", M_WAITOK, - taskqueue_thread_enqueue, &hn_tx_taskq); - taskqueue_start_threads(&hn_tx_taskq, 1, PI_NET, "hn tx"); + hn_tx_taskque = malloc(hn_tx_taskq_cnt * sizeof(struct taskqueue *), + M_DEVBUF, M_WAITOK); + for (i = 0; i < hn_tx_taskq_cnt; ++i) { + hn_tx_taskque[i] = taskqueue_create("hn_tx", M_WAITOK, + taskqueue_thread_enqueue, &hn_tx_taskque[i]); + taskqueue_start_threads(&hn_tx_taskque[i], 1, PI_NET, + "hn tx%d", i); + } } SYSINIT(hn_txtq_create, SI_SUB_DRIVERS, SI_ORDER_SECOND, hn_tx_taskq_create, NULL); @@ -5352,8 +5383,13 @@ static void hn_tx_taskq_destroy(void *arg __unused) { - if (hn_tx_taskq != NULL) - taskqueue_free(hn_tx_taskq); + if (hn_tx_taskque != NULL) { + int i; + + for (i = 0; i < hn_tx_taskq_cnt; ++i) + taskqueue_free(hn_tx_taskque[i]); + free(hn_tx_taskque, M_DEVBUF); + } } SYSUNINIT(hn_txtq_destroy, SI_SUB_DRIVERS, SI_ORDER_SECOND, hn_tx_taskq_destroy, NULL); Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Wed Nov 30 05:11:59 2016 (r309310) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Wed Nov 30 05:28:39 2016 (r309311) @@ -192,7 +192,7 @@ struct hn_softc { int hn_chim_szmax; int hn_cpu; - struct taskqueue *hn_tx_taskq; + struct taskqueue **hn_tx_taskqs; struct sysctl_oid *hn_tx_sysctl_tree; struct sysctl_oid *hn_rx_sysctl_tree; struct vmbus_xact_ctx *hn_xact; From owner-svn-src-all@freebsd.org Wed Nov 30 05:39:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92432C5CB42; Wed, 30 Nov 2016 05:39:58 +0000 (UTC) (envelope-from jakub@ixsystems.com) Received: from mx.ixsystems.com (mail.ixsystems.com [12.229.62.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN ".", Issuer "." (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 244241EDA; Wed, 30 Nov 2016 05:39:58 +0000 (UTC) (envelope-from jakub@ixsystems.com) Received: from localhost (localhost.localdomain [127.0.0.1]) by mx.ixsystems.com (Postfix) with ESMTP id 3tSSmg6bK1zCs4F; Mon, 28 Nov 2016 18:53:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ixsystems.com; h= x-mailer:references:message-id:content-transfer-encoding:date :date:in-reply-to:from:from:subject:subject:mime-version :content-type:content-type:received:received:received:received :received:received:received; s=dkim; t=1480388030; x=1482202431; bh=hCXKvsRvN+beCkw8PVA/gnARr52oB92qL/OIapyuFaE=; b=eeoSFg74r9PE 81Xy03vvTyA50R9XDkAKz2gzEbBIQQG6OSgPLJqUL9oZxSBN0zAkr/wKoKZu8StL 6U/vmO0FRRrZBuimr05dRSdbcTVEl6nj6C3ojvbX4nMt7gf6/8lJky08gZrSJUiT FgYq5UL/k9SgcdgyzZ1y81XcZeKikhdW+8uQaPme2X299KvgD5ZlRnSBRRZhK2pO SfNAbl9StHCRvCcA/eQwWqwKy9FP6XGD+e+XPzadEnaRsYGjf+zR+C+CqazDduxE p9vSZJK7mTVz4Gi2H8GmVr/wKOPK/aCeG74t6NVQ9kJ+asNodY1El2nGY7FOGIEN nMYn108QUg== X-Amavis-Modified: Mail body modified (using disclaimer) - mx.ixsystems.com X-Virus-Scanned: Scrollout F1 at ixsystems.com Received: from mx.ixsystems.com ([127.0.0.1]) by localhost (mx.ixsystems.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id X0VAuMUryfQI; Mon, 28 Nov 2016 18:53:50 -0800 (PST) Received: from zimbra.ixsystems.com (unknown [10.246.0.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx.ixsystems.com (Postfix) with ESMTPS id 3tSSm733FHzCs7r; Mon, 28 Nov 2016 18:53:27 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.ixsystems.com (Postfix) with ESMTP id 203B1C4E0DD; Thu, 24 Nov 2016 14:27:10 -0800 (PST) Received: from zimbra.ixsystems.com ([127.0.0.1]) by localhost (zimbra.ixsystems.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 7mmTssxD37CL; Thu, 24 Nov 2016 14:27:09 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.ixsystems.com (Postfix) with ESMTP id 3E642C4E130; Thu, 24 Nov 2016 14:27:09 -0800 (PST) X-Virus-Scanned: amavisd-new at ixsystems.com Received: from zimbra.ixsystems.com ([127.0.0.1]) by localhost (zimbra.ixsystems.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id kcxlAuZqb47J; Thu, 24 Nov 2016 14:27:09 -0800 (PST) Received: from [172.20.0.30] (vpn.ixsystems.com [10.249.0.2]) by zimbra.ixsystems.com (Postfix) with ESMTPSA id EB664C4E0DD; Thu, 24 Nov 2016 14:27:07 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.0 \(3226\)) Subject: Re: svn commit: r309121 - head/usr.sbin/bhyve From: Jakub Klama In-Reply-To: <1480026232.1889.63.camel@freebsd.org> Date: Thu, 24 Nov 2016 23:27:04 +0100 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <7F692FF4-4F36-4ED8-AF26-4684D41CB3AE@ixsystems.com> References: <201611242216.uAOMGIi0065703@repo.freebsd.org> <1480026232.1889.63.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.3226) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 05:39:58 -0000 > Wiadomo=C5=9B=C4=87 napisana przez Ian Lepore w dniu = 24.11.2016, o godz. 23:23: >=20 > On Thu, 2016-11-24 at 22:16 +0000, Jakub Wojciech Klama wrote: >> Author: jceel >> Date: Thu Nov 24 22:16:18 2016 >> New Revision: 309121 >> URL: https://svnweb.freebsd.org/changeset/base/309121 >>=20 >> Log: >> virtio_console: handle short writes to an Unix domain socket >> gracefully. >>=20 >> writev() can do a short write. Retrying it results in a very >> convoluted >> and complex code, so we iterate over iovec and do regular >> stream_write() >> instead. >>=20 >=20 > Doesn't pwritev(2) simplify iterating to handle short writes? >=20 Correct me if I'm wrong, but pwritev(2) is a writev(2) with offset. = We're writing to an Unix domain socket here, which is not seekable. Thanks, Jakub From owner-svn-src-all@freebsd.org Wed Nov 30 06:20:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B40D5C5D399; Wed, 30 Nov 2016 06:20:45 +0000 (UTC) (envelope-from dexuan@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 7C9D01F86; Wed, 30 Nov 2016 06:20:45 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU6KiP1073406; Wed, 30 Nov 2016 06:20:44 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU6KiY2073398; Wed, 30 Nov 2016 06:20:44 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201611300620.uAU6KiY2073398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexuan set sender to dexuan@FreeBSD.org using -f From: Dexuan Cui Date: Wed, 30 Nov 2016 06:20:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309312 - in stable/11/sys: conf dev/hyperv/pcib dev/hyperv/vmbus modules/hyperv/pcib modules/hyperv/vmbus X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 06:20:45 -0000 Author: dexuan Date: Wed Nov 30 06:20:43 2016 New Revision: 309312 URL: https://svnweb.freebsd.org/changeset/base/309312 Log: MFC: 308723-308725,308793-308795,309127 Approved by: sephe (mentor) r308723 hyperv/vmbus: add a new method to get vcpu_id vcpu_id is host's representation of guest CPU. We get the mapping between vcpu_id and FreeBSD kernel's cpu id when VMBus driver is loaded. Later, when a driver, like the coming pcib driver, talks to the host and needs to refer to a guest CPU, the driver must use the vcpu_id. Reviewed by: jhb, sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8410 r308724 hyperv/vmbus: add new vmbus methods to support PCIe pass-through The new methods will be used by the coming pcib driver. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8409 r308725 hyperv/pcib: enable PCIe pass-through (a.k.a. Discrete Device Assignment) The feature enables us to pass through physical PCIe devices to FreeBSD VM running on Hyper-V (Windows Server 2016) to get near-native performance with low CPU utilization. The patch implements a PCI bridge driver to support the feature: 1) The pcib driver talks to the host to discover device(s) and presents the device(s) to FreeBSD's pci driver via PCI configuration space (note: to access the configuration space, we don't use the standard I/O port 0xCF8/CFC method; instead, we use an MMIO-based method supplied by Hyper-V, which is very similar to the 0xCF8/CFC method). 2) The pcib driver allocates resources for the device(s) and initialize the related BARs, when the device driver's attach method is invoked; 3) The pcib driver talks to the host to create MSI/MSI-X interrupt remapping between the guest and the host; 4) The pcib driver supports device hot add/remove. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8332 r308793 hyperv/pcib: Fix the build for some kernel configs Add the dependency on pci explicitly for the pcib and vmbus drivers. The related Makefiles are updated accordingly too. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft r308794 hyperv/vmbus,pcib: Add MODULE_DEPEND on pci We'd better add this dependency explicitly, though usually the pci driver is built into the kernel by default. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft r308795 hyperv/pcib: change the file name: pcib.c -> vmbus_pcib.c This makes the file name and the variable naming in the file consistent. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft r309127 hyperv/vmbus,pcib: unbreak build in case NEW_PCIB is undefined vmbus_pcib requires NEW_PCIB, but in case that's not defined, we at least shouldn't break build. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft Added: stable/11/sys/dev/hyperv/pcib/ - copied from r308725, head/sys/dev/hyperv/pcib/ stable/11/sys/dev/hyperv/pcib/vmbus_pcib.c - copied, changed from r308795, head/sys/dev/hyperv/pcib/vmbus_pcib.c stable/11/sys/modules/hyperv/pcib/ - copied from r308725, head/sys/modules/hyperv/pcib/ Deleted: stable/11/sys/dev/hyperv/pcib/pcib.c Modified: stable/11/sys/conf/files.amd64 stable/11/sys/conf/files.i386 stable/11/sys/dev/hyperv/vmbus/vmbus.c stable/11/sys/dev/hyperv/vmbus/vmbus_if.m stable/11/sys/dev/hyperv/vmbus/vmbus_var.h stable/11/sys/modules/hyperv/pcib/Makefile stable/11/sys/modules/hyperv/vmbus/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files.amd64 ============================================================================== --- stable/11/sys/conf/files.amd64 Wed Nov 30 05:28:39 2016 (r309311) +++ stable/11/sys/conf/files.amd64 Wed Nov 30 06:20:43 2016 (r309312) @@ -292,6 +292,7 @@ dev/hwpmc/hwpmc_uncore.c optional hwpmc dev/hwpmc/hwpmc_piv.c optional hwpmc dev/hwpmc/hwpmc_tsc.c optional hwpmc dev/hwpmc/hwpmc_x86.c optional hwpmc +dev/hyperv/pcib/vmbus_pcib.c optional hyperv pci dev/hyperv/netvsc/hn_nvs.c optional hyperv dev/hyperv/netvsc/hn_rndis.c optional hyperv dev/hyperv/netvsc/if_hn.c optional hyperv @@ -303,7 +304,7 @@ dev/hyperv/utilities/hv_timesync.c opt dev/hyperv/utilities/hv_util.c optional hyperv dev/hyperv/vmbus/hyperv.c optional hyperv dev/hyperv/vmbus/hyperv_busdma.c optional hyperv -dev/hyperv/vmbus/vmbus.c optional hyperv +dev/hyperv/vmbus/vmbus.c optional hyperv pci dev/hyperv/vmbus/vmbus_br.c optional hyperv dev/hyperv/vmbus/vmbus_chan.c optional hyperv dev/hyperv/vmbus/vmbus_et.c optional hyperv Modified: stable/11/sys/conf/files.i386 ============================================================================== --- stable/11/sys/conf/files.i386 Wed Nov 30 05:28:39 2016 (r309311) +++ stable/11/sys/conf/files.i386 Wed Nov 30 06:20:43 2016 (r309312) @@ -249,6 +249,7 @@ dev/hwpmc/hwpmc_piv.c optional hwpmc dev/hwpmc/hwpmc_ppro.c optional hwpmc dev/hwpmc/hwpmc_tsc.c optional hwpmc dev/hwpmc/hwpmc_x86.c optional hwpmc +dev/hyperv/pcib/vmbus_pcib.c optional hyperv pci dev/hyperv/netvsc/hn_nvs.c optional hyperv dev/hyperv/netvsc/hn_rndis.c optional hyperv dev/hyperv/netvsc/if_hn.c optional hyperv @@ -260,7 +261,7 @@ dev/hyperv/utilities/hv_timesync.c opt dev/hyperv/utilities/hv_util.c optional hyperv dev/hyperv/vmbus/hyperv.c optional hyperv dev/hyperv/vmbus/hyperv_busdma.c optional hyperv -dev/hyperv/vmbus/vmbus.c optional hyperv +dev/hyperv/vmbus/vmbus.c optional hyperv pci dev/hyperv/vmbus/vmbus_br.c optional hyperv dev/hyperv/vmbus/vmbus_chan.c optional hyperv dev/hyperv/vmbus/vmbus_et.c optional hyperv Copied and modified: stable/11/sys/dev/hyperv/pcib/vmbus_pcib.c (from r308795, head/sys/dev/hyperv/pcib/vmbus_pcib.c) ============================================================================== --- head/sys/dev/hyperv/pcib/vmbus_pcib.c Fri Nov 18 06:44:18 2016 (r308795, copy source) +++ stable/11/sys/dev/hyperv/pcib/vmbus_pcib.c Wed Nov 30 06:20:43 2016 (r309312) @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +#ifdef NEW_PCIB + #include #include #include @@ -1789,3 +1791,5 @@ DEFINE_CLASS_0(pcib, vmbus_pcib_driver, DRIVER_MODULE(vmbus_pcib, vmbus, vmbus_pcib_driver, pcib_devclass, 0, 0); MODULE_DEPEND(vmbus_pcib, vmbus, 1, 1, 1); MODULE_DEPEND(vmbus_pcib, pci, 1, 1, 1); + +#endif /* NEW_PCIB */ Modified: stable/11/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- stable/11/sys/dev/hyperv/vmbus/vmbus.c Wed Nov 30 05:28:39 2016 (r309311) +++ stable/11/sys/dev/hyperv/vmbus/vmbus.c Wed Nov 30 06:20:43 2016 (r309312) @@ -44,10 +44,13 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include #include #include +#include #include #include @@ -58,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include "acpi_if.h" +#include "pcib_if.h" #include "vmbus_if.h" #define VMBUS_GPADL_START 0xe1e10 @@ -74,9 +78,25 @@ static int vmbus_read_ivar(device_t, d uintptr_t *); static int vmbus_child_pnpinfo_str(device_t, device_t, char *, size_t); +static struct resource *vmbus_alloc_resource(device_t dev, + device_t child, int type, int *rid, + rman_res_t start, rman_res_t end, + rman_res_t count, u_int flags); +static int vmbus_alloc_msi(device_t bus, device_t dev, + int count, int maxcount, int *irqs); +static int vmbus_release_msi(device_t bus, device_t dev, + int count, int *irqs); +static int vmbus_alloc_msix(device_t bus, device_t dev, + int *irq); +static int vmbus_release_msix(device_t bus, device_t dev, + int irq); +static int vmbus_map_msi(device_t bus, device_t dev, + int irq, uint64_t *addr, uint32_t *data); static uint32_t vmbus_get_version_method(device_t, device_t); static int vmbus_probe_guid_method(device_t, device_t, const struct hyperv_guid *); +static uint32_t vmbus_get_vcpu_id_method(device_t bus, + device_t dev, int cpu); static int vmbus_init(struct vmbus_softc *); static int vmbus_connect(struct vmbus_softc *, uint32_t); @@ -131,10 +151,27 @@ static device_method_t vmbus_methods[] = DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, vmbus_read_ivar), DEVMETHOD(bus_child_pnpinfo_str, vmbus_child_pnpinfo_str), + DEVMETHOD(bus_alloc_resource, vmbus_alloc_resource), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), +#if __FreeBSD_version >= 1100000 + DEVMETHOD(bus_get_cpus, bus_generic_get_cpus), +#endif + + /* pcib interface */ + DEVMETHOD(pcib_alloc_msi, vmbus_alloc_msi), + DEVMETHOD(pcib_release_msi, vmbus_release_msi), + DEVMETHOD(pcib_alloc_msix, vmbus_alloc_msix), + DEVMETHOD(pcib_release_msix, vmbus_release_msix), + DEVMETHOD(pcib_map_msi, vmbus_map_msi), /* Vmbus interface */ DEVMETHOD(vmbus_get_version, vmbus_get_version_method), DEVMETHOD(vmbus_probe_guid, vmbus_probe_guid_method), + DEVMETHOD(vmbus_get_vcpu_id, vmbus_get_vcpu_id_method), DEVMETHOD_END }; @@ -149,6 +186,7 @@ static devclass_t vmbus_devclass; DRIVER_MODULE(vmbus, acpi, vmbus_driver, vmbus_devclass, NULL, NULL); MODULE_DEPEND(vmbus, acpi, 1, 1, 1); +MODULE_DEPEND(vmbus, pci, 1, 1, 1); MODULE_VERSION(vmbus, 1); static __inline struct vmbus_softc * @@ -972,6 +1010,74 @@ vmbus_sysctl_version(SYSCTL_HANDLER_ARGS return sysctl_handle_string(oidp, verstr, sizeof(verstr), req); } +/* + * We need the function to make sure the MMIO resource is allocated from the + * ranges found in _CRS. + * + * For the release function, we can use bus_generic_release_resource(). + */ +static struct resource * +vmbus_alloc_resource(device_t dev, device_t child, int type, int *rid, + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) +{ + device_t parent = device_get_parent(dev); + struct resource *res; + +#ifdef NEW_PCIB + if (type == SYS_RES_MEMORY) { + struct vmbus_softc *sc = device_get_softc(dev); + + res = pcib_host_res_alloc(&sc->vmbus_mmio_res, child, type, + rid, start, end, count, flags); + } else +#endif + { + res = BUS_ALLOC_RESOURCE(parent, child, type, rid, start, + end, count, flags); + } + + return (res); +} + +static device_t +get_nexus(device_t vmbus) +{ + device_t acpi = device_get_parent(vmbus); + device_t nexus = device_get_parent(acpi); + return (nexus); +} + +static int +vmbus_alloc_msi(device_t bus, device_t dev, int count, int maxcount, int *irqs) +{ + return (PCIB_ALLOC_MSI(get_nexus(bus), dev, count, maxcount, irqs)); +} + +static int +vmbus_release_msi(device_t bus, device_t dev, int count, int *irqs) +{ + return (PCIB_RELEASE_MSI(get_nexus(bus), dev, count, irqs)); +} + +static int +vmbus_alloc_msix(device_t bus, device_t dev, int *irq) +{ + return (PCIB_ALLOC_MSIX(get_nexus(bus), dev, irq)); +} + +static int +vmbus_release_msix(device_t bus, device_t dev, int irq) +{ + return (PCIB_RELEASE_MSIX(get_nexus(bus), dev, irq)); +} + +static int +vmbus_map_msi(device_t bus, device_t dev, int irq, uint64_t *addr, + uint32_t *data) +{ + return (PCIB_MAP_MSI(get_nexus(bus), dev, irq, addr, data)); +} + static uint32_t vmbus_get_version_method(device_t bus, device_t dev) { @@ -991,6 +1097,148 @@ vmbus_probe_guid_method(device_t bus, de return ENXIO; } +static uint32_t +vmbus_get_vcpu_id_method(device_t bus, device_t dev, int cpu) +{ + const struct vmbus_softc *sc = device_get_softc(bus); + + return (VMBUS_PCPU_GET(sc, vcpuid, cpu)); +} + +#ifdef NEW_PCIB +#define VTPM_BASE_ADDR 0xfed40000 +#define FOUR_GB (1ULL << 32) + +enum parse_pass { parse_64, parse_32 }; + +struct parse_context { + device_t vmbus_dev; + enum parse_pass pass; +}; + +static ACPI_STATUS +parse_crs(ACPI_RESOURCE *res, void *ctx) +{ + const struct parse_context *pc = ctx; + device_t vmbus_dev = pc->vmbus_dev; + + struct vmbus_softc *sc = device_get_softc(vmbus_dev); + UINT64 start, end; + + switch (res->Type) { + case ACPI_RESOURCE_TYPE_ADDRESS32: + start = res->Data.Address32.Address.Minimum; + end = res->Data.Address32.Address.Maximum; + break; + + case ACPI_RESOURCE_TYPE_ADDRESS64: + start = res->Data.Address64.Address.Minimum; + end = res->Data.Address64.Address.Maximum; + break; + + default: + /* Unused types. */ + return (AE_OK); + } + + /* + * We don't use <1MB addresses. + */ + if (end < 0x100000) + return (AE_OK); + + /* Don't conflict with vTPM. */ + if (end >= VTPM_BASE_ADDR && start < VTPM_BASE_ADDR) + end = VTPM_BASE_ADDR - 1; + + if ((pc->pass == parse_32 && start < FOUR_GB) || + (pc->pass == parse_64 && start >= FOUR_GB)) + pcib_host_res_decodes(&sc->vmbus_mmio_res, SYS_RES_MEMORY, + start, end, 0); + + return (AE_OK); +} + +static void +vmbus_get_crs(device_t dev, device_t vmbus_dev, enum parse_pass pass) +{ + struct parse_context pc; + ACPI_STATUS status; + + if (bootverbose) + device_printf(dev, "walking _CRS, pass=%d\n", pass); + + pc.vmbus_dev = vmbus_dev; + pc.pass = pass; + status = AcpiWalkResources(acpi_get_handle(dev), "_CRS", + parse_crs, &pc); + + if (bootverbose && ACPI_FAILURE(status)) + device_printf(dev, "_CRS: not found, pass=%d\n", pass); +} + +static void +vmbus_get_mmio_res_pass(device_t dev, enum parse_pass pass) +{ + device_t acpi0, pcib0 = NULL; + device_t *children; + int i, count; + + /* Try to find _CRS on VMBus device */ + vmbus_get_crs(dev, dev, pass); + + /* Try to find _CRS on VMBus device's parent */ + acpi0 = device_get_parent(dev); + vmbus_get_crs(acpi0, dev, pass); + + /* Try to locate pcib0 and find _CRS on it */ + if (device_get_children(acpi0, &children, &count) != 0) + return; + + for (i = 0; i < count; i++) { + if (!device_is_attached(children[i])) + continue; + + if (strcmp("pcib0", device_get_nameunit(children[i]))) + continue; + + pcib0 = children[i]; + break; + } + + if (pcib0) + vmbus_get_crs(pcib0, dev, pass); + + free(children, M_TEMP); +} + +static void +vmbus_get_mmio_res(device_t dev) +{ + struct vmbus_softc *sc = device_get_softc(dev); + /* + * We walk the resources twice to make sure that: in the resource + * list, the 32-bit resources appear behind the 64-bit resources. + * NB: resource_list_add() uses INSERT_TAIL. This way, when we + * iterate through the list to find a range for a 64-bit BAR in + * vmbus_alloc_resource(), we can make sure we try to use >4GB + * ranges first. + */ + pcib_host_res_init(dev, &sc->vmbus_mmio_res); + + vmbus_get_mmio_res_pass(dev, parse_64); + vmbus_get_mmio_res_pass(dev, parse_32); +} + +static void +vmbus_free_mmio_res(device_t dev) +{ + struct vmbus_softc *sc = device_get_softc(dev); + + pcib_host_res_free(dev, &sc->vmbus_mmio_res); +} +#endif /* NEW_PCIB */ + static int vmbus_probe(device_t dev) { @@ -1027,6 +1275,11 @@ vmbus_doattach(struct vmbus_softc *sc) if (sc->vmbus_flags & VMBUS_FLAG_ATTACHED) return (0); + +#ifdef NEW_PCIB + vmbus_get_mmio_res(sc->vmbus_dev); +#endif + sc->vmbus_flags |= VMBUS_FLAG_ATTACHED; sc->vmbus_gpadl = VMBUS_GPADL_START; @@ -1173,6 +1426,10 @@ vmbus_detach(device_t dev) mtx_destroy(&sc->vmbus_prichan_lock); mtx_destroy(&sc->vmbus_chan_lock); +#ifdef NEW_PCIB + vmbus_free_mmio_res(dev); +#endif + return (0); } Modified: stable/11/sys/dev/hyperv/vmbus/vmbus_if.m ============================================================================== --- stable/11/sys/dev/hyperv/vmbus/vmbus_if.m Wed Nov 30 05:28:39 2016 (r309311) +++ stable/11/sys/dev/hyperv/vmbus/vmbus_if.m Wed Nov 30 06:20:43 2016 (r309312) @@ -45,3 +45,9 @@ METHOD int probe_guid { device_t dev; const struct hyperv_guid *guid; }; + +METHOD uint32_t get_vcpu_id { + device_t bus; + device_t dev; + int cpu; +}; Modified: stable/11/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- stable/11/sys/dev/hyperv/vmbus/vmbus_var.h Wed Nov 30 05:28:39 2016 (r309311) +++ stable/11/sys/dev/hyperv/vmbus/vmbus_var.h Wed Nov 30 06:20:43 2016 (r309312) @@ -31,8 +31,11 @@ #include #include +#include #include +#include +#include /* * NOTE: DO NOT CHANGE THIS. @@ -77,6 +80,10 @@ struct vmbus_pcpu_data { struct task message_task; /* message task */ } __aligned(CACHE_LINE_SIZE); +#if __FreeBSD_version < 1100000 +typedef u_long rman_res_t; +#endif + struct vmbus_softc { void (*vmbus_event_proc)(struct vmbus_softc *, int); u_long *vmbus_tx_evtflags; @@ -120,6 +127,11 @@ struct vmbus_softc { /* Complete channel list */ struct mtx vmbus_chan_lock; TAILQ_HEAD(, vmbus_channel) vmbus_chans; + +#ifdef NEW_PCIB + /* The list of usable MMIO ranges for PCIe pass-through */ + struct pcib_host_resources vmbus_mmio_res; +#endif }; #define VMBUS_FLAG_ATTACHED 0x0001 /* vmbus was attached */ Modified: stable/11/sys/modules/hyperv/pcib/Makefile ============================================================================== --- head/sys/modules/hyperv/pcib/Makefile Wed Nov 16 09:25:00 2016 (r308725) +++ stable/11/sys/modules/hyperv/pcib/Makefile Wed Nov 30 06:20:43 2016 (r309312) @@ -4,8 +4,8 @@ ${.CURDIR}/../../../dev/hyperv/vmbus KMOD= vmbus_pcib -SRCS= pcib.c -SRCS+= bus_if.h device_if.h vmbus_if.h +SRCS= vmbus_pcib.c +SRCS+= bus_if.h device_if.h pci_if.h pcib_if.h vmbus_if.h CFLAGS+= -I${.CURDIR}/../../../dev/hyperv/pcib Modified: stable/11/sys/modules/hyperv/vmbus/Makefile ============================================================================== --- stable/11/sys/modules/hyperv/vmbus/Makefile Wed Nov 30 05:28:39 2016 (r309311) +++ stable/11/sys/modules/hyperv/vmbus/Makefile Wed Nov 30 06:20:43 2016 (r309312) @@ -13,7 +13,7 @@ SRCS= hyperv.c \ vmbus_et.c \ vmbus_if.c \ vmbus_xact.c -SRCS+= acpi_if.h bus_if.h device_if.h opt_acpi.h vmbus_if.h +SRCS+= acpi_if.h bus_if.h device_if.h opt_acpi.h pci_if.h pcib_if.h vmbus_if.h # XXX: for assym.s SRCS+= opt_kstack_pages.h opt_nfs.h opt_hwpmc_hooks.h opt_compat.h From owner-svn-src-all@freebsd.org Wed Nov 30 06:26:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E41A4C5D5C2; Wed, 30 Nov 2016 06:26:39 +0000 (UTC) (envelope-from dexuan@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 AC9991451; Wed, 30 Nov 2016 06:26:39 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU6QcBx077450; Wed, 30 Nov 2016 06:26:38 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU6QcBq077442; Wed, 30 Nov 2016 06:26:38 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201611300626.uAU6QcBq077442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexuan set sender to dexuan@FreeBSD.org using -f From: Dexuan Cui Date: Wed, 30 Nov 2016 06:26:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309313 - in stable/10/sys: conf dev/hyperv/pcib dev/hyperv/vmbus modules/hyperv/pcib modules/hyperv/vmbus X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 06:26:40 -0000 Author: dexuan Date: Wed Nov 30 06:26:37 2016 New Revision: 309313 URL: https://svnweb.freebsd.org/changeset/base/309313 Log: MFC: 308723-308725,308793-308795,309127 Approved by: sephe (mentor) r308723 hyperv/vmbus: add a new method to get vcpu_id vcpu_id is host's representation of guest CPU. We get the mapping between vcpu_id and FreeBSD kernel's cpu id when VMBus driver is loaded. Later, when a driver, like the coming pcib driver, talks to the host and needs to refer to a guest CPU, the driver must use the vcpu_id. Reviewed by: jhb, sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8410 r308724 hyperv/vmbus: add new vmbus methods to support PCIe pass-through The new methods will be used by the coming pcib driver. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8409 r308725 hyperv/pcib: enable PCIe pass-through (a.k.a. Discrete Device Assignment) The feature enables us to pass through physical PCIe devices to FreeBSD VM running on Hyper-V (Windows Server 2016) to get near-native performance with low CPU utilization. The patch implements a PCI bridge driver to support the feature: 1) The pcib driver talks to the host to discover device(s) and presents the device(s) to FreeBSD's pci driver via PCI configuration space (note: to access the configuration space, we don't use the standard I/O port 0xCF8/CFC method; instead, we use an MMIO-based method supplied by Hyper-V, which is very similar to the 0xCF8/CFC method). 2) The pcib driver allocates resources for the device(s) and initialize the related BARs, when the device driver's attach method is invoked; 3) The pcib driver talks to the host to create MSI/MSI-X interrupt remapping between the guest and the host; 4) The pcib driver supports device hot add/remove. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8332 r308793 hyperv/pcib: Fix the build for some kernel configs Add the dependency on pci explicitly for the pcib and vmbus drivers. The related Makefiles are updated accordingly too. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft r308794 hyperv/vmbus,pcib: Add MODULE_DEPEND on pci We'd better add this dependency explicitly, though usually the pci driver is built into the kernel by default. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft r308795 hyperv/pcib: change the file name: pcib.c -> vmbus_pcib.c This makes the file name and the variable naming in the file consistent. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft r309127 hyperv/vmbus,pcib: unbreak build in case NEW_PCIB is undefined vmbus_pcib requires NEW_PCIB, but in case that's not defined, we at least shouldn't break build. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft Added: stable/10/sys/dev/hyperv/pcib/ - copied from r308725, head/sys/dev/hyperv/pcib/ stable/10/sys/dev/hyperv/pcib/vmbus_pcib.c - copied, changed from r308795, head/sys/dev/hyperv/pcib/vmbus_pcib.c stable/10/sys/modules/hyperv/pcib/ - copied from r308725, head/sys/modules/hyperv/pcib/ Deleted: stable/10/sys/dev/hyperv/pcib/pcib.c Modified: stable/10/sys/conf/files.amd64 stable/10/sys/conf/files.i386 stable/10/sys/dev/hyperv/vmbus/vmbus.c stable/10/sys/dev/hyperv/vmbus/vmbus_if.m stable/10/sys/dev/hyperv/vmbus/vmbus_var.h stable/10/sys/modules/hyperv/pcib/Makefile stable/10/sys/modules/hyperv/vmbus/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files.amd64 ============================================================================== --- stable/10/sys/conf/files.amd64 Wed Nov 30 06:20:43 2016 (r309312) +++ stable/10/sys/conf/files.amd64 Wed Nov 30 06:26:37 2016 (r309313) @@ -261,6 +261,7 @@ dev/hwpmc/hwpmc_uncore.c optional hwpmc dev/hwpmc/hwpmc_piv.c optional hwpmc dev/hwpmc/hwpmc_tsc.c optional hwpmc dev/hwpmc/hwpmc_x86.c optional hwpmc +dev/hyperv/pcib/vmbus_pcib.c optional hyperv pci dev/hyperv/netvsc/hn_nvs.c optional hyperv dev/hyperv/netvsc/hn_rndis.c optional hyperv dev/hyperv/netvsc/if_hn.c optional hyperv @@ -272,7 +273,7 @@ dev/hyperv/utilities/hv_timesync.c opt dev/hyperv/utilities/hv_util.c optional hyperv dev/hyperv/vmbus/hyperv.c optional hyperv dev/hyperv/vmbus/hyperv_busdma.c optional hyperv -dev/hyperv/vmbus/vmbus.c optional hyperv +dev/hyperv/vmbus/vmbus.c optional hyperv pci dev/hyperv/vmbus/vmbus_br.c optional hyperv dev/hyperv/vmbus/vmbus_chan.c optional hyperv dev/hyperv/vmbus/vmbus_et.c optional hyperv Modified: stable/10/sys/conf/files.i386 ============================================================================== --- stable/10/sys/conf/files.i386 Wed Nov 30 06:20:43 2016 (r309312) +++ stable/10/sys/conf/files.i386 Wed Nov 30 06:26:37 2016 (r309313) @@ -238,6 +238,7 @@ dev/hwpmc/hwpmc_piv.c optional hwpmc dev/hwpmc/hwpmc_ppro.c optional hwpmc dev/hwpmc/hwpmc_tsc.c optional hwpmc dev/hwpmc/hwpmc_x86.c optional hwpmc +dev/hyperv/pcib/vmbus_pcib.c optional hyperv pci dev/hyperv/netvsc/hn_nvs.c optional hyperv dev/hyperv/netvsc/hn_rndis.c optional hyperv dev/hyperv/netvsc/if_hn.c optional hyperv @@ -249,7 +250,7 @@ dev/hyperv/utilities/hv_timesync.c opt dev/hyperv/utilities/hv_util.c optional hyperv dev/hyperv/vmbus/hyperv.c optional hyperv dev/hyperv/vmbus/hyperv_busdma.c optional hyperv -dev/hyperv/vmbus/vmbus.c optional hyperv +dev/hyperv/vmbus/vmbus.c optional hyperv pci dev/hyperv/vmbus/vmbus_br.c optional hyperv dev/hyperv/vmbus/vmbus_chan.c optional hyperv dev/hyperv/vmbus/vmbus_et.c optional hyperv Copied and modified: stable/10/sys/dev/hyperv/pcib/vmbus_pcib.c (from r308795, head/sys/dev/hyperv/pcib/vmbus_pcib.c) ============================================================================== --- head/sys/dev/hyperv/pcib/vmbus_pcib.c Fri Nov 18 06:44:18 2016 (r308795, copy source) +++ stable/10/sys/dev/hyperv/pcib/vmbus_pcib.c Wed Nov 30 06:26:37 2016 (r309313) @@ -27,6 +27,8 @@ #include __FBSDID("$FreeBSD$"); +#ifdef NEW_PCIB + #include #include #include @@ -1789,3 +1791,5 @@ DEFINE_CLASS_0(pcib, vmbus_pcib_driver, DRIVER_MODULE(vmbus_pcib, vmbus, vmbus_pcib_driver, pcib_devclass, 0, 0); MODULE_DEPEND(vmbus_pcib, vmbus, 1, 1, 1); MODULE_DEPEND(vmbus_pcib, pci, 1, 1, 1); + +#endif /* NEW_PCIB */ Modified: stable/10/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/vmbus.c Wed Nov 30 06:20:43 2016 (r309312) +++ stable/10/sys/dev/hyperv/vmbus/vmbus.c Wed Nov 30 06:26:37 2016 (r309313) @@ -45,11 +45,14 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include #include #include #include +#include #include #include @@ -60,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include "acpi_if.h" +#include "pcib_if.h" #include "vmbus_if.h" #define VMBUS_GPADL_START 0xe1e10 @@ -76,9 +80,25 @@ static int vmbus_read_ivar(device_t, d uintptr_t *); static int vmbus_child_pnpinfo_str(device_t, device_t, char *, size_t); +static struct resource *vmbus_alloc_resource(device_t dev, + device_t child, int type, int *rid, + rman_res_t start, rman_res_t end, + rman_res_t count, u_int flags); +static int vmbus_alloc_msi(device_t bus, device_t dev, + int count, int maxcount, int *irqs); +static int vmbus_release_msi(device_t bus, device_t dev, + int count, int *irqs); +static int vmbus_alloc_msix(device_t bus, device_t dev, + int *irq); +static int vmbus_release_msix(device_t bus, device_t dev, + int irq); +static int vmbus_map_msi(device_t bus, device_t dev, + int irq, uint64_t *addr, uint32_t *data); static uint32_t vmbus_get_version_method(device_t, device_t); static int vmbus_probe_guid_method(device_t, device_t, const struct hyperv_guid *); +static uint32_t vmbus_get_vcpu_id_method(device_t bus, + device_t dev, int cpu); static int vmbus_init(struct vmbus_softc *); static int vmbus_connect(struct vmbus_softc *, uint32_t); @@ -133,10 +153,27 @@ static device_method_t vmbus_methods[] = DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_read_ivar, vmbus_read_ivar), DEVMETHOD(bus_child_pnpinfo_str, vmbus_child_pnpinfo_str), + DEVMETHOD(bus_alloc_resource, vmbus_alloc_resource), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), + DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), +#if __FreeBSD_version >= 1100000 + DEVMETHOD(bus_get_cpus, bus_generic_get_cpus), +#endif + + /* pcib interface */ + DEVMETHOD(pcib_alloc_msi, vmbus_alloc_msi), + DEVMETHOD(pcib_release_msi, vmbus_release_msi), + DEVMETHOD(pcib_alloc_msix, vmbus_alloc_msix), + DEVMETHOD(pcib_release_msix, vmbus_release_msix), + DEVMETHOD(pcib_map_msi, vmbus_map_msi), /* Vmbus interface */ DEVMETHOD(vmbus_get_version, vmbus_get_version_method), DEVMETHOD(vmbus_probe_guid, vmbus_probe_guid_method), + DEVMETHOD(vmbus_get_vcpu_id, vmbus_get_vcpu_id_method), DEVMETHOD_END }; @@ -151,6 +188,7 @@ static devclass_t vmbus_devclass; DRIVER_MODULE(vmbus, acpi, vmbus_driver, vmbus_devclass, NULL, NULL); MODULE_DEPEND(vmbus, acpi, 1, 1, 1); +MODULE_DEPEND(vmbus, pci, 1, 1, 1); MODULE_VERSION(vmbus, 1); static __inline struct vmbus_softc * @@ -1054,6 +1092,74 @@ vmbus_sysctl_version(SYSCTL_HANDLER_ARGS return sysctl_handle_string(oidp, verstr, sizeof(verstr), req); } +/* + * We need the function to make sure the MMIO resource is allocated from the + * ranges found in _CRS. + * + * For the release function, we can use bus_generic_release_resource(). + */ +static struct resource * +vmbus_alloc_resource(device_t dev, device_t child, int type, int *rid, + rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) +{ + device_t parent = device_get_parent(dev); + struct resource *res; + +#ifdef NEW_PCIB + if (type == SYS_RES_MEMORY) { + struct vmbus_softc *sc = device_get_softc(dev); + + res = pcib_host_res_alloc(&sc->vmbus_mmio_res, child, type, + rid, start, end, count, flags); + } else +#endif + { + res = BUS_ALLOC_RESOURCE(parent, child, type, rid, start, + end, count, flags); + } + + return (res); +} + +static device_t +get_nexus(device_t vmbus) +{ + device_t acpi = device_get_parent(vmbus); + device_t nexus = device_get_parent(acpi); + return (nexus); +} + +static int +vmbus_alloc_msi(device_t bus, device_t dev, int count, int maxcount, int *irqs) +{ + return (PCIB_ALLOC_MSI(get_nexus(bus), dev, count, maxcount, irqs)); +} + +static int +vmbus_release_msi(device_t bus, device_t dev, int count, int *irqs) +{ + return (PCIB_RELEASE_MSI(get_nexus(bus), dev, count, irqs)); +} + +static int +vmbus_alloc_msix(device_t bus, device_t dev, int *irq) +{ + return (PCIB_ALLOC_MSIX(get_nexus(bus), dev, irq)); +} + +static int +vmbus_release_msix(device_t bus, device_t dev, int irq) +{ + return (PCIB_RELEASE_MSIX(get_nexus(bus), dev, irq)); +} + +static int +vmbus_map_msi(device_t bus, device_t dev, int irq, uint64_t *addr, + uint32_t *data) +{ + return (PCIB_MAP_MSI(get_nexus(bus), dev, irq, addr, data)); +} + static uint32_t vmbus_get_version_method(device_t bus, device_t dev) { @@ -1073,6 +1179,148 @@ vmbus_probe_guid_method(device_t bus, de return ENXIO; } +static uint32_t +vmbus_get_vcpu_id_method(device_t bus, device_t dev, int cpu) +{ + const struct vmbus_softc *sc = device_get_softc(bus); + + return (VMBUS_PCPU_GET(sc, vcpuid, cpu)); +} + +#ifdef NEW_PCIB +#define VTPM_BASE_ADDR 0xfed40000 +#define FOUR_GB (1ULL << 32) + +enum parse_pass { parse_64, parse_32 }; + +struct parse_context { + device_t vmbus_dev; + enum parse_pass pass; +}; + +static ACPI_STATUS +parse_crs(ACPI_RESOURCE *res, void *ctx) +{ + const struct parse_context *pc = ctx; + device_t vmbus_dev = pc->vmbus_dev; + + struct vmbus_softc *sc = device_get_softc(vmbus_dev); + UINT64 start, end; + + switch (res->Type) { + case ACPI_RESOURCE_TYPE_ADDRESS32: + start = res->Data.Address32.Address.Minimum; + end = res->Data.Address32.Address.Maximum; + break; + + case ACPI_RESOURCE_TYPE_ADDRESS64: + start = res->Data.Address64.Address.Minimum; + end = res->Data.Address64.Address.Maximum; + break; + + default: + /* Unused types. */ + return (AE_OK); + } + + /* + * We don't use <1MB addresses. + */ + if (end < 0x100000) + return (AE_OK); + + /* Don't conflict with vTPM. */ + if (end >= VTPM_BASE_ADDR && start < VTPM_BASE_ADDR) + end = VTPM_BASE_ADDR - 1; + + if ((pc->pass == parse_32 && start < FOUR_GB) || + (pc->pass == parse_64 && start >= FOUR_GB)) + pcib_host_res_decodes(&sc->vmbus_mmio_res, SYS_RES_MEMORY, + start, end, 0); + + return (AE_OK); +} + +static void +vmbus_get_crs(device_t dev, device_t vmbus_dev, enum parse_pass pass) +{ + struct parse_context pc; + ACPI_STATUS status; + + if (bootverbose) + device_printf(dev, "walking _CRS, pass=%d\n", pass); + + pc.vmbus_dev = vmbus_dev; + pc.pass = pass; + status = AcpiWalkResources(acpi_get_handle(dev), "_CRS", + parse_crs, &pc); + + if (bootverbose && ACPI_FAILURE(status)) + device_printf(dev, "_CRS: not found, pass=%d\n", pass); +} + +static void +vmbus_get_mmio_res_pass(device_t dev, enum parse_pass pass) +{ + device_t acpi0, pcib0 = NULL; + device_t *children; + int i, count; + + /* Try to find _CRS on VMBus device */ + vmbus_get_crs(dev, dev, pass); + + /* Try to find _CRS on VMBus device's parent */ + acpi0 = device_get_parent(dev); + vmbus_get_crs(acpi0, dev, pass); + + /* Try to locate pcib0 and find _CRS on it */ + if (device_get_children(acpi0, &children, &count) != 0) + return; + + for (i = 0; i < count; i++) { + if (!device_is_attached(children[i])) + continue; + + if (strcmp("pcib0", device_get_nameunit(children[i]))) + continue; + + pcib0 = children[i]; + break; + } + + if (pcib0) + vmbus_get_crs(pcib0, dev, pass); + + free(children, M_TEMP); +} + +static void +vmbus_get_mmio_res(device_t dev) +{ + struct vmbus_softc *sc = device_get_softc(dev); + /* + * We walk the resources twice to make sure that: in the resource + * list, the 32-bit resources appear behind the 64-bit resources. + * NB: resource_list_add() uses INSERT_TAIL. This way, when we + * iterate through the list to find a range for a 64-bit BAR in + * vmbus_alloc_resource(), we can make sure we try to use >4GB + * ranges first. + */ + pcib_host_res_init(dev, &sc->vmbus_mmio_res); + + vmbus_get_mmio_res_pass(dev, parse_64); + vmbus_get_mmio_res_pass(dev, parse_32); +} + +static void +vmbus_free_mmio_res(device_t dev) +{ + struct vmbus_softc *sc = device_get_softc(dev); + + pcib_host_res_free(dev, &sc->vmbus_mmio_res); +} +#endif /* NEW_PCIB */ + static int vmbus_probe(device_t dev) { @@ -1109,6 +1357,11 @@ vmbus_doattach(struct vmbus_softc *sc) if (sc->vmbus_flags & VMBUS_FLAG_ATTACHED) return (0); + +#ifdef NEW_PCIB + vmbus_get_mmio_res(sc->vmbus_dev); +#endif + sc->vmbus_flags |= VMBUS_FLAG_ATTACHED; sc->vmbus_gpadl = VMBUS_GPADL_START; @@ -1252,6 +1505,10 @@ vmbus_detach(device_t dev) mtx_destroy(&sc->vmbus_prichan_lock); mtx_destroy(&sc->vmbus_chan_lock); +#ifdef NEW_PCIB + vmbus_free_mmio_res(dev); +#endif + return (0); } Modified: stable/10/sys/dev/hyperv/vmbus/vmbus_if.m ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/vmbus_if.m Wed Nov 30 06:20:43 2016 (r309312) +++ stable/10/sys/dev/hyperv/vmbus/vmbus_if.m Wed Nov 30 06:26:37 2016 (r309313) @@ -45,3 +45,9 @@ METHOD int probe_guid { device_t dev; const struct hyperv_guid *guid; }; + +METHOD uint32_t get_vcpu_id { + device_t bus; + device_t dev; + int cpu; +}; Modified: stable/10/sys/dev/hyperv/vmbus/vmbus_var.h ============================================================================== --- stable/10/sys/dev/hyperv/vmbus/vmbus_var.h Wed Nov 30 06:20:43 2016 (r309312) +++ stable/10/sys/dev/hyperv/vmbus/vmbus_var.h Wed Nov 30 06:26:37 2016 (r309313) @@ -31,8 +31,11 @@ #include #include +#include #include +#include +#include /* * NOTE: DO NOT CHANGE THIS. @@ -77,6 +80,10 @@ struct vmbus_pcpu_data { struct task message_task; /* message task */ } __aligned(CACHE_LINE_SIZE); +#if __FreeBSD_version < 1100000 +typedef u_long rman_res_t; +#endif + struct vmbus_softc { void (*vmbus_event_proc)(struct vmbus_softc *, int); u_long *vmbus_tx_evtflags; @@ -120,6 +127,11 @@ struct vmbus_softc { /* Complete channel list */ struct mtx vmbus_chan_lock; TAILQ_HEAD(, vmbus_channel) vmbus_chans; + +#ifdef NEW_PCIB + /* The list of usable MMIO ranges for PCIe pass-through */ + struct pcib_host_resources vmbus_mmio_res; +#endif }; #define VMBUS_FLAG_ATTACHED 0x0001 /* vmbus was attached */ Modified: stable/10/sys/modules/hyperv/pcib/Makefile ============================================================================== --- head/sys/modules/hyperv/pcib/Makefile Wed Nov 16 09:25:00 2016 (r308725) +++ stable/10/sys/modules/hyperv/pcib/Makefile Wed Nov 30 06:26:37 2016 (r309313) @@ -4,8 +4,8 @@ ${.CURDIR}/../../../dev/hyperv/vmbus KMOD= vmbus_pcib -SRCS= pcib.c -SRCS+= bus_if.h device_if.h vmbus_if.h +SRCS= vmbus_pcib.c +SRCS+= bus_if.h device_if.h pci_if.h pcib_if.h vmbus_if.h CFLAGS+= -I${.CURDIR}/../../../dev/hyperv/pcib Modified: stable/10/sys/modules/hyperv/vmbus/Makefile ============================================================================== --- stable/10/sys/modules/hyperv/vmbus/Makefile Wed Nov 30 06:20:43 2016 (r309312) +++ stable/10/sys/modules/hyperv/vmbus/Makefile Wed Nov 30 06:26:37 2016 (r309313) @@ -13,7 +13,7 @@ SRCS= hyperv.c \ vmbus_et.c \ vmbus_if.c \ vmbus_xact.c -SRCS+= acpi_if.h bus_if.h device_if.h opt_acpi.h vmbus_if.h +SRCS+= acpi_if.h bus_if.h device_if.h opt_acpi.h pci_if.h pcib_if.h vmbus_if.h # XXX: for assym.s SRCS+= opt_kstack_pages.h opt_nfs.h opt_apic.h opt_hwpmc_hooks.h opt_compat.h From owner-svn-src-all@freebsd.org Wed Nov 30 07:16:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99D78C5DEB5; Wed, 30 Nov 2016 07:16:30 +0000 (UTC) (envelope-from matthew@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 746C716A0; Wed, 30 Nov 2016 07:16:30 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU7GT4d097455; Wed, 30 Nov 2016 07:16:29 GMT (envelope-from matthew@FreeBSD.org) Received: (from matthew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU7GTPr097452; Wed, 30 Nov 2016 07:16:29 GMT (envelope-from matthew@FreeBSD.org) Message-Id: <201611300716.uAU7GTPr097452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: matthew set sender to matthew@FreeBSD.org using -f From: Matthew Seaman Date: Wed, 30 Nov 2016 07:16:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309314 - in head: . release/scripts share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 07:16:30 -0000 Author: matthew (ports committer) Date: Wed Nov 30 07:16:29 2016 New Revision: 309314 URL: https://svnweb.freebsd.org/changeset/base/309314 Log: Allow a user-overridable setting 'PKG_CMD' to control the command used to create a repo during 'make packages' This would have been useful for a situation I found myself in where pkg(8) had been upgraded to a version that wanted the FBSD_1.5 ABI version but libc.so.7 had not been upgraded, and only provided FBSD_1.4. I found I needed to update libc in order to run pkg, and I also needed to use pkg to update libc... Which is why pkg-static exists, but there's currently no way to tell the build system to use pkg-static instead of pkg. This creates a variable PKG_CMD, default value 'pkg', that can be overridden from the command line. Reviewed by: gjb Approved by: gjb Differential Revision: https://reviews.freebsd.org/D8120 Modified: head/Makefile.inc1 head/release/scripts/make-pkg-package.sh head/share/mk/bsd.own.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Nov 30 06:26:37 2016 (r309313) +++ head/Makefile.inc1 Wed Nov 30 07:16:29 2016 (r309314) @@ -1379,7 +1379,8 @@ packages: .PHONY package-pkg: .PHONY rm -rf /tmp/ports.${TARGET} || : env ${WMAKEENV:Q} SRCDIR=${.CURDIR} PORTSDIR=${PORTSDIR} REVISION=${_REVISION} \ - PKG_VERSION=${PKG_VERSION} REPODIR=${REPODIR} WSTAGEDIR=${WSTAGEDIR} \ + PKG_CMD=${PKG_CMD} PKG_VERSION=${PKG_VERSION} REPODIR=${REPODIR} \ + WSTAGEDIR=${WSTAGEDIR} \ sh ${.CURDIR}/release/scripts/make-pkg-package.sh real-packages: stage-packages create-packages sign-packages .PHONY @@ -1417,11 +1418,11 @@ create-world-packages: _pkgbootstrap .PH /^name/ { printf("===> Creating %s-", $$2); next } \ /^version/ { print $$2; next } \ ' ${WSTAGEDIR}/$${pkgname}.ucl ; \ - pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ + ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ create -M ${WSTAGEDIR}/$${pkgname}.ucl \ -p ${WSTAGEDIR}/$${pkgname}.plist \ -r ${WSTAGEDIR} \ - -o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} ; \ + -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} ; \ done create-kernel-packages: _pkgbootstrap .PHONY @@ -1445,11 +1446,11 @@ create-kernel-packages: _pkgbootstrap .P /name/ { printf("===> Creating %s-", $$2); next } \ /version/ {print $$2; next } ' \ ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl ; \ - pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ + ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ create -M ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl \ -p ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.plist \ -r ${KSTAGEDIR}/${DISTDIR} \ - -o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} + -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} .endfor .endif .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" @@ -1474,25 +1475,25 @@ create-kernel-packages: _pkgbootstrap .P /name/ { printf("===> Creating %s-", $$2); next } \ /version/ {print $$2; next } ' \ ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl ; \ - pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ + ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ create -M ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl \ -p ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.plist \ -r ${KSTAGEDIR}/kernel.${_kernel} \ - -o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} + -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} .endfor .endif .endfor .endif sign-packages: _pkgbootstrap .PHONY - @[ -L "${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest" ] && \ - unlink ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest ; \ - pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh repo \ - -o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ - ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ + @[ -L "${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest" ] && \ + unlink ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest ; \ + ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh repo \ + -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ + ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ ${PKGSIGNKEY} ; \ - ln -s ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ - ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest + ln -s ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ + ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest # # Modified: head/release/scripts/make-pkg-package.sh ============================================================================== --- head/release/scripts/make-pkg-package.sh Wed Nov 30 06:26:37 2016 (r309313) +++ head/release/scripts/make-pkg-package.sh Wed Nov 30 07:16:29 2016 (r309314) @@ -8,6 +8,7 @@ eval $(make -C ${SRCDIR} TARGET=${TARGET export WRKDIRPREFIX=/tmp/ports.${TARGET} export WSTAGEDIR=${WSTAGEDIR} export REPODIR=${REPODIR} +export PKG_CMD=${PKG_CMD} export PKG_VERSION=${PKG_VERSION} export WRKDIR=$(make -C ${PORTSDIR}/ports-mgmt/pkg -V WRKDIR) @@ -15,11 +16,11 @@ make -C ${PORTSDIR}/ports-mgmt/pkg TARGE CONFIGURE_ARGS="--host=$(uname -m)-portbld-freebsd${REVISION}" \ stage create-manifest -pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh \ +${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh \ create -v -m ${WRKDIR}/.metadir/ \ -r ${WRKDIR}/stage \ -p ${WRKDIR}/.PLIST.mktmp \ - -o ${REPODIR}/$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} -mkdir -p ${REPODIR}/$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}/Latest/ -cd ${REPODIR}/$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}/Latest/ && \ + -o ${REPODIR}/$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} +mkdir -p ${REPODIR}/$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}/Latest/ +cd ${REPODIR}/$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}/Latest/ && \ ln -s ../pkg-*.txz Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Wed Nov 30 06:26:37 2016 (r309313) +++ head/share/mk/bsd.own.mk Wed Nov 30 07:16:29 2016 (r309314) @@ -116,6 +116,9 @@ # NLSMODE National Language Support files mode. [${NOBINMODE}] # # INCLUDEDIR Base path for standard C include files [/usr/include] +# +# PKG_CMD Program for creating and manipulating packages. +# [pkg] .if !target(____) ____: @@ -249,6 +252,8 @@ XZ_CMD?= xz -T ${XZ_THREADS} XZ_CMD?= xz .endif +PKG_CMD?= pkg + # Pointer to the top directory into which tests are installed. Should not be # overriden by Makefiles, but the user may choose to set this in src.conf(5). TESTSBASE?= /usr/tests From owner-svn-src-all@freebsd.org Wed Nov 30 07:22:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0813C5C0BF; Wed, 30 Nov 2016 07:22:47 +0000 (UTC) (envelope-from dexuan@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 AAAAB1B1B; Wed, 30 Nov 2016 07:22:47 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU7Mk1N001320; Wed, 30 Nov 2016 07:22:46 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU7MkHZ001317; Wed, 30 Nov 2016 07:22:46 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201611300722.uAU7MkHZ001317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexuan set sender to dexuan@FreeBSD.org using -f From: Dexuan Cui Date: Wed, 30 Nov 2016 07:22:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309315 - in stable/11: . share/man/man4 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 07:22:47 -0000 Author: dexuan Date: Wed Nov 30 07:22:46 2016 New Revision: 309315 URL: https://svnweb.freebsd.org/changeset/base/309315 Log: MFC 308797-308799, 309082 r308797 update the hv_vmbus(4) manual by adding a dependency on pci We enhanced the vmbus driver to support PCIe pass-through recently. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft r308798 remove the hv_ata_pci_disengage(4) manual A few months ago, we removed the driver, which was not necessary any longer. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft r308799 fix share/man/man4/Makefile for hv_ata_pci_disengage.4 We need to remove the line since we removed the related manual just now. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft r309082 share/man/man4/Makefile: Only install Hyper-V man pages on amd64 and i386 We shouldn't install them on the architectures not supported by Hyper-V. And, hv_ata_pci_disengage.4.gz should be removed from all architectures: 1) It should have only applied to Hyper-V; 2) For Hyper-V platforms (amd64 and i386), the related driver was removed by r306426 | sephe | 2016-09-29 09:41:52 +0800 (Thu, 29 Sep 2016), because now we have a better mechanism to disble the ata driver for hard disks when the VM runs on Hyper-V. Reviewed by: sephe, andrew, jhb Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8572 Deleted: stable/11/share/man/man4/hv_ata_pci_disengage.4 Modified: stable/11/ObsoleteFiles.inc stable/11/share/man/man4/Makefile stable/11/share/man/man4/hv_vmbus.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/ObsoleteFiles.inc ============================================================================== --- stable/11/ObsoleteFiles.inc Wed Nov 30 07:16:29 2016 (r309314) +++ stable/11/ObsoleteFiles.inc Wed Nov 30 07:22:46 2016 (r309315) @@ -38,6 +38,17 @@ # xargs -n1 | sort | uniq -d; # done +# 20161121: Hyper-V manuals only apply to amd64 and i386. +.if ${TARGET_ARCH} != "amd64" && ${TARGET_ARCH} != "i386" +OLD_FILES+=usr/share/man/man4/hv_kvp.4.gz +OLD_FILES+=usr/share/man/man4/hv_netvsc.4.gz +OLD_FILES+=usr/share/man/man4/hv_storvsc.4.gz +OLD_FILES+=usr/share/man/man4/hv_utils.4.gz +OLD_FILES+=usr/share/man/man4/hv_vmbus.4.gz +OLD_FILES+=usr/share/man/man4/hv_vss.4.gz +.endif +# 20161118: Remove hv_ata_pci_disengage(4) +OLD_FILES+=usr/share/man/man4/hv_ata_pci_disengage.4.gz # 20161015: remove link to removed m_getclr(9) macro OLD_FILES+=usr/share/man/man9/m_getclr.9.gz # 20160703: POSIXify locales with variants Modified: stable/11/share/man/man4/Makefile ============================================================================== --- stable/11/share/man/man4/Makefile Wed Nov 30 07:16:29 2016 (r309314) +++ stable/11/share/man/man4/Makefile Wed Nov 30 07:22:46 2016 (r309315) @@ -187,12 +187,11 @@ MAN= aac.4 \ ${_hptmv.4} \ ${_hptnr.4} \ ${_hptrr.4} \ - hv_ata_pci_disengage.4 \ - hv_kvp.4 \ - hv_netvsc.4 \ - hv_storvsc.4 \ - hv_utils.4 \ - hv_vmbus.4 \ + ${_hv_kvp.4} \ + ${_hv_netvsc.4} \ + ${_hv_storvsc.4} \ + ${_hv_utils.4} \ + ${_hv_vmbus.4} \ hwpmc.4 \ ichsmb.4 \ ${_ichwd.4} \ @@ -776,6 +775,11 @@ _hptiop.4= hptiop.4 _hptmv.4= hptmv.4 _hptnr.4= hptnr.4 _hptrr.4= hptrr.4 +_hv_kvp.4= hv_kvp.4 +_hv_netvsc.4= hv_netvsc.4 +_hv_storvsc.4= hv_storvsc.4 +_hv_utils.4= hv_utils.4 +_hv_vmbus.4= hv_vmbus.4 _i8254.4= i8254.4 _ichwd.4= ichwd.4 _if_bxe.4= if_bxe.4 Modified: stable/11/share/man/man4/hv_vmbus.4 ============================================================================== --- stable/11/share/man/man4/hv_vmbus.4 Wed Nov 30 07:16:29 2016 (r309314) +++ stable/11/share/man/man4/hv_vmbus.4 Wed Nov 30 07:22:46 2016 (r309315) @@ -35,6 +35,7 @@ To compile this driver into the kernel, the system kernel configuration file: .Bd -ragged -offset indent .Cd "device hyperv" +.Cd "device pci" .Ed .Sh DESCRIPTION The @@ -73,7 +74,6 @@ the interface that facilitate high perfo between the VSCs and VSPs. All VSCs utilize the VMBus driver. .Sh SEE ALSO -.Xr hv_ata_pci_disengage 4 , .Xr hv_netvsc 4 , .Xr hv_storvsc 4 , .Xr hv_utils 4 From owner-svn-src-all@freebsd.org Wed Nov 30 07:45:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3BD3C5C81E; Wed, 30 Nov 2016 07:45:06 +0000 (UTC) (envelope-from sephe@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 994391674; Wed, 30 Nov 2016 07:45:06 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU7j5eY010036; Wed, 30 Nov 2016 07:45:05 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU7j5eT010034; Wed, 30 Nov 2016 07:45:05 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611300745.uAU7j5eT010034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 30 Nov 2016 07:45:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309316 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 07:45:07 -0000 Author: sephe Date: Wed Nov 30 07:45:05 2016 New Revision: 309316 URL: https://svnweb.freebsd.org/changeset/base/309316 Log: hyperv/vmbus: Add DEVMETHOD to map cpu to event taskq. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8658 Modified: head/sys/dev/hyperv/vmbus/vmbus.c head/sys/dev/hyperv/vmbus/vmbus_if.m Modified: head/sys/dev/hyperv/vmbus/vmbus.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus.c Wed Nov 30 07:22:46 2016 (r309315) +++ head/sys/dev/hyperv/vmbus/vmbus.c Wed Nov 30 07:45:05 2016 (r309316) @@ -97,6 +97,8 @@ static int vmbus_probe_guid_method(dev const struct hyperv_guid *); static uint32_t vmbus_get_vcpu_id_method(device_t bus, device_t dev, int cpu); +static struct taskqueue *vmbus_get_eventtq_method(device_t, device_t, + int); static int vmbus_init(struct vmbus_softc *); static int vmbus_connect(struct vmbus_softc *, uint32_t); @@ -172,6 +174,7 @@ static device_method_t vmbus_methods[] = DEVMETHOD(vmbus_get_version, vmbus_get_version_method), DEVMETHOD(vmbus_probe_guid, vmbus_probe_guid_method), DEVMETHOD(vmbus_get_vcpu_id, vmbus_get_vcpu_id_method), + DEVMETHOD(vmbus_get_event_taskq, vmbus_get_eventtq_method), DEVMETHOD_END }; @@ -1126,6 +1129,15 @@ vmbus_get_vcpu_id_method(device_t bus, d return (VMBUS_PCPU_GET(sc, vcpuid, cpu)); } +static struct taskqueue * +vmbus_get_eventtq_method(device_t bus, device_t dev __unused, int cpu) +{ + const struct vmbus_softc *sc = device_get_softc(bus); + + KASSERT(cpu >= 0 && cpu < mp_ncpus, ("invalid cpu%d", cpu)); + return (VMBUS_PCPU_GET(sc, event_tq, cpu)); +} + #ifdef NEW_PCIB #define VTPM_BASE_ADDR 0xfed40000 #define FOUR_GB (1ULL << 32) Modified: head/sys/dev/hyperv/vmbus/vmbus_if.m ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_if.m Wed Nov 30 07:22:46 2016 (r309315) +++ head/sys/dev/hyperv/vmbus/vmbus_if.m Wed Nov 30 07:45:05 2016 (r309316) @@ -33,6 +33,7 @@ INTERFACE vmbus; HEADER { struct hyperv_guid; + struct taskqueue; }; METHOD uint32_t get_version { @@ -51,3 +52,9 @@ METHOD uint32_t get_vcpu_id { device_t dev; int cpu; }; + +METHOD struct taskqueue * get_event_taskq { + device_t bus; + device_t dev; + int cpu; +}; From owner-svn-src-all@freebsd.org Wed Nov 30 07:51:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A208C5C94C; Wed, 30 Nov 2016 07:51:48 +0000 (UTC) (envelope-from dexuan@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 1789D1A64; Wed, 30 Nov 2016 07:51:48 +0000 (UTC) (envelope-from dexuan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU7plWu013050; Wed, 30 Nov 2016 07:51:47 GMT (envelope-from dexuan@FreeBSD.org) Received: (from dexuan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU7plls013047; Wed, 30 Nov 2016 07:51:47 GMT (envelope-from dexuan@FreeBSD.org) Message-Id: <201611300751.uAU7plls013047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dexuan set sender to dexuan@FreeBSD.org using -f From: Dexuan Cui Date: Wed, 30 Nov 2016 07:51:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309317 - in stable/10: . share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 07:51:48 -0000 Author: dexuan Date: Wed Nov 30 07:51:46 2016 New Revision: 309317 URL: https://svnweb.freebsd.org/changeset/base/309317 Log: MFC r308797-308799,309082 Approved by: sephe (mentor) r308797 update the hv_vmbus(4) manual by adding a dependency on pci We enhanced the vmbus driver to support PCIe pass-through recently. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft r308798 remove the hv_ata_pci_disengage(4) manual A few months ago, we removed the driver, which was not necessary any longer. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft r308799 fix share/man/man4/Makefile for hv_ata_pci_disengage.4 We need to remove the line since we removed the related manual just now. Reviewed by: sephe Approved by: sephe (mentor) Sponsored by: Microsoft r309082 share/man/man4/Makefile: Only install Hyper-V man pages on amd64 and i386 We shouldn't install them on the architectures not supported by Hyper-V. And, hv_ata_pci_disengage.4.gz should be removed from all architectures: 1) It should have only applied to Hyper-V; 2) For Hyper-V platforms (amd64 and i386), the related driver was removed by r306426 | sephe | 2016-09-29 09:41:52 +0800 (Thu, 29 Sep 2016), because now we have a better mechanism to disble the ata driver for hard disks when the VM runs on Hyper-V. Reviewed by: sephe, andrew, jhb Approved by: sephe (mentor) Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8572 Deleted: stable/10/share/man/man4/hv_ata_pci_disengage.4 Modified: stable/10/ObsoleteFiles.inc stable/10/share/man/man4/Makefile stable/10/share/man/man4/hv_vmbus.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Wed Nov 30 07:45:05 2016 (r309316) +++ stable/10/ObsoleteFiles.inc Wed Nov 30 07:51:46 2016 (r309317) @@ -38,6 +38,17 @@ # xargs -n1 | sort | uniq -d; # done +# 20161121: Hyper-V manuals only apply to amd64 and i386. +.if ${TARGET_ARCH} != "amd64" && ${TARGET_ARCH} != "i386" +OLD_FILES+=usr/share/man/man4/hv_kvp.4.gz +OLD_FILES+=usr/share/man/man4/hv_netvsc.4.gz +OLD_FILES+=usr/share/man/man4/hv_storvsc.4.gz +OLD_FILES+=usr/share/man/man4/hv_utils.4.gz +OLD_FILES+=usr/share/man/man4/hv_vmbus.4.gz +OLD_FILES+=usr/share/man/man4/hv_vss.4.gz +.endif +# 20161118: Remove hv_ata_pci_disengage(4) +OLD_FILES+=usr/share/man/man4/hv_ata_pci_disengage.4.gz # 20160723: stale MLINK removed OLD_FILES+=usr/share/man/man9/rman_await_resource.9.gz # 20160216: Remove obsolete unbound-control-setup Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Wed Nov 30 07:45:05 2016 (r309316) +++ stable/10/share/man/man4/Makefile Wed Nov 30 07:51:46 2016 (r309317) @@ -174,12 +174,11 @@ MAN= aac.4 \ ${_hptmv.4} \ ${_hptnr.4} \ ${_hptrr.4} \ - hv_ata_pci_disengage.4 \ - hv_kvp.4 \ - hv_netvsc.4 \ - hv_storvsc.4 \ - hv_utils.4 \ - hv_vmbus.4 \ + ${_hv_kvp.4} \ + ${_hv_netvsc.4} \ + ${_hv_storvsc.4} \ + ${_hv_utils.4} \ + ${_hv_vmbus.4} \ hwpmc.4 \ ichsmb.4 \ ${_ichwd.4} \ @@ -749,6 +748,11 @@ _hptiop.4= hptiop.4 _hptmv.4= hptmv.4 _hptnr.4= hptnr.4 _hptrr.4= hptrr.4 +_hv_kvp.4= hv_kvp.4 +_hv_netvsc.4= hv_netvsc.4 +_hv_storvsc.4= hv_storvsc.4 +_hv_utils.4= hv_utils.4 +_hv_vmbus.4= hv_vmbus.4 _i8254.4= i8254.4 _ichwd.4= ichwd.4 _if_bxe.4= if_bxe.4 Modified: stable/10/share/man/man4/hv_vmbus.4 ============================================================================== --- stable/10/share/man/man4/hv_vmbus.4 Wed Nov 30 07:45:05 2016 (r309316) +++ stable/10/share/man/man4/hv_vmbus.4 Wed Nov 30 07:51:46 2016 (r309317) @@ -35,6 +35,7 @@ To compile this driver into the kernel, the system kernel configuration file: .Bd -ragged -offset indent .Cd "device hyperv" +.Cd "device pci" .Ed .Sh DESCRIPTION The @@ -76,7 +77,6 @@ All VSCs utilize the VMBus driver. .Xr hv_utils 4 , .Xr hv_netvsc 4 , .Xr hv_storvsc 4 , -.Xr hv_ata_pci_disengage 4 .Sh HISTORY Support for .Nm From owner-svn-src-all@freebsd.org Wed Nov 30 07:54:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2816C5CB96; Wed, 30 Nov 2016 07:54:29 +0000 (UTC) (envelope-from sephe@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 7D4591C93; Wed, 30 Nov 2016 07:54:29 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU7sSwA013919; Wed, 30 Nov 2016 07:54:28 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU7sS1C013918; Wed, 30 Nov 2016 07:54:28 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611300754.uAU7sS1C013918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 30 Nov 2016 07:54:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309318 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 07:54:29 -0000 Author: sephe Date: Wed Nov 30 07:54:28 2016 New Revision: 309318 URL: https://svnweb.freebsd.org/changeset/base/309318 Log: hyperv/hn: Allow TX to share event taskqueues. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8659 Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Wed Nov 30 07:51:46 2016 (r309317) +++ head/sys/dev/hyperv/netvsc/if_hn.c Wed Nov 30 07:54:28 2016 (r309318) @@ -169,6 +169,8 @@ do { \ #define HN_PKTSIZE(m, align) \ roundup2((m)->m_pkthdr.len + HN_RNDIS_PKT_LEN, (align)) +#define HN_RING_IDX2CPU(sc, idx) (((sc)->hn_cpu + (idx)) % mp_ncpus) + struct hn_txdesc { #ifndef HN_USE_TXDESC_BUFRING SLIST_ENTRY(hn_txdesc) link; @@ -411,15 +413,19 @@ SYSCTL_INT(_hw_hn, OID_AUTO, lro_entry_c #endif #endif -/* Use shared TX taskqueue */ -static int hn_share_tx_taskq = 0; -SYSCTL_INT(_hw_hn, OID_AUTO, share_tx_taskq, CTLFLAG_RDTUN, - &hn_share_tx_taskq, 0, "Enable shared TX taskqueue"); - static int hn_tx_taskq_cnt = 1; SYSCTL_INT(_hw_hn, OID_AUTO, tx_taskq_cnt, CTLFLAG_RDTUN, &hn_tx_taskq_cnt, 0, "# of TX taskqueues"); +#define HN_TX_TASKQ_M_INDEP 0 +#define HN_TX_TASKQ_M_GLOBAL 1 +#define HN_TX_TASKQ_M_EVTTQ 2 + +static int hn_tx_taskq_mode = HN_TX_TASKQ_M_INDEP; +SYSCTL_INT(_hw_hn, OID_AUTO, tx_taskq_mode, CTLFLAG_RDTUN, + &hn_tx_taskq_mode, 0, "TX taskqueue modes: " + "0 - independent, 1 - share global tx taskqs, 2 - share event taskqs"); + #ifndef HN_USE_TXDESC_BUFRING static int hn_use_txdesc_bufring = 0; #else @@ -902,7 +908,7 @@ hn_attach(device_t dev) /* * Setup taskqueue for transmission. */ - if (hn_tx_taskque == NULL) { + if (hn_tx_taskq_mode == HN_TX_TASKQ_M_INDEP) { int i; sc->hn_tx_taskqs = @@ -915,7 +921,7 @@ hn_attach(device_t dev) taskqueue_start_threads(&sc->hn_tx_taskqs[i], 1, PI_NET, "%s tx%d", device_get_nameunit(dev), i); } - } else { + } else if (hn_tx_taskq_mode == HN_TX_TASKQ_M_GLOBAL) { sc->hn_tx_taskqs = hn_tx_taskque; } @@ -1216,7 +1222,7 @@ hn_detach(device_t dev) hn_destroy_rx_data(sc); hn_destroy_tx_data(sc); - if (sc->hn_tx_taskqs != hn_tx_taskque) { + if (sc->hn_tx_taskqs != NULL && sc->hn_tx_taskqs != hn_tx_taskque) { int i; for (i = 0; i < hn_tx_taskq_cnt; ++i) @@ -3312,7 +3318,12 @@ hn_tx_ring_create(struct hn_softc *sc, i M_WAITOK, &txr->hn_tx_lock); #endif - txr->hn_tx_taskq = sc->hn_tx_taskqs[id % hn_tx_taskq_cnt]; + if (hn_tx_taskq_mode == HN_TX_TASKQ_M_EVTTQ) { + txr->hn_tx_taskq = VMBUS_GET_EVENT_TASKQ( + device_get_parent(dev), dev, HN_RING_IDX2CPU(sc, id)); + } else { + txr->hn_tx_taskq = sc->hn_tx_taskqs[id % hn_tx_taskq_cnt]; + } #ifdef HN_IFSTART_SUPPORT if (hn_use_if_start) { @@ -4205,7 +4216,7 @@ hn_chan_attach(struct hn_softc *sc, stru } /* Bind this channel to a proper CPU. */ - vmbus_chan_cpu_set(chan, (sc->hn_cpu + idx) % mp_ncpus); + vmbus_chan_cpu_set(chan, HN_RING_IDX2CPU(sc, idx)); /* * Open this channel @@ -5361,10 +5372,23 @@ hn_tx_taskq_create(void *arg __unused) else if (hn_tx_taskq_cnt > mp_ncpus) hn_tx_taskq_cnt = mp_ncpus; + /* + * Fix the TX taskqueue mode. + */ + switch (hn_tx_taskq_mode) { + case HN_TX_TASKQ_M_INDEP: + case HN_TX_TASKQ_M_GLOBAL: + case HN_TX_TASKQ_M_EVTTQ: + break; + default: + hn_tx_taskq_mode = HN_TX_TASKQ_M_INDEP; + break; + } + if (vm_guest != VM_GUEST_HV) return; - if (!hn_share_tx_taskq) + if (hn_tx_taskq_mode != HN_TX_TASKQ_M_GLOBAL) return; hn_tx_taskque = malloc(hn_tx_taskq_cnt * sizeof(struct taskqueue *), From owner-svn-src-all@freebsd.org Wed Nov 30 08:10:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A0C5C5D3B0; Wed, 30 Nov 2016 08:10:50 +0000 (UTC) (envelope-from sephe@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 52D661554; Wed, 30 Nov 2016 08:10:50 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU8Anws018644; Wed, 30 Nov 2016 08:10:49 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU8AnWN018628; Wed, 30 Nov 2016 08:10:49 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611300810.uAU8AnWN018628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 30 Nov 2016 08:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309319 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 08:10:50 -0000 Author: sephe Date: Wed Nov 30 08:10:49 2016 New Revision: 309319 URL: https://svnweb.freebsd.org/changeset/base/309319 Log: hypver/vmbus: Remove extra assertion. It is asserted by vmbus_chan_gpadl_connect() now. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8660 Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c ============================================================================== --- head/sys/dev/hyperv/vmbus/vmbus_chan.c Wed Nov 30 07:54:28 2016 (r309318) +++ head/sys/dev/hyperv/vmbus/vmbus_chan.c Wed Nov 30 08:10:49 2016 (r309319) @@ -405,8 +405,6 @@ vmbus_chan_open_br(struct vmbus_channel /* * Connect the bufrings, both RX and TX, to this channel. */ - KASSERT(chan->ch_bufring_gpadl == 0, - ("bufring GPADL is still connected")); error = vmbus_chan_gpadl_connect(chan, cbr->cbr_paddr, txbr_size + rxbr_size, &chan->ch_bufring_gpadl); if (error) { From owner-svn-src-all@freebsd.org Wed Nov 30 08:21:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C3B2C5D769; Wed, 30 Nov 2016 08:21:17 +0000 (UTC) (envelope-from sephe@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 D14251B63; Wed, 30 Nov 2016 08:21:16 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU8LGl0024498; Wed, 30 Nov 2016 08:21:16 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU8LGOQ024497; Wed, 30 Nov 2016 08:21:16 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201611300821.uAU8LGOQ024497@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 30 Nov 2016 08:21:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309320 - head/sys/dev/hyperv/storvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 08:21:17 -0000 Author: sephe Date: Wed Nov 30 08:21:15 2016 New Revision: 309320 URL: https://svnweb.freebsd.org/changeset/base/309320 Log: hyperv/storvsc: Don't use timedwait. The timeout is unnecessary. Reviewed by: jhb MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8656 Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Nov 30 08:10:49 2016 (r309319) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Nov 30 08:21:15 2016 (r309320) @@ -413,13 +413,7 @@ storvsc_send_multichannel_request(struct VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, vstor_packet, VSTOR_PKT_SIZE, (uint64_t)(uintptr_t)request); - /* wait for 5 seconds */ - ret = sema_timedwait(&request->synch_sema, 5 * hz); - if (ret != 0) { - printf("Storvsc_error: create multi-channel timeout, %d\n", - ret); - return; - } + sema_wait(&request->synch_sema); if (vstor_packet->operation != VSTOR_OPERATION_COMPLETEIO || vstor_packet->status != 0) { @@ -486,10 +480,7 @@ hv_storvsc_channel_init(struct storvsc_s if (ret != 0) goto cleanup; - /* wait 5 seconds */ - ret = sema_timedwait(&request->synch_sema, 5 * hz); - if (ret != 0) - goto cleanup; + sema_wait(&request->synch_sema); if (vstor_packet->operation != VSTOR_OPERATION_COMPLETEIO || vstor_packet->status != 0) { @@ -516,11 +507,7 @@ hv_storvsc_channel_init(struct storvsc_s if (ret != 0) goto cleanup; - /* wait 5 seconds */ - ret = sema_timedwait(&request->synch_sema, 5 * hz); - - if (ret) - goto cleanup; + sema_wait(&request->synch_sema); if (vstor_packet->operation != VSTOR_OPERATION_COMPLETEIO) { ret = EINVAL; @@ -555,11 +542,7 @@ hv_storvsc_channel_init(struct storvsc_s if ( ret != 0) goto cleanup; - /* wait 5 seconds */ - ret = sema_timedwait(&request->synch_sema, 5 * hz); - - if (ret != 0) - goto cleanup; + sema_wait(&request->synch_sema); /* TODO: Check returned version */ if (vstor_packet->operation != VSTOR_OPERATION_COMPLETEIO || @@ -588,11 +571,7 @@ hv_storvsc_channel_init(struct storvsc_s goto cleanup; } - /* wait 5 seconds */ - ret = sema_timedwait(&request->synch_sema, 5 * hz); - - if (ret != 0) - goto cleanup; + sema_wait(&request->synch_sema); if (vstor_packet->operation != VSTOR_OPERATION_COMPLETEIO || vstor_packet->status != 0) @@ -672,12 +651,7 @@ hv_storvsc_host_reset(struct storvsc_sof goto cleanup; } - ret = sema_timedwait(&request->synch_sema, 5 * hz); /* KYS 5 seconds */ - - if (ret) { - goto cleanup; - } - + sema_wait(&request->synch_sema); /* * At this point, all outstanding requests in the adapter From owner-svn-src-all@freebsd.org Wed Nov 30 09:27:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1B2EC5ABCC; Wed, 30 Nov 2016 09:27:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0D1F1C02; Wed, 30 Nov 2016 09:27:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU9R8TD049960; Wed, 30 Nov 2016 09:27:08 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU9R8vh049955; Wed, 30 Nov 2016 09:27:08 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201611300927.uAU9R8vh049955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 30 Nov 2016 09:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309321 - in head: sbin/geom/class/mirror sys/geom/mirror X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 09:27:10 -0000 Author: mav Date: Wed Nov 30 09:27:08 2016 New Revision: 309321 URL: https://svnweb.freebsd.org/changeset/base/309321 Log: Add `gmirror create` subcommand, alike to gstripe, gconcat, etc. It is quite specific mode of operation without storing on-disk metadata. It can be useful in some cases in combination with some external control tools handling mirror creation and disks hot-plug. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sbin/geom/class/mirror/geom_mirror.c head/sbin/geom/class/mirror/gmirror.8 head/sys/geom/mirror/g_mirror.c head/sys/geom/mirror/g_mirror.h head/sys/geom/mirror/g_mirror_ctl.c Modified: head/sbin/geom/class/mirror/geom_mirror.c ============================================================================== --- head/sbin/geom/class/mirror/geom_mirror.c Wed Nov 30 08:21:15 2016 (r309320) +++ head/sbin/geom/class/mirror/geom_mirror.c Wed Nov 30 09:27:08 2016 (r309321) @@ -79,6 +79,16 @@ struct g_command class_commands[] = { "[-adfFhnv] [-b balance] [-s slice] name\n" "[-v] -p priority name prov" }, + { "create", G_FLAG_VERBOSE, NULL, + { + { 'b', "balance", GMIRROR_BALANCE, G_TYPE_STRING }, + { 'F', "nofailsync", NULL, G_TYPE_BOOL }, + { 'n', "noautosync", NULL, G_TYPE_BOOL }, + { 's', "slice", GMIRROR_SLICE, G_TYPE_NUMBER }, + G_OPT_SENTINEL + }, + "[-Fnv] [-b balance] [-s slice] name prov ..." + }, { "deactivate", G_FLAG_VERBOSE, NULL, G_NULL_OPTS, "[-v] name prov ..." }, Modified: head/sbin/geom/class/mirror/gmirror.8 ============================================================================== --- head/sbin/geom/class/mirror/gmirror.8 Wed Nov 30 08:21:15 2016 (r309320) +++ head/sbin/geom/class/mirror/gmirror.8 Wed Nov 30 09:27:08 2016 (r309321) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 27, 2013 +.Dd November 27, 2016 .Dt GMIRROR 8 .Os .Sh NAME @@ -43,6 +43,13 @@ .Op Fl v .Ar prov ... .Nm +.Cm create +.Op Fl Fnv +.Op Fl b Ar balance +.Op Fl s Ar slice +.Ar name +.Ar prov ... +.Nm .Cm configure .Op Fl adfFhnv .Op Fl b Ar balance @@ -170,6 +177,12 @@ Defaults to 4096 bytes. .El .It Cm clear Clear metadata on the given providers. +.It Cm create +Similar to +.Cm label, +but creates mirror without storing on-disk metadata in last sector. +This special "manual" operation mode assumes some external control to manage +mirror detection after reboot, device hot-plug and other external events. .It Cm configure Configure the given device. .Pp Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Wed Nov 30 08:21:15 2016 (r309320) +++ head/sys/geom/mirror/g_mirror.c Wed Nov 30 09:27:08 2016 (r309321) @@ -700,6 +700,8 @@ g_mirror_clear_metadata(struct g_mirror_ g_topology_assert_not(); sx_assert(&disk->d_softc->sc_lock, SX_LOCKED); + if (disk->d_softc->sc_type != G_MIRROR_TYPE_AUTOMATIC) + return (0); error = g_mirror_write_metadata(disk, NULL); if (error == 0) { G_MIRROR_DEBUG(2, "Metadata on %s cleared.", @@ -765,6 +767,8 @@ g_mirror_update_metadata(struct g_mirror sc = disk->d_softc; sx_assert(&sc->sc_lock, SX_LOCKED); + if (sc->sc_type != G_MIRROR_TYPE_AUTOMATIC) + return; if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_WIPE) == 0) g_mirror_fill_metadata(sc, disk, &md); error = g_mirror_write_metadata(disk, &md); @@ -2942,8 +2946,9 @@ end: return (error); } -static struct g_geom * -g_mirror_create(struct g_class *mp, const struct g_mirror_metadata *md) +struct g_geom * +g_mirror_create(struct g_class *mp, const struct g_mirror_metadata *md, + u_int type) { struct g_mirror_softc *sc; struct g_geom *gp; @@ -2966,6 +2971,7 @@ g_mirror_create(struct g_class *mp, cons gp->access = g_mirror_access; gp->dumpconf = g_mirror_dumpconf; + sc->sc_type = type; sc->sc_id = md->md_mid; sc->sc_slice = md->md_slice; sc->sc_balance = md->md_balance; @@ -3142,6 +3148,8 @@ g_mirror_taste(struct g_class *mp, struc sc = gp->softc; if (sc == NULL) continue; + if (sc->sc_type != G_MIRROR_TYPE_AUTOMATIC) + continue; if (sc->sc_sync.ds_geom == gp) continue; if (strcmp(md.md_name, sc->sc_name) != 0) @@ -3154,7 +3162,7 @@ g_mirror_taste(struct g_class *mp, struc break; } if (gp == NULL) { - gp = g_mirror_create(mp, &md); + gp = g_mirror_create(mp, &md, G_MIRROR_TYPE_AUTOMATIC); if (gp == NULL) { G_MIRROR_DEBUG(0, "Cannot create device %s.", md.md_name); @@ -3302,6 +3310,19 @@ g_mirror_dumpconf(struct sbuf *sb, const } else { g_topology_unlock(); sx_xlock(&sc->sc_lock); + sbuf_printf(sb, "%s", indent); + switch (sc->sc_type) { + case G_MIRROR_TYPE_AUTOMATIC: + sbuf_printf(sb, "AUTOMATIC"); + break; + case G_MIRROR_TYPE_MANUAL: + sbuf_printf(sb, "MANUAL"); + break; + default: + sbuf_printf(sb, "UNKNOWN"); + break; + } + sbuf_printf(sb, "\n"); sbuf_printf(sb, "%s%u\n", indent, (u_int)sc->sc_id); sbuf_printf(sb, "%s%u\n", indent, sc->sc_syncid); sbuf_printf(sb, "%s%u\n", indent, sc->sc_genid); Modified: head/sys/geom/mirror/g_mirror.h ============================================================================== --- head/sys/geom/mirror/g_mirror.h Wed Nov 30 08:21:15 2016 (r309320) +++ head/sys/geom/mirror/g_mirror.h Wed Nov 30 09:27:08 2016 (r309321) @@ -165,11 +165,15 @@ struct g_mirror_event { #define G_MIRROR_DEVICE_STATE_STARTING 0 #define G_MIRROR_DEVICE_STATE_RUNNING 1 +#define G_MIRROR_TYPE_MANUAL 0 +#define G_MIRROR_TYPE_AUTOMATIC 1 + /* Bump syncid on first write. */ #define G_MIRROR_BUMP_SYNCID 0x1 /* Bump genid immediately. */ #define G_MIRROR_BUMP_GENID 0x2 struct g_mirror_softc { + u_int sc_type; /* Device type (manual/automatic). */ u_int sc_state; /* Device state. */ uint32_t sc_slice; /* Slice size. */ uint8_t sc_balance; /* Balance algorithm. */ @@ -220,7 +224,11 @@ struct g_mirror_softc { }; #define sc_name sc_geom->name +struct g_mirror_metadata; + u_int g_mirror_ndisks(struct g_mirror_softc *sc, int state); +struct g_geom * g_mirror_create(struct g_class *mp, + const struct g_mirror_metadata *md, u_int type); #define G_MIRROR_DESTROY_SOFT 0 #define G_MIRROR_DESTROY_DELAYED 1 #define G_MIRROR_DESTROY_HARD 2 Modified: head/sys/geom/mirror/g_mirror_ctl.c ============================================================================== --- head/sys/geom/mirror/g_mirror_ctl.c Wed Nov 30 08:21:15 2016 (r309320) +++ head/sys/geom/mirror/g_mirror_ctl.c Wed Nov 30 09:27:08 2016 (r309321) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -301,6 +302,182 @@ g_mirror_ctl_configure(struct gctl_req * } static void +g_mirror_create_orphan(struct g_consumer *cp) +{ + + KASSERT(1 == 0, ("%s called while creating %s.", __func__, + cp->provider->name)); +} + +static void +g_mirror_ctl_create(struct gctl_req *req, struct g_class *mp) +{ + struct g_mirror_metadata md; + struct g_geom *gp; + struct g_consumer *cp; + struct g_provider *pp; + struct g_mirror_softc *sc; + struct sbuf *sb; + const char *name; + char param[16]; + int *nargs; + intmax_t *val; + int *ival; + const char *sval; + int bal; + unsigned attached, no, sectorsize; + off_t mediasize; + + nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); + if (nargs == NULL) { + gctl_error(req, "No '%s' argument.", "nargs"); + return; + } + if (*nargs <= 2) { + gctl_error(req, "Too few arguments."); + return; + } + + strlcpy(md.md_magic, G_MIRROR_MAGIC, sizeof(md.md_magic)); + md.md_version = G_MIRROR_VERSION; + name = gctl_get_asciiparam(req, "arg0"); + if (name == NULL) { + gctl_error(req, "No 'arg%u' argument.", 0); + return; + } + strlcpy(md.md_name, name, sizeof(md.md_name)); + md.md_mid = arc4random(); + md.md_all = *nargs - 1; + md.md_genid = 0; + md.md_syncid = 1; + md.md_sync_offset = 0; + val = gctl_get_paraml(req, "slice", sizeof(*val)); + if (val == NULL) { + gctl_error(req, "No slice argument."); + return; + } + md.md_slice = *val; + sval = gctl_get_asciiparam(req, "balance"); + if (sval == NULL) { + gctl_error(req, "No balance argument."); + return; + } + bal = balance_id(sval); + if (bal < 0) { + gctl_error(req, "Invalid balance algorithm."); + return; + } + md.md_balance = bal; + md.md_mflags = 0; + md.md_dflags = 0; + ival = gctl_get_paraml(req, "noautosync", sizeof(*ival)); + if (ival != NULL && *ival) + md.md_mflags |= G_MIRROR_DEVICE_FLAG_NOAUTOSYNC; + ival = gctl_get_paraml(req, "nofailsync", sizeof(*ival)); + if (ival != NULL && *ival) + md.md_mflags |= G_MIRROR_DEVICE_FLAG_NOFAILSYNC; + /* These fields not used in manual mode. */ + bzero(md.md_provider, sizeof(md.md_provider)); + md.md_provsize = 0; + + g_topology_lock(); + mediasize = OFF_MAX; + sectorsize = 0; + gp = g_new_geomf(mp, "%s", md.md_name); + gp->orphan = g_mirror_create_orphan; + cp = g_new_consumer(gp); + for (no = 1; no < *nargs; no++) { + snprintf(param, sizeof(param), "arg%u", no); + name = gctl_get_asciiparam(req, param); + if (name == NULL) { + gctl_error(req, "No 'arg%u' argument.", no); +err: + g_destroy_consumer(cp); + g_destroy_geom(gp); + g_topology_unlock(); + return; + } + if (strncmp(name, "/dev/", strlen("/dev/")) == 0) + name += strlen("/dev/"); + pp = g_provider_by_name(name); + if (pp == NULL) { + G_MIRROR_DEBUG(1, "Disk %s is invalid.", name); + gctl_error(req, "Disk %s is invalid.", name); + goto err; + } + g_attach(cp, pp); + if (g_access(cp, 1, 0, 0) != 0) { + G_MIRROR_DEBUG(1, "Can't open disk %s.", name); + gctl_error(req, "Can't open disk %s.", name); +err2: + g_detach(cp); + goto err; + } + if (pp->mediasize == 0 || pp->sectorsize == 0) { + G_MIRROR_DEBUG(1, "Disk %s has no media.", name); + gctl_error(req, "Disk %s has no media.", name); + g_access(cp, -1, 0, 0); + goto err2; + } + if (pp->mediasize < mediasize) + mediasize = pp->mediasize; + if (pp->sectorsize > sectorsize) + sectorsize = pp->sectorsize; + g_access(cp, -1, 0, 0); + g_detach(cp); + } + g_destroy_consumer(cp); + g_destroy_geom(gp); + md.md_mediasize = mediasize; + md.md_sectorsize = sectorsize; + md.md_mediasize -= (md.md_mediasize % md.md_sectorsize); + + gp = g_mirror_create(mp, &md, G_MIRROR_TYPE_MANUAL); + if (gp == NULL) { + gctl_error(req, "Can't create %s.", md.md_name); + g_topology_unlock(); + return; + } + + sc = gp->softc; + g_topology_unlock(); + sx_xlock(&sc->sc_lock); + sc->sc_flags |= G_MIRROR_DEVICE_FLAG_TASTING; + sb = sbuf_new_auto(); + sbuf_printf(sb, "Can't attach disk(s) to %s:", gp->name); + for (attached = 0, no = 1; no < *nargs; no++) { + snprintf(param, sizeof(param), "arg%u", no); + name = gctl_get_asciiparam(req, param); + if (strncmp(name, "/dev/", strlen("/dev/")) == 0) + name += strlen("/dev/"); + pp = g_provider_by_name(name); + if (pp == NULL) { + G_MIRROR_DEBUG(1, "Provider %s disappear?!", name); + sbuf_printf(sb, " %s", name); + continue; + } + md.md_did = arc4random(); + md.md_priority = no - 1; + if (g_mirror_add_disk(sc, pp, &md) != 0) { + G_MIRROR_DEBUG(1, "Disk %u (%s) not attached to %s.", + no, pp->name, gp->name); + sbuf_printf(sb, " %s", pp->name); + continue; + } + attached++; + } + sbuf_finish(sb); + sc->sc_flags &= ~G_MIRROR_DEVICE_FLAG_TASTING; + if (md.md_all != attached || + (sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROY) != 0) { + g_mirror_destroy(gp->softc, G_MIRROR_DESTROY_HARD); + gctl_error(req, "%s", sbuf_data(sb)); + } else + sx_xunlock(&sc->sc_lock); + sbuf_delete(sb); +} + +static void g_mirror_ctl_rebuild(struct gctl_req *req, struct g_class *mp) { struct g_mirror_metadata md; @@ -401,6 +578,7 @@ g_mirror_ctl_insert(struct gctl_req *req struct g_provider *provider; struct g_consumer *consumer; } *disks; + off_t mdsize; nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs)); if (nargs == NULL) { @@ -462,16 +640,6 @@ g_mirror_ctl_insert(struct gctl_req *req gctl_error(req, "Unknown provider %s.", name); continue; } - if (sc->sc_provider->mediasize > - pp->mediasize - pp->sectorsize) { - gctl_error(req, "Provider %s too small.", name); - continue; - } - if ((sc->sc_provider->sectorsize % pp->sectorsize) != 0) { - gctl_error(req, "Invalid sectorsize of provider %s.", - name); - continue; - } cp = g_new_consumer(sc->sc_geom); if (g_attach(cp, pp) != 0) { g_destroy_consumer(cp); @@ -479,9 +647,40 @@ g_mirror_ctl_insert(struct gctl_req *req continue; } if (g_access(cp, 0, 1, 1) != 0) { + gctl_error(req, "Cannot access provider %s.", name); +err: g_detach(cp); g_destroy_consumer(cp); - gctl_error(req, "Cannot access provider %s.", name); + continue; + } + mdsize = (sc->sc_type == G_MIRROR_TYPE_AUTOMATIC) ? + pp->sectorsize : 0; + if (sc->sc_provider->mediasize > pp->mediasize - mdsize) { + gctl_error(req, "Provider %s too small.", name); +err2: + g_access(cp, 0, -1, -1); + goto err; + } + if ((sc->sc_provider->sectorsize % pp->sectorsize) != 0) { + gctl_error(req, "Invalid sectorsize of provider %s.", + name); + goto err2; + } + if (sc->sc_type != G_MIRROR_TYPE_AUTOMATIC) { + g_access(cp, 0, -1, -1); + g_detach(cp); + g_destroy_consumer(cp); + g_topology_unlock(); + sc->sc_ndisks++; + g_mirror_fill_metadata(sc, NULL, &md); + md.md_priority = *priority; + if (*inactive) + md.md_dflags |= G_MIRROR_DISK_FLAG_INACTIVE; + if (g_mirror_add_disk(sc, pp, &md) != 0) { + sc->sc_ndisks--; + gctl_error(req, "Disk %s not inserted.", name); + } + g_topology_lock(); continue; } disks[n].provider = pp; @@ -872,6 +1071,8 @@ g_mirror_config(struct gctl_req *req, st g_topology_unlock(); if (strcmp(verb, "configure") == 0) g_mirror_ctl_configure(req, mp); + else if (strcmp(verb, "create") == 0) + g_mirror_ctl_create(req, mp); else if (strcmp(verb, "rebuild") == 0) g_mirror_ctl_rebuild(req, mp); else if (strcmp(verb, "insert") == 0) From owner-svn-src-all@freebsd.org Wed Nov 30 09:45:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53E68C5D305; Wed, 30 Nov 2016 09:45:19 +0000 (UTC) (envelope-from andrew@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 261FD1762; Wed, 30 Nov 2016 09:45:19 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU9jIfo058099; Wed, 30 Nov 2016 09:45:18 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU9jImi058097; Wed, 30 Nov 2016 09:45:18 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201611300945.uAU9jImi058097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 30 Nov 2016 09:45:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309322 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 09:45:19 -0000 Author: andrew Date: Wed Nov 30 09:45:18 2016 New Revision: 309322 URL: https://svnweb.freebsd.org/changeset/base/309322 Log: Only include FDT headders when building for FDT. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm/arm/gic.c Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Wed Nov 30 09:27:08 2016 (r309321) +++ head/sys/arm/arm/gic.c Wed Nov 30 09:45:18 2016 (r309322) @@ -61,8 +61,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT #include #include +#endif #include From owner-svn-src-all@freebsd.org Wed Nov 30 09:47:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41114C5D3B1; Wed, 30 Nov 2016 09:47:30 +0000 (UTC) (envelope-from andrew@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 1DFDE1944; Wed, 30 Nov 2016 09:47:30 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAU9lTM4058214; Wed, 30 Nov 2016 09:47:29 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAU9lTPM058212; Wed, 30 Nov 2016 09:47:29 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201611300947.uAU9lTPM058212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 30 Nov 2016 09:47:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309323 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 09:47:30 -0000 Author: andrew Date: Wed Nov 30 09:47:29 2016 New Revision: 309323 URL: https://svnweb.freebsd.org/changeset/base/309323 Log: Move the FDT specific parts of the GIC diver softc to the FDT attachment. This allows the driver to be built in a kernel with no FDT support, e.g. on arm64 with just ACPI. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm/arm/gic.h head/sys/arm/arm/gic_fdt.c Modified: head/sys/arm/arm/gic.h ============================================================================== --- head/sys/arm/arm/gic.h Wed Nov 30 09:45:18 2016 (r309322) +++ head/sys/arm/arm/gic.h Wed Nov 30 09:47:29 2016 (r309323) @@ -75,9 +75,6 @@ struct arm_gic_softc { #endif #ifdef INTRNG - /* FDT child data */ - pcell_t addr_cells; - pcell_t size_cells; int nranges; struct arm_gic_range * ranges; #endif Modified: head/sys/arm/arm/gic_fdt.c ============================================================================== --- head/sys/arm/arm/gic_fdt.c Wed Nov 30 09:45:18 2016 (r309322) +++ head/sys/arm/arm/gic_fdt.c Wed Nov 30 09:47:29 2016 (r309323) @@ -60,6 +60,12 @@ struct arm_gic_devinfo { }; #endif +struct arm_gic_fdt_softc { + struct arm_gic_softc base; + pcell_t addr_cells; + pcell_t size_cells; +}; + static device_probe_t gic_fdt_probe; static device_attach_t gic_fdt_attach; static ofw_bus_get_devinfo_t gic_ofw_get_devinfo; @@ -102,7 +108,7 @@ static device_method_t gic_fdt_methods[] }; DEFINE_CLASS_1(gic, gic_fdt_driver, gic_fdt_methods, - sizeof(struct arm_gic_softc), arm_gic_driver); + sizeof(struct arm_gic_fdt_softc), arm_gic_driver); static devclass_t gic_fdt_devclass; @@ -128,7 +134,7 @@ static int gic_fdt_attach(device_t dev) { #ifdef INTRNG - struct arm_gic_softc *sc = device_get_softc(dev); + struct arm_gic_fdt_softc *sc = device_get_softc(dev); phandle_t pxref; intptr_t xref; #endif @@ -164,14 +170,14 @@ gic_fdt_attach(device_t dev) goto cleanup; } } else { - if (sc->gic_res[2] == NULL) { + if (sc->base.gic_res[2] == NULL) { device_printf(dev, "not root PIC must have defined interrupt\n"); intr_pic_deregister(dev, xref); goto cleanup; } - if (bus_setup_intr(dev, sc->gic_res[2], INTR_TYPE_CLK, - arm_gic_intr, NULL, sc, &sc->gic_intrhand)) { + if (bus_setup_intr(dev, sc->base.gic_res[2], INTR_TYPE_CLK, + arm_gic_intr, NULL, sc, &sc->base.gic_intrhand)) { device_printf(dev, "could not setup irq handler\n"); intr_pic_deregister(dev, xref); goto cleanup; @@ -209,7 +215,7 @@ gic_fdt_get_resource_list(device_t bus, } static int -arm_gic_fill_ranges(phandle_t node, struct arm_gic_softc *sc) +arm_gic_fill_ranges(phandle_t node, struct arm_gic_fdt_softc *sc) { pcell_t host_cells; cell_t *base_ranges; @@ -229,42 +235,42 @@ arm_gic_fill_ranges(phandle_t node, stru nbase_ranges = OF_getproplen(node, "ranges"); if (nbase_ranges < 0) return (-1); - sc->nranges = nbase_ranges / sizeof(cell_t) / + sc->base.nranges = nbase_ranges / sizeof(cell_t) / (sc->addr_cells + host_cells + sc->size_cells); - if (sc->nranges == 0) + if (sc->base.nranges == 0) return (0); - sc->ranges = malloc(sc->nranges * sizeof(sc->ranges[0]), + sc->base.ranges = malloc(sc->base.nranges * sizeof(sc->base.ranges[0]), M_DEVBUF, M_WAITOK); base_ranges = malloc(nbase_ranges, M_DEVBUF, M_WAITOK); OF_getencprop(node, "ranges", base_ranges, nbase_ranges); - for (i = 0, j = 0; i < sc->nranges; i++) { - sc->ranges[i].bus = 0; + for (i = 0, j = 0; i < sc->base.nranges; i++) { + sc->base.ranges[i].bus = 0; for (k = 0; k < sc->addr_cells; k++) { - sc->ranges[i].bus <<= 32; - sc->ranges[i].bus |= base_ranges[j++]; + sc->base.ranges[i].bus <<= 32; + sc->base.ranges[i].bus |= base_ranges[j++]; } - sc->ranges[i].host = 0; + sc->base.ranges[i].host = 0; for (k = 0; k < host_cells; k++) { - sc->ranges[i].host <<= 32; - sc->ranges[i].host |= base_ranges[j++]; + sc->base.ranges[i].host <<= 32; + sc->base.ranges[i].host |= base_ranges[j++]; } - sc->ranges[i].size = 0; + sc->base.ranges[i].size = 0; for (k = 0; k < sc->size_cells; k++) { - sc->ranges[i].size <<= 32; - sc->ranges[i].size |= base_ranges[j++]; + sc->base.ranges[i].size <<= 32; + sc->base.ranges[i].size |= base_ranges[j++]; } } free(base_ranges, M_DEVBUF); - return (sc->nranges); + return (sc->base.nranges); } static bool arm_gic_add_children(device_t dev) { - struct arm_gic_softc *sc; + struct arm_gic_fdt_softc *sc; struct arm_gic_devinfo *dinfo; phandle_t child, node; device_t cdev; From owner-svn-src-all@freebsd.org Wed Nov 30 10:17:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DE05C5DADD; Wed, 30 Nov 2016 10:17:04 +0000 (UTC) (envelope-from andrew@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 2D6251A0B; Wed, 30 Nov 2016 10:17:04 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAUAH31W070300; Wed, 30 Nov 2016 10:17:03 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAUAH3Na070299; Wed, 30 Nov 2016 10:17:03 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201611301017.uAUAH3Na070299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 30 Nov 2016 10:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309324 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 10:17:04 -0000 Author: andrew Date: Wed Nov 30 10:17:03 2016 New Revision: 309324 URL: https://svnweb.freebsd.org/changeset/base/309324 Log: Mark the Alpine ethernet driver as FDT only. It calls alpine_serdes_resource_get which is defined in an FDT only file. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Nov 30 09:47:29 2016 (r309323) +++ head/sys/conf/files Wed Nov 30 10:17:03 2016 (r309324) @@ -719,13 +719,13 @@ dev/aic7xxx/aic7xxx_93cx6.c optional ahc dev/aic7xxx/aic7xxx_osm.c optional ahc dev/aic7xxx/aic7xxx_pci.c optional ahc pci dev/aic7xxx/aic7xxx_reg_print.c optional ahc ahc_reg_pretty_print -dev/al_eth/al_eth.c optional al_eth \ +dev/al_eth/al_eth.c optional al_eth fdt \ no-depend \ compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" -dev/al_eth/al_init_eth_lm.c optional al_eth \ +dev/al_eth/al_init_eth_lm.c optional al_eth fdt \ no-depend \ compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" -dev/al_eth/al_init_eth_kr.c optional al_eth \ +dev/al_eth/al_init_eth_kr.c optional al_eth fdt \ no-depend \ compile-with "${CC} -c -o ${.TARGET} ${CFLAGS} -I$S/contrib/alpine-hal -I$S/contrib/alpine-hal/eth ${PROF} ${.IMPSRC}" contrib/alpine-hal/al_hal_iofic.c optional al_iofic \ From owner-svn-src-all@freebsd.org Wed Nov 30 12:06:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6294CC5B617; Wed, 30 Nov 2016 12:06:04 +0000 (UTC) (envelope-from bapt@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 31C801C5E; Wed, 30 Nov 2016 12:06:04 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAUC63ov014679; Wed, 30 Nov 2016 12:06:03 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAUC63Lb014678; Wed, 30 Nov 2016 12:06:03 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201611301206.uAUC63Lb014678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 30 Nov 2016 12:06:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309325 - stable/11/lib/libstand X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 12:06:04 -0000 Author: bapt Date: Wed Nov 30 12:06:03 2016 New Revision: 309325 URL: https://svnweb.freebsd.org/changeset/base/309325 Log: MFC r308129: When issuing a PXE dhcp request, always issue a param request (DHCP option 55) with all dhcp parameters we might be interested in. Some DHCP server like the new kea (by ISC) expect it. This makes pxeboot functional with ISC kea. Submitted by: Vincent Legout Sponsored by: Gandi.net Modified: stable/11/lib/libstand/bootp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libstand/bootp.c ============================================================================== --- stable/11/lib/libstand/bootp.c Wed Nov 30 10:17:03 2016 (r309324) +++ stable/11/lib/libstand/bootp.c Wed Nov 30 12:06:03 2016 (r309325) @@ -148,7 +148,17 @@ bootp(sock, flag) bp->bp_vend[7] = TAG_CLASSID; bp->bp_vend[8] = 9; bcopy("PXEClient", &bp->bp_vend[9], 9); - bp->bp_vend[18] = TAG_END; + bp->bp_vend[18] = TAG_PARAM_REQ; + bp->bp_vend[19] = 8; + bp->bp_vend[20] = TAG_ROOTPATH; + bp->bp_vend[21] = TAG_TFTP_SERVER; + bp->bp_vend[22] = TAG_HOSTNAME; + bp->bp_vend[23] = TAG_SWAPSERVER; + bp->bp_vend[24] = TAG_GATEWAY; + bp->bp_vend[25] = TAG_SUBNET_MASK; + bp->bp_vend[26] = TAG_INTF_MTU; + bp->bp_vend[27] = TAG_SERVERID; + bp->bp_vend[28] = TAG_END; } else bp->bp_vend[7] = TAG_END; #else From owner-svn-src-all@freebsd.org Wed Nov 30 14:02:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91CD1C5DE3C; Wed, 30 Nov 2016 14:02:37 +0000 (UTC) (envelope-from rwatson@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 614E61F7F; Wed, 30 Nov 2016 14:02:37 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAUE2aDm062825; Wed, 30 Nov 2016 14:02:36 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAUE2a80062824; Wed, 30 Nov 2016 14:02:36 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201611301402.uAUE2a80062824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Wed, 30 Nov 2016 14:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309326 - head/usr.bin/login X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 14:02:37 -0000 Author: rwatson Date: Wed Nov 30 14:02:36 2016 New Revision: 309326 URL: https://svnweb.freebsd.org/changeset/base/309326 Log: Clarify warning message when failing to configure audit on user login: when au_user_mask() fails, it's not a failure to set the audit mask, but to calculate the audit mask -- and hence a condfiguration-file issue (of some sort). MFC after: 3 days Sponsored by: DARPA, AFRL Modified: head/usr.bin/login/login_audit.c Modified: head/usr.bin/login/login_audit.c ============================================================================== --- head/usr.bin/login/login_audit.c Wed Nov 30 12:06:03 2016 (r309325) +++ head/usr.bin/login/login_audit.c Wed Nov 30 14:02:36 2016 (r309326) @@ -80,7 +80,7 @@ au_login_success(void) /* Compute and set the user's preselection mask. */ if (au_user_mask(pwd->pw_name, &aumask) == -1) - errx(1, "could not set audit mask"); + errx(1, "could not calculate audit mask"); /* Set the audit info for the user. */ auinfo.ai_auid = uid; From owner-svn-src-all@freebsd.org Wed Nov 30 14:17:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00BC3C5D23E; Wed, 30 Nov 2016 14:17:08 +0000 (UTC) (envelope-from andrew@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 C481F1881; Wed, 30 Nov 2016 14:17:07 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAUEH64M066827; Wed, 30 Nov 2016 14:17:06 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAUEH6CP066826; Wed, 30 Nov 2016 14:17:06 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201611301417.uAUEH6CP066826@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 30 Nov 2016 14:17:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309327 - head/sys/arm64/cavium X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 14:17:08 -0000 Author: andrew Date: Wed Nov 30 14:17:06 2016 New Revision: 309327 URL: https://svnweb.freebsd.org/changeset/base/309327 Log: Fix the alloc function the ThunderX PCIe driver calls, the previous function may not exist when FDT is removed from the kernel. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/cavium/thunder_pcie_common.c Modified: head/sys/arm64/cavium/thunder_pcie_common.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_common.c Wed Nov 30 14:02:36 2016 (r309326) +++ head/sys/arm64/cavium/thunder_pcie_common.c Wed Nov 30 14:17:06 2016 (r309327) @@ -204,7 +204,7 @@ thunder_pcie_alloc_resource(device_t dev end = start + count - 1; } - return (pci_host_generic_alloc_resource(dev, child, type, rid, start, - end, count, flags)); + return (pci_host_generic_core_alloc_resource(dev, child, type, rid, + start, end, count, flags)); } #endif From owner-svn-src-all@freebsd.org Wed Nov 30 14:18:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCE64C5D2B3; Wed, 30 Nov 2016 14:18:53 +0000 (UTC) (envelope-from andrew@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 9C9CF1A18; Wed, 30 Nov 2016 14:18:53 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAUEIqf8066972; Wed, 30 Nov 2016 14:18:52 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAUEIqDk066971; Wed, 30 Nov 2016 14:18:52 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201611301418.uAUEIqDk066971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 30 Nov 2016 14:18:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309328 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 14:18:53 -0000 Author: andrew Date: Wed Nov 30 14:18:52 2016 New Revision: 309328 URL: https://svnweb.freebsd.org/changeset/base/309328 Log: Fix the PCI host generic FDT driver to call into the common code and not recurse into itself. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/pci/pci_host_generic_fdt.c Modified: head/sys/dev/pci/pci_host_generic_fdt.c ============================================================================== --- head/sys/dev/pci/pci_host_generic_fdt.c Wed Nov 30 14:17:06 2016 (r309327) +++ head/sys/dev/pci/pci_host_generic_fdt.c Wed Nov 30 14:18:52 2016 (r309328) @@ -152,7 +152,7 @@ pci_host_generic_attach(device_t dev) device_printf(dev, "Bus is%s cache-coherent\n", sc->base.coherent ? "" : " not"); - error = pci_host_generic_attach(dev); + error = pci_host_generic_core_attach(dev); if (error != 0) return (error); @@ -327,15 +327,15 @@ pci_host_generic_alloc_resource(device_t #if defined(NEW_PCIB) && defined(PCI_RES_BUS) if (type == PCI_RES_BUS) { - return (pci_host_generic_alloc_resource(dev, child, type, rid, + return (pci_host_generic_core_alloc_resource(dev, child, type, rid, start, end, count, flags)); } #endif /* For PCIe devices that do not have FDT nodes, use PCIB method */ if ((int)ofw_bus_get_node(child) <= 0) - return (pci_host_generic_alloc_resource(dev, child, type, rid, - start, end, count, flags)); + return (pci_host_generic_core_alloc_resource(dev, child, type, + rid, start, end, count, flags)); /* For other devices use OFW method */ sc = device_get_softc(dev); @@ -377,8 +377,8 @@ pci_host_generic_alloc_resource(device_t } } - return (bus_generic_alloc_resource(dev, child, type, rid, start, end, - count, flags)); + return (bus_generic_alloc_resource(dev, child, type, rid, start, + end, count, flags)); } static int From owner-svn-src-all@freebsd.org Wed Nov 30 18:11:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0629C5DA3E; Wed, 30 Nov 2016 18:11:36 +0000 (UTC) (envelope-from vangyzen@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 9475D190B; Wed, 30 Nov 2016 18:11:36 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAUIBZs2065019; Wed, 30 Nov 2016 18:11:35 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAUIBZ88065018; Wed, 30 Nov 2016 18:11:35 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201611301811.uAUIBZ88065018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 30 Nov 2016 18:11:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309329 - stable/10/usr.bin/locale X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 18:11:37 -0000 Author: vangyzen Date: Wed Nov 30 18:11:35 2016 New Revision: 309329 URL: https://svnweb.freebsd.org/changeset/base/309329 Log: MFC r308824 locale: fix display of "grouping" and "mon_grouping" values The "grouping" and "mon_grouping" values are arrays of one-byte integers, not arrays of ASCII characters. Display them in a format similar to GNU and MacOS. Sponsored by: Dell EMC Modified: stable/10/usr.bin/locale/locale.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/locale/locale.c ============================================================================== --- stable/10/usr.bin/locale/locale.c Wed Nov 30 14:18:52 2016 (r309328) +++ stable/10/usr.bin/locale/locale.c Wed Nov 30 18:11:35 2016 (r309329) @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -48,6 +49,7 @@ #include "setlocale.h" /* Local prototypes */ +char *format_grouping(const char *); void init_locales_list(void); void list_charmaps(void); void list_locales(void); @@ -486,6 +488,34 @@ showlocale(void) printf("LC_ALL=%s\n", vval); } +char * +format_grouping(const char *binary) +{ + static char rval[64]; + const char *cp; + size_t len; + + rval[0] = '\0'; + for (cp = binary; *cp != '\0'; ++cp) { + char group[sizeof("127;")]; + snprintf(group, sizeof(group), "%hhd;", *cp); + len = strlcat(rval, group, sizeof(rval)); + if (len >= sizeof(rval)) { + len = sizeof(rval) - 1; + break; + } + if (*cp == CHAR_MAX) { + break; + } + } + + /* Remove the trailing ';'. */ + rval[len - 1] = '\0'; + + return (rval); +} + + /* * keyword value lookup helper (via localeconv()) */ @@ -499,7 +529,7 @@ kwval_lconv(int id) lc = localeconv(); switch (id) { case KW_GROUPING: - rval = lc->grouping; + rval = format_grouping(lc->grouping); break; case KW_INT_CURR_SYMBOL: rval = lc->int_curr_symbol; @@ -514,7 +544,7 @@ kwval_lconv(int id) rval = lc->mon_thousands_sep; break; case KW_MON_GROUPING: - rval = lc->mon_grouping; + rval = format_grouping(lc->mon_grouping); break; case KW_POSITIVE_SIGN: rval = lc->positive_sign; From owner-svn-src-all@freebsd.org Wed Nov 30 18:26:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0E1FC5DEDD; Wed, 30 Nov 2016 18:26:23 +0000 (UTC) (envelope-from vangyzen@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 A5C3110A0; Wed, 30 Nov 2016 18:26:23 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAUIQMIC071607; Wed, 30 Nov 2016 18:26:22 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAUIQMTh071606; Wed, 30 Nov 2016 18:26:22 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201611301826.uAUIQMTh071606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 30 Nov 2016 18:26:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309330 - stable/11/usr.bin/locale X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 18:26:24 -0000 Author: vangyzen Date: Wed Nov 30 18:26:22 2016 New Revision: 309330 URL: https://svnweb.freebsd.org/changeset/base/309330 Log: MFC r308824 locale: fix display of "grouping" and "mon_grouping" values The "grouping" and "mon_grouping" values are arrays of one-byte integers, not arrays of ASCII characters. Display them in a format similar to GNU and MacOS. Sponsored by: Dell EMC Modified: stable/11/usr.bin/locale/locale.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/locale/locale.c ============================================================================== --- stable/11/usr.bin/locale/locale.c Wed Nov 30 18:11:35 2016 (r309329) +++ stable/11/usr.bin/locale/locale.c Wed Nov 30 18:26:22 2016 (r309330) @@ -40,6 +40,7 @@ #include #include +#include #include #include #include @@ -50,6 +51,7 @@ #include "setlocale.h" /* Local prototypes */ +char *format_grouping(const char *); void init_locales_list(void); void list_charmaps(void); void list_locales(void); @@ -488,6 +490,34 @@ showlocale(void) printf("LC_ALL=%s\n", vval); } +char * +format_grouping(const char *binary) +{ + static char rval[64]; + const char *cp; + size_t len; + + rval[0] = '\0'; + for (cp = binary; *cp != '\0'; ++cp) { + char group[sizeof("127;")]; + snprintf(group, sizeof(group), "%hhd;", *cp); + len = strlcat(rval, group, sizeof(rval)); + if (len >= sizeof(rval)) { + len = sizeof(rval) - 1; + break; + } + if (*cp == CHAR_MAX) { + break; + } + } + + /* Remove the trailing ';'. */ + rval[len - 1] = '\0'; + + return (rval); +} + + /* * keyword value lookup helper (via localeconv()) */ @@ -501,7 +531,7 @@ kwval_lconv(int id) lc = localeconv(); switch (id) { case KW_GROUPING: - rval = lc->grouping; + rval = format_grouping(lc->grouping); break; case KW_INT_CURR_SYMBOL: rval = lc->int_curr_symbol; @@ -516,7 +546,7 @@ kwval_lconv(int id) rval = lc->mon_thousands_sep; break; case KW_MON_GROUPING: - rval = lc->mon_grouping; + rval = format_grouping(lc->mon_grouping); break; case KW_POSITIVE_SIGN: rval = lc->positive_sign; From owner-svn-src-all@freebsd.org Wed Nov 30 18:34:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3248DC5D1D6; Wed, 30 Nov 2016 18:34:42 +0000 (UTC) (envelope-from vangyzen@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 01BB61687; Wed, 30 Nov 2016 18:34:41 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAUIYfOe075428; Wed, 30 Nov 2016 18:34:41 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAUIYfQs075427; Wed, 30 Nov 2016 18:34:41 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201611301834.uAUIYfQs075427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 30 Nov 2016 18:34:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309331 - head/usr.bin/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 18:34:42 -0000 Author: vangyzen Date: Wed Nov 30 18:34:40 2016 New Revision: 309331 URL: https://svnweb.freebsd.org/changeset/base/309331 Log: Include limits.h for CHAR_MAX This was needed on stable/10. Apparently, sys/param.h supplies CHAR_MAX on head. Include limits.h anyway, for consistency, and because C says so. Sponsored by: Dell EMC Modified: head/usr.bin/locale/locale.c Modified: head/usr.bin/locale/locale.c ============================================================================== --- head/usr.bin/locale/locale.c Wed Nov 30 18:26:22 2016 (r309330) +++ head/usr.bin/locale/locale.c Wed Nov 30 18:34:40 2016 (r309331) @@ -40,6 +40,7 @@ #include #include +#include #include #include #include From owner-svn-src-all@freebsd.org Wed Nov 30 19:06:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54E33C5DD11; Wed, 30 Nov 2016 19:06:48 +0000 (UTC) (envelope-from dim@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 24C931808; Wed, 30 Nov 2016 19:06:48 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAUJ6lQk087764; Wed, 30 Nov 2016 19:06:47 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAUJ6lKX087763; Wed, 30 Nov 2016 19:06:47 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201611301906.uAUJ6lKX087763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 30 Nov 2016 19:06:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309332 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 19:06:48 -0000 Author: dim Date: Wed Nov 30 19:06:47 2016 New Revision: 309332 URL: https://svnweb.freebsd.org/changeset/base/309332 Log: Cleanup old debug dirs in delete-old-dirs target Any .debug or .symbols files under /usr/lib/debug which correspond to OLD_FILES entries in ObsoleteFiles.inc are also automatically cleaned up by the delete-old target. Make this also apply to any OLD_DIRS entries. Reviewed by: emaste MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D8683 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Nov 30 18:34:40 2016 (r309331) +++ head/Makefile.inc1 Wed Nov 30 19:06:47 2016 (r309332) @@ -2404,6 +2404,11 @@ delete-old-dirs: .PHONY elif [ -L "${DESTDIR}/$${dir}" ]; then \ echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \ fi; \ + if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \ + rmdir -v "${DESTDIR}${DEBUGDIR}/$${dir}" || true; \ + elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \ + echo "${DESTDIR}${DEBUGDIR}/$${dir} is a link, please remove everything manually."; \ + fi; \ done @echo ">>> Old directories removed" @@ -2418,6 +2423,11 @@ check-old-dirs: .PHONY elif [ -L "${DESTDIR}/$${dir}" ]; then \ echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \ fi; \ + if [ -d "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \ + echo "${DESTDIR}${DEBUGDIR}/$${dir}"; \ + elif [ -L "${DESTDIR}${DEBUGDIR}/$${dir}" ]; then \ + echo "${DESTDIR}${DEBUGDIR}/$${dir} is a link, please remove everything manually."; \ + fi; \ done delete-old: delete-old-files delete-old-dirs .PHONY From owner-svn-src-all@freebsd.org Wed Nov 30 19:57:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DEC1C5DC1E; Wed, 30 Nov 2016 19:57:22 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0288E1082; Wed, 30 Nov 2016 19:57:22 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1354) id 548691FA5; Wed, 30 Nov 2016 19:57:21 +0000 (UTC) To: des@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r308996 - head/lib/libfetch In-Reply-To: <201611221330.uAMDU7fg052989@repo.freebsd.org> Message-Id: <20161130195721.548691FA5@freefall.freebsd.org> Date: Wed, 30 Nov 2016 19:57:21 +0000 (UTC) From: jbeich@freebsd.org (Jan Beich) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 19:57:22 -0000 Dag-Erling Smørgrav writes: > conn_t * > fetch_connect(const char *host, int port, int af, int verbose) > { [...] > + fetch_info("resolved"); Can you hide it behind "verbose" flag to avoid confusion? $ pkg The package management tool is not yet installed on your system. Do you want to fetch and install it now? [y/N]: y Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:12:amd64/latest, please wait... resolved resolved [...] $ fetch -q http://example.com resolved From owner-svn-src-all@freebsd.org Wed Nov 30 20:41:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33636C5E866 for ; Wed, 30 Nov 2016 20:41:01 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (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 177D01964 for ; Wed, 30 Nov 2016 20:41:00 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 4a9ac7e5-b73d-11e6-9ec7-5d8fa496b077 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id 4a9ac7e5-b73d-11e6-9ec7-5d8fa496b077; Wed, 30 Nov 2016 20:40:55 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id uAUKepYb001753; Wed, 30 Nov 2016 13:40:51 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1480538451.1889.187.camel@freebsd.org> Subject: Re: svn commit: r309121 - head/usr.sbin/bhyve From: Ian Lepore To: Jakub Klama Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 30 Nov 2016 13:40:51 -0700 In-Reply-To: <7F692FF4-4F36-4ED8-AF26-4684D41CB3AE@ixsystems.com> References: <201611242216.uAOMGIi0065703@repo.freebsd.org> <1480026232.1889.63.camel@freebsd.org> <7F692FF4-4F36-4ED8-AF26-4684D41CB3AE@ixsystems.com> Content-Type: text/plain; charset="iso-8859-2" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 20:41:01 -0000 On Thu, 2016-11-24 at 23:27 +0100, Jakub Klama wrote: > > > > Wiadomo¶æ napisana przez Ian Lepore w dniu > > 24.11.2016, o godz. 23:23: > > > > On Thu, 2016-11-24 at 22:16 +0000, Jakub Wojciech Klama wrote: > > > > > > Author: jceel > > > Date: Thu Nov 24 22:16:18 2016 > > > New Revision: 309121 > > > URL: https://svnweb.freebsd.org/changeset/base/309121 > > > > > > Log: > > >  virtio_console: handle short writes to an Unix domain socket > > > gracefully. > > > > > >  writev() can do a short write.  Retrying it results in a very > > > convoluted > > >  and complex code, so we iterate over iovec and do regular > > > stream_write() > > >  instead. > > > > > Doesn't pwritev(2) simplify iterating to handle short writes? > > > Correct me if I'm wrong, but pwritev(2) is a writev(2) with offset. > We're writing to an Unix domain socket here, which is not seekable. > > Thanks, > Jakub > > My bad, I was under the impression the offset was an offset into the iovec, not into the file.  So, ummm... nevermind. :) -- Ian From owner-svn-src-all@freebsd.org Wed Nov 30 20:47:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AE8DC5EA71; Wed, 30 Nov 2016 20:47:56 +0000 (UTC) (envelope-from vangyzen@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 2B84D1E09; Wed, 30 Nov 2016 20:47:56 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAUKltBO028126; Wed, 30 Nov 2016 20:47:55 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAUKltCI028124; Wed, 30 Nov 2016 20:47:55 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201611302047.uAUKltCI028124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 30 Nov 2016 20:47:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309333 - stable/11/lib/libc/locale X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 20:47:56 -0000 Author: vangyzen Date: Wed Nov 30 20:47:54 2016 New Revision: 309333 URL: https://svnweb.freebsd.org/changeset/base/309333 Log: MFC r308904 Fix error reporting from wcstof() When wcstof() skipped initial space and then parsing failed, it set endptr to the first non-space character. Fix it to correctly report failure by setting endptr to the beginning of the input string. The fix is from theraven@, who fixed this bug in wcstod() and wcstold() in r227753. While I'm here: Move assignments out of declarations in wcstod() and wcstold(). This is against my personal preference, but it is our agreed style(9). Set endptr correctly on malloc() failure in all three functions. Remove an incorrect comment: This is pointer arithmetic, so the code was not actually making that assumption. wcstold() advanced the wcp pointer beyond leading whitespace and then reset it back to the beginning of the string. Do not reset it. This seems to have no functional effect, since strtold_l() also skips leading whitespace. I'm making the change to keep this function consistent with wcstof() and wcstod(), and because the C11 spec prescribes the use of iswspace() to skip leading space. Reported by: libc++ unit test for std::stof(std::wstring) Sponsored by: Dell EMC Modified: stable/11/lib/libc/locale/wcstod.c stable/11/lib/libc/locale/wcstof.c stable/11/lib/libc/locale/wcstold.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/locale/wcstod.c ============================================================================== --- stable/11/lib/libc/locale/wcstod.c Wed Nov 30 19:06:47 2016 (r309332) +++ stable/11/lib/libc/locale/wcstod.c Wed Nov 30 20:47:54 2016 (r309333) @@ -54,11 +54,13 @@ wcstod_l(const wchar_t * __restrict nptr mbstate_t mbs; double val; char *buf, *end; - const wchar_t *wcp = nptr; + const wchar_t *wcp; size_t len; - size_t spaces = 0; + size_t spaces; FIX_LOCALE(locale); + wcp = nptr; + spaces = 0; while (iswspace_l(*wcp, locale)) { wcp++; spaces++; @@ -80,8 +82,11 @@ wcstod_l(const wchar_t * __restrict nptr *endptr = (wchar_t *)nptr; return (0.0); } - if ((buf = malloc(len + 1)) == NULL) + if ((buf = malloc(len + 1)) == NULL) { + if (endptr != NULL) + *endptr = (wchar_t *)nptr; return (0.0); + } mbs = initial; wcsrtombs_l(buf, &wcp, len + 1, &mbs, locale); @@ -95,13 +100,11 @@ wcstod_l(const wchar_t * __restrict nptr * corresponding position in the wide char string. */ if (endptr != NULL) { - /* XXX Assume each wide char is one byte. */ *endptr = (wchar_t *)nptr + (end - buf); if (buf != end) *endptr += spaces; } - free(buf); return (val); Modified: stable/11/lib/libc/locale/wcstof.c ============================================================================== --- stable/11/lib/libc/locale/wcstof.c Wed Nov 30 19:06:47 2016 (r309332) +++ stable/11/lib/libc/locale/wcstof.c Wed Nov 30 20:47:54 2016 (r309333) @@ -50,27 +50,37 @@ wcstof_l(const wchar_t * __restrict nptr char *buf, *end; const wchar_t *wcp; size_t len; + size_t spaces; FIX_LOCALE(locale); - while (iswspace_l(*nptr, locale)) - nptr++; - wcp = nptr; + spaces = 0; + while (iswspace_l(*wcp, locale)) { + wcp++; + spaces++; + } + mbs = initial; if ((len = wcsrtombs_l(NULL, &wcp, 0, &mbs, locale)) == (size_t)-1) { if (endptr != NULL) *endptr = (wchar_t *)nptr; return (0.0); } - if ((buf = malloc(len + 1)) == NULL) + if ((buf = malloc(len + 1)) == NULL) { + if (endptr != NULL) + *endptr = (wchar_t *)nptr; return (0.0); + } mbs = initial; wcsrtombs_l(buf, &wcp, len + 1, &mbs, locale); val = strtof_l(buf, &end, locale); - if (endptr != NULL) + if (endptr != NULL) { *endptr = (wchar_t *)nptr + (end - buf); + if (buf != end) + *endptr += spaces; + } free(buf); Modified: stable/11/lib/libc/locale/wcstold.c ============================================================================== --- stable/11/lib/libc/locale/wcstold.c Wed Nov 30 19:06:47 2016 (r309332) +++ stable/11/lib/libc/locale/wcstold.c Wed Nov 30 20:47:54 2016 (r309333) @@ -48,32 +48,35 @@ wcstold_l(const wchar_t * __restrict npt mbstate_t mbs; long double val; char *buf, *end; - const wchar_t *wcp = nptr; + const wchar_t *wcp; size_t len; - size_t spaces = 0; + size_t spaces; FIX_LOCALE(locale); + wcp = nptr; + spaces = 0; while (iswspace_l(*wcp, locale)) { wcp++; spaces++; } - wcp = nptr; mbs = initial; if ((len = wcsrtombs_l(NULL, &wcp, 0, &mbs, locale)) == (size_t)-1) { if (endptr != NULL) *endptr = (wchar_t *)nptr; return (0.0); } - if ((buf = malloc(len + 1)) == NULL) + if ((buf = malloc(len + 1)) == NULL) { + if (endptr != NULL) + *endptr = (wchar_t *)nptr; return (0.0); + } mbs = initial; wcsrtombs_l(buf, &wcp, len + 1, &mbs, locale); val = strtold_l(buf, &end, locale); if (endptr != NULL) { - /* XXX Assume each wide char is one byte. */ *endptr = (wchar_t *)nptr + (end - buf); if (buf != end) *endptr += spaces; From owner-svn-src-all@freebsd.org Wed Nov 30 20:48:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FECDC5EAD4; Wed, 30 Nov 2016 20:48:46 +0000 (UTC) (envelope-from vangyzen@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 307041F69; Wed, 30 Nov 2016 20:48:46 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAUKmj1v028206; Wed, 30 Nov 2016 20:48:45 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAUKmjBV028203; Wed, 30 Nov 2016 20:48:45 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201611302048.uAUKmjBV028203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 30 Nov 2016 20:48:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309334 - stable/10/lib/libc/locale X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 20:48:46 -0000 Author: vangyzen Date: Wed Nov 30 20:48:44 2016 New Revision: 309334 URL: https://svnweb.freebsd.org/changeset/base/309334 Log: MFC r308904 Fix error reporting from wcstof() When wcstof() skipped initial space and then parsing failed, it set endptr to the first non-space character. Fix it to correctly report failure by setting endptr to the beginning of the input string. The fix is from theraven@, who fixed this bug in wcstod() and wcstold() in r227753. While I'm here: Move assignments out of declarations in wcstod() and wcstold(). This is against my personal preference, but it is our agreed style(9). Set endptr correctly on malloc() failure in all three functions. Remove an incorrect comment: This is pointer arithmetic, so the code was not actually making that assumption. wcstold() advanced the wcp pointer beyond leading whitespace and then reset it back to the beginning of the string. Do not reset it. This seems to have no functional effect, since strtold_l() also skips leading whitespace. I'm making the change to keep this function consistent with wcstof() and wcstod(), and because the C11 spec prescribes the use of iswspace() to skip leading space. Reported by: libc++ unit test for std::stof(std::wstring) Sponsored by: Dell EMC Modified: stable/10/lib/libc/locale/wcstod.c stable/10/lib/libc/locale/wcstof.c stable/10/lib/libc/locale/wcstold.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/locale/wcstod.c ============================================================================== --- stable/10/lib/libc/locale/wcstod.c Wed Nov 30 20:47:54 2016 (r309333) +++ stable/10/lib/libc/locale/wcstod.c Wed Nov 30 20:48:44 2016 (r309334) @@ -54,11 +54,13 @@ wcstod_l(const wchar_t * __restrict nptr mbstate_t mbs; double val; char *buf, *end; - const wchar_t *wcp = nptr; + const wchar_t *wcp; size_t len; - size_t spaces = 0; + size_t spaces; FIX_LOCALE(locale); + wcp = nptr; + spaces = 0; while (iswspace_l(*wcp, locale)) { wcp++; spaces++; @@ -80,8 +82,11 @@ wcstod_l(const wchar_t * __restrict nptr *endptr = (wchar_t *)nptr; return (0.0); } - if ((buf = malloc(len + 1)) == NULL) + if ((buf = malloc(len + 1)) == NULL) { + if (endptr != NULL) + *endptr = (wchar_t *)nptr; return (0.0); + } mbs = initial; wcsrtombs_l(buf, &wcp, len + 1, &mbs, locale); @@ -95,13 +100,11 @@ wcstod_l(const wchar_t * __restrict nptr * corresponding position in the wide char string. */ if (endptr != NULL) { - /* XXX Assume each wide char is one byte. */ *endptr = (wchar_t *)nptr + (end - buf); if (buf != end) *endptr += spaces; } - free(buf); return (val); Modified: stable/10/lib/libc/locale/wcstof.c ============================================================================== --- stable/10/lib/libc/locale/wcstof.c Wed Nov 30 20:47:54 2016 (r309333) +++ stable/10/lib/libc/locale/wcstof.c Wed Nov 30 20:48:44 2016 (r309334) @@ -50,27 +50,37 @@ wcstof_l(const wchar_t * __restrict nptr char *buf, *end; const wchar_t *wcp; size_t len; + size_t spaces; FIX_LOCALE(locale); - while (iswspace_l(*nptr, locale)) - nptr++; - wcp = nptr; + spaces = 0; + while (iswspace_l(*wcp, locale)) { + wcp++; + spaces++; + } + mbs = initial; if ((len = wcsrtombs_l(NULL, &wcp, 0, &mbs, locale)) == (size_t)-1) { if (endptr != NULL) *endptr = (wchar_t *)nptr; return (0.0); } - if ((buf = malloc(len + 1)) == NULL) + if ((buf = malloc(len + 1)) == NULL) { + if (endptr != NULL) + *endptr = (wchar_t *)nptr; return (0.0); + } mbs = initial; wcsrtombs_l(buf, &wcp, len + 1, &mbs, locale); val = strtof_l(buf, &end, locale); - if (endptr != NULL) + if (endptr != NULL) { *endptr = (wchar_t *)nptr + (end - buf); + if (buf != end) + *endptr += spaces; + } free(buf); Modified: stable/10/lib/libc/locale/wcstold.c ============================================================================== --- stable/10/lib/libc/locale/wcstold.c Wed Nov 30 20:47:54 2016 (r309333) +++ stable/10/lib/libc/locale/wcstold.c Wed Nov 30 20:48:44 2016 (r309334) @@ -48,32 +48,35 @@ wcstold_l(const wchar_t * __restrict npt mbstate_t mbs; long double val; char *buf, *end; - const wchar_t *wcp = nptr; + const wchar_t *wcp; size_t len; - size_t spaces = 0; + size_t spaces; FIX_LOCALE(locale); + wcp = nptr; + spaces = 0; while (iswspace_l(*wcp, locale)) { wcp++; spaces++; } - wcp = nptr; mbs = initial; if ((len = wcsrtombs_l(NULL, &wcp, 0, &mbs, locale)) == (size_t)-1) { if (endptr != NULL) *endptr = (wchar_t *)nptr; return (0.0); } - if ((buf = malloc(len + 1)) == NULL) + if ((buf = malloc(len + 1)) == NULL) { + if (endptr != NULL) + *endptr = (wchar_t *)nptr; return (0.0); + } mbs = initial; wcsrtombs_l(buf, &wcp, len + 1, &mbs, locale); val = strtold_l(buf, &end, locale); if (endptr != NULL) { - /* XXX Assume each wide char is one byte. */ *endptr = (wchar_t *)nptr + (end - buf); if (buf != end) *endptr += spaces; From owner-svn-src-all@freebsd.org Wed Nov 30 20:51:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77ED2C5EB86; Wed, 30 Nov 2016 20:51:15 +0000 (UTC) (envelope-from vangyzen@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 4709B128F; Wed, 30 Nov 2016 20:51:15 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAUKpEPS031430; Wed, 30 Nov 2016 20:51:14 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAUKpEmM031429; Wed, 30 Nov 2016 20:51:14 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201611302051.uAUKpEmM031429@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 30 Nov 2016 20:51:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309335 - stable/11/usr.bin/ncal X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 20:51:15 -0000 Author: vangyzen Date: Wed Nov 30 20:51:14 2016 New Revision: 309335 URL: https://svnweb.freebsd.org/changeset/base/309335 Log: MFC r308340 ncal: fix a reference to an out-of-scope stack buffer PR: 214237 Submitted by: Jonathan de Boyne Pollard Sponsored by: Dell EMC Modified: stable/11/usr.bin/ncal/ncal.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/ncal/ncal.c ============================================================================== --- stable/11/usr.bin/ncal/ncal.c Wed Nov 30 20:48:44 2016 (r309334) +++ stable/11/usr.bin/ncal/ncal.c Wed Nov 30 20:51:14 2016 (r309335) @@ -1110,7 +1110,8 @@ highlight(char *dst, char *src, int len, static const char *term_so, *term_se; if (first) { - char tbuf[1024], cbuf[512], *b; + static char cbuf[512]; + char tbuf[1024], *b; term_se = term_so = NULL; From owner-svn-src-all@freebsd.org Wed Nov 30 20:51:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B74EAC5EBE0; Wed, 30 Nov 2016 20:51:52 +0000 (UTC) (envelope-from vangyzen@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 8692E15F0; Wed, 30 Nov 2016 20:51:52 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAUKppvd031510; Wed, 30 Nov 2016 20:51:51 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAUKppJm031509; Wed, 30 Nov 2016 20:51:51 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201611302051.uAUKppJm031509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 30 Nov 2016 20:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309336 - stable/10/usr.bin/ncal X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 20:51:52 -0000 Author: vangyzen Date: Wed Nov 30 20:51:51 2016 New Revision: 309336 URL: https://svnweb.freebsd.org/changeset/base/309336 Log: MFC r308340 ncal: fix a reference to an out-of-scope stack buffer PR: 214237 Submitted by: Jonathan de Boyne Pollard Sponsored by: Dell EMC Modified: stable/10/usr.bin/ncal/ncal.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/ncal/ncal.c ============================================================================== --- stable/10/usr.bin/ncal/ncal.c Wed Nov 30 20:51:14 2016 (r309335) +++ stable/10/usr.bin/ncal/ncal.c Wed Nov 30 20:51:51 2016 (r309336) @@ -1110,7 +1110,8 @@ highlight(char *dst, char *src, int len, static const char *term_so, *term_se; if (first) { - char tbuf[1024], cbuf[512], *b; + static char cbuf[512]; + char tbuf[1024], *b; term_se = term_so = NULL; From owner-svn-src-all@freebsd.org Wed Nov 30 21:53:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 044E7C5E09A; Wed, 30 Nov 2016 21:53:08 +0000 (UTC) (envelope-from vangyzen@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 D314A19D5; Wed, 30 Nov 2016 21:53:07 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAULr7t7057217; Wed, 30 Nov 2016 21:53:07 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAULr6MB057213; Wed, 30 Nov 2016 21:53:06 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201611302153.uAULr6MB057213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 30 Nov 2016 21:53:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309337 - in stable/11: sys/netinet usr.sbin/arp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 21:53:08 -0000 Author: vangyzen Date: Wed Nov 30 21:53:06 2016 New Revision: 309337 URL: https://svnweb.freebsd.org/changeset/base/309337 Log: MFC r306577 r306652 306830 Add GARP retransmit capability A single gratuitous ARP (GARP) is always transmitted when an IPv4 address is added to an interface, and that is usually sufficient. However, in some circumstances, such as when a shared address is passed between cluster nodes, this single GARP may occasionally be dropped or lost. This can lead to neighbors on the network link working with a stale ARP cache and sending packets destined for that address to the node that previously owned the address, which may not respond. To avoid this situation, GARP retransmissions can be enabled by setting the net.link.ether.inet.garp_rexmit_count sysctl to a value greater than zero. The setting represents the maximum number of retransmissions. The interval between retransmissions is calculated using an exponential backoff algorithm, doubling each time, so the retransmission intervals are: {1, 2, 4, 8, 16, ...} (seconds). Due to the exponential backoff algorithm used for the interval between GARP retransmissions, the maximum number of retransmissions is limited to 16 for sanity. This limit corresponds to a maximum interval between retransmissions of 2^16 seconds ~= 18 hours. Increasing this limit is possible, but sending out GARPs spaced days apart would be of little use. Update arp(4) to document the net.link.ether.inet.garp_rexmit_count sysctl. Submitted by: dab Relnotes: yes Sponsored by: Dell EMC Modified: stable/11/sys/netinet/if_ether.c stable/11/sys/netinet/in.c stable/11/sys/netinet/in_var.h stable/11/usr.sbin/arp/arp.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/if_ether.c ============================================================================== --- stable/11/sys/netinet/if_ether.c Wed Nov 30 20:51:51 2016 (r309336) +++ stable/11/sys/netinet/if_ether.c Wed Nov 30 21:53:06 2016 (r309337) @@ -137,6 +137,28 @@ SYSCTL_INT(_net_link_ether_inet, OID_AUT "Maximum number of remotely triggered ARP messages that can be " "logged per second"); +/* + * Due to the exponential backoff algorithm used for the interval between GARP + * retransmissions, the maximum number of retransmissions is limited for + * sanity. This limit corresponds to a maximum interval between retransmissions + * of 2^16 seconds ~= 18 hours. + * + * Making this limit more dynamic is more complicated than worthwhile, + * especially since sending out GARPs spaced days apart would be of little + * use. A maximum dynamic limit would look something like: + * + * const int max = fls(INT_MAX / hz) - 1; + */ +#define MAX_GARP_RETRANSMITS 16 +static int sysctl_garp_rexmit(SYSCTL_HANDLER_ARGS); +static int garp_rexmit_count = 0; /* GARP retransmission setting. */ + +SYSCTL_PROC(_net_link_ether_inet, OID_AUTO, garp_rexmit_count, + CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_MPSAFE, + &garp_rexmit_count, 0, sysctl_garp_rexmit, "I", + "Number of times to retransmit GARP packets;" + " 0 to disable, maximum of 16"); + #define ARP_LOG(pri, ...) do { \ if (ppsratecheck(&arp_lastlog, &arp_curpps, arp_maxpps)) \ log((pri), "arp: " __VA_ARGS__); \ @@ -1287,6 +1309,109 @@ arp_add_ifa_lle(struct ifnet *ifp, const lltable_free_entry(LLTABLE(ifp), lle_tmp); } +/* + * Handle the garp_rexmit_count. Like sysctl_handle_int(), but limits the range + * of valid values. + */ +static int +sysctl_garp_rexmit(SYSCTL_HANDLER_ARGS) +{ + int error; + int rexmit_count = *(int *)arg1; + + error = sysctl_handle_int(oidp, &rexmit_count, 0, req); + + /* Enforce limits on any new value that may have been set. */ + if (!error && req->newptr) { + /* A new value was set. */ + if (rexmit_count < 0) { + rexmit_count = 0; + } else if (rexmit_count > MAX_GARP_RETRANSMITS) { + rexmit_count = MAX_GARP_RETRANSMITS; + } + *(int *)arg1 = rexmit_count; + } + + return (error); +} + +/* + * Retransmit a Gratuitous ARP (GARP) and, if necessary, schedule a callout to + * retransmit it again. A pending callout owns a reference to the ifa. + */ +static void +garp_rexmit(void *arg) +{ + struct in_ifaddr *ia = arg; + + if (callout_pending(&ia->ia_garp_timer) || + !callout_active(&ia->ia_garp_timer)) { + IF_ADDR_WUNLOCK(ia->ia_ifa.ifa_ifp); + ifa_free(&ia->ia_ifa); + return; + } + + /* + * Drop lock while the ARP request is generated. + */ + IF_ADDR_WUNLOCK(ia->ia_ifa.ifa_ifp); + + arprequest(ia->ia_ifa.ifa_ifp, &IA_SIN(ia)->sin_addr, + &IA_SIN(ia)->sin_addr, IF_LLADDR(ia->ia_ifa.ifa_ifp)); + + /* + * Increment the count of retransmissions. If the count has reached the + * maximum value, stop sending the GARP packets. Otherwise, schedule + * the callout to retransmit another GARP packet. + */ + ++ia->ia_garp_count; + if (ia->ia_garp_count >= garp_rexmit_count) { + ifa_free(&ia->ia_ifa); + } else { + int rescheduled; + IF_ADDR_WLOCK(ia->ia_ifa.ifa_ifp); + rescheduled = callout_reset(&ia->ia_garp_timer, + (1 << ia->ia_garp_count) * hz, + garp_rexmit, ia); + IF_ADDR_WUNLOCK(ia->ia_ifa.ifa_ifp); + if (rescheduled) { + ifa_free(&ia->ia_ifa); + } + } +} + +/* + * Start the GARP retransmit timer. + * + * A single GARP is always transmitted when an IPv4 address is added + * to an interface and that is usually sufficient. However, in some + * circumstances, such as when a shared address is passed between + * cluster nodes, this single GARP may occasionally be dropped or + * lost. This can lead to neighbors on the network link working with a + * stale ARP cache and sending packets destined for that address to + * the node that previously owned the address, which may not respond. + * + * To avoid this situation, GARP retransmits can be enabled by setting + * the net.link.ether.inet.garp_rexmit_count sysctl to a value greater + * than zero. The setting represents the maximum number of + * retransmissions. The interval between retransmissions is calculated + * using an exponential backoff algorithm, doubling each time, so the + * retransmission intervals are: {1, 2, 4, 8, 16, ...} (seconds). + */ +static void +garp_timer_start(struct ifaddr *ifa) +{ + struct in_ifaddr *ia = (struct in_ifaddr *) ifa; + + IF_ADDR_WLOCK(ia->ia_ifa.ifa_ifp); + ia->ia_garp_count = 0; + if (callout_reset(&ia->ia_garp_timer, (1 << ia->ia_garp_count) * hz, + garp_rexmit, ia) == 0) { + ifa_ref(ifa); + } + IF_ADDR_WUNLOCK(ia->ia_ifa.ifa_ifp); +} + void arp_ifinit(struct ifnet *ifp, struct ifaddr *ifa) { @@ -1302,6 +1427,9 @@ arp_ifinit(struct ifnet *ifp, struct ifa if (ntohl(dst_in->sin_addr.s_addr) == INADDR_ANY) return; arp_announce_ifaddr(ifp, dst_in->sin_addr, IF_LLADDR(ifp)); + if (garp_rexmit_count > 0) { + garp_timer_start(ifa); + } arp_add_ifa_lle(ifp, dst); } Modified: stable/11/sys/netinet/in.c ============================================================================== --- stable/11/sys/netinet/in.c Wed Nov 30 20:51:51 2016 (r309336) +++ stable/11/sys/netinet/in.c Wed Nov 30 21:53:06 2016 (r309337) @@ -397,6 +397,8 @@ in_aifaddr_ioctl(u_long cmd, caddr_t dat ifa->ifa_addr = (struct sockaddr *)&ia->ia_addr; ifa->ifa_dstaddr = (struct sockaddr *)&ia->ia_dstaddr; ifa->ifa_netmask = (struct sockaddr *)&ia->ia_sockmask; + callout_init_rw(&ia->ia_garp_timer, &ifp->if_addr_lock, + CALLOUT_RETURNUNLOCKED); ia->ia_ifp = ifp; ia->ia_addr = *addr; @@ -635,6 +637,12 @@ in_difaddr_ioctl(caddr_t data, struct if IN_MULTI_UNLOCK(); } + IF_ADDR_WLOCK(ifp); + if (callout_stop(&ia->ia_garp_timer) == 1) { + ifa_free(&ia->ia_ifa); + } + IF_ADDR_WUNLOCK(ifp); + EVENTHANDLER_INVOKE(ifaddr_event, ifp); ifa_free(&ia->ia_ifa); /* in_ifaddrhead */ Modified: stable/11/sys/netinet/in_var.h ============================================================================== --- stable/11/sys/netinet/in_var.h Wed Nov 30 20:51:51 2016 (r309336) +++ stable/11/sys/netinet/in_var.h Wed Nov 30 21:53:06 2016 (r309337) @@ -82,6 +82,8 @@ struct in_ifaddr { struct sockaddr_in ia_dstaddr; /* reserve space for broadcast addr */ #define ia_broadaddr ia_dstaddr struct sockaddr_in ia_sockmask; /* reserve space for general netmask */ + struct callout ia_garp_timer; /* timer for retransmitting GARPs */ + int ia_garp_count; /* count of retransmitted GARPs */ }; /* Modified: stable/11/usr.sbin/arp/arp.4 ============================================================================== --- stable/11/usr.sbin/arp/arp.4 Wed Nov 30 20:51:51 2016 (r309336) +++ stable/11/usr.sbin/arp/arp.4 Wed Nov 30 21:53:06 2016 (r309337) @@ -28,7 +28,7 @@ .\" @(#)arp4.4 6.5 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd November 5, 2013 +.Dd October 7, 2016 .Dt ARP 4 .Os .Sh NAME @@ -121,49 +121,65 @@ of the MIB. .Bl -tag -width "log_arp_permanent_modify" .It Va allow_multicast -Should the kernel install ARP entries with multicast bit set in -the hardware address. -Installing such entries is RFC 1812 violation, but some prorietary -load balancing techniques require routers on network to do so. +Install ARP entries with the multicast bit set in the hardware address. +Installing such entries is an RFC 1812 violation, but some proprietary load +balancing techniques require routers to do so. Turned off by default. +.It Va garp_rexmit_count +Retransmit gratuitous ARP (GARP) packets when an IPv4 address is added to an +interface. +A GARP is always transmitted when an IPv4 address is added to an interface. +A non-zero value causes the GARP packet to be retransmitted the stated number +of times. +The interval between retransmissions is doubled each time, so the +retransmission intervals are: {1, 2, 4, 8, 16, ...} (seconds). +The default value of zero means only the initial GARP is sent; no +additional GARP packets are retransmitted. +The maximum value is sixteen. +.Pp +The default behavior of a single GARP packet is usually sufficient. +However, a single GARP might be dropped or lost in some circumstances. +This is particularly harmful when a shared address is passed between cluster +nodes. +Neighbors on the network link might then work with a stale ARP cache and send +packets destined for that address to the node that previously owned the +address, which might not respond. .It Va log_arp_movements -Should the kernel log movements of IP addresses from one hardware -address to an other. +Log movements of IP addresses from one hardware address to another. See .Sx DIAGNOSTICS below. Turned on by default. .It Va log_arp_permanent_modify -Should the kernel log attempts of remote host on network to modify a -permanent ARP entry. +Log attempts by a remote host to modify a permanent ARP entry. See .Sx DIAGNOSTICS below. Turned on by default. .It Va log_arp_wrong_iface -Should the kernel log attempts to insert an ARP entry on an interface -when the IP network the address belongs to is connected to an other -interface. +Log attempts to insert an ARP entry on an interface when the IP network to +which the address belongs is connected to another interface. See .Sx DIAGNOSTICS below. Turned on by default. .It Va max_log_per_second -Limit number of remotely triggered logging events to a configured value -per second. +Limit the number of remotely triggered logging events to a configured value per +second. Default is 1 log message per second. .It Va max_age How long an ARP entry is held in the cache until it needs to be refreshed. Default is 1200 seconds. .It Va maxhold -How many packets hold in the per-entry output queue while the entry +How many packets to hold in the per-entry output queue while the entry is being resolved. Default is one packet. .It Va maxtries -Number of retransmits before host is considered down and error is returned. +Number of retransmits before a host is considered down and an error is +returned. Default is 5 tries. .It Va proxyall -Enables ARP proxying for all hosts on net. +Enables ARP proxying. Turned off by default. .It Va wait Lifetime of an incomplete ARP entry. From owner-svn-src-all@freebsd.org Wed Nov 30 21:59:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A47BCC5E28F; Wed, 30 Nov 2016 21:59:53 +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 58BBF1E70; Wed, 30 Nov 2016 21:59:53 +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 uAULxqG0057528; Wed, 30 Nov 2016 21:59:52 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAULxqBP057526; Wed, 30 Nov 2016 21:59:52 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201611302159.uAULxqBP057526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 30 Nov 2016 21:59:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309338 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 21:59:53 -0000 Author: cem Date: Wed Nov 30 21:59:52 2016 New Revision: 309338 URL: https://svnweb.freebsd.org/changeset/base/309338 Log: ioat(4): Fix 'bogus completion_pending' KASSERT Fix ioat_release to only set is_completion_pending if DMAs were actually queued. Otherwise, the spurious flag could trigger an assert in the reset path on INVARIANTS kernels. Reviewed by: bdrewery, Suraj Raju @ Isilon Sponsored by: Dell EMC Isilon Modified: head/sys/dev/ioat/ioat.c head/sys/dev/ioat/ioat_internal.h Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Wed Nov 30 21:53:06 2016 (r309337) +++ head/sys/dev/ioat/ioat.c Wed Nov 30 21:59:52 2016 (r309338) @@ -947,6 +947,7 @@ ioat_acquire(bus_dmaengine_t dmaengine) ioat = to_ioat_softc(dmaengine); mtx_lock(&ioat->submit_lock); CTR2(KTR_IOAT, "%s channel=%u", __func__, ioat->chan_idx); + ioat->acq_head = ioat->head; } int @@ -976,12 +977,15 @@ ioat_release(bus_dmaengine_t dmaengine) CTR4(KTR_IOAT, "%s channel=%u dispatch2 hw_head=%u head=%u", __func__, ioat->chan_idx, ioat->hw_head & UINT16_MAX, ioat->head); - ioat_write_2(ioat, IOAT_DMACOUNT_OFFSET, (uint16_t)ioat->hw_head); - - if (!ioat->is_completion_pending) { - ioat->is_completion_pending = TRUE; - callout_reset(&ioat->poll_timer, 1, ioat_poll_timer_callback, - ioat); + if (ioat->acq_head != ioat->head) { + ioat_write_2(ioat, IOAT_DMACOUNT_OFFSET, + (uint16_t)ioat->hw_head); + + if (!ioat->is_completion_pending) { + ioat->is_completion_pending = TRUE; + callout_reset(&ioat->poll_timer, 1, + ioat_poll_timer_callback, ioat); + } } mtx_unlock(&ioat->submit_lock); } Modified: head/sys/dev/ioat/ioat_internal.h ============================================================================== --- head/sys/dev/ioat/ioat_internal.h Wed Nov 30 21:53:06 2016 (r309337) +++ head/sys/dev/ioat/ioat_internal.h Wed Nov 30 21:59:52 2016 (r309338) @@ -483,6 +483,7 @@ struct ioat_softc { boolean_t resetting_cleanup; /* cleanup_lock */ uint32_t head; + uint32_t acq_head; uint32_t tail; uint32_t hw_head; uint32_t ring_size_order; From owner-svn-src-all@freebsd.org Wed Nov 30 22:00:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86CA0C5E2FA; Wed, 30 Nov 2016 22:00:26 +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 6157A1FFD; Wed, 30 Nov 2016 22:00:26 +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 uAUM0Pd1057638; Wed, 30 Nov 2016 22:00:25 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAUM0PJx057635; Wed, 30 Nov 2016 22:00:25 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201611302200.uAUM0PJx057635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 30 Nov 2016 22:00:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309339 - in head: . release/scripts share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 22:00:26 -0000 Author: gjb Date: Wed Nov 30 22:00:25 2016 New Revision: 309339 URL: https://svnweb.freebsd.org/changeset/base/309339 Log: Revert r309314, which breaks installing ports. Requested by: antoine Differential Revision: https://reviews.freebsd.org/D8120 (related) Sponsored by: The FreeBSD Foundation Modified: head/Makefile.inc1 head/release/scripts/make-pkg-package.sh head/share/mk/bsd.own.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Nov 30 21:59:52 2016 (r309338) +++ head/Makefile.inc1 Wed Nov 30 22:00:25 2016 (r309339) @@ -1379,8 +1379,7 @@ packages: .PHONY package-pkg: .PHONY rm -rf /tmp/ports.${TARGET} || : env ${WMAKEENV:Q} SRCDIR=${.CURDIR} PORTSDIR=${PORTSDIR} REVISION=${_REVISION} \ - PKG_CMD=${PKG_CMD} PKG_VERSION=${PKG_VERSION} REPODIR=${REPODIR} \ - WSTAGEDIR=${WSTAGEDIR} \ + PKG_VERSION=${PKG_VERSION} REPODIR=${REPODIR} WSTAGEDIR=${WSTAGEDIR} \ sh ${.CURDIR}/release/scripts/make-pkg-package.sh real-packages: stage-packages create-packages sign-packages .PHONY @@ -1418,11 +1417,11 @@ create-world-packages: _pkgbootstrap .PH /^name/ { printf("===> Creating %s-", $$2); next } \ /^version/ { print $$2; next } \ ' ${WSTAGEDIR}/$${pkgname}.ucl ; \ - ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ + pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ create -M ${WSTAGEDIR}/$${pkgname}.ucl \ -p ${WSTAGEDIR}/$${pkgname}.plist \ -r ${WSTAGEDIR} \ - -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} ; \ + -o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} ; \ done create-kernel-packages: _pkgbootstrap .PHONY @@ -1446,11 +1445,11 @@ create-kernel-packages: _pkgbootstrap .P /name/ { printf("===> Creating %s-", $$2); next } \ /version/ {print $$2; next } ' \ ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl ; \ - ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ + pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ create -M ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl \ -p ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.plist \ -r ${KSTAGEDIR}/${DISTDIR} \ - -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} + -o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} .endfor .endif .if ${BUILDKERNELS:[#]} > 1 && ${NO_INSTALLEXTRAKERNELS} != "yes" @@ -1475,25 +1474,25 @@ create-kernel-packages: _pkgbootstrap .P /name/ { printf("===> Creating %s-", $$2); next } \ /version/ {print $$2; next } ' \ ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl ; \ - ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ + pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh -o ALLOW_BASE_SHLIBS=yes \ create -M ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl \ -p ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.plist \ -r ${KSTAGEDIR}/kernel.${_kernel} \ - -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} + -o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} .endfor .endif .endfor .endif sign-packages: _pkgbootstrap .PHONY - @[ -L "${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest" ] && \ - unlink ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest ; \ - ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh repo \ - -o ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ - ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ + @[ -L "${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest" ] && \ + unlink ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest ; \ + pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh repo \ + -o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ + ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ ${PKGSIGNKEY} ; \ - ln -s ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ - ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest + ln -s ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ + ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest # # Modified: head/release/scripts/make-pkg-package.sh ============================================================================== --- head/release/scripts/make-pkg-package.sh Wed Nov 30 21:59:52 2016 (r309338) +++ head/release/scripts/make-pkg-package.sh Wed Nov 30 22:00:25 2016 (r309339) @@ -8,7 +8,6 @@ eval $(make -C ${SRCDIR} TARGET=${TARGET export WRKDIRPREFIX=/tmp/ports.${TARGET} export WSTAGEDIR=${WSTAGEDIR} export REPODIR=${REPODIR} -export PKG_CMD=${PKG_CMD} export PKG_VERSION=${PKG_VERSION} export WRKDIR=$(make -C ${PORTSDIR}/ports-mgmt/pkg -V WRKDIR) @@ -16,11 +15,11 @@ make -C ${PORTSDIR}/ports-mgmt/pkg TARGE CONFIGURE_ARGS="--host=$(uname -m)-portbld-freebsd${REVISION}" \ stage create-manifest -${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh \ +pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh \ create -v -m ${WRKDIR}/.metadir/ \ -r ${WRKDIR}/stage \ -p ${WRKDIR}/.PLIST.mktmp \ - -o ${REPODIR}/$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} -mkdir -p ${REPODIR}/$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}/Latest/ -cd ${REPODIR}/$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}/Latest/ && \ + -o ${REPODIR}/$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} +mkdir -p ${REPODIR}/$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}/Latest/ +cd ${REPODIR}/$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION}/Latest/ && \ ln -s ../pkg-*.txz Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Wed Nov 30 21:59:52 2016 (r309338) +++ head/share/mk/bsd.own.mk Wed Nov 30 22:00:25 2016 (r309339) @@ -116,9 +116,6 @@ # NLSMODE National Language Support files mode. [${NOBINMODE}] # # INCLUDEDIR Base path for standard C include files [/usr/include] -# -# PKG_CMD Program for creating and manipulating packages. -# [pkg] .if !target(____) ____: @@ -252,8 +249,6 @@ XZ_CMD?= xz -T ${XZ_THREADS} XZ_CMD?= xz .endif -PKG_CMD?= pkg - # Pointer to the top directory into which tests are installed. Should not be # overriden by Makefiles, but the user may choose to set this in src.conf(5). TESTSBASE?= /usr/tests From owner-svn-src-all@freebsd.org Wed Nov 30 22:01:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42478C5E465; Wed, 30 Nov 2016 22:01:29 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (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 0B5B8135F; Wed, 30 Nov 2016 22:01:25 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 19B671FE156; Wed, 30 Nov 2016 23:01:23 +0100 (CET) Subject: Re: svn commit: r309337 - in stable/11: sys/netinet usr.sbin/arp To: Eric van Gyzen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org References: <201611302153.uAULr6MB057213@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <593937db-9883-7c75-de81-761040676b62@selasky.org> Date: Wed, 30 Nov 2016 23:00:59 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <201611302153.uAULr6MB057213@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 22:01:29 -0000 On 11/30/16 22:53, Eric van Gyzen wrote: > +SYSCTL_PROC(_net_link_ether_inet, OID_AUTO, garp_rexmit_count, > + CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_MPSAFE, > + &garp_rexmit_count, 0, sysctl_garp_rexmit, "I", > + "Number of times to retransmit GARP packets;" > + " 0 to disable, maximum of 16"); TIP: You can also make such sysctls tunable. --HPS From owner-svn-src-all@freebsd.org Wed Nov 30 22:20:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 455F4C5E9DC; Wed, 30 Nov 2016 22:20:25 +0000 (UTC) (envelope-from vangyzen@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 200351EA4; Wed, 30 Nov 2016 22:20:25 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uAUMKOit065641; Wed, 30 Nov 2016 22:20:24 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uAUMKNJv065637; Wed, 30 Nov 2016 22:20:23 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201611302220.uAUMKNJv065637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 30 Nov 2016 22:20:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309340 - in stable/10: sys/netinet usr.sbin/arp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Nov 2016 22:20:25 -0000 Author: vangyzen Date: Wed Nov 30 22:20:23 2016 New Revision: 309340 URL: https://svnweb.freebsd.org/changeset/base/309340 Log: MFC r306577 r306652 306830 Add GARP retransmit capability A single gratuitous ARP (GARP) is always transmitted when an IPv4 address is added to an interface, and that is usually sufficient. However, in some circumstances, such as when a shared address is passed between cluster nodes, this single GARP may occasionally be dropped or lost. This can lead to neighbors on the network link working with a stale ARP cache and sending packets destined for that address to the node that previously owned the address, which may not respond. To avoid this situation, GARP retransmissions can be enabled by setting the net.link.ether.inet.garp_rexmit_count sysctl to a value greater than zero. The setting represents the maximum number of retransmissions. The interval between retransmissions is calculated using an exponential backoff algorithm, doubling each time, so the retransmission intervals are: {1, 2, 4, 8, 16, ...} (seconds). Due to the exponential backoff algorithm used for the interval between GARP retransmissions, the maximum number of retransmissions is limited to 16 for sanity. This limit corresponds to a maximum interval between retransmissions of 2^16 seconds ~= 18 hours. Increasing this limit is possible, but sending out GARPs spaced days apart would be of little use. Update arp(4) to document the net.link.ether.inet.garp_rexmit_count sysctl. Submitted by: dab Relnotes: yes Sponsored by: Dell EMC Modified: stable/10/sys/netinet/if_ether.c stable/10/sys/netinet/in.c stable/10/sys/netinet/in_var.h stable/10/usr.sbin/arp/arp.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/if_ether.c ============================================================================== --- stable/10/sys/netinet/if_ether.c Wed Nov 30 22:00:25 2016 (r309339) +++ stable/10/sys/netinet/if_ether.c Wed Nov 30 22:20:23 2016 (r309340) @@ -125,6 +125,28 @@ SYSCTL_VNET_INT(_net_link_ether_inet, OI &VNET_NAME(arp_maxhold), 0, "Number of packets to hold per ARP entry"); +/* + * Due to the exponential backoff algorithm used for the interval between GARP + * retransmissions, the maximum number of retransmissions is limited for + * sanity. This limit corresponds to a maximum interval between retransmissions + * of 2^16 seconds ~= 18 hours. + * + * Making this limit more dynamic is more complicated than worthwhile, + * especially since sending out GARPs spaced days apart would be of little + * use. A maximum dynamic limit would look something like: + * + * const int max = fls(INT_MAX / hz) - 1; + */ +#define MAX_GARP_RETRANSMITS 16 +static int sysctl_garp_rexmit(SYSCTL_HANDLER_ARGS); +static int garp_rexmit_count = 0; /* GARP retransmission setting. */ + +SYSCTL_PROC(_net_link_ether_inet, OID_AUTO, garp_rexmit_count, + CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_MPSAFE, + &garp_rexmit_count, 0, sysctl_garp_rexmit, "I", + "Number of times to retransmit GARP packets;" + " 0 to disable, maximum of 16"); + static void arp_init(void); static void arpintr(struct mbuf *); static void arptimer(void *); @@ -928,6 +950,109 @@ drop: } #endif +/* + * Handle the garp_rexmit_count. Like sysctl_handle_int(), but limits the range + * of valid values. + */ +static int +sysctl_garp_rexmit(SYSCTL_HANDLER_ARGS) +{ + int error; + int rexmit_count = *(int *)arg1; + + error = sysctl_handle_int(oidp, &rexmit_count, 0, req); + + /* Enforce limits on any new value that may have been set. */ + if (!error && req->newptr) { + /* A new value was set. */ + if (rexmit_count < 0) { + rexmit_count = 0; + } else if (rexmit_count > MAX_GARP_RETRANSMITS) { + rexmit_count = MAX_GARP_RETRANSMITS; + } + *(int *)arg1 = rexmit_count; + } + + return (error); +} + +/* + * Retransmit a Gratuitous ARP (GARP) and, if necessary, schedule a callout to + * retransmit it again. A pending callout owns a reference to the ifa. + */ +static void +garp_rexmit(void *arg) +{ + struct in_ifaddr *ia = arg; + + if (callout_pending(&ia->ia_garp_timer) || + !callout_active(&ia->ia_garp_timer)) { + IFA_UNLOCK(&ia->ia_ifa); + ifa_free(&ia->ia_ifa); + return; + } + + /* + * Drop ifa lock while the ARP request is generated. + */ + IFA_UNLOCK(&ia->ia_ifa); + + arprequest(ia->ia_ifa.ifa_ifp, &IA_SIN(ia)->sin_addr, + &IA_SIN(ia)->sin_addr, IF_LLADDR(ia->ia_ifa.ifa_ifp)); + + /* + * Increment the count of retransmissions. If the count has reached the + * maximum value, stop sending the GARP packets. Otherwise, schedule + * the callout to retransmit another GARP packet. + */ + ++ia->ia_garp_count; + if (ia->ia_garp_count >= garp_rexmit_count) { + ifa_free(&ia->ia_ifa); + } else { + int rescheduled; + IFA_LOCK(&ia->ia_ifa); + rescheduled = callout_reset(&ia->ia_garp_timer, + (1 << ia->ia_garp_count) * hz, + garp_rexmit, ia); + IFA_UNLOCK(&ia->ia_ifa); + if (rescheduled) { + ifa_free(&ia->ia_ifa); + } + } +} + +/* + * Start the GARP retransmit timer. + * + * A single GARP is always transmitted when an IPv4 address is added + * to an interface and that is usually sufficient. However, in some + * circumstances, such as when a shared address is passed between + * cluster nodes, this single GARP may occasionally be dropped or + * lost. This can lead to neighbors on the network link working with a + * stale ARP cache and sending packets destined for that address to + * the node that previously owned the address, which may not respond. + * + * To avoid this situation, GARP retransmits can be enabled by setting + * the net.link.ether.inet.garp_rexmit_count sysctl to a value greater + * than zero. The setting represents the maximum number of + * retransmissions. The interval between retransmissions is calculated + * using an exponential backoff algorithm, doubling each time, so the + * retransmission intervals are: {1, 2, 4, 8, 16, ...} (seconds). + */ +static void +garp_timer_start(struct ifaddr *ifa) +{ + struct in_ifaddr *ia = (struct in_ifaddr *) ifa; + + IFA_LOCK(ifa); + ia->ia_garp_count = 0; + if (callout_reset(&ia->ia_garp_timer, (1 << ia->ia_garp_count) * hz, + garp_rexmit, ia) == 0) { + ifa_ref(ifa); + } + IFA_UNLOCK(ifa); +} + void arp_ifinit(struct ifnet *ifp, struct ifaddr *ifa) { @@ -939,6 +1064,10 @@ arp_ifinit(struct ifnet *ifp, struct ifa if (ntohl(IA_SIN(ifa)->sin_addr.s_addr) != INADDR_ANY) { arprequest(ifp, &IA_SIN(ifa)->sin_addr, &IA_SIN(ifa)->sin_addr, IF_LLADDR(ifp)); + if (garp_rexmit_count > 0) { + garp_timer_start(ifa); + } + /* * interface address is considered static entry * because the output of the arp utility shows Modified: stable/10/sys/netinet/in.c ============================================================================== --- stable/10/sys/netinet/in.c Wed Nov 30 22:00:25 2016 (r309339) +++ stable/10/sys/netinet/in.c Wed Nov 30 22:20:23 2016 (r309340) @@ -417,6 +417,8 @@ in_control(struct socket *so, u_long cmd ifa->ifa_addr = (struct sockaddr *)&ia->ia_addr; ifa->ifa_dstaddr = (struct sockaddr *)&ia->ia_dstaddr; ifa->ifa_netmask = (struct sockaddr *)&ia->ia_sockmask; + callout_init_mtx(&ia->ia_garp_timer, &ifa->ifa_mtx, + CALLOUT_RETURNUNLOCKED); ia->ia_sockmask.sin_len = 8; ia->ia_sockmask.sin_family = AF_INET; @@ -594,6 +596,10 @@ in_control(struct socket *so, u_long cmd } else ifa_free(&iap->ia_ifa); + IFA_LOCK(&ia->ia_ifa); + if (callout_stop(&ia->ia_garp_timer)) + ifa_free(&ia->ia_ifa); + IFA_UNLOCK(&ia->ia_ifa); ifa_free(&ia->ia_ifa); /* in_ifaddrhead */ out: if (ia != NULL) Modified: stable/10/sys/netinet/in_var.h ============================================================================== --- stable/10/sys/netinet/in_var.h Wed Nov 30 22:00:25 2016 (r309339) +++ stable/10/sys/netinet/in_var.h Wed Nov 30 22:20:23 2016 (r309340) @@ -33,6 +33,7 @@ #ifndef _NETINET_IN_VAR_H_ #define _NETINET_IN_VAR_H_ +#include #include #include #include @@ -69,6 +70,8 @@ struct in_ifaddr { struct sockaddr_in ia_dstaddr; /* reserve space for broadcast addr */ #define ia_broadaddr ia_dstaddr struct sockaddr_in ia_sockmask; /* reserve space for general netmask */ + struct callout ia_garp_timer; /* timer for retransmitting GARPs */ + int ia_garp_count; /* count of retransmitted GARPs */ }; struct in_aliasreq { Modified: stable/10/usr.sbin/arp/arp.4 ============================================================================== --- stable/10/usr.sbin/arp/arp.4 Wed Nov 30 22:00:25 2016 (r309339) +++ stable/10/usr.sbin/arp/arp.4 Wed Nov 30 22:20:23 2016 (r309340) @@ -28,7 +28,7 @@ .\" @(#)arp4.4 6.5 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd May 11, 2013 +.Dd October 7, 2016 .Dt ARP 4 .Os .Sh NAME @@ -121,49 +121,65 @@ of the MIB. .Bl -tag -width "log_arp_permanent_modify" .It Va allow_multicast -Should the kernel install ARP entries with multicast bit set in -the hardware address. -Installing such entries is RFC 1812 violation, but some prorietary -load balancing techniques require routers on network to do so. +Install ARP entries with the multicast bit set in the hardware address. +Installing such entries is an RFC 1812 violation, but some proprietary load +balancing techniques require routers to do so. Turned off by default. +.It Va garp_rexmit_count +Retransmit gratuitous ARP (GARP) packets when an IPv4 address is added to an +interface. +A GARP is always transmitted when an IPv4 address is added to an interface. +A non-zero value causes the GARP packet to be retransmitted the stated number +of times. +The interval between retransmissions is doubled each time, so the +retransmission intervals are: {1, 2, 4, 8, 16, ...} (seconds). +The default value of zero means only the initial GARP is sent; no +additional GARP packets are retransmitted. +The maximum value is sixteen. +.Pp +The default behavior of a single GARP packet is usually sufficient. +However, a single GARP might be dropped or lost in some circumstances. +This is particularly harmful when a shared address is passed between cluster +nodes. +Neighbors on the network link might then work with a stale ARP cache and send +packets destined for that address to the node that previously owned the +address, which might not respond. .It Va log_arp_movements -Should the kernel log movements of IP addresses from one hardware -address to an other. +Log movements of IP addresses from one hardware address to another. See .Sx DIAGNOSTICS below. Turned on by default. .It Va log_arp_permanent_modify -Should the kernel log attempts of remote host on network to modify a -permanent ARP entry. +Log attempts by a remote host to modify a permanent ARP entry. See .Sx DIAGNOSTICS below. Turned on by default. .It Va log_arp_wrong_iface -Should the kernel log attempts to insert an ARP entry on an interface -when the IP network the address belongs to is connected to an other -interface. +Log attempts to insert an ARP entry on an interface when the IP network to +which the address belongs is connected to another interface. See .Sx DIAGNOSTICS below. Turned on by default. .It Va max_log_per_second -Limit number of remotely triggered logging events to a configured value -per second. +Limit the number of remotely triggered logging events to a configured value per +second. Default is 1 log message per second. .It Va max_age How long an ARP entry is held in the cache until it needs to be refreshed. Default is 1200 seconds. .It Va maxhold -How many packets hold in the per-entry output queue while the entry +How many packets to hold in the per-entry output queue while the entry is being resolved. Default is one packet. .It Va maxtries -Number of retransmits before host is considered down and error is returned. +Number of retransmits before a host is considered down and an error is +returned. Default is 5 tries. .It Va proxyall -Enables ARP proxying for all hosts on net. +Enables ARP proxying. Turned off by default. .It Va useloopback If an ARP entry is added for local address, force the traffic to go through From owner-svn-src-all@freebsd.org Thu Dec 1 00:19:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9DDFC5D8D6; Thu, 1 Dec 2016 00:19:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 617EC13C1; Thu, 1 Dec 2016 00:19:22 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c110-21-100-78.carlnfd1.nsw.optusnet.com.au [110.21.100.78]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 60B4410420A1; Thu, 1 Dec 2016 11:19:20 +1100 (AEDT) Date: Thu, 1 Dec 2016 11:19:19 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eric van Gyzen cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309331 - head/usr.bin/locale In-Reply-To: <201611301834.uAUIYfQs075427@repo.freebsd.org> Message-ID: <20161201082459.T1285@besplex.bde.org> References: <201611301834.uAUIYfQs075427@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=BKLDlBYG c=1 sm=1 tr=0 a=uGjuzT6u7JdBDS7kH8taPg==:117 a=uGjuzT6u7JdBDS7kH8taPg==:17 a=kj9zAlcOel0A:10 a=jWiCfzBZR5YcepJ51wAA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 00:19:24 -0000 On Wed, 30 Nov 2016, Eric van Gyzen wrote: > Log: > Include limits.h for CHAR_MAX > > This was needed on stable/10. Apparently, sys/param.h supplies CHAR_MAX > on head. Include limits.h anyway, for consistency, and because C says so. sys/param.actually supplies CHAR_MAX (undocumented namespace pollution) in all versions of FreeBSD. The function that uses this has many bugs, but most are only style bugs due to various magic. X char * X format_grouping(const char *binary) X { X static char rval[64]; X const char *cp; X size_t len; X X rval[0] = '\0'; X for (cp = binary; *cp != '\0'; ++cp) { X char group[sizeof("127;")]; This hard-codes CHAR_MAX is 127. This works accidentally on POSIX >= 2100 since POSIX now specifies 8-bit chars, and even if chars are unsigned so that CHAR_MAX is 255, that fits in the same space as 127. X snprintf(group, sizeof(group), "%hhd;", *cp); X len = strlcat(rval, group, sizeof(rval)); X if (len >= sizeof(rval)) { X len = sizeof(rval) - 1; X break; X } I don't like the error handling. It is too careful, yet not careful enough to be correct. Use of snprintf() with no error handling instead of sprintf() has no effect unless there are bugs, but there are bugs. The first few are: - if chars are signed, then *cp may be negative. This is an invalid format, but we should check it. Negative chars are converted to garbage starting with a minus sign. group[] is too small to hold large ones. We defend against buffer overruns by using snprintf(), but don't check for errors. Truncation gives further garbage. - %hhd is a bogus format if chars are signed. Then hh in it has no effect - %hhd is a broken format if chars are unsigned. It says to convert the arg to signed char. On non-exotic machines with CHAR_MAX = 255, this corrupts values between 128 and 255 to negative ones. Large values are unlikely/physically impossible, but CHAR_MAX is a magic sentinel value which I think we want to print as itself (users also need to know what CHAR_MAX is to decode it). - on exotic machines, CHAR_MAX can be UINT_MAX. Then char promotes to u_int and %d format would give undefined behaviour if the value exceeds INT_MAX. %hhd is no better for avoiding the undefined behviour, and when it works normally it corrupts large values as for the non-exotic case. X if (*cp == CHAR_MAX) { X break; X } X } X X /* Remove the trailing ';'. */ X rval[len - 1] = '\0'; This writes outside of rval when binary is the null string. Possible for at least invalid formats. len should be initialized to 0 in this case, but it actually uninitialized, so compilers will warn at high WARNS even if this case is unreachable. X X return (rval); X } Untested fixes and cleanups: Y diff -u2 locale.c~ locale.c Y --- locale.c~ 2016-11-25 08:26:48.000000000 +0000 Y +++ locale.c 2016-12-01 00:09:23.603179000 +0000 Y @@ -495,27 +495,27 @@ Y static char rval[64]; Y const char *cp; Y - size_t len; Y + size_t roff; Y + int len; Y Y rval[0] = '\0'; Y + roff = 0; Y for (cp = binary; *cp != '\0'; ++cp) { Y - char group[sizeof("127;")]; Y - snprintf(group, sizeof(group), "%hhd;", *cp); Y - len = strlcat(rval, group, sizeof(rval)); Y - if (len >= sizeof(rval)) { Y - len = sizeof(rval) - 1; Y - break; Y - } Y - if (*cp == CHAR_MAX) { Y - break; Y - } Y + if (*cp < 0) Y + break; /* garbage input */ Y + len = snprintf(&rval[roff], sizeof(rval) - roff, "%u;", *cp); Y + if (len < 0 || len >= sizeof(rval) - roff) Y + break; /* insufficient space for output */ Y + roff += len; Y + if (*cp == CHAR_MAX) Y + break; /* special termination */ Y } Y Y - /* Remove the trailing ';'. */ Y - rval[len - 1] = '\0'; Y + /* Truncate at the last successfully snprintf()ed semicolon. */ Y + if (roff != 0) Y + rval[roff - 1] = '\0'; Y Y - return (rval); Y + return (&rval[0]); Y } Y Y - Y /* Y * keyword value lookup helper (via localeconv()) It was much easier to just use snprintf(). The error handling can be further simplified by checking if rval[] is large enough up front. It needs to have size strlen("255;") * strlen(binary) + 1, where 255 is POSIX CHAR_MAX hard-coded. Bruce From owner-svn-src-all@freebsd.org Thu Dec 1 01:32:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67AC6C5DDFA; Thu, 1 Dec 2016 01:32:14 +0000 (UTC) (envelope-from pfg@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 4243B1986; Thu, 1 Dec 2016 01:32:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB11WDSr046955; Thu, 1 Dec 2016 01:32:13 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB11WD9v046953; Thu, 1 Dec 2016 01:32:13 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612010132.uB11WD9v046953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 1 Dec 2016 01:32:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309341 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 01:32:14 -0000 Author: pfg Date: Thu Dec 1 01:32:13 2016 New Revision: 309341 URL: https://svnweb.freebsd.org/changeset/base/309341 Log: indent(1): Avoid out of bound access of array in_buffer Work-around a somewhat complex interaction within the code. From Piotr's commit [1]: When pr_comment() calls dump_line() for the first line of a multiline comment, it doesn't include any indentation - it starts with the "/*". This is consistent for both boxed and not boxed comments. Where the logic diverges is in how it treats the rest of the lines of the comment. For box comments indent assumes that it must not change anything, so lines are dumped as they were, including the indentation where it exists. For the rest of comments, it will first remove the indentation to store plain text of the comment and then add it again where indent thinks it's appropriate -- this is part of comment re-indenting process. For continuations of multi-line comments, the code that handles comments in dump_line() will use pad_output() to create indentation from the beginning of the line (what indent calls the first column) and then write string pointed by s_com afterwards. But if it's a box comment, the string will include original indentation, unless it's the first line of the comment. This is why tab characters from s_com have to be considered when calculating how much padding is needed and the "while (*com_st == '\t') com_st++, target += 8;" does that. In dump_line(), /target/ is initially set to ps.com_col, so it always assumes that indentation needs to be produced in this function, regardless of which line of a box comment it is. But for the first line of a box comment it is not true, so pr_comment() signals it by setting ps.n_comment_delta, the negative comment delta, to a negative number which is then added to /target/ in dump_line() on all lines except the first one, so that the function produces adequate indentation in this special case. The bug was in how that negative offset was calculated: pr_comment() used count_spaces() on in_buffer, which pr_comment() expected to contain non-null terminated sequence of characters, originating from whatever originally was on the left side of the comment. Understanding that count_spaces() requires a string, pr_comment() temporarily set buf_ptr[-2] to 0 in hope that it would nul-terminate the right thing in in_buffer and calling count_spaces() would be safe and do the expected thing. This was false whenever buf_ptr would point into save_com, an entirely different char array than in_buffer. The short-term fix is to recognize whether buf_ptr points into in_buffer or save_com. Reference: [1] https://github.com/pstef/freebsd_indent/commit/ea486a2aa3b056b146bdfbb8e94843159750f200 Taken from: Piotr Stefaniak Modified: head/usr.bin/indent/io.c head/usr.bin/indent/pr_comment.c Modified: head/usr.bin/indent/io.c ============================================================================== --- head/usr.bin/indent/io.c Wed Nov 30 22:20:23 2016 (r309340) +++ head/usr.bin/indent/io.c Thu Dec 1 01:32:13 2016 (r309341) @@ -225,8 +225,9 @@ dump_line(void) char *com_st = s_com; target += ps.comment_delta; - while (*com_st == '\t') - com_st++, target += 8; /* ? */ + while (*com_st == '\t') /* consider original indentation in + * case this is a box comment */ + com_st++, target += 8; while (target <= 0) if (*com_st == ' ') target++, com_st++; Modified: head/usr.bin/indent/pr_comment.c ============================================================================== --- head/usr.bin/indent/pr_comment.c Wed Nov 30 22:20:23 2016 (r309340) +++ head/usr.bin/indent/pr_comment.c Thu Dec 1 01:32:13 2016 (r309341) @@ -147,9 +147,16 @@ pr_comment(void) } } if (ps.box_com) { - buf_ptr[-2] = 0; - ps.n_comment_delta = 1 - count_spaces(1, in_buffer); - buf_ptr[-2] = '/'; + /* + * Find out how much indentation there was originally, because that + * much will have to be ignored by pad_output() in dump_line(). This + * is a box comment, so nothing changes -- not even indentation. + * + * The comment we're about to read usually comes from in_buffer, + * unless it has been copied into save_com. + */ + char *start = buf_ptr >= save_com && buf_ptr < save_com + sc_size ? bp_save : buf_ptr; + ps.n_comment_delta = 1 - count_spaces_until(1, in_buffer, start - 2); } else { ps.n_comment_delta = 0; From owner-svn-src-all@freebsd.org Thu Dec 1 01:48:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03137C5E7F2; Thu, 1 Dec 2016 01:48:58 +0000 (UTC) (envelope-from pfg@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 C6F5F146A; Thu, 1 Dec 2016 01:48:57 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB11muAS051387; Thu, 1 Dec 2016 01:48:56 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB11muut051386; Thu, 1 Dec 2016 01:48:56 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612010148.uB11muut051386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 1 Dec 2016 01:48:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309342 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 01:48:58 -0000 Author: pfg Date: Thu Dec 1 01:48:56 2016 New Revision: 309342 URL: https://svnweb.freebsd.org/changeset/base/309342 Log: indent(1): Don't ignore newlines after comments that follow braces. indent.c has a special loop that stores tokens from between an if () and the next statement into a buffer. The loop ignored all newlines, but that resulted in not calling dump_line() when it was needed to produce the final line of the buffered up comment. Taken from: Piotr Stefaniak Modified: head/usr.bin/indent/indent.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Thu Dec 1 01:32:13 2016 (r309341) +++ head/usr.bin/indent/indent.c Thu Dec 1 01:48:56 2016 (r309342) @@ -335,8 +335,10 @@ main(int argc, char **argv) switch (type_code) { case newline: ++line_no; - if (sc_end != NULL) - goto sw_buffer; /* dump comment, if any */ + if (sc_end != NULL) { /* dump comment, if any */ + *sc_end++ = '\n'; /* newlines are needed in this case */ + goto sw_buffer; + } flushed_nl = true; case form_feed: break; /* form feeds and newlines found here will be From owner-svn-src-all@freebsd.org Thu Dec 1 01:56:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33BEEC5ED07; Thu, 1 Dec 2016 01:56:36 +0000 (UTC) (envelope-from pfg@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 036C81AD0; Thu, 1 Dec 2016 01:56:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB11uZ1L055377; Thu, 1 Dec 2016 01:56:35 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB11uZXK055376; Thu, 1 Dec 2016 01:56:35 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612010156.uB11uZXK055376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 1 Dec 2016 01:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309343 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 01:56:36 -0000 Author: pfg Date: Thu Dec 1 01:56:34 2016 New Revision: 309343 URL: https://svnweb.freebsd.org/changeset/base/309343 Log: indent(1): Don't unnecessarily add a blank before a comment ends. pr_comment() did avoid adding surplus space character when a comment contained it at the end. Now it's also paying attention to tabs. Taken from: Piotr Stefaniak Modified: head/usr.bin/indent/pr_comment.c Modified: head/usr.bin/indent/pr_comment.c ============================================================================== --- head/usr.bin/indent/pr_comment.c Thu Dec 1 01:48:56 2016 (r309342) +++ head/usr.bin/indent/pr_comment.c Thu Dec 1 01:56:34 2016 (r309343) @@ -293,7 +293,7 @@ pr_comment(void) s_com = e_com; *e_com++ = ' '; } - if (e_com[-1] != ' ' && !ps.box_com) + if (e_com[-1] != ' ' && e_com[-1] != '\t' && !ps.box_com) *e_com++ = ' '; /* ensure blank before end */ *e_com++ = '*', *e_com++ = '/', *e_com = '\0'; ps.just_saw_decl = l_just_saw_decl; From owner-svn-src-all@freebsd.org Thu Dec 1 02:21:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08750C5E34D; Thu, 1 Dec 2016 02:21:38 +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 CC5F41D9F; Thu, 1 Dec 2016 02:21:37 +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 uB12Lbov067203; Thu, 1 Dec 2016 02:21:37 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB12Lb6x067202; Thu, 1 Dec 2016 02:21:37 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201612010221.uB12Lb6x067202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 1 Dec 2016 02:21:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309344 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 02:21:38 -0000 Author: cem Date: Thu Dec 1 02:21:36 2016 New Revision: 309344 URL: https://svnweb.freebsd.org/changeset/base/309344 Log: Remove a death threat from the FreeBSD sources Reported by: koobs@, araujo@, linimon@, bjk@, emaste@, jhb@, ngie@, cem@ Maintainer timeout: des@ Modified: head/lib/libutil/flopen.c Modified: head/lib/libutil/flopen.c ============================================================================== --- head/lib/libutil/flopen.c Thu Dec 1 01:56:34 2016 (r309343) +++ head/lib/libutil/flopen.c Thu Dec 1 02:21:36 2016 (r309344) @@ -40,10 +40,10 @@ __FBSDID("$FreeBSD$"); /* * Reliably open and lock a file. * - * DO NOT, UNDER PAIN OF DEATH, modify this code without first reading the - * revision history and discussing your changes with . - * Don't be fooled by the code's apparent simplicity; there would be no - * need for this function if it was as easy to get right as you think. + * Please do not modify this code without first reading the revision history + * and discussing your changes with . Don't be fooled by the + * code's apparent simplicity; there would be no need for this function if it + * was easy to get right. */ int flopen(const char *path, int flags, ...) @@ -108,7 +108,11 @@ flopen(const char *path, int flags, ...) errno = serrno; return (-1); } -#ifdef DONT_EVEN_THINK_ABOUT_IT + /* + * The following change is provided as a specific example to + * avoid. + */ +#if 0 if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) { serrno = errno; (void)close(fd); From owner-svn-src-all@freebsd.org Thu Dec 1 02:35:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BEE0C5EF35; Thu, 1 Dec 2016 02:35:16 +0000 (UTC) (envelope-from loos@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 6B83D1A2F; Thu, 1 Dec 2016 02:35:16 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB12ZFLc071334; Thu, 1 Dec 2016 02:35:15 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB12ZFFN071333; Thu, 1 Dec 2016 02:35:15 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201612010235.uB12ZFFN071333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Thu, 1 Dec 2016 02:35:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309345 - head/sys/arm/ti/cpsw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 02:35:16 -0000 Author: loos Date: Thu Dec 1 02:35:15 2016 New Revision: 309345 URL: https://svnweb.freebsd.org/changeset/base/309345 Log: The RX_FREEBUFFER registers are a write to increment field. Writing the full queue size to it every time was makeing it overflow with a lot of bogus values. This fixes the interrupt storms on irq 40. Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/arm/ti/cpsw/if_cpsw.c Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Thu Dec 1 02:21:36 2016 (r309344) +++ head/sys/arm/ti/cpsw/if_cpsw.c Thu Dec 1 02:35:15 2016 (r309345) @@ -1760,7 +1760,7 @@ cpsw_rx_enqueue(struct cpsw_softc *sc) sc->rx.queue_adds += added; sc->rx.avail_queue_len -= added; sc->rx.active_queue_len += added; - cpsw_write_4(sc, CPSW_CPDMA_RX_FREEBUFFER(0), sc->rx.active_queue_len); + cpsw_write_4(sc, CPSW_CPDMA_RX_FREEBUFFER(0), added); if (sc->rx.active_queue_len > sc->rx.max_active_queue_len) { sc->rx.max_active_queue_len = sc->rx.active_queue_len; } From owner-svn-src-all@freebsd.org Thu Dec 1 03:07:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC551C5E965; Thu, 1 Dec 2016 03:07:59 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com [IPv6:2607:f8b0:400e:c00::242]) (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 AD39811ED; Thu, 1 Dec 2016 03:07:59 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x242.google.com with SMTP id 144so11054306pfv.0; Wed, 30 Nov 2016 19:07:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=TsaIeffNhhqXio7V8tGRMkWapp5FuF6Vj4f8Wx1SVl8=; b=sz7HJojE1bMbgpDNl2Ogp119tolaSppbeLWxsIJPMwlHy2YcBfSLYj6eygX94CNjNm dIFLXzUt+iaIeS8oAi/mv3t/4UK9szNwWi8L0Ao5DIJ79jiiPIBNHExc6Q9Egd+bpuxn WVhZPu1Eva3lTp2AZeFCuLamK/Jom7VJy0Y+VvEFqzxkRp1ObnEVxQ+MF2g+cY+YRJVH zTzijoNnuE8srsCAqSziEft+OemHPtFQC78aUNtS9pFOioTnlkXyakEFfcOt0laLwwEd X/BMlCcxuxU7BUhP+4K9RZb8gb25bEbYKwPIeyhMraz+xlhwkTe4WxL+SWLGp95dEvqa KYgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=TsaIeffNhhqXio7V8tGRMkWapp5FuF6Vj4f8Wx1SVl8=; b=HOP8qnt//MPHSXMFIMR8N7bENagFEE0eZ55PzdZUmLlS03euDb00FdpoCzeKHwaYlb FzxXX67Yjy48hjd0VDq8r4+CSjq6VQb1MlaVQFxCNfF5ts0IZp2fQqKcDw2a9xNKndo8 nEImZumGfP3VstDFZZ7JdthG8HZ2CacOIaMnCcAOe2liNMuqrYgE7t1E9WDE8he3B1a/ Dd/VrKXgN/5AgaJOmn5LCoAJIUftMP5P/A8vlFuSe2GTpTlwWbk3SbCcjkOjVXHPAwK8 kIw2g1KndOgUoUDAo9cIkDiAnkdOgcqErQoFtw8nOdVHH/w7FD5wP6cxm3bq8Q99CnWD 2OtA== X-Gm-Message-State: AKaTC03fNxp24DBy5Ver29/6a+VHOMdJ4BQCM67yhBs5SB+gwX3SURFQobnQdsbm2j0tPQ== X-Received: by 10.99.37.195 with SMTP id l186mr64510827pgl.91.1480561679135; Wed, 30 Nov 2016 19:07:59 -0800 (PST) Received: from ?IPv6:2607:fb90:80a6:d7d:3150:ed8c:ca08:27e4? ([2607:fb90:80a6:d7d:3150:ed8c:ca08:27e4]) by smtp.gmail.com with ESMTPSA id 72sm102541894pfw.37.2016.11.30.19.07.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 30 Nov 2016 19:07:58 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r309344 - head/lib/libutil From: Ngie Cooper X-Mailer: iPhone Mail (14B100) In-Reply-To: <201612010221.uB12Lb6x067202@repo.freebsd.org> Date: Wed, 30 Nov 2016 19:07:57 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <4DFE017D-90FD-44F4-8FE7-7EE53D499F7B@gmail.com> References: <201612010221.uB12Lb6x067202@repo.freebsd.org> To: "Conrad E. Meyer" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 03:08:00 -0000 > On Nov 30, 2016, at 18:21, Conrad E. Meyer wrote: >=20 > Author: cem > Date: Thu Dec 1 02:21:36 2016 > New Revision: 309344 > URL: https://svnweb.freebsd.org/changeset/base/309344 >=20 > Log: > Remove a death threat from the FreeBSD sources >=20 > Reported by: koobs@, araujo@, linimon@, bjk@, emaste@, jhb@, ngie@, ce= m@ > Maintainer timeout: des@ Really?? I wish you hadn't added me to this list.. I don't in any way endors= e the way that you went about dealing with this disagreement. You kind of ju= st pissed all over what des@ did out of spite. > Modified: > head/lib/libutil/flopen.c >=20 > Modified: head/lib/libutil/flopen.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/lib/libutil/flopen.c Thu Dec 1 01:56:34 2016 (r309343) > +++ head/lib/libutil/flopen.c Thu Dec 1 02:21:36 2016 (r309344) > @@ -40,10 +40,10 @@ __FBSDID("$FreeBSD$"); > /* > * Reliably open and lock a file. > * > - * DO NOT, UNDER PAIN OF DEATH, modify this code without first reading th= e > - * revision history and discussing your changes with . > - * Don't be fooled by the code's apparent simplicity; there would be no > - * need for this function if it was as easy to get right as you think. > + * Please do not modify this code without first reading the revision hist= ory > + * and discussing your changes with . Don't be fooled b= y the > + * code's apparent simplicity; there would be no need for this function i= f it > + * was easy to get right. > */ > int > flopen(const char *path, int flags, ...) > @@ -108,7 +108,11 @@ flopen(const char *path, int flags, ...) > errno =3D serrno; > return (-1); > } > -#ifdef DONT_EVEN_THINK_ABOUT_IT > + /* > + * The following change is provided as a specific example to > + * avoid. > + */ > +#if 0 > if (fcntl(fd, F_SETFD, FD_CLOEXEC) !=3D 0) { > serrno =3D errno; > (void)close(fd); >=20 From owner-svn-src-all@freebsd.org Thu Dec 1 03:27:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B878C5E61D; Thu, 1 Dec 2016 03:27:18 +0000 (UTC) (envelope-from sephe@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 E066B1F98; Thu, 1 Dec 2016 03:27:17 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB13RHQF092077; Thu, 1 Dec 2016 03:27:17 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB13RGZB092074; Thu, 1 Dec 2016 03:27:16 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612010327.uB13RGZB092074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 1 Dec 2016 03:27:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309346 - in head/sys: conf dev/hyperv/netvsc modules/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 03:27:18 -0000 Author: sephe Date: Thu Dec 1 03:27:16 2016 New Revision: 309346 URL: https://svnweb.freebsd.org/changeset/base/309346 Log: hyperv/hn: Add HN_DEBUG kernel option. If bufring is used for per-TX ring descs, don't update "available" counter, which is only used to help debugging. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8674 Modified: head/sys/conf/options head/sys/dev/hyperv/netvsc/if_hn.c head/sys/modules/hyperv/netvsc/Makefile Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu Dec 1 02:35:15 2016 (r309345) +++ head/sys/conf/options Thu Dec 1 03:27:16 2016 (r309346) @@ -1001,3 +1001,5 @@ EVDEV_SUPPORT opt_evdev.h EVDEV_DEBUG opt_evdev.h UINPUT_DEBUG opt_evdev.h +# Hyper-V network driver +HN_DEBUG opt_hn.h Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Thu Dec 1 02:35:15 2016 (r309345) +++ head/sys/dev/hyperv/netvsc/if_hn.c Thu Dec 1 03:27:16 2016 (r309346) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include "opt_inet.h" +#include "opt_hn.h" #include #include @@ -1428,10 +1429,12 @@ hn_txdesc_put(struct hn_tx_ring *txr, st txr->hn_txdesc_avail++; SLIST_INSERT_HEAD(&txr->hn_txlist, txd, link); mtx_unlock_spin(&txr->hn_txlist_spin); -#else +#else /* HN_USE_TXDESC_BUFRING */ +#ifdef HN_DEBUG atomic_add_int(&txr->hn_txdesc_avail, 1); - buf_ring_enqueue(txr->hn_txdesc_br, txd); #endif + buf_ring_enqueue(txr->hn_txdesc_br, txd); +#endif /* !HN_USE_TXDESC_BUFRING */ return 1; } @@ -1457,8 +1460,10 @@ hn_txdesc_get(struct hn_tx_ring *txr) if (txd != NULL) { #ifdef HN_USE_TXDESC_BUFRING +#ifdef HN_DEBUG atomic_subtract_int(&txr->hn_txdesc_avail, 1); #endif +#endif /* HN_USE_TXDESC_BUFRING */ KASSERT(txd->m == NULL && txd->refs == 0 && STAILQ_EMPTY(&txd->agg_list) && txd->chim_index == HN_NVS_CHIM_IDX_INVALID && @@ -3467,9 +3472,11 @@ hn_tx_ring_create(struct hn_softc *sc, i if (txr->hn_tx_sysctl_tree != NULL) { child = SYSCTL_CHILDREN(txr->hn_tx_sysctl_tree); +#ifdef HN_DEBUG SYSCTL_ADD_INT(ctx, child, OID_AUTO, "txdesc_avail", CTLFLAG_RD, &txr->hn_txdesc_avail, 0, "# of available TX descs"); +#endif #ifdef HN_IFSTART_SUPPORT if (!hn_use_if_start) #endif Modified: head/sys/modules/hyperv/netvsc/Makefile ============================================================================== --- head/sys/modules/hyperv/netvsc/Makefile Thu Dec 1 02:35:15 2016 (r309345) +++ head/sys/modules/hyperv/netvsc/Makefile Thu Dec 1 03:27:16 2016 (r309346) @@ -5,7 +5,7 @@ KMOD= hv_netvsc SRCS= hn_nvs.c hn_rndis.c if_hn.c -SRCS+= bus_if.h device_if.h opt_inet.h opt_inet6.h vmbus_if.h +SRCS+= bus_if.h device_if.h opt_inet.h opt_inet6.h vmbus_if.h opt_hn.h CFLAGS+= -I${.CURDIR}/../../../dev/hyperv/netvsc From owner-svn-src-all@freebsd.org Thu Dec 1 03:34:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC20EC5ED03; Thu, 1 Dec 2016 03:34:05 +0000 (UTC) (envelope-from loos@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 7BC9F16AF; Thu, 1 Dec 2016 03:34:05 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB13Y4Rr096021; Thu, 1 Dec 2016 03:34:04 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB13Y4To096019; Thu, 1 Dec 2016 03:34:04 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201612010334.uB13Y4To096019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Thu, 1 Dec 2016 03:34:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309347 - head/sys/arm/ti/cpsw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 03:34:05 -0000 Author: loos Date: Thu Dec 1 03:34:04 2016 New Revision: 309347 URL: https://svnweb.freebsd.org/changeset/base/309347 Log: MDIO_PHYACCESS_ACK is only valid for read access, remove it from miibus_writereg. Reduce the DELAY() between reads while waiting for MII access. Spotted by: yongari Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/arm/ti/cpsw/if_cpsw.c head/sys/arm/ti/cpsw/if_cpswvar.h Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Thu Dec 1 03:27:16 2016 (r309346) +++ head/sys/arm/ti/cpsw/if_cpsw.c Thu Dec 1 03:34:04 2016 (r309347) @@ -1512,9 +1512,6 @@ cpswp_miibus_writereg(device_t dev, int return (0); } - if ((cpsw_read_4(sc->swsc, sc->phyaccess) & MDIO_PHYACCESS_ACK) == 0) - device_printf(dev, "Failed to write to PHY.\n"); - return (0); } Modified: head/sys/arm/ti/cpsw/if_cpswvar.h ============================================================================== --- head/sys/arm/ti/cpsw/if_cpswvar.h Thu Dec 1 03:27:16 2016 (r309346) +++ head/sys/arm/ti/cpsw/if_cpswvar.h Thu Dec 1 03:34:04 2016 (r309347) @@ -33,8 +33,8 @@ #define CPSW_INTR_COUNT 4 /* MII BUS */ -#define CPSW_MIIBUS_RETRIES 5 -#define CPSW_MIIBUS_DELAY 1000 +#define CPSW_MIIBUS_RETRIES 20 +#define CPSW_MIIBUS_DELAY 100 #define CPSW_MAX_ALE_ENTRIES 1024 From owner-svn-src-all@freebsd.org Thu Dec 1 03:39:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B03CC5F157; Thu, 1 Dec 2016 03:39:36 +0000 (UTC) (envelope-from sephe@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 EEDD31A3B; Thu, 1 Dec 2016 03:39:35 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB13dZQG096240; Thu, 1 Dec 2016 03:39:35 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB13dZOS096239; Thu, 1 Dec 2016 03:39:35 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612010339.uB13dZOS096239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 1 Dec 2016 03:39:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309348 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 03:39:36 -0000 Author: sephe Date: Thu Dec 1 03:39:34 2016 New Revision: 309348 URL: https://svnweb.freebsd.org/changeset/base/309348 Log: hyperv/hn: Don't hold txdesc, if no BPFs are attached. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8675 Modified: head/sys/dev/hyperv/netvsc/if_hn.c Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Thu Dec 1 03:34:04 2016 (r309347) +++ head/sys/dev/hyperv/netvsc/if_hn.c Thu Dec 1 03:39:34 2016 (r309348) @@ -1924,17 +1924,20 @@ done: static int hn_txpkt(struct ifnet *ifp, struct hn_tx_ring *txr, struct hn_txdesc *txd) { - int error, send_failed = 0; + int error, send_failed = 0, has_bpf; again: - /* - * Make sure that this txd and any aggregated txds are not freed - * before ETHER_BPF_MTAP. - */ - hn_txdesc_hold(txd); + has_bpf = bpf_peers_present(ifp->if_bpf); + if (has_bpf) { + /* + * Make sure that this txd and any aggregated txds are not + * freed before ETHER_BPF_MTAP. + */ + hn_txdesc_hold(txd); + } error = txr->hn_sendpkt(txr, txd); if (!error) { - if (bpf_peers_present(ifp->if_bpf)) { + if (has_bpf) { const struct hn_txdesc *tmp_txd; ETHER_BPF_MTAP(ifp, txd->m); @@ -1957,7 +1960,8 @@ again: txr->hn_pkts += txr->hn_stat_pkts; txr->hn_sends++; } - hn_txdesc_put(txr, txd); + if (has_bpf) + hn_txdesc_put(txr, txd); if (__predict_false(error)) { int freed; From owner-svn-src-all@freebsd.org Thu Dec 1 04:35:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 458AFC5F582; Thu, 1 Dec 2016 04:35:44 +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 156901E1D; Thu, 1 Dec 2016 04:35:44 +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 uB14ZhNU020051; Thu, 1 Dec 2016 04:35:43 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB14Zh21020050; Thu, 1 Dec 2016 04:35:43 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201612010435.uB14Zh21020050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 1 Dec 2016 04:35:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309351 - head/etc/defaults X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 04:35:44 -0000 Author: imp Date: Thu Dec 1 04:35:43 2016 New Revision: 309351 URL: https://svnweb.freebsd.org/changeset/base/309351 Log: Revert the 'performance' setting to 'NONE' from C2. C2 has issues with USB in places, as well as having the potential for reducing performance. Since this is used even when powerd isn't enabled, these two problems can cause on servers. Supermicro X9 motherboards, for example, have problems with the virtual IPMI USB keyboards and mice attaching and detaching repeatedly. Since there are issues on some CPUs with C2, fail safe by defaulting to not altering it. MFC After: 3 days Modified: head/etc/defaults/rc.conf Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Thu Dec 1 04:35:41 2016 (r309350) +++ head/etc/defaults/rc.conf Thu Dec 1 04:35:43 2016 (r309351) @@ -672,7 +672,7 @@ devfs_system_ruleset="" # The name (NOT devfs_set_rulesets="" # A list of /mount/dev=ruleset_name settings to # apply (must be mounted already, i.e. fstab(5)) devfs_load_rulesets="YES" # Enable to always load the default rulesets -performance_cx_lowest="C2" # Online CPU idle state +performance_cx_lowest="NONE" # Online CPU idle state performance_cpu_freq="NONE" # Online CPU frequency economy_cx_lowest="Cmax" # Offline CPU idle state economy_cpu_freq="NONE" # Offline CPU frequency From owner-svn-src-all@freebsd.org Thu Dec 1 04:35:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50649C5F578; Thu, 1 Dec 2016 04:35:39 +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 205061E16; Thu, 1 Dec 2016 04:35:39 +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 uB14Zcmi019962; Thu, 1 Dec 2016 04:35:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB14ZcfB019961; Thu, 1 Dec 2016 04:35:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201612010435.uB14ZcfB019961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 1 Dec 2016 04:35:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309349 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 04:35:39 -0000 Author: imp Date: Thu Dec 1 04:35:38 2016 New Revision: 309349 URL: https://svnweb.freebsd.org/changeset/base/309349 Log: Simplify test. Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Thu Dec 1 03:39:34 2016 (r309348) +++ head/sbin/devd/devd.cc Thu Dec 1 04:35:38 2016 (r309349) @@ -1193,7 +1193,7 @@ devdlog(int priority, const char* fmt, . va_start(argp, fmt); if (no_daemon) vfprintf(stderr, fmt, argp); - else if ((! quiet_mode) || (priority <= LOG_WARNING)) + else if (quiet_mode == 0 || priority <= LOG_WARNING) vsyslog(priority, fmt, argp); va_end(argp); } From owner-svn-src-all@freebsd.org Thu Dec 1 04:35:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D27FEC5F57D; Thu, 1 Dec 2016 04:35:42 +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 A26751E17; Thu, 1 Dec 2016 04:35:42 +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 uB14Zfvo020007; Thu, 1 Dec 2016 04:35:41 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB14Zfgu020006; Thu, 1 Dec 2016 04:35:41 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201612010435.uB14Zfgu020006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 1 Dec 2016 04:35:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309350 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 04:35:42 -0000 Author: imp Date: Thu Dec 1 04:35:41 2016 New Revision: 309350 URL: https://svnweb.freebsd.org/changeset/base/309350 Log: If the kenv variable rc_debug is set, turn on rc_debug. Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Thu Dec 1 04:35:38 2016 (r309349) +++ head/etc/rc.subr Thu Dec 1 04:35:41 2016 (r309350) @@ -2119,6 +2119,12 @@ _echoonce() esac } +# If the loader env variable rc.debug is set, turn on debugging. rc.conf will +# still override this, but /etc/defaults/rc.conf.a +if kenv -q rc.debug > /dev/null ; then + rc_debug=YES +fi + fi # [ -z "${_rc_subr_loaded}" ] _rc_subr_loaded=: From owner-svn-src-all@freebsd.org Thu Dec 1 05:16:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE888C6097D; Thu, 1 Dec 2016 05:16:28 +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 BAEA825C8; Thu, 1 Dec 2016 05:16:28 +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 uB15GRti035990; Thu, 1 Dec 2016 05:16:27 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB15GRa2035988; Thu, 1 Dec 2016 05:16:27 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201612010516.uB15GRa2035988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 1 Dec 2016 05:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309352 - in head/etc: . defaults X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 05:16:29 -0000 Author: imp Date: Thu Dec 1 05:16:27 2016 New Revision: 309352 URL: https://svnweb.freebsd.org/changeset/base/309352 Log: Finish incomplete comments in prior revision. I was going to fix this after I tested it, but didn't. Modified: head/etc/defaults/rc.conf head/etc/rc.subr Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Thu Dec 1 04:35:43 2016 (r309351) +++ head/etc/defaults/rc.conf Thu Dec 1 05:16:27 2016 (r309352) @@ -21,6 +21,8 @@ ### Important initial Boot-time options #################### ############################################################## +# rc_debug can't be set here without interferring with rc.subr's setting it +# when the kenv variable rc.debug is set. #rc_debug="NO" # Set to YES to enable debugging output from rc.d rc_info="NO" # Enables display of informational messages at boot. rc_startmsgs="YES" # Show "Starting foo:" messages at boot Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Thu Dec 1 04:35:43 2016 (r309351) +++ head/etc/rc.subr Thu Dec 1 05:16:27 2016 (r309352) @@ -2120,7 +2120,8 @@ _echoonce() } # If the loader env variable rc.debug is set, turn on debugging. rc.conf will -# still override this, but /etc/defaults/rc.conf.a +# still override this, but /etc/defaults/rc.conf can't unconditionally set this +# since it would undo what we've done here. if kenv -q rc.debug > /dev/null ; then rc_debug=YES fi From owner-svn-src-all@freebsd.org Thu Dec 1 05:37:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56AC2C62264; Thu, 1 Dec 2016 05:37:30 +0000 (UTC) (envelope-from sephe@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 315431CE1; Thu, 1 Dec 2016 05:37:30 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB15bTUE044509; Thu, 1 Dec 2016 05:37:29 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB15bTRS044507; Thu, 1 Dec 2016 05:37:29 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201612010537.uB15bTRS044507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 1 Dec 2016 05:37:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309353 - in head/sys: dev/hyperv/netvsc modules/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 05:37:30 -0000 Author: sephe Date: Thu Dec 1 05:37:29 2016 New Revision: 309353 URL: https://svnweb.freebsd.org/changeset/base/309353 Log: hyperv/hn: Add 'options RSS' support. Reviewed by: adrian MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8676 Modified: head/sys/dev/hyperv/netvsc/if_hn.c head/sys/modules/hyperv/netvsc/Makefile Modified: head/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hn.c Thu Dec 1 05:16:27 2016 (r309352) +++ head/sys/dev/hyperv/netvsc/if_hn.c Thu Dec 1 05:37:29 2016 (r309353) @@ -55,9 +55,10 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_hn.h" #include "opt_inet6.h" #include "opt_inet.h" -#include "opt_hn.h" +#include "opt_rss.h" #include #include @@ -87,6 +88,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef RSS +#include +#endif #include #include @@ -170,7 +174,11 @@ do { \ #define HN_PKTSIZE(m, align) \ roundup2((m)->m_pkthdr.len + HN_RNDIS_PKT_LEN, (align)) +#ifdef RSS +#define HN_RING_IDX2CPU(sc, idx) rss_getcpu((idx) % rss_getnumbuckets()) +#else #define HN_RING_IDX2CPU(sc, idx) (((sc)->hn_cpu + (idx)) % mp_ncpus) +#endif struct hn_txdesc { #ifndef HN_USE_TXDESC_BUFRING @@ -276,8 +284,10 @@ static int hn_ndis_version_sysctl(SYSC static int hn_caps_sysctl(SYSCTL_HANDLER_ARGS); static int hn_hwassist_sysctl(SYSCTL_HANDLER_ARGS); static int hn_rxfilter_sysctl(SYSCTL_HANDLER_ARGS); +#ifndef RSS static int hn_rss_key_sysctl(SYSCTL_HANDLER_ARGS); static int hn_rss_ind_sysctl(SYSCTL_HANDLER_ARGS); +#endif static int hn_rss_hash_sysctl(SYSCTL_HANDLER_ARGS); static int hn_txagg_size_sysctl(SYSCTL_HANDLER_ARGS); static int hn_txagg_pkts_sysctl(SYSCTL_HANDLER_ARGS); @@ -321,7 +331,9 @@ static int hn_create_rx_data(struct hn static void hn_destroy_rx_data(struct hn_softc *); static int hn_check_iplen(const struct mbuf *, int); static int hn_set_rxfilter(struct hn_softc *); +#ifndef RSS static int hn_rss_reconfig(struct hn_softc *); +#endif static void hn_rss_ind_fixup(struct hn_softc *); static int hn_rxpkt(struct hn_rx_ring *, const void *, int, const struct hn_rxinfo *); @@ -478,6 +490,7 @@ SYSCTL_INT(_hw_hn, OID_AUTO, tx_agg_pkts static u_int hn_cpu_index; /* next CPU for channel */ static struct taskqueue **hn_tx_taskque;/* shared TX taskqueues */ +#ifndef RSS static const uint8_t hn_rss_key_default[NDIS_HASH_KEYSIZE_TOEPLITZ] = { 0x6d, 0x5a, 0x56, 0xda, 0x25, 0x5b, 0x0e, 0xc2, @@ -486,6 +499,7 @@ hn_rss_key_default[NDIS_HASH_KEYSIZE_TOE 0x77, 0xcb, 0x2d, 0xa3, 0x80, 0x30, 0xf2, 0x0c, 0x6a, 0x42, 0xb7, 0x3b, 0xbe, 0xac, 0x01, 0xfa }; +#endif /* !RSS */ static device_method_t hn_methods[] = { /* Device interface */ @@ -783,6 +797,7 @@ hn_get_txswq_depth(const struct hn_tx_ri return hn_tx_swq_depth; } +#ifndef RSS static int hn_rss_reconfig(struct hn_softc *sc) { @@ -821,6 +836,7 @@ hn_rss_reconfig(struct hn_softc *sc) } return (0); } +#endif /* !RSS */ static void hn_rss_ind_fixup(struct hn_softc *sc) @@ -969,6 +985,10 @@ hn_attach(device_t dev) } else if (ring_cnt > mp_ncpus) { ring_cnt = mp_ncpus; } +#ifdef RSS + if (ring_cnt > rss_getnumbuckets()) + ring_cnt = rss_getnumbuckets(); +#endif tx_ring_cnt = hn_tx_ring_cnt; if (tx_ring_cnt <= 0 || tx_ring_cnt > ring_cnt) @@ -1068,12 +1088,17 @@ hn_attach(device_t dev) hn_rss_hash_sysctl, "A", "RSS hash"); SYSCTL_ADD_INT(ctx, child, OID_AUTO, "rss_ind_size", CTLFLAG_RD, &sc->hn_rss_ind_size, 0, "RSS indirect entry count"); +#ifndef RSS + /* + * Don't allow RSS key/indirect table changes, if RSS is defined. + */ SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rss_key", CTLTYPE_OPAQUE | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, hn_rss_key_sysctl, "IU", "RSS key"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "rss_ind", CTLTYPE_OPAQUE | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, hn_rss_ind_sysctl, "IU", "RSS indirect table"); +#endif SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "rndis_agg_size", CTLFLAG_RD, &sc->hn_rndis_agg_size, 0, "RNDIS offered packet transmission aggregation size limit"); @@ -2905,6 +2930,8 @@ hn_rxfilter_sysctl(SYSCTL_HANDLER_ARGS) return sysctl_handle_string(oidp, filter_str, sizeof(filter_str), req); } +#ifndef RSS + static int hn_rss_key_sysctl(SYSCTL_HANDLER_ARGS) { @@ -2966,6 +2993,8 @@ back: return (error); } +#endif /* !RSS */ + static int hn_rss_hash_sysctl(SYSCTL_HANDLER_ARGS) { @@ -4085,8 +4114,17 @@ hn_transmit(struct ifnet *ifp, struct mb /* * Select the TX ring based on flowid */ - if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) - idx = m->m_pkthdr.flowid % sc->hn_tx_ring_inuse; + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) { +#ifdef RSS + uint32_t bid; + + if (rss_hash2bucket(m->m_pkthdr.flowid, M_HASHTYPE_GET(m), + &bid) == 0) + idx = bid % sc->hn_tx_ring_inuse; + else +#endif + idx = m->m_pkthdr.flowid % sc->hn_tx_ring_inuse; + } txr = &sc->hn_tx_ring[idx]; error = drbr_enqueue(ifp, txr->hn_mbuf_br, m); @@ -4542,7 +4580,11 @@ hn_synth_attach(struct hn_softc *sc, int */ if (bootverbose) if_printf(sc->hn_ifp, "setup default RSS key\n"); +#ifdef RSS + rss_getkey(rss->rss_key); +#else memcpy(rss->rss_key, hn_rss_key_default, sizeof(rss->rss_key)); +#endif sc->hn_flags |= HN_FLAG_HAS_RSSKEY; } @@ -4555,8 +4597,16 @@ hn_synth_attach(struct hn_softc *sc, int if_printf(sc->hn_ifp, "setup default RSS indirect " "table\n"); } - for (i = 0; i < NDIS_HASH_INDCNT; ++i) - rss->rss_ind[i] = i % nchan; + for (i = 0; i < NDIS_HASH_INDCNT; ++i) { + uint32_t subidx; + +#ifdef RSS + subidx = rss_get_indirection_to_bucket(i); +#else + subidx = i; +#endif + rss->rss_ind[i] = subidx % nchan; + } sc->hn_flags |= HN_FLAG_HAS_RSSIND; } else { /* @@ -4633,6 +4683,14 @@ hn_set_ring_inuse(struct hn_softc *sc, i sc->hn_tx_ring_inuse = sc->hn_tx_ring_cnt; sc->hn_rx_ring_inuse = ring_cnt; +#ifdef RSS + if (sc->hn_rx_ring_inuse != rss_getnumbuckets()) { + if_printf(sc->hn_ifp, "# of RX rings (%d) does not match " + "# of RSS buckets (%d)\n", sc->hn_rx_ring_inuse, + rss_getnumbuckets()); + } +#endif + if (bootverbose) { if_printf(sc->hn_ifp, "%d TX ring, %d RX ring\n", sc->hn_tx_ring_inuse, sc->hn_rx_ring_inuse); Modified: head/sys/modules/hyperv/netvsc/Makefile ============================================================================== --- head/sys/modules/hyperv/netvsc/Makefile Thu Dec 1 05:16:27 2016 (r309352) +++ head/sys/modules/hyperv/netvsc/Makefile Thu Dec 1 05:37:29 2016 (r309353) @@ -5,7 +5,8 @@ KMOD= hv_netvsc SRCS= hn_nvs.c hn_rndis.c if_hn.c -SRCS+= bus_if.h device_if.h opt_inet.h opt_inet6.h vmbus_if.h opt_hn.h +SRCS+= bus_if.h device_if.h vmbus_if.h +SRCS+= opt_hn.h opt_inet.h opt_inet6.h opt_rss.h CFLAGS+= -I${.CURDIR}/../../../dev/hyperv/netvsc From owner-svn-src-all@freebsd.org Thu Dec 1 07:50:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2CDC5C5F32C; Thu, 1 Dec 2016 07:50:47 +0000 (UTC) (envelope-from peter@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 D71101CEC; Thu, 1 Dec 2016 07:50:46 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB17okZg001236; Thu, 1 Dec 2016 07:50:46 GMT (envelope-from peter@FreeBSD.org) Received: (from peter@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB17oidw001220; Thu, 1 Dec 2016 07:50:44 GMT (envelope-from peter@FreeBSD.org) Message-Id: <201612010750.uB17oidw001220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: peter set sender to peter@FreeBSD.org using -f From: Peter Wemm Date: Thu, 1 Dec 2016 07:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309356 - in head/contrib/subversion: . subversion/include subversion/include/private subversion/libsvn_client subversion/libsvn_fs_fs subversion/libsvn_fs_x subversion/libsvn_ra_serf s... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 07:50:47 -0000 Author: peter Date: Thu Dec 1 07:50:44 2016 New Revision: 309356 URL: https://svnweb.freebsd.org/changeset/base/309356 Log: Update from subversion 1.9.4 to 1.9.5. This includes a security fix for a component that we do not build, and two potentially useful client side fixes for reintegrate merges and tree conflict handling. See CHANGES for full details. Modified: head/contrib/subversion/CHANGES head/contrib/subversion/README head/contrib/subversion/build-outputs.mk head/contrib/subversion/configure head/contrib/subversion/configure.ac head/contrib/subversion/get-deps.sh head/contrib/subversion/subversion/include/private/svn_sqlite.h head/contrib/subversion/subversion/include/svn_version.h head/contrib/subversion/subversion/libsvn_client/merge.c head/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c head/contrib/subversion/subversion/libsvn_fs_fs/caching.c head/contrib/subversion/subversion/libsvn_fs_fs/fs.c head/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c head/contrib/subversion/subversion/libsvn_fs_fs/low_level.c head/contrib/subversion/subversion/libsvn_fs_fs/pack.c head/contrib/subversion/subversion/libsvn_fs_fs/pack.h head/contrib/subversion/subversion/libsvn_fs_fs/rep-cache-db.h head/contrib/subversion/subversion/libsvn_fs_fs/rep-cache.c head/contrib/subversion/subversion/libsvn_fs_fs/rep-cache.h head/contrib/subversion/subversion/libsvn_fs_fs/transaction.c head/contrib/subversion/subversion/libsvn_fs_fs/tree.c head/contrib/subversion/subversion/libsvn_fs_x/rep-cache-db.h head/contrib/subversion/subversion/libsvn_ra_serf/xml.c head/contrib/subversion/subversion/libsvn_repos/reporter.c head/contrib/subversion/subversion/libsvn_repos/repos.c head/contrib/subversion/subversion/libsvn_subr/config_file.c head/contrib/subversion/subversion/libsvn_subr/deprecated.c head/contrib/subversion/subversion/libsvn_subr/gpg_agent.c head/contrib/subversion/subversion/libsvn_subr/internal_statements.h head/contrib/subversion/subversion/libsvn_subr/sqlite.c head/contrib/subversion/subversion/libsvn_subr/sysinfo.c head/contrib/subversion/subversion/libsvn_subr/win32_crashrpt.c head/contrib/subversion/subversion/libsvn_subr/xml.c head/contrib/subversion/subversion/libsvn_wc/conflicts.c head/contrib/subversion/subversion/libsvn_wc/update_editor.c head/contrib/subversion/subversion/libsvn_wc/wc-checks.h head/contrib/subversion/subversion/libsvn_wc/wc-metadata.h head/contrib/subversion/subversion/libsvn_wc/wc-queries.h head/contrib/subversion/subversion/svn/info-cmd.c head/contrib/subversion/subversion/svn/merge-cmd.c head/contrib/subversion/subversion/svnserve/serve.c Directory Properties: head/contrib/subversion/ (props changed) Modified: head/contrib/subversion/CHANGES ============================================================================== --- head/contrib/subversion/CHANGES Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/CHANGES Thu Dec 1 07:50:44 2016 (r309356) @@ -1,3 +1,54 @@ +Version 1.9.5 +(29 Nov 2016, from /branches/1.9.x) +http://svn.apache.org/repos/asf/subversion/tags/1.9.5 + + User-visible changes: + - Client-side bugfixes: + * fix accessing non-existent paths during reintegrate merge (r1766699 et al) + * fix handling of newly secured subdirectories in working copy (r1724448) + * info: remove trailing whitespace in --show-item=revision (issue #4660) + * fix recording wrong revisions for tree conflicts (r1734106) + * gpg-agent: improve discovery of gpg-agent sockets (r1766327) + * gpg-agent: fix file descriptor leak (r1766323) + * resolve: fix --accept=mine-full for binary files (issue #4647) + * merge: fix possible crash (issue #4652) + * resolve: fix possible crash (r1748514) + * fix potential crash in Win32 crash reporter (r1663253 et al) + + - Server-side bugfixes: + * fsfs: fix "offset too large" error during pack (issue #4657) + * svnserve: enable hook script environments (r1769152) + * fsfs: fix possible data reconstruction error (issue #4658) + * fix source of spurious 'incoming edit' tree conflicts (r1770108) + * fsfs: improve caching for large directories (r1721285) + * fsfs: fix crash when encountering all-zero checksums (r1759686) + * fsfs: fix potential source of repository corruptions (r1756266) + * mod_dav_svn: fix excessive memory usage with mod_headers/mod_deflate + (issue #3084) + * mod_dav_svn: reduce memory usage during GET requests (r1757529 et al) + * fsfs: fix unexpected "database is locked" errors (r1741096 et al) + * fsfs: fix opening old repositories without db/format files (r1720015) + + - Client-side and server-side bugfixes: + * fix possible crash when reading invalid configuration files (r1715777) + + - Bindings bugfixes: + * swig-pl: do not corrupt "{DATE}" revision variable (r1767768) + * javahl: fix temporary accepting SSL server certificates (r1764851) + * swig-pl: fix possible stack corruption (r1683266, r1683267) + + Developer-visible changes: + - General: + * add zlib discovery through pkg-config (issue #4655) + * fix potential build issue with invalid SVN_LOCALE_DIR (issue #4653) + * ruby: fix test failures with ruby >= 2.2 (r1766621) + * fix link error with --disable-keychain on OS X (r1765385) + * swig: enable building with SWIG >= 3.0.6 (r1721488 et al) + * swig: fix building with -Wdate-time in $CPPFLAGS (r1722164) + * update serf download URI in build scripts (r1700130 et al) + * raise minimal httpd version from 2.0 to 2.2 (r1754193) + + Version 1.9.4 (28 Apr 2016, from /branches/1.9.x) http://svn.apache.org/repos/asf/subversion/tags/1.9.4 @@ -14,6 +65,8 @@ http://svn.apache.org/repos/asf/subversi * ra_serf: fix deleting directories with many files (issue #4557) - Server-side bugfixes: + * mod_authz_svn: fix crash in COPY/MOVE authorization check (CVE-2016-2168) + * svnserve/sasl: fix authenticating users with wrong realm (CVE-2016-2167) * improve documentation for AuthzSVNGroupsFile and groups-db (r1730856) * fsfs: reduce peak memory usage when listing large directories (r1725180) * fsfs: fix a rare source of incomplete dump files and reports (r1717876) @@ -31,8 +84,7 @@ http://svn.apache.org/repos/asf/subversi * fix ruby test suite to work with test-unit gem (r1714790) * allow building against KDE4 without conflict with KDE5 (r1734926) * fix update_tests.py#76 with SVNPathAuthz short_circuit (r1736432) - * build system tweaks: - * tweak how symbolic error names in maintainer mode (r1735179) + * tweak getting symbolic error names in maintainer mode (r1735179) * fix inconsistent behavior of inherited property API (r1717874 et al) - API changes: @@ -882,12 +934,44 @@ http://svn.apache.org/repos/asf/subversi * javahl: allow compiling with a C++11 compiler (r1684412) +Version 1.8.17 +(29 Nov 2016, from /branches/1.8.x) +http://svn.apache.org/repos/asf/subversion/tags/1.8.17 + + User-visible changes: + - Client-side bugfixes: + * fix handling of newly secured subdirectories in working copy (r1724448) + * ra_serf: fix deleting directories with many files (issue #4557) + * svnlook: properly remove tempfiles on diff errors (r1711346) + * gpg-agent: properly handle passwords with percent characters (issue #4611) + * merge: fix crash when merging to a local add (r1702299 et al) + + - Server-side bugfixes: + * fsfs: fix possible data reconstruction error (issue #4658) + + - Client-side and server-side bugfixes: + * fix potential memory access bugs (r1722860 et al) + + - Bindings bugfixes: + * javahl: fix temporary accepting SSL server certificates (r1764851) + * swig-pl: do not corrupt "{DATE}" revision variable (r1767768) + * swig-pl: fix possible stack corruption (r1683266) + + Developer-visible changes: + - General: + * fix inconsistent behavior of inherited property API (r1717875, r1717878) + * fix patch filter invocation in svn_client_patch() (r1706783) + * fix potential build issue with invalid SVN_LOCALE_DIR (issue #4653) + + Version 1.8.16 (28 Apr 2016, from /branches/1.8.x) http://svn.apache.org/repos/asf/subversion/tags/1.8.16 User-visible changes: - Server-side bugfixes: + * mod_authz_svn: fix crash in COPY/MOVE authorization check (CVE-2016-2168) + * svnserve/sasl: fix authenticating users with wrong realm (CVE-2016-2167) * mod_authz_svn: fix authz with mod_auth_kerb/mod_auth_ntlm (issue #4602) * dump: don't write broken dump files in some ambiguously encoded fsfs repositories (issue #4554) @@ -1641,7 +1725,7 @@ http://svn.apache.org/repos/asf/subversi * fix bug in mergeinfo recording during foreign-repos merge (r1430310) * fix spurious merge conflicts for binary files with keywords (issue #4221) * fix patching symlinks with 'svn patch' (issue #4273) - * make 'svn switch' refresh lock information (issue #3376) + * make 'svn switch' refresh lock information (issue #3378) * fix 'svn diff' output doesn't apply as patch without fuzz (issue #3362) * fix mergeinfo recording for multiple-revision-range merge (issue #4306) * fix diffs shown by 'show-diff' conflict prompt option (r1438879) Modified: head/contrib/subversion/README ============================================================================== --- head/contrib/subversion/README Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/README Thu Dec 1 07:50:44 2016 (r309356) @@ -2,7 +2,7 @@ Subversion, a version control system. ===================================== -$LastChangedDate: 2012-02-10 14:58:53 +0000 (Fri, 10 Feb 2012) $ +$LastChangedDate: 2016-05-31 16:08:20 +0000 (Tue, 31 May 2016) $ Contents: @@ -36,10 +36,10 @@ II. DOCUMENTATION It is written in DocBook XML, and the sources can be found at: - http://svnbook.googlecode.com/svn/trunk/ + http://svn.code.sf.net/p/svnbook/source/trunk/ If you wish to build the documentation from source, read the - src/en/README file within the book source. + en/README file within the book source. Modified: head/contrib/subversion/build-outputs.mk ============================================================================== --- head/contrib/subversion/build-outputs.mk Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/build-outputs.mk Thu Dec 1 07:50:44 2016 (r309356) @@ -3351,7 +3351,7 @@ subversion/tests/libsvn_diff/diff-diff3- subversion/tests/libsvn_diff/parse-diff-test.lo: subversion/tests/libsvn_diff/parse-diff-test.c subversion/include/private/svn_debug.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_utf.h subversion/tests/svn_test.h -subversion/tests/libsvn_fs/fs-test.lo: subversion/tests/libsvn_fs/fs-test.c subversion/include/private/svn_debug.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_fs_util.h subversion/include/private/svn_fspath.h subversion/include/private/svn_mutex.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_time.h subversion/include/svn_types.h subversion/include/svn_version.h subversion/libsvn_delta/delta.h subversion/libsvn_fs/fs-loader.h subversion/s vn_private_config.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h +subversion/tests/libsvn_fs/fs-test.lo: subversion/tests/libsvn_fs/fs-test.c subversion/include/private/svn_debug.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_fs_util.h subversion/include/private/svn_fspath.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_time.h subversion/include/svn_types.h subversion/include/svn_version. h subversion/libsvn_delta/delta.h subversion/libsvn_fs/fs-loader.h subversion/svn_private_config.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h subversion/tests/libsvn_fs/locks-test.lo: subversion/tests/libsvn_fs/locks-test.c subversion/include/private/svn_debug.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h @@ -3363,7 +3363,7 @@ subversion/tests/libsvn_fs_base/strings- subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.lo: subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.c subversion/include/private/svn_atomic.h subversion/include/private/svn_cache.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_fs_private.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_string_private.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_iter.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_poo ls.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/libsvn_fs_fs/fs.h subversion/libsvn_fs_fs/fs_fs.h subversion/libsvn_fs_fs/id.h subversion/libsvn_fs_fs/rev_file.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h -subversion/tests/libsvn_fs_fs/fs-fs-pack-test.lo: subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c subversion/include/private/svn_atomic.h subversion/include/private/svn_cache.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_fs_private.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_string_private.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_iter.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools .h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/libsvn_fs/fs-loader.h subversion/libsvn_fs_fs/fs.h subversion/libsvn_fs_fs/fs_fs.h subversion/libsvn_fs_fs/id.h subversion/libsvn_fs_fs/low_level.h subversion/libsvn_fs_fs/util.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h +subversion/tests/libsvn_fs_fs/fs-fs-pack-test.lo: subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c subversion/include/private/svn_atomic.h subversion/include/private/svn_cache.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_fs_private.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_string_private.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_iter.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools .h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/libsvn_fs/fs-loader.h subversion/libsvn_fs_fs/fs.h subversion/libsvn_fs_fs/fs_fs.h subversion/libsvn_fs_fs/id.h subversion/libsvn_fs_fs/low_level.h subversion/libsvn_fs_fs/pack.h subversion/libsvn_fs_fs/util.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h subversion/tests/libsvn_fs_fs/fs-fs-private-test.lo: subversion/tests/libsvn_fs_fs/fs-fs-private-test.c subversion/include/private/svn_atomic.h subversion/include/private/svn_cache.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_fs_private.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_string_private.h subversion/include/private/svn_subr_private.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_iter.h subversion/include/svn_mergeinfo.h subver sion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/libsvn_fs_fs/fs.h subversion/libsvn_fs_fs/id.h subversion/libsvn_fs_fs/index.h subversion/libsvn_fs_fs/rev_file.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h Modified: head/contrib/subversion/configure ============================================================================== --- head/contrib/subversion/configure Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/configure Thu Dec 1 07:50:44 2016 (r309356) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for subversion 1.9.4. +# Generated by GNU Autoconf 2.69 for subversion 1.9.5. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='subversion' PACKAGE_TARNAME='subversion' -PACKAGE_VERSION='1.9.4' -PACKAGE_STRING='subversion 1.9.4' +PACKAGE_VERSION='1.9.5' +PACKAGE_STRING='subversion 1.9.5' PACKAGE_BUGREPORT='http://subversion.apache.org/' PACKAGE_URL='' @@ -1471,7 +1471,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures subversion 1.9.4 to adapt to many kinds of systems. +\`configure' configures subversion 1.9.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1537,7 +1537,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of subversion 1.9.4:";; + short | recursive ) echo "Configuration of subversion 1.9.5:";; esac cat <<\_ACEOF @@ -1751,7 +1751,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -subversion configure 1.9.4 +subversion configure 1.9.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2295,7 +2295,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by subversion $as_me 1.9.4, which was +It was created by subversion $as_me 1.9.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2675,8 +2675,8 @@ ac_configure="$SHELL $ac_aux_dir/configu -{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring Subversion 1.9.4" >&5 -$as_echo "$as_me: Configuring Subversion 1.9.4" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring Subversion 1.9.5" >&5 +$as_echo "$as_me: Configuring Subversion 1.9.5" >&6;} abs_srcdir="`cd $srcdir && pwd`" @@ -7422,7 +7422,10 @@ _ACEOF localedir='${datadir}/locale' -if test "${datadir}" = '${prefix}/share' && test "${prefix}" = "NONE"; then +if test "${prefix}" = "NONE" \ + && ( test "${datadir}" = '${prefix}/share' \ + || ( test "${datadir}" = '${datarootdir}' \ + && test "${datarootdir}" = '${prefix}/share' ) ); then exp_localedir='${ac_default_prefix}/share/locale' else exp_localedir=$localedir @@ -22550,68 +22553,34 @@ fi zlib_found=no + zlib_skip=no # Check whether --with-zlib was given. if test "${with_zlib+set}" = set; then : withval=$with_zlib; - if test "$withval" = "yes" ; then - ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" -if test "x$ac_cv_header_zlib_h" = xyes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 -$as_echo_n "checking for inflate in -lz... " >&6; } -if ${ac_cv_lib_z_inflate+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lz $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + if test "$withval" = "yes"; then + zlib_skip=no + elif test "$withval" = "no"; then + zlib_skip=yes + else + zlib_skip=no + zlib_prefix="$withval" + fi -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char inflate (); -int -main () -{ -return inflate (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_z_inflate=yes -else - ac_cv_lib_z_inflate=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5 -$as_echo "$ac_cv_lib_z_inflate" >&6; } -if test "x$ac_cv_lib_z_inflate" = xyes; then : - zlib_found="builtin" fi -fi - + if test "$zlib_skip" = "yes"; then + as_fn_error $? "subversion requires zlib" "$LINENO" 5 + fi - elif test "$withval" = "no" ; then - as_fn_error $? "cannot compile without zlib." "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: zlib library configuration" >&5 -$as_echo "$as_me: zlib library configuration" >&6;} - zlib_prefix=$withval - save_cppflags="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I$zlib_prefix/include" - for ac_header in zlib.h + if test -n "$zlib_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: zlib library configuration via prefix" >&5 +$as_echo "$as_me: zlib library configuration via prefix" >&6;} + save_cppflags="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -I$zlib_prefix/include" + for ac_header in zlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" if test "x$ac_cv_header_zlib_h" = xyes; then : @@ -22619,9 +22588,9 @@ if test "x$ac_cv_header_zlib_h" = xyes; #define HAVE_ZLIB_H 1 _ACEOF - save_ldflags="$LDFLAGS" - LDFLAGS="$LDFLAGS -L$zlib_prefix/lib" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 + save_ldflags="$LDFLAGS" + LDFLAGS="$LDFLAGS -L$zlib_prefix/lib" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 $as_echo_n "checking for inflate in -lz... " >&6; } if ${ac_cv_lib_z_inflate+:} false; then : $as_echo_n "(cached) " >&6 @@ -22658,24 +22627,86 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5 $as_echo "$ac_cv_lib_z_inflate" >&6; } if test "x$ac_cv_lib_z_inflate" = xyes; then : - zlib_found="yes" + + zlib_found="yes" + SVN_ZLIB_INCLUDES="-I$zlib_prefix/include" + SVN_ZLIB_LIBS="` + input_flags="-L$zlib_prefix/lib" + output_flags="" + filtered_dirs="/lib /lib64 /usr/lib /usr/lib64" + for flag in $input_flags; do + filter="no" + for dir in $filtered_dirs; do + if test "$flag" = "-L$dir" || test "$flag" = "-L$dir/"; then + filter="yes" + break + fi + done + if test "$filter" = "no"; then + output_flags="$output_flags $flag" + fi + done + if test -n "$output_flags"; then + printf "%s" "${output_flags# }" + fi +` -lz" + fi - LDFLAGS="$save_ldflags" + LDFLAGS="$save_ldflags" fi done - CPPFLAGS="$save_cppflags" + CPPFLAGS="$save_cppflags" + else + + { $as_echo "$as_me:${as_lineno-$LINENO}: zlib library configuration via pkg-config" >&5 +$as_echo "$as_me: zlib library configuration via pkg-config" >&6;} + if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlib library" >&5 +$as_echo_n "checking for zlib library... " >&6; } + if $PKG_CONFIG zlib --exists; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + zlib_found=yes + SVN_ZLIB_INCLUDES=`$PKG_CONFIG zlib --cflags` + SVN_ZLIB_LIBS=`$PKG_CONFIG zlib --libs` + SVN_ZLIB_LIBS="` + input_flags="$SVN_ZLIB_LIBS" + output_flags="" + filtered_dirs="/lib /lib64 /usr/lib /usr/lib64" + for flag in $input_flags; do + filter="no" + for dir in $filtered_dirs; do + if test "$flag" = "-L$dir" || test "$flag" = "-L$dir/"; then + filter="yes" + break + fi + done + if test "$filter" = "no"; then + output_flags="$output_flags $flag" + fi + done + if test -n "$output_flags"; then + printf "%s" "${output_flags# }" + fi +`" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi -else - ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" + if test "$zlib_found" = "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: zlib library configuration" >&5 +$as_echo "$as_me: zlib library configuration" >&6;} + ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" if test "x$ac_cv_header_zlib_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 $as_echo_n "checking for inflate in -lz... " >&6; } if ${ac_cv_lib_z_inflate+:} false; then : $as_echo_n "(cached) " >&6 @@ -22712,46 +22743,22 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5 $as_echo "$ac_cv_lib_z_inflate" >&6; } if test "x$ac_cv_lib_z_inflate" = xyes; then : - zlib_found="builtin" -fi + zlib_found="builtin" + SVN_ZLIB_LIBS="-lz" fi - fi - if test "$zlib_found" = "no"; then - as_fn_error $? "subversion requires zlib" "$LINENO" 5 - fi - - if test "$zlib_found" = "yes"; then - SVN_ZLIB_INCLUDES="-I$zlib_prefix/include" - LDFLAGS="$LDFLAGS ` - input_flags="-L$zlib_prefix/lib" - output_flags="" - filtered_dirs="/lib /lib64 /usr/lib /usr/lib64" - for flag in $input_flags; do - filter="no" - for dir in $filtered_dirs; do - if test "$flag" = "-L$dir" || test "$flag" = "-L$dir/"; then - filter="yes" - break - fi - done - if test "$filter" = "no"; then - output_flags="$output_flags $flag" fi - done - if test -n "$output_flags"; then - printf "%s" "${output_flags# }" - fi -`" fi - SVN_ZLIB_LIBS="-lz" + if test "$zlib_found" = "no"; then + as_fn_error $? "subversion requires zlib" "$LINENO" 5 + fi @@ -23785,15 +23792,14 @@ $as_echo "$SWIG_VERSION_RAW" >&6; } # packages/rpm/redhat-7.x/subversion.spec # packages/rpm/rhel-3/subversion.spec # packages/rpm/rhel-4/subversion.spec - if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" && \ - test "$SWIG_VERSION" -lt "300000"; then + if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024"; then SWIG_SUITABLE=yes else SWIG_SUITABLE=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&5 $as_echo "$as_me: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&5 -$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24" >&5 +$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24" >&2;} fi fi @@ -24274,15 +24280,14 @@ $as_echo "$SWIG_VERSION_RAW" >&6; } # packages/rpm/redhat-7.x/subversion.spec # packages/rpm/rhel-3/subversion.spec # packages/rpm/rhel-4/subversion.spec - if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" && \ - test "$SWIG_VERSION" -lt "300000"; then + if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024"; then SWIG_SUITABLE=yes else SWIG_SUITABLE=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&5 $as_echo "$as_me: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&5 -$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24" >&5 +$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24" >&2;} fi fi @@ -24763,15 +24768,14 @@ $as_echo "$SWIG_VERSION_RAW" >&6; } # packages/rpm/redhat-7.x/subversion.spec # packages/rpm/rhel-3/subversion.spec # packages/rpm/rhel-4/subversion.spec - if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" && \ - test "$SWIG_VERSION" -lt "300000"; then + if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024"; then SWIG_SUITABLE=yes else SWIG_SUITABLE=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&5 $as_echo "$as_me: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&5 -$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24" >&5 +$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24" >&2;} fi fi @@ -25255,15 +25259,14 @@ $as_echo "$SWIG_VERSION_RAW" >&6; } # packages/rpm/redhat-7.x/subversion.spec # packages/rpm/rhel-3/subversion.spec # packages/rpm/rhel-4/subversion.spec - if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" && \ - test "$SWIG_VERSION" -lt "300000"; then + if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024"; then SWIG_SUITABLE=yes else SWIG_SUITABLE=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&5 $as_echo "$as_me: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&5 -$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24" >&5 +$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24" >&2;} fi fi @@ -26152,6 +26155,9 @@ SWIG_CPPFLAGS="$CPPFLAGS" SWIG_CPPFLAGS=`echo "$SWIG_CPPFLAGS" | $SED -e 's/-no-cpp-precomp //'` + SWIG_CPPFLAGS=`echo "$SWIG_CPPFLAGS" | $SED -e 's/-Wdate-time //'` + + cat >>confdefs.h <<_ACEOF @@ -26750,7 +26756,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by subversion $as_me 1.9.4, which was +This file was extended by subversion $as_me 1.9.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -26816,7 +26822,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -subversion config.status 1.9.4 +subversion config.status 1.9.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: head/contrib/subversion/configure.ac ============================================================================== --- head/contrib/subversion/configure.ac Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/configure.ac Thu Dec 1 07:50:44 2016 (r309356) @@ -199,7 +199,10 @@ localedir='${datadir}/locale' AC_SUBST(localedir) dnl For SVN_LOCALE_DIR, we have to expand it to something. See SVN_BINDIR. -if test "${datadir}" = '${prefix}/share' && test "${prefix}" = "NONE"; then +if test "${prefix}" = "NONE" \ + && ( test "${datadir}" = '${prefix}/share' \ + || ( test "${datadir}" = '${datarootdir}' \ + && test "${datarootdir}" = '${prefix}/share' ) ); then exp_localedir='${ac_default_prefix}/share/locale' else exp_localedir=$localedir @@ -1504,6 +1507,7 @@ fi # Need to strip '-no-cpp-precomp' from CPPFLAGS for SWIG as well. SWIG_CPPFLAGS="$CPPFLAGS" SVN_STRIP_FLAG(SWIG_CPPFLAGS, [-no-cpp-precomp ]) +SVN_STRIP_FLAG(SWIG_CPPFLAGS, [-Wdate-time ]) AC_SUBST([SWIG_CPPFLAGS]) dnl Since this is used only on Unix-y systems, define the path separator as '/' Modified: head/contrib/subversion/get-deps.sh ============================================================================== --- head/contrib/subversion/get-deps.sh Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/get-deps.sh Thu Dec 1 07:50:44 2016 (r309356) @@ -89,7 +89,7 @@ get_serf() { test -d $BASEDIR/serf && return cd $TEMPDIR - $HTTP_FETCH http://serf.googlecode.com/svn/src_releases/$SERF.tar.bz2 + $HTTP_FETCH https://archive.apache.org/dist/serf/$SERF.tar.bz2 cd $BASEDIR bzip2 -dc $TEMPDIR/$SERF.tar.bz2 | tar -xf - Modified: head/contrib/subversion/subversion/include/private/svn_sqlite.h ============================================================================== --- head/contrib/subversion/subversion/include/private/svn_sqlite.h Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/subversion/include/private/svn_sqlite.h Thu Dec 1 07:50:44 2016 (r309356) @@ -555,6 +555,9 @@ svn_sqlite__hotcopy(const char *src_path const char *dst_path, apr_pool_t *scratch_pool); +/* Backported version of SVN_ERR_SQLITE_ROLLBACK_FAILED. */ +#define SVN_SQLITE__ERR_ROLLBACK_FAILED (SVN_ERR_MISC_CATEGORY_START + 44) + #ifdef __cplusplus } #endif /* __cplusplus */ Modified: head/contrib/subversion/subversion/include/svn_version.h ============================================================================== --- head/contrib/subversion/subversion/include/svn_version.h Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/subversion/include/svn_version.h Thu Dec 1 07:50:44 2016 (r309356) @@ -70,7 +70,7 @@ extern "C" { * * @since New in 1.1. */ -#define SVN_VER_PATCH 4 +#define SVN_VER_PATCH 5 /** @deprecated Provided for backward compatibility with the 1.0 API. */ @@ -93,7 +93,7 @@ extern "C" { * * Always change this at the same time as SVN_VER_NUMTAG. */ -#define SVN_VER_TAG " (r1740329)" +#define SVN_VER_TAG " (r1770682)" /** Number tag: a string describing the version. @@ -117,7 +117,7 @@ extern "C" { * file version. Its value remains 0 in the repository except in release * tags where it is the revision from which the tag was created. */ -#define SVN_VER_REVISION 1740329 +#define SVN_VER_REVISION 1770682 /* Version strings composed from the above definitions. */ Modified: head/contrib/subversion/subversion/libsvn_client/merge.c ============================================================================== --- head/contrib/subversion/subversion/libsvn_client/merge.c Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/subversion/libsvn_client/merge.c Thu Dec 1 07:50:44 2016 (r309356) @@ -1295,6 +1295,15 @@ record_skip(merge_cmd_baton_t *merge_b, return SVN_NO_ERROR; } +/* Forward declaration */ +static svn_client__merge_path_t * +find_nearest_ancestor_with_intersecting_ranges( + svn_revnum_t *start, + svn_revnum_t *end, + const apr_array_header_t *children_with_mergeinfo, + svn_boolean_t path_is_own_ancestor, + const char *local_abspath); + /* Record a tree conflict in the WC, unless this is a dry run or a record- * only merge, or if a tree conflict is already flagged for the VICTIM_PATH. * (The latter can happen if a merge-tracking-aware merge is doing multiple @@ -1366,11 +1375,45 @@ record_tree_conflict(merge_cmd_baton_t * reason = svn_wc_conflict_reason_moved_here; } - SVN_ERR(make_conflict_versions(&left, &right, local_abspath, - merge_left_node_kind, - merge_right_node_kind, - &merge_b->merge_source, merge_b->target, - result_pool, scratch_pool)); + if (HONOR_MERGEINFO(merge_b) && merge_b->merge_source.ancestral) + { + struct merge_source_t *source; + svn_client__pathrev_t *loc1; + svn_client__pathrev_t *loc2; + svn_merge_range_t range = + {SVN_INVALID_REVNUM, SVN_INVALID_REVNUM, TRUE}; + + /* We are honoring mergeinfo so do not blindly record + * a conflict describing the merge of + * SOURCE->LOC1->URL@SOURCE->LOC1->REV through + * SOURCE->LOC2->URL@SOURCE->LOC2->REV + * but figure out the actual revision range merged. */ + (void)find_nearest_ancestor_with_intersecting_ranges( + &(range.start), &(range.end), + merge_b->notify_begin.nodes_with_mergeinfo, + action != svn_wc_conflict_action_delete, + local_abspath); + loc1 = svn_client__pathrev_dup(merge_b->merge_source.loc1, + scratch_pool); + loc2 = svn_client__pathrev_dup(merge_b->merge_source.loc2, + scratch_pool); + loc1->rev = range.start; + loc2->rev = range.end; + source = merge_source_create(loc1, loc2, + merge_b->merge_source.ancestral, + scratch_pool); + SVN_ERR(make_conflict_versions(&left, &right, local_abspath, + merge_left_node_kind, + merge_right_node_kind, + source, merge_b->target, + result_pool, scratch_pool)); + } + else + SVN_ERR(make_conflict_versions(&left, &right, local_abspath, + merge_left_node_kind, + merge_right_node_kind, + &merge_b->merge_source, merge_b->target, + result_pool, scratch_pool)); /* Fix up delete of file, add of dir replacement (or other way around) */ if (existing_conflict != NULL && existing_conflict->src_left_version) @@ -10956,7 +10999,7 @@ find_unsynced_ranges(const svn_client__p potentially_unmerged_ranges->nelts - 1, svn_merge_range_t *))->end; log_find_operative_baton_t log_baton; - const char *old_session_url; + const char *old_session_url = NULL; svn_error_t *err; log_baton.merged_catalog = merged_catalog; @@ -10967,14 +11010,22 @@ find_unsynced_ranges(const svn_client__p = svn_client__pathrev_fspath(target_loc, scratch_pool); log_baton.result_pool = result_pool; - SVN_ERR(svn_client__ensure_ra_session_url( - &old_session_url, ra_session, target_loc->url, scratch_pool)); + /* Reparent the session to TARGET_LOC if this target location + * exists within the unmerged revision range. */ + if (target_loc->rev <= youngest_rev && target_loc->rev >= oldest_rev) + SVN_ERR(svn_client__ensure_ra_session_url( + &old_session_url, ra_session, target_loc->url, scratch_pool)); + err = get_log(ra_session, "", youngest_rev, oldest_rev, TRUE, /* discover_changed_paths */ log_find_operative_revs, &log_baton, scratch_pool); - SVN_ERR(svn_error_compose_create( - err, svn_ra_reparent(ra_session, old_session_url, scratch_pool))); + if (old_session_url) + err = svn_error_compose_create(err, + svn_ra_reparent(ra_session, + old_session_url, + scratch_pool)); + SVN_ERR(err); } return SVN_NO_ERROR; Modified: head/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c ============================================================================== --- head/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c Thu Dec 1 07:50:44 2016 (r309356) @@ -1571,6 +1571,17 @@ read_plain_window(svn_stringbuf_t **nwin return SVN_NO_ERROR; } +/* Skip SIZE bytes from the PLAIN representation RS. */ +static svn_error_t * +skip_plain_window(rep_state_t *rs, + apr_size_t size) +{ + /* Update RS. */ + rs->current += (apr_off_t)size; + + return SVN_NO_ERROR; +} + /* Get the undeltified window that is a result of combining all deltas from the current desired representation identified in *RB with its base representation. Store the window in *RESULT. */ @@ -1628,9 +1639,18 @@ get_combined_window(svn_stringbuf_t **re Also note that we may have short-cut reading the delta chain -- in which case SRC_OPS is 0 and it might not be a PLAIN rep. */ source = buf; - if (source == NULL && rb->src_state != NULL && window->src_ops) - SVN_ERR(read_plain_window(&source, rb->src_state, window->sview_len, - pool, iterpool)); + if (source == NULL && rb->src_state != NULL) + { + /* Even if we don't need the source rep now, we still must keep + * its read offset in sync with what we might need for the next + * window. */ + if (window->src_ops) + SVN_ERR(read_plain_window(&source, rb->src_state, + window->sview_len, + pool, iterpool)); + else + SVN_ERR(skip_plain_window(rb->src_state, window->sview_len)); + } /* Combine this window with the current one. */ new_pool = svn_pool_create(rb->pool); Modified: head/contrib/subversion/subversion/libsvn_fs_fs/caching.c ============================================================================== --- head/contrib/subversion/subversion/libsvn_fs_fs/caching.c Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/subversion/libsvn_fs_fs/caching.c Thu Dec 1 07:50:44 2016 (r309356) @@ -430,7 +430,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f svn_fs_fs__deserialize_dir_entries, sizeof(pair_cache_key_t), apr_pstrcat(pool, prefix, "DIR", SVN_VA_NULL), - SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY, + SVN_CACHE__MEMBUFFER_HIGH_PRIORITY, fs, no_handler, fs->pool, pool)); @@ -806,7 +806,7 @@ svn_fs_fs__initialize_txn_caches(svn_fs_ APR_HASH_KEY_STRING, apr_pstrcat(pool, prefix, "TXNDIR", SVN_VA_NULL), - 0, + SVN_CACHE__MEMBUFFER_HIGH_PRIORITY, fs, TRUE, pool, pool)); Modified: head/contrib/subversion/subversion/libsvn_fs_fs/fs.c ============================================================================== --- head/contrib/subversion/subversion/libsvn_fs_fs/fs.c Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/subversion/libsvn_fs_fs/fs.c Thu Dec 1 07:50:44 2016 (r309356) @@ -452,7 +452,7 @@ fs_pack(svn_fs_t *fs, apr_pool_t *common_pool) { SVN_ERR(fs_open(fs, path, common_pool_lock, pool, common_pool)); - return svn_fs_fs__pack(fs, notify_func, notify_baton, + return svn_fs_fs__pack(fs, 0, notify_func, notify_baton, cancel_func, cancel_baton, pool); } Modified: head/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c ============================================================================== --- head/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c Thu Dec 1 07:50:44 2016 (r309356) @@ -492,6 +492,7 @@ read_format(int *pformat, svn_error_clear(err); *pformat = 1; *max_files_per_dir = 0; + *use_log_addressing = FALSE; return SVN_NO_ERROR; } Modified: head/contrib/subversion/subversion/libsvn_fs_fs/low_level.c ============================================================================== --- head/contrib/subversion/subversion/libsvn_fs_fs/low_level.c Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/subversion/libsvn_fs_fs/low_level.c Thu Dec 1 07:50:44 2016 (r309356) @@ -764,7 +764,11 @@ svn_fs_fs__parse_representation(represen SVN_ERR(svn_checksum_parse_hex(&checksum, svn_checksum_md5, str, scratch_pool)); - memcpy(rep->md5_digest, checksum->digest, sizeof(rep->md5_digest)); + + /* If STR is a all-zero checksum, CHECKSUM will be NULL and REP already + contains the correct value. */ + if (checksum) + memcpy(rep->md5_digest, checksum->digest, sizeof(rep->md5_digest)); /* The remaining fields are only used for formats >= 4, so check that. */ str = svn_cstring_tokenize(" ", &string); @@ -778,8 +782,16 @@ svn_fs_fs__parse_representation(represen SVN_ERR(svn_checksum_parse_hex(&checksum, svn_checksum_sha1, str, scratch_pool)); + + /* We do have a valid SHA1 but it might be all 0. + We cannot be sure where that came from (Alas! legacy), so let's not + claim we know the SHA1 in that case. */ rep->has_sha1 = checksum != NULL; - memcpy(rep->sha1_digest, checksum->digest, sizeof(rep->sha1_digest)); + + /* If STR is a all-zero checksum, CHECKSUM will be NULL and REP already + contains the correct value. */ + if (checksum) + memcpy(rep->sha1_digest, checksum->digest, sizeof(rep->sha1_digest)); /* Read the uniquifier. */ str = svn_cstring_tokenize("/", &string); Modified: head/contrib/subversion/subversion/libsvn_fs_fs/pack.c ============================================================================== --- head/contrib/subversion/subversion/libsvn_fs_fs/pack.c Thu Dec 1 07:46:24 2016 (r309355) +++ head/contrib/subversion/subversion/libsvn_fs_fs/pack.c Thu Dec 1 07:50:44 2016 (r309356) @@ -335,21 +335,40 @@ static svn_error_t * reset_pack_context(pack_context_t *context, apr_pool_t *pool) { + const char *temp_dir; + apr_array_clear(context->changes); - SVN_ERR(svn_io_file_trunc(context->changes_file, 0, pool)); + SVN_ERR(svn_io_file_close(context->changes_file, pool)); apr_array_clear(context->file_props); - SVN_ERR(svn_io_file_trunc(context->file_props_file, 0, pool)); + SVN_ERR(svn_io_file_close(context->file_props_file, pool)); apr_array_clear(context->dir_props); - SVN_ERR(svn_io_file_trunc(context->dir_props_file, 0, pool)); + SVN_ERR(svn_io_file_close(context->dir_props_file, pool)); apr_array_clear(context->rev_offsets); apr_array_clear(context->path_order); apr_array_clear(context->references); apr_array_clear(context->reps); - SVN_ERR(svn_io_file_trunc(context->reps_file, 0, pool)); + SVN_ERR(svn_io_file_close(context->reps_file, pool)); svn_pool_clear(context->info_pool); + /* The new temporary files must live at least as long as any other info + * object in CONTEXT. */ + SVN_ERR(svn_io_temp_dir(&temp_dir, pool)); + SVN_ERR(svn_io_open_unique_file3(&context->changes_file, NULL, temp_dir, + svn_io_file_del_on_close, + context->info_pool, pool)); + SVN_ERR(svn_io_open_unique_file3(&context->file_props_file, NULL, temp_dir, + svn_io_file_del_on_close, + context->info_pool, pool)); + SVN_ERR(svn_io_open_unique_file3(&context->dir_props_file, NULL, temp_dir, + svn_io_file_del_on_close, + context->info_pool, pool)); + SVN_ERR(svn_io_open_unique_file3(&context->reps_file, NULL, temp_dir, + svn_io_file_del_on_close, + context->info_pool, pool)); + context->paths = svn_prefix_tree__create(context->info_pool); + return SVN_NO_ERROR; } @@ -1410,21 +1429,20 @@ append_revision(pack_context_t *context, apr_off_t offset = 0; apr_pool_t *iterpool = svn_pool_create(pool); svn_fs_fs__revision_file_t *rev_file; - apr_finfo_t finfo; - - /* Get the size of the file. */ - const char *path = svn_dirent_join(context->shard_dir, - apr_psprintf(iterpool, "%ld", - context->start_rev), - pool); - SVN_ERR(svn_io_stat(&finfo, path, APR_FINFO_SIZE, pool)); + svn_filesize_t revdata_size; - /* Copy all the bits from the rev file to the end of the pack file. */ + /* Copy all non-index contents the rev file to the end of the pack file. */ SVN_ERR(svn_fs_fs__open_pack_or_rev_file(&rev_file, context->fs, context->start_rev, pool, iterpool)); + + SVN_ERR(svn_fs_fs__auto_read_footer(rev_file)); + revdata_size = rev_file->l2p_offset; + + SVN_ERR(svn_io_file_aligned_seek(rev_file->file, ffd->block_size, NULL, 0, + iterpool)); SVN_ERR(copy_file_data(context, context->pack_file, rev_file->file, - finfo.size, iterpool)); + revdata_size, iterpool)); /* mark the start of a new revision */ SVN_ERR(svn_fs_fs__l2p_proto_index_add_revision(context->proto_l2p_index, @@ -1432,7 +1450,7 @@ append_revision(pack_context_t *context, /* read the phys-to-log index file until we covered the whole rev file. * That index contains enough info to build both target indexes from it. */ - while (offset < finfo.size) + while (offset < revdata_size) { /* read one cluster */ int i; @@ -1456,7 +1474,7 @@ append_revision(pack_context_t *context, /* process entry while inside the rev file */ offset = entry->offset; - if (offset < finfo.size) + if (offset < revdata_size) { entry->offset += context->pack_offset; offset += entry->size; @@ -1470,7 +1488,7 @@ append_revision(pack_context_t *context, } svn_pool_destroy(iterpool); - context->pack_offset += finfo.size; + context->pack_offset += revdata_size; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Dec 1 07:45:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD8FBC5F951; Thu, 1 Dec 2016 07:45:08 +0000 (UTC) (envelope-from peter@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 73FCB1A2B; Thu, 1 Dec 2016 07:45:08 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB17j7Tm098719; Thu, 1 Dec 2016 07:45:07 GMT (envelope-from peter@FreeBSD.org) Received: (from peter@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB17j6f4098703; Thu, 1 Dec 2016 07:45:06 GMT (envelope-from peter@FreeBSD.org) Message-Id: <201612010745.uB17j6f4098703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: peter set sender to peter@FreeBSD.org using -f From: Peter Wemm Date: Thu, 1 Dec 2016 07:45:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r309354 - in vendor/subversion/dist: . subversion/include subversion/include/private subversion/libsvn_client subversion/libsvn_fs_fs subversion/libsvn_fs_x subversion/libsvn_ra_serf su... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 07:45:08 -0000 Author: peter Date: Thu Dec 1 07:45:05 2016 New Revision: 309354 URL: https://svnweb.freebsd.org/changeset/base/309354 Log: Import subversion-1.9.5. This includes a security fix for a component that we do not build, and two potentially useful client side fixes for reintegrate merges and tree conflict handling. See CHANGES for full details. Modified: vendor/subversion/dist/CHANGES vendor/subversion/dist/README vendor/subversion/dist/build-outputs.mk vendor/subversion/dist/configure vendor/subversion/dist/configure.ac vendor/subversion/dist/get-deps.sh vendor/subversion/dist/subversion/include/private/svn_sqlite.h vendor/subversion/dist/subversion/include/svn_version.h vendor/subversion/dist/subversion/libsvn_client/merge.c vendor/subversion/dist/subversion/libsvn_fs_fs/cached_data.c vendor/subversion/dist/subversion/libsvn_fs_fs/caching.c vendor/subversion/dist/subversion/libsvn_fs_fs/fs.c vendor/subversion/dist/subversion/libsvn_fs_fs/fs_fs.c vendor/subversion/dist/subversion/libsvn_fs_fs/low_level.c vendor/subversion/dist/subversion/libsvn_fs_fs/pack.c vendor/subversion/dist/subversion/libsvn_fs_fs/pack.h vendor/subversion/dist/subversion/libsvn_fs_fs/rep-cache-db.h vendor/subversion/dist/subversion/libsvn_fs_fs/rep-cache.c vendor/subversion/dist/subversion/libsvn_fs_fs/rep-cache.h vendor/subversion/dist/subversion/libsvn_fs_fs/transaction.c vendor/subversion/dist/subversion/libsvn_fs_fs/tree.c vendor/subversion/dist/subversion/libsvn_fs_x/rep-cache-db.h vendor/subversion/dist/subversion/libsvn_ra_serf/xml.c vendor/subversion/dist/subversion/libsvn_repos/reporter.c vendor/subversion/dist/subversion/libsvn_repos/repos.c vendor/subversion/dist/subversion/libsvn_subr/config_file.c vendor/subversion/dist/subversion/libsvn_subr/deprecated.c vendor/subversion/dist/subversion/libsvn_subr/gpg_agent.c vendor/subversion/dist/subversion/libsvn_subr/internal_statements.h vendor/subversion/dist/subversion/libsvn_subr/sqlite.c vendor/subversion/dist/subversion/libsvn_subr/sysinfo.c vendor/subversion/dist/subversion/libsvn_subr/win32_crashrpt.c vendor/subversion/dist/subversion/libsvn_subr/xml.c vendor/subversion/dist/subversion/libsvn_wc/conflicts.c vendor/subversion/dist/subversion/libsvn_wc/update_editor.c vendor/subversion/dist/subversion/libsvn_wc/wc-checks.h vendor/subversion/dist/subversion/libsvn_wc/wc-metadata.h vendor/subversion/dist/subversion/libsvn_wc/wc-queries.h vendor/subversion/dist/subversion/svn/info-cmd.c vendor/subversion/dist/subversion/svn/merge-cmd.c vendor/subversion/dist/subversion/svnserve/serve.c Modified: vendor/subversion/dist/CHANGES ============================================================================== --- vendor/subversion/dist/CHANGES Thu Dec 1 05:37:29 2016 (r309353) +++ vendor/subversion/dist/CHANGES Thu Dec 1 07:45:05 2016 (r309354) @@ -1,3 +1,54 @@ +Version 1.9.5 +(29 Nov 2016, from /branches/1.9.x) +http://svn.apache.org/repos/asf/subversion/tags/1.9.5 + + User-visible changes: + - Client-side bugfixes: + * fix accessing non-existent paths during reintegrate merge (r1766699 et al) + * fix handling of newly secured subdirectories in working copy (r1724448) + * info: remove trailing whitespace in --show-item=revision (issue #4660) + * fix recording wrong revisions for tree conflicts (r1734106) + * gpg-agent: improve discovery of gpg-agent sockets (r1766327) + * gpg-agent: fix file descriptor leak (r1766323) + * resolve: fix --accept=mine-full for binary files (issue #4647) + * merge: fix possible crash (issue #4652) + * resolve: fix possible crash (r1748514) + * fix potential crash in Win32 crash reporter (r1663253 et al) + + - Server-side bugfixes: + * fsfs: fix "offset too large" error during pack (issue #4657) + * svnserve: enable hook script environments (r1769152) + * fsfs: fix possible data reconstruction error (issue #4658) + * fix source of spurious 'incoming edit' tree conflicts (r1770108) + * fsfs: improve caching for large directories (r1721285) + * fsfs: fix crash when encountering all-zero checksums (r1759686) + * fsfs: fix potential source of repository corruptions (r1756266) + * mod_dav_svn: fix excessive memory usage with mod_headers/mod_deflate + (issue #3084) + * mod_dav_svn: reduce memory usage during GET requests (r1757529 et al) + * fsfs: fix unexpected "database is locked" errors (r1741096 et al) + * fsfs: fix opening old repositories without db/format files (r1720015) + + - Client-side and server-side bugfixes: + * fix possible crash when reading invalid configuration files (r1715777) + + - Bindings bugfixes: + * swig-pl: do not corrupt "{DATE}" revision variable (r1767768) + * javahl: fix temporary accepting SSL server certificates (r1764851) + * swig-pl: fix possible stack corruption (r1683266, r1683267) + + Developer-visible changes: + - General: + * add zlib discovery through pkg-config (issue #4655) + * fix potential build issue with invalid SVN_LOCALE_DIR (issue #4653) + * ruby: fix test failures with ruby >= 2.2 (r1766621) + * fix link error with --disable-keychain on OS X (r1765385) + * swig: enable building with SWIG >= 3.0.6 (r1721488 et al) + * swig: fix building with -Wdate-time in $CPPFLAGS (r1722164) + * update serf download URI in build scripts (r1700130 et al) + * raise minimal httpd version from 2.0 to 2.2 (r1754193) + + Version 1.9.4 (28 Apr 2016, from /branches/1.9.x) http://svn.apache.org/repos/asf/subversion/tags/1.9.4 @@ -14,6 +65,8 @@ http://svn.apache.org/repos/asf/subversi * ra_serf: fix deleting directories with many files (issue #4557) - Server-side bugfixes: + * mod_authz_svn: fix crash in COPY/MOVE authorization check (CVE-2016-2168) + * svnserve/sasl: fix authenticating users with wrong realm (CVE-2016-2167) * improve documentation for AuthzSVNGroupsFile and groups-db (r1730856) * fsfs: reduce peak memory usage when listing large directories (r1725180) * fsfs: fix a rare source of incomplete dump files and reports (r1717876) @@ -31,8 +84,7 @@ http://svn.apache.org/repos/asf/subversi * fix ruby test suite to work with test-unit gem (r1714790) * allow building against KDE4 without conflict with KDE5 (r1734926) * fix update_tests.py#76 with SVNPathAuthz short_circuit (r1736432) - * build system tweaks: - * tweak how symbolic error names in maintainer mode (r1735179) + * tweak getting symbolic error names in maintainer mode (r1735179) * fix inconsistent behavior of inherited property API (r1717874 et al) - API changes: @@ -882,12 +934,44 @@ http://svn.apache.org/repos/asf/subversi * javahl: allow compiling with a C++11 compiler (r1684412) +Version 1.8.17 +(29 Nov 2016, from /branches/1.8.x) +http://svn.apache.org/repos/asf/subversion/tags/1.8.17 + + User-visible changes: + - Client-side bugfixes: + * fix handling of newly secured subdirectories in working copy (r1724448) + * ra_serf: fix deleting directories with many files (issue #4557) + * svnlook: properly remove tempfiles on diff errors (r1711346) + * gpg-agent: properly handle passwords with percent characters (issue #4611) + * merge: fix crash when merging to a local add (r1702299 et al) + + - Server-side bugfixes: + * fsfs: fix possible data reconstruction error (issue #4658) + + - Client-side and server-side bugfixes: + * fix potential memory access bugs (r1722860 et al) + + - Bindings bugfixes: + * javahl: fix temporary accepting SSL server certificates (r1764851) + * swig-pl: do not corrupt "{DATE}" revision variable (r1767768) + * swig-pl: fix possible stack corruption (r1683266) + + Developer-visible changes: + - General: + * fix inconsistent behavior of inherited property API (r1717875, r1717878) + * fix patch filter invocation in svn_client_patch() (r1706783) + * fix potential build issue with invalid SVN_LOCALE_DIR (issue #4653) + + Version 1.8.16 (28 Apr 2016, from /branches/1.8.x) http://svn.apache.org/repos/asf/subversion/tags/1.8.16 User-visible changes: - Server-side bugfixes: + * mod_authz_svn: fix crash in COPY/MOVE authorization check (CVE-2016-2168) + * svnserve/sasl: fix authenticating users with wrong realm (CVE-2016-2167) * mod_authz_svn: fix authz with mod_auth_kerb/mod_auth_ntlm (issue #4602) * dump: don't write broken dump files in some ambiguously encoded fsfs repositories (issue #4554) @@ -1641,7 +1725,7 @@ http://svn.apache.org/repos/asf/subversi * fix bug in mergeinfo recording during foreign-repos merge (r1430310) * fix spurious merge conflicts for binary files with keywords (issue #4221) * fix patching symlinks with 'svn patch' (issue #4273) - * make 'svn switch' refresh lock information (issue #3376) + * make 'svn switch' refresh lock information (issue #3378) * fix 'svn diff' output doesn't apply as patch without fuzz (issue #3362) * fix mergeinfo recording for multiple-revision-range merge (issue #4306) * fix diffs shown by 'show-diff' conflict prompt option (r1438879) Modified: vendor/subversion/dist/README ============================================================================== --- vendor/subversion/dist/README Thu Dec 1 05:37:29 2016 (r309353) +++ vendor/subversion/dist/README Thu Dec 1 07:45:05 2016 (r309354) @@ -2,7 +2,7 @@ Subversion, a version control system. ===================================== -$LastChangedDate: 2012-02-10 14:58:53 +0000 (Fri, 10 Feb 2012) $ +$LastChangedDate: 2016-05-31 16:08:20 +0000 (Tue, 31 May 2016) $ Contents: @@ -36,10 +36,10 @@ II. DOCUMENTATION It is written in DocBook XML, and the sources can be found at: - http://svnbook.googlecode.com/svn/trunk/ + http://svn.code.sf.net/p/svnbook/source/trunk/ If you wish to build the documentation from source, read the - src/en/README file within the book source. + en/README file within the book source. Modified: vendor/subversion/dist/build-outputs.mk ============================================================================== --- vendor/subversion/dist/build-outputs.mk Thu Dec 1 05:37:29 2016 (r309353) +++ vendor/subversion/dist/build-outputs.mk Thu Dec 1 07:45:05 2016 (r309354) @@ -3351,7 +3351,7 @@ subversion/tests/libsvn_diff/diff-diff3- subversion/tests/libsvn_diff/parse-diff-test.lo: subversion/tests/libsvn_diff/parse-diff-test.c subversion/include/private/svn_debug.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_utf.h subversion/tests/svn_test.h -subversion/tests/libsvn_fs/fs-test.lo: subversion/tests/libsvn_fs/fs-test.c subversion/include/private/svn_debug.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_fs_util.h subversion/include/private/svn_fspath.h subversion/include/private/svn_mutex.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_time.h subversion/include/svn_types.h subversion/include/svn_version.h subversion/libsvn_delta/delta.h subversion/libsvn_fs/fs-loader.h subversion/s vn_private_config.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h +subversion/tests/libsvn_fs/fs-test.lo: subversion/tests/libsvn_fs/fs-test.c subversion/include/private/svn_debug.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_fs_util.h subversion/include/private/svn_fspath.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_time.h subversion/include/svn_types.h subversion/include/svn_version. h subversion/libsvn_delta/delta.h subversion/libsvn_fs/fs-loader.h subversion/svn_private_config.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h subversion/tests/libsvn_fs/locks-test.lo: subversion/tests/libsvn_fs/locks-test.c subversion/include/private/svn_debug.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h @@ -3363,7 +3363,7 @@ subversion/tests/libsvn_fs_base/strings- subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.lo: subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.c subversion/include/private/svn_atomic.h subversion/include/private/svn_cache.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_fs_private.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_string_private.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_iter.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_poo ls.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/libsvn_fs_fs/fs.h subversion/libsvn_fs_fs/fs_fs.h subversion/libsvn_fs_fs/id.h subversion/libsvn_fs_fs/rev_file.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h -subversion/tests/libsvn_fs_fs/fs-fs-pack-test.lo: subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c subversion/include/private/svn_atomic.h subversion/include/private/svn_cache.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_fs_private.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_string_private.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_iter.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools .h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/libsvn_fs/fs-loader.h subversion/libsvn_fs_fs/fs.h subversion/libsvn_fs_fs/fs_fs.h subversion/libsvn_fs_fs/id.h subversion/libsvn_fs_fs/low_level.h subversion/libsvn_fs_fs/util.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h +subversion/tests/libsvn_fs_fs/fs-fs-pack-test.lo: subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c subversion/include/private/svn_atomic.h subversion/include/private/svn_cache.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_fs_private.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_string_private.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_iter.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools .h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/libsvn_fs/fs-loader.h subversion/libsvn_fs_fs/fs.h subversion/libsvn_fs_fs/fs_fs.h subversion/libsvn_fs_fs/id.h subversion/libsvn_fs_fs/low_level.h subversion/libsvn_fs_fs/pack.h subversion/libsvn_fs_fs/util.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h subversion/tests/libsvn_fs_fs/fs-fs-private-test.lo: subversion/tests/libsvn_fs_fs/fs-fs-private-test.c subversion/include/private/svn_atomic.h subversion/include/private/svn_cache.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_fs_private.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_string_private.h subversion/include/private/svn_subr_private.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_iter.h subversion/include/svn_mergeinfo.h subver sion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/libsvn_fs_fs/fs.h subversion/libsvn_fs_fs/id.h subversion/libsvn_fs_fs/index.h subversion/libsvn_fs_fs/rev_file.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h Modified: vendor/subversion/dist/configure ============================================================================== --- vendor/subversion/dist/configure Thu Dec 1 05:37:29 2016 (r309353) +++ vendor/subversion/dist/configure Thu Dec 1 07:45:05 2016 (r309354) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for subversion 1.9.4. +# Generated by GNU Autoconf 2.69 for subversion 1.9.5. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='subversion' PACKAGE_TARNAME='subversion' -PACKAGE_VERSION='1.9.4' -PACKAGE_STRING='subversion 1.9.4' +PACKAGE_VERSION='1.9.5' +PACKAGE_STRING='subversion 1.9.5' PACKAGE_BUGREPORT='http://subversion.apache.org/' PACKAGE_URL='' @@ -1471,7 +1471,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures subversion 1.9.4 to adapt to many kinds of systems. +\`configure' configures subversion 1.9.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1537,7 +1537,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of subversion 1.9.4:";; + short | recursive ) echo "Configuration of subversion 1.9.5:";; esac cat <<\_ACEOF @@ -1751,7 +1751,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -subversion configure 1.9.4 +subversion configure 1.9.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2295,7 +2295,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by subversion $as_me 1.9.4, which was +It was created by subversion $as_me 1.9.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2675,8 +2675,8 @@ ac_configure="$SHELL $ac_aux_dir/configu -{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring Subversion 1.9.4" >&5 -$as_echo "$as_me: Configuring Subversion 1.9.4" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring Subversion 1.9.5" >&5 +$as_echo "$as_me: Configuring Subversion 1.9.5" >&6;} abs_srcdir="`cd $srcdir && pwd`" @@ -7422,7 +7422,10 @@ _ACEOF localedir='${datadir}/locale' -if test "${datadir}" = '${prefix}/share' && test "${prefix}" = "NONE"; then +if test "${prefix}" = "NONE" \ + && ( test "${datadir}" = '${prefix}/share' \ + || ( test "${datadir}" = '${datarootdir}' \ + && test "${datarootdir}" = '${prefix}/share' ) ); then exp_localedir='${ac_default_prefix}/share/locale' else exp_localedir=$localedir @@ -22550,68 +22553,34 @@ fi zlib_found=no + zlib_skip=no # Check whether --with-zlib was given. if test "${with_zlib+set}" = set; then : withval=$with_zlib; - if test "$withval" = "yes" ; then - ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" -if test "x$ac_cv_header_zlib_h" = xyes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 -$as_echo_n "checking for inflate in -lz... " >&6; } -if ${ac_cv_lib_z_inflate+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lz $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + if test "$withval" = "yes"; then + zlib_skip=no + elif test "$withval" = "no"; then + zlib_skip=yes + else + zlib_skip=no + zlib_prefix="$withval" + fi -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char inflate (); -int -main () -{ -return inflate (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_z_inflate=yes -else - ac_cv_lib_z_inflate=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5 -$as_echo "$ac_cv_lib_z_inflate" >&6; } -if test "x$ac_cv_lib_z_inflate" = xyes; then : - zlib_found="builtin" fi -fi - + if test "$zlib_skip" = "yes"; then + as_fn_error $? "subversion requires zlib" "$LINENO" 5 + fi - elif test "$withval" = "no" ; then - as_fn_error $? "cannot compile without zlib." "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: zlib library configuration" >&5 -$as_echo "$as_me: zlib library configuration" >&6;} - zlib_prefix=$withval - save_cppflags="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I$zlib_prefix/include" - for ac_header in zlib.h + if test -n "$zlib_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: zlib library configuration via prefix" >&5 +$as_echo "$as_me: zlib library configuration via prefix" >&6;} + save_cppflags="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -I$zlib_prefix/include" + for ac_header in zlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" if test "x$ac_cv_header_zlib_h" = xyes; then : @@ -22619,9 +22588,9 @@ if test "x$ac_cv_header_zlib_h" = xyes; #define HAVE_ZLIB_H 1 _ACEOF - save_ldflags="$LDFLAGS" - LDFLAGS="$LDFLAGS -L$zlib_prefix/lib" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 + save_ldflags="$LDFLAGS" + LDFLAGS="$LDFLAGS -L$zlib_prefix/lib" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 $as_echo_n "checking for inflate in -lz... " >&6; } if ${ac_cv_lib_z_inflate+:} false; then : $as_echo_n "(cached) " >&6 @@ -22658,24 +22627,86 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5 $as_echo "$ac_cv_lib_z_inflate" >&6; } if test "x$ac_cv_lib_z_inflate" = xyes; then : - zlib_found="yes" + + zlib_found="yes" + SVN_ZLIB_INCLUDES="-I$zlib_prefix/include" + SVN_ZLIB_LIBS="` + input_flags="-L$zlib_prefix/lib" + output_flags="" + filtered_dirs="/lib /lib64 /usr/lib /usr/lib64" + for flag in $input_flags; do + filter="no" + for dir in $filtered_dirs; do + if test "$flag" = "-L$dir" || test "$flag" = "-L$dir/"; then + filter="yes" + break + fi + done + if test "$filter" = "no"; then + output_flags="$output_flags $flag" + fi + done + if test -n "$output_flags"; then + printf "%s" "${output_flags# }" + fi +` -lz" + fi - LDFLAGS="$save_ldflags" + LDFLAGS="$save_ldflags" fi done - CPPFLAGS="$save_cppflags" + CPPFLAGS="$save_cppflags" + else + + { $as_echo "$as_me:${as_lineno-$LINENO}: zlib library configuration via pkg-config" >&5 +$as_echo "$as_me: zlib library configuration via pkg-config" >&6;} + if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlib library" >&5 +$as_echo_n "checking for zlib library... " >&6; } + if $PKG_CONFIG zlib --exists; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + zlib_found=yes + SVN_ZLIB_INCLUDES=`$PKG_CONFIG zlib --cflags` + SVN_ZLIB_LIBS=`$PKG_CONFIG zlib --libs` + SVN_ZLIB_LIBS="` + input_flags="$SVN_ZLIB_LIBS" + output_flags="" + filtered_dirs="/lib /lib64 /usr/lib /usr/lib64" + for flag in $input_flags; do + filter="no" + for dir in $filtered_dirs; do + if test "$flag" = "-L$dir" || test "$flag" = "-L$dir/"; then + filter="yes" + break + fi + done + if test "$filter" = "no"; then + output_flags="$output_flags $flag" + fi + done + if test -n "$output_flags"; then + printf "%s" "${output_flags# }" + fi +`" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi -else - ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" + if test "$zlib_found" = "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: zlib library configuration" >&5 +$as_echo "$as_me: zlib library configuration" >&6;} + ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" if test "x$ac_cv_header_zlib_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 $as_echo_n "checking for inflate in -lz... " >&6; } if ${ac_cv_lib_z_inflate+:} false; then : $as_echo_n "(cached) " >&6 @@ -22712,46 +22743,22 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5 $as_echo "$ac_cv_lib_z_inflate" >&6; } if test "x$ac_cv_lib_z_inflate" = xyes; then : - zlib_found="builtin" -fi + zlib_found="builtin" + SVN_ZLIB_LIBS="-lz" fi - fi - if test "$zlib_found" = "no"; then - as_fn_error $? "subversion requires zlib" "$LINENO" 5 - fi - - if test "$zlib_found" = "yes"; then - SVN_ZLIB_INCLUDES="-I$zlib_prefix/include" - LDFLAGS="$LDFLAGS ` - input_flags="-L$zlib_prefix/lib" - output_flags="" - filtered_dirs="/lib /lib64 /usr/lib /usr/lib64" - for flag in $input_flags; do - filter="no" - for dir in $filtered_dirs; do - if test "$flag" = "-L$dir" || test "$flag" = "-L$dir/"; then - filter="yes" - break - fi - done - if test "$filter" = "no"; then - output_flags="$output_flags $flag" fi - done - if test -n "$output_flags"; then - printf "%s" "${output_flags# }" - fi -`" fi - SVN_ZLIB_LIBS="-lz" + if test "$zlib_found" = "no"; then + as_fn_error $? "subversion requires zlib" "$LINENO" 5 + fi @@ -23785,15 +23792,14 @@ $as_echo "$SWIG_VERSION_RAW" >&6; } # packages/rpm/redhat-7.x/subversion.spec # packages/rpm/rhel-3/subversion.spec # packages/rpm/rhel-4/subversion.spec - if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" && \ - test "$SWIG_VERSION" -lt "300000"; then + if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024"; then SWIG_SUITABLE=yes else SWIG_SUITABLE=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&5 $as_echo "$as_me: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&5 -$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24" >&5 +$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24" >&2;} fi fi @@ -24274,15 +24280,14 @@ $as_echo "$SWIG_VERSION_RAW" >&6; } # packages/rpm/redhat-7.x/subversion.spec # packages/rpm/rhel-3/subversion.spec # packages/rpm/rhel-4/subversion.spec - if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" && \ - test "$SWIG_VERSION" -lt "300000"; then + if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024"; then SWIG_SUITABLE=yes else SWIG_SUITABLE=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&5 $as_echo "$as_me: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&5 -$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24" >&5 +$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24" >&2;} fi fi @@ -24763,15 +24768,14 @@ $as_echo "$SWIG_VERSION_RAW" >&6; } # packages/rpm/redhat-7.x/subversion.spec # packages/rpm/rhel-3/subversion.spec # packages/rpm/rhel-4/subversion.spec - if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" && \ - test "$SWIG_VERSION" -lt "300000"; then + if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024"; then SWIG_SUITABLE=yes else SWIG_SUITABLE=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&5 $as_echo "$as_me: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&5 -$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24" >&5 +$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24" >&2;} fi fi @@ -25255,15 +25259,14 @@ $as_echo "$SWIG_VERSION_RAW" >&6; } # packages/rpm/redhat-7.x/subversion.spec # packages/rpm/rhel-3/subversion.spec # packages/rpm/rhel-4/subversion.spec - if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" && \ - test "$SWIG_VERSION" -lt "300000"; then + if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024"; then SWIG_SUITABLE=yes else SWIG_SUITABLE=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&5 $as_echo "$as_me: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&5 -$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24" >&5 +$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24" >&2;} fi fi @@ -26152,6 +26155,9 @@ SWIG_CPPFLAGS="$CPPFLAGS" SWIG_CPPFLAGS=`echo "$SWIG_CPPFLAGS" | $SED -e 's/-no-cpp-precomp //'` + SWIG_CPPFLAGS=`echo "$SWIG_CPPFLAGS" | $SED -e 's/-Wdate-time //'` + + cat >>confdefs.h <<_ACEOF @@ -26750,7 +26756,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by subversion $as_me 1.9.4, which was +This file was extended by subversion $as_me 1.9.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -26816,7 +26822,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -subversion config.status 1.9.4 +subversion config.status 1.9.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: vendor/subversion/dist/configure.ac ============================================================================== --- vendor/subversion/dist/configure.ac Thu Dec 1 05:37:29 2016 (r309353) +++ vendor/subversion/dist/configure.ac Thu Dec 1 07:45:05 2016 (r309354) @@ -199,7 +199,10 @@ localedir='${datadir}/locale' AC_SUBST(localedir) dnl For SVN_LOCALE_DIR, we have to expand it to something. See SVN_BINDIR. -if test "${datadir}" = '${prefix}/share' && test "${prefix}" = "NONE"; then +if test "${prefix}" = "NONE" \ + && ( test "${datadir}" = '${prefix}/share' \ + || ( test "${datadir}" = '${datarootdir}' \ + && test "${datarootdir}" = '${prefix}/share' ) ); then exp_localedir='${ac_default_prefix}/share/locale' else exp_localedir=$localedir @@ -1504,6 +1507,7 @@ fi # Need to strip '-no-cpp-precomp' from CPPFLAGS for SWIG as well. SWIG_CPPFLAGS="$CPPFLAGS" SVN_STRIP_FLAG(SWIG_CPPFLAGS, [-no-cpp-precomp ]) +SVN_STRIP_FLAG(SWIG_CPPFLAGS, [-Wdate-time ]) AC_SUBST([SWIG_CPPFLAGS]) dnl Since this is used only on Unix-y systems, define the path separator as '/' Modified: vendor/subversion/dist/get-deps.sh ============================================================================== --- vendor/subversion/dist/get-deps.sh Thu Dec 1 05:37:29 2016 (r309353) +++ vendor/subversion/dist/get-deps.sh Thu Dec 1 07:45:05 2016 (r309354) @@ -89,7 +89,7 @@ get_serf() { test -d $BASEDIR/serf && return cd $TEMPDIR - $HTTP_FETCH http://serf.googlecode.com/svn/src_releases/$SERF.tar.bz2 + $HTTP_FETCH https://archive.apache.org/dist/serf/$SERF.tar.bz2 cd $BASEDIR bzip2 -dc $TEMPDIR/$SERF.tar.bz2 | tar -xf - Modified: vendor/subversion/dist/subversion/include/private/svn_sqlite.h ============================================================================== --- vendor/subversion/dist/subversion/include/private/svn_sqlite.h Thu Dec 1 05:37:29 2016 (r309353) +++ vendor/subversion/dist/subversion/include/private/svn_sqlite.h Thu Dec 1 07:45:05 2016 (r309354) @@ -555,6 +555,9 @@ svn_sqlite__hotcopy(const char *src_path const char *dst_path, apr_pool_t *scratch_pool); +/* Backported version of SVN_ERR_SQLITE_ROLLBACK_FAILED. */ +#define SVN_SQLITE__ERR_ROLLBACK_FAILED (SVN_ERR_MISC_CATEGORY_START + 44) + #ifdef __cplusplus } #endif /* __cplusplus */ Modified: vendor/subversion/dist/subversion/include/svn_version.h ============================================================================== --- vendor/subversion/dist/subversion/include/svn_version.h Thu Dec 1 05:37:29 2016 (r309353) +++ vendor/subversion/dist/subversion/include/svn_version.h Thu Dec 1 07:45:05 2016 (r309354) @@ -70,7 +70,7 @@ extern "C" { * * @since New in 1.1. */ -#define SVN_VER_PATCH 4 +#define SVN_VER_PATCH 5 /** @deprecated Provided for backward compatibility with the 1.0 API. */ @@ -93,7 +93,7 @@ extern "C" { * * Always change this at the same time as SVN_VER_NUMTAG. */ -#define SVN_VER_TAG " (r1740329)" +#define SVN_VER_TAG " (r1770682)" /** Number tag: a string describing the version. @@ -117,7 +117,7 @@ extern "C" { * file version. Its value remains 0 in the repository except in release * tags where it is the revision from which the tag was created. */ -#define SVN_VER_REVISION 1740329 +#define SVN_VER_REVISION 1770682 /* Version strings composed from the above definitions. */ Modified: vendor/subversion/dist/subversion/libsvn_client/merge.c ============================================================================== --- vendor/subversion/dist/subversion/libsvn_client/merge.c Thu Dec 1 05:37:29 2016 (r309353) +++ vendor/subversion/dist/subversion/libsvn_client/merge.c Thu Dec 1 07:45:05 2016 (r309354) @@ -1295,6 +1295,15 @@ record_skip(merge_cmd_baton_t *merge_b, return SVN_NO_ERROR; } +/* Forward declaration */ +static svn_client__merge_path_t * +find_nearest_ancestor_with_intersecting_ranges( + svn_revnum_t *start, + svn_revnum_t *end, + const apr_array_header_t *children_with_mergeinfo, + svn_boolean_t path_is_own_ancestor, + const char *local_abspath); + /* Record a tree conflict in the WC, unless this is a dry run or a record- * only merge, or if a tree conflict is already flagged for the VICTIM_PATH. * (The latter can happen if a merge-tracking-aware merge is doing multiple @@ -1366,11 +1375,45 @@ record_tree_conflict(merge_cmd_baton_t * reason = svn_wc_conflict_reason_moved_here; } - SVN_ERR(make_conflict_versions(&left, &right, local_abspath, - merge_left_node_kind, - merge_right_node_kind, - &merge_b->merge_source, merge_b->target, - result_pool, scratch_pool)); + if (HONOR_MERGEINFO(merge_b) && merge_b->merge_source.ancestral) + { + struct merge_source_t *source; + svn_client__pathrev_t *loc1; + svn_client__pathrev_t *loc2; + svn_merge_range_t range = + {SVN_INVALID_REVNUM, SVN_INVALID_REVNUM, TRUE}; + + /* We are honoring mergeinfo so do not blindly record + * a conflict describing the merge of + * SOURCE->LOC1->URL@SOURCE->LOC1->REV through + * SOURCE->LOC2->URL@SOURCE->LOC2->REV + * but figure out the actual revision range merged. */ + (void)find_nearest_ancestor_with_intersecting_ranges( + &(range.start), &(range.end), + merge_b->notify_begin.nodes_with_mergeinfo, + action != svn_wc_conflict_action_delete, + local_abspath); + loc1 = svn_client__pathrev_dup(merge_b->merge_source.loc1, + scratch_pool); + loc2 = svn_client__pathrev_dup(merge_b->merge_source.loc2, + scratch_pool); + loc1->rev = range.start; + loc2->rev = range.end; + source = merge_source_create(loc1, loc2, + merge_b->merge_source.ancestral, + scratch_pool); + SVN_ERR(make_conflict_versions(&left, &right, local_abspath, + merge_left_node_kind, + merge_right_node_kind, + source, merge_b->target, + result_pool, scratch_pool)); + } + else + SVN_ERR(make_conflict_versions(&left, &right, local_abspath, + merge_left_node_kind, + merge_right_node_kind, + &merge_b->merge_source, merge_b->target, + result_pool, scratch_pool)); /* Fix up delete of file, add of dir replacement (or other way around) */ if (existing_conflict != NULL && existing_conflict->src_left_version) @@ -10956,7 +10999,7 @@ find_unsynced_ranges(const svn_client__p potentially_unmerged_ranges->nelts - 1, svn_merge_range_t *))->end; log_find_operative_baton_t log_baton; - const char *old_session_url; + const char *old_session_url = NULL; svn_error_t *err; log_baton.merged_catalog = merged_catalog; @@ -10967,14 +11010,22 @@ find_unsynced_ranges(const svn_client__p = svn_client__pathrev_fspath(target_loc, scratch_pool); log_baton.result_pool = result_pool; - SVN_ERR(svn_client__ensure_ra_session_url( - &old_session_url, ra_session, target_loc->url, scratch_pool)); + /* Reparent the session to TARGET_LOC if this target location + * exists within the unmerged revision range. */ + if (target_loc->rev <= youngest_rev && target_loc->rev >= oldest_rev) + SVN_ERR(svn_client__ensure_ra_session_url( + &old_session_url, ra_session, target_loc->url, scratch_pool)); + err = get_log(ra_session, "", youngest_rev, oldest_rev, TRUE, /* discover_changed_paths */ log_find_operative_revs, &log_baton, scratch_pool); - SVN_ERR(svn_error_compose_create( - err, svn_ra_reparent(ra_session, old_session_url, scratch_pool))); + if (old_session_url) + err = svn_error_compose_create(err, + svn_ra_reparent(ra_session, + old_session_url, + scratch_pool)); + SVN_ERR(err); } return SVN_NO_ERROR; Modified: vendor/subversion/dist/subversion/libsvn_fs_fs/cached_data.c ============================================================================== --- vendor/subversion/dist/subversion/libsvn_fs_fs/cached_data.c Thu Dec 1 05:37:29 2016 (r309353) +++ vendor/subversion/dist/subversion/libsvn_fs_fs/cached_data.c Thu Dec 1 07:45:05 2016 (r309354) @@ -1571,6 +1571,17 @@ read_plain_window(svn_stringbuf_t **nwin return SVN_NO_ERROR; } +/* Skip SIZE bytes from the PLAIN representation RS. */ +static svn_error_t * +skip_plain_window(rep_state_t *rs, + apr_size_t size) +{ + /* Update RS. */ + rs->current += (apr_off_t)size; + + return SVN_NO_ERROR; +} + /* Get the undeltified window that is a result of combining all deltas from the current desired representation identified in *RB with its base representation. Store the window in *RESULT. */ @@ -1628,9 +1639,18 @@ get_combined_window(svn_stringbuf_t **re Also note that we may have short-cut reading the delta chain -- in which case SRC_OPS is 0 and it might not be a PLAIN rep. */ source = buf; - if (source == NULL && rb->src_state != NULL && window->src_ops) - SVN_ERR(read_plain_window(&source, rb->src_state, window->sview_len, - pool, iterpool)); + if (source == NULL && rb->src_state != NULL) + { + /* Even if we don't need the source rep now, we still must keep + * its read offset in sync with what we might need for the next + * window. */ + if (window->src_ops) + SVN_ERR(read_plain_window(&source, rb->src_state, + window->sview_len, + pool, iterpool)); + else + SVN_ERR(skip_plain_window(rb->src_state, window->sview_len)); + } /* Combine this window with the current one. */ new_pool = svn_pool_create(rb->pool); Modified: vendor/subversion/dist/subversion/libsvn_fs_fs/caching.c ============================================================================== --- vendor/subversion/dist/subversion/libsvn_fs_fs/caching.c Thu Dec 1 05:37:29 2016 (r309353) +++ vendor/subversion/dist/subversion/libsvn_fs_fs/caching.c Thu Dec 1 07:45:05 2016 (r309354) @@ -430,7 +430,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f svn_fs_fs__deserialize_dir_entries, sizeof(pair_cache_key_t), apr_pstrcat(pool, prefix, "DIR", SVN_VA_NULL), - SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY, + SVN_CACHE__MEMBUFFER_HIGH_PRIORITY, fs, no_handler, fs->pool, pool)); @@ -806,7 +806,7 @@ svn_fs_fs__initialize_txn_caches(svn_fs_ APR_HASH_KEY_STRING, apr_pstrcat(pool, prefix, "TXNDIR", SVN_VA_NULL), - 0, + SVN_CACHE__MEMBUFFER_HIGH_PRIORITY, fs, TRUE, pool, pool)); Modified: vendor/subversion/dist/subversion/libsvn_fs_fs/fs.c ============================================================================== --- vendor/subversion/dist/subversion/libsvn_fs_fs/fs.c Thu Dec 1 05:37:29 2016 (r309353) +++ vendor/subversion/dist/subversion/libsvn_fs_fs/fs.c Thu Dec 1 07:45:05 2016 (r309354) @@ -452,7 +452,7 @@ fs_pack(svn_fs_t *fs, apr_pool_t *common_pool) { SVN_ERR(fs_open(fs, path, common_pool_lock, pool, common_pool)); - return svn_fs_fs__pack(fs, notify_func, notify_baton, + return svn_fs_fs__pack(fs, 0, notify_func, notify_baton, cancel_func, cancel_baton, pool); } Modified: vendor/subversion/dist/subversion/libsvn_fs_fs/fs_fs.c ============================================================================== --- vendor/subversion/dist/subversion/libsvn_fs_fs/fs_fs.c Thu Dec 1 05:37:29 2016 (r309353) +++ vendor/subversion/dist/subversion/libsvn_fs_fs/fs_fs.c Thu Dec 1 07:45:05 2016 (r309354) @@ -492,6 +492,7 @@ read_format(int *pformat, svn_error_clear(err); *pformat = 1; *max_files_per_dir = 0; + *use_log_addressing = FALSE; return SVN_NO_ERROR; } Modified: vendor/subversion/dist/subversion/libsvn_fs_fs/low_level.c ============================================================================== --- vendor/subversion/dist/subversion/libsvn_fs_fs/low_level.c Thu Dec 1 05:37:29 2016 (r309353) +++ vendor/subversion/dist/subversion/libsvn_fs_fs/low_level.c Thu Dec 1 07:45:05 2016 (r309354) @@ -764,7 +764,11 @@ svn_fs_fs__parse_representation(represen SVN_ERR(svn_checksum_parse_hex(&checksum, svn_checksum_md5, str, scratch_pool)); - memcpy(rep->md5_digest, checksum->digest, sizeof(rep->md5_digest)); + + /* If STR is a all-zero checksum, CHECKSUM will be NULL and REP already + contains the correct value. */ + if (checksum) + memcpy(rep->md5_digest, checksum->digest, sizeof(rep->md5_digest)); /* The remaining fields are only used for formats >= 4, so check that. */ str = svn_cstring_tokenize(" ", &string); @@ -778,8 +782,16 @@ svn_fs_fs__parse_representation(represen SVN_ERR(svn_checksum_parse_hex(&checksum, svn_checksum_sha1, str, scratch_pool)); + + /* We do have a valid SHA1 but it might be all 0. + We cannot be sure where that came from (Alas! legacy), so let's not + claim we know the SHA1 in that case. */ rep->has_sha1 = checksum != NULL; - memcpy(rep->sha1_digest, checksum->digest, sizeof(rep->sha1_digest)); + + /* If STR is a all-zero checksum, CHECKSUM will be NULL and REP already + contains the correct value. */ + if (checksum) + memcpy(rep->sha1_digest, checksum->digest, sizeof(rep->sha1_digest)); /* Read the uniquifier. */ str = svn_cstring_tokenize("/", &string); Modified: vendor/subversion/dist/subversion/libsvn_fs_fs/pack.c ============================================================================== --- vendor/subversion/dist/subversion/libsvn_fs_fs/pack.c Thu Dec 1 05:37:29 2016 (r309353) +++ vendor/subversion/dist/subversion/libsvn_fs_fs/pack.c Thu Dec 1 07:45:05 2016 (r309354) @@ -335,21 +335,40 @@ static svn_error_t * reset_pack_context(pack_context_t *context, apr_pool_t *pool) { + const char *temp_dir; + apr_array_clear(context->changes); - SVN_ERR(svn_io_file_trunc(context->changes_file, 0, pool)); + SVN_ERR(svn_io_file_close(context->changes_file, pool)); apr_array_clear(context->file_props); - SVN_ERR(svn_io_file_trunc(context->file_props_file, 0, pool)); + SVN_ERR(svn_io_file_close(context->file_props_file, pool)); apr_array_clear(context->dir_props); - SVN_ERR(svn_io_file_trunc(context->dir_props_file, 0, pool)); + SVN_ERR(svn_io_file_close(context->dir_props_file, pool)); apr_array_clear(context->rev_offsets); apr_array_clear(context->path_order); apr_array_clear(context->references); apr_array_clear(context->reps); - SVN_ERR(svn_io_file_trunc(context->reps_file, 0, pool)); + SVN_ERR(svn_io_file_close(context->reps_file, pool)); svn_pool_clear(context->info_pool); + /* The new temporary files must live at least as long as any other info + * object in CONTEXT. */ + SVN_ERR(svn_io_temp_dir(&temp_dir, pool)); + SVN_ERR(svn_io_open_unique_file3(&context->changes_file, NULL, temp_dir, + svn_io_file_del_on_close, + context->info_pool, pool)); + SVN_ERR(svn_io_open_unique_file3(&context->file_props_file, NULL, temp_dir, + svn_io_file_del_on_close, + context->info_pool, pool)); + SVN_ERR(svn_io_open_unique_file3(&context->dir_props_file, NULL, temp_dir, + svn_io_file_del_on_close, + context->info_pool, pool)); + SVN_ERR(svn_io_open_unique_file3(&context->reps_file, NULL, temp_dir, + svn_io_file_del_on_close, + context->info_pool, pool)); + context->paths = svn_prefix_tree__create(context->info_pool); + return SVN_NO_ERROR; } @@ -1410,21 +1429,20 @@ append_revision(pack_context_t *context, apr_off_t offset = 0; apr_pool_t *iterpool = svn_pool_create(pool); svn_fs_fs__revision_file_t *rev_file; - apr_finfo_t finfo; - - /* Get the size of the file. */ - const char *path = svn_dirent_join(context->shard_dir, - apr_psprintf(iterpool, "%ld", - context->start_rev), - pool); - SVN_ERR(svn_io_stat(&finfo, path, APR_FINFO_SIZE, pool)); + svn_filesize_t revdata_size; - /* Copy all the bits from the rev file to the end of the pack file. */ + /* Copy all non-index contents the rev file to the end of the pack file. */ SVN_ERR(svn_fs_fs__open_pack_or_rev_file(&rev_file, context->fs, context->start_rev, pool, iterpool)); + + SVN_ERR(svn_fs_fs__auto_read_footer(rev_file)); + revdata_size = rev_file->l2p_offset; + + SVN_ERR(svn_io_file_aligned_seek(rev_file->file, ffd->block_size, NULL, 0, + iterpool)); SVN_ERR(copy_file_data(context, context->pack_file, rev_file->file, - finfo.size, iterpool)); + revdata_size, iterpool)); /* mark the start of a new revision */ SVN_ERR(svn_fs_fs__l2p_proto_index_add_revision(context->proto_l2p_index, @@ -1432,7 +1450,7 @@ append_revision(pack_context_t *context, /* read the phys-to-log index file until we covered the whole rev file. * That index contains enough info to build both target indexes from it. */ - while (offset < finfo.size) + while (offset < revdata_size) { /* read one cluster */ int i; @@ -1456,7 +1474,7 @@ append_revision(pack_context_t *context, /* process entry while inside the rev file */ offset = entry->offset; - if (offset < finfo.size) + if (offset < revdata_size) { entry->offset += context->pack_offset; offset += entry->size; @@ -1470,7 +1488,7 @@ append_revision(pack_context_t *context, } svn_pool_destroy(iterpool); - context->pack_offset += finfo.size; + context->pack_offset += revdata_size; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Dec 1 07:46:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 867A1C5FB75; Thu, 1 Dec 2016 07:46:25 +0000 (UTC) (envelope-from peter@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 398001B48; Thu, 1 Dec 2016 07:46:25 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB17kOOJ098805; Thu, 1 Dec 2016 07:46:24 GMT (envelope-from peter@FreeBSD.org) Received: (from peter@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB17kOD5098804; Thu, 1 Dec 2016 07:46:24 GMT (envelope-from peter@FreeBSD.org) Message-Id: <201612010746.uB17kOD5098804@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: peter set sender to peter@FreeBSD.org using -f From: Peter Wemm Date: Thu, 1 Dec 2016 07:46:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r309355 - vendor/subversion/subversion-1.9.5 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 07:46:25 -0000 Author: peter Date: Thu Dec 1 07:46:24 2016 New Revision: 309355 URL: https://svnweb.freebsd.org/changeset/base/309355 Log: Tag import of subversion-1.9.5 Added: vendor/subversion/subversion-1.9.5/ - copied from r309354, vendor/subversion/dist/ From owner-svn-src-all@freebsd.org Thu Dec 1 09:14:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7756BC6094A; Thu, 1 Dec 2016 09:14:59 +0000 (UTC) (envelope-from n_hibma@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 3198519DD; Thu, 1 Dec 2016 09:14:59 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB19EwXd035159; Thu, 1 Dec 2016 09:14:58 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB19EwW2035158; Thu, 1 Dec 2016 09:14:58 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <201612010914.uB19EwW2035158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: n_hibma set sender to n_hibma@FreeBSD.org using -f From: Nick Hibma Date: Thu, 1 Dec 2016 09:14:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309357 - head/usr.sbin/i2c X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 09:14:59 -0000 Author: n_hibma Date: Thu Dec 1 09:14:58 2016 New Revision: 309357 URL: https://svnweb.freebsd.org/changeset/base/309357 Log: Speling fixes and fix line endings for err_msg output. In some cases there was not \n, in other cases there was. Modified: head/usr.sbin/i2c/i2c.c Modified: head/usr.sbin/i2c/i2c.c ============================================================================== --- head/usr.sbin/i2c/i2c.c Thu Dec 1 07:50:44 2016 (r309356) +++ head/usr.sbin/i2c/i2c.c Thu Dec 1 09:14:58 2016 (r309357) @@ -310,7 +310,7 @@ i2c_write(char *dev, struct options i2c_ error = ioctl(fd, I2CWRITE, &cmd); free(buf); if (error == -1) { - err_msg = "ioctl: error when write offset"; + err_msg = "ioctl: error writing offset"; goto err1; } } @@ -335,7 +335,7 @@ i2c_write(char *dev, struct options i2c_ cmd.last = 0; error = ioctl(fd, I2CWRITE, &cmd); if (error == -1) { - err_msg = "ioctl: error when write"; + err_msg = "ioctl: error writing"; goto err1; } break; @@ -350,7 +350,7 @@ i2c_write(char *dev, struct options i2c_ error = ioctl(fd, I2CWRITE, &cmd); free(buf); if (error == -1) { - err_msg = "ioctl: error when write offset"; + err_msg = "ioctl: error writing offset"; goto err1; } } @@ -371,7 +371,7 @@ i2c_write(char *dev, struct options i2c_ cmd.last = 0; error = ioctl(fd, I2CWRITE, &cmd); if (error == -1) { - err_msg = "ioctl: error when write"; + err_msg = "ioctl: error writing"; goto err1; } break; @@ -394,7 +394,7 @@ i2c_write(char *dev, struct options i2c_ error = ioctl(fd, I2CWRITE, &cmd); free(buf); if (error == -1) { - err_msg = "ioctl: error when write"; + err_msg = "ioctl: error writing"; goto err1; } break; @@ -416,7 +416,7 @@ err1: fprintf(stderr, "error sending stop condtion\n"); err2: if (err_msg) - fprintf(stderr, "%s", err_msg); + fprintf(stderr, "%s\n", err_msg); close(fd); return (1); @@ -458,7 +458,7 @@ i2c_read(char *dev, struct options i2c_o error = ioctl(fd, I2CWRITE, &cmd); free(buf); if (error == -1) { - err_msg = "ioctl: error when write offset"; + err_msg = "ioctl: error writing offset"; goto err1; } @@ -466,7 +466,7 @@ i2c_read(char *dev, struct options i2c_o cmd.slave = i2c_opt.addr; error = ioctl(fd, I2CSTOP, &cmd); if (error == -1) { - err_msg = "error sending stop condtion\n"; + err_msg = "error sending stop condtion"; goto err2; } } @@ -491,7 +491,7 @@ i2c_read(char *dev, struct options i2c_o } error = ioctl(fd, I2CSTOP, &cmd); if (error == -1) { - err_msg = "error sending stop condtion\n"; + err_msg = "error sending stop condtion"; goto err2; } @@ -513,7 +513,7 @@ err1: fprintf(stderr, "error sending stop condtion\n"); err2: if (err_msg) - fprintf(stderr, "%s", err_msg); + fprintf(stderr, "%s\n", err_msg); close(fd); return (1); From owner-svn-src-all@freebsd.org Thu Dec 1 14:28:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A60E0C601D9; Thu, 1 Dec 2016 14:28:38 +0000 (UTC) (envelope-from emaste@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 5D15E18EB; Thu, 1 Dec 2016 14:28:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB1ESbqp063180; Thu, 1 Dec 2016 14:28:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1ESbnh063179; Thu, 1 Dec 2016 14:28:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201612011428.uB1ESbnh063179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 1 Dec 2016 14:28:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309360 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 14:28:38 -0000 Author: emaste Date: Thu Dec 1 14:28:37 2016 New Revision: 309360 URL: https://svnweb.freebsd.org/changeset/base/309360 Log: EFI loaders: parse rela relocations on amd64 Prior to this change the loader self relocation code interpreted amd64's rela relocations as if they were rel relocations, discarding the addend. This "works" because GNU ld 2.17.50 stores the addend value in both the r_addend field of the relocation (as expected) and at the target of the relocation. Other linkers, and possibly other versions of GNU ld, won't have this behaviour, so interpret the relocations correctly. Reported by: George Rimar Reviewed by: andrew MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8681 Modified: head/sys/boot/common/self_reloc.c Modified: head/sys/boot/common/self_reloc.c ============================================================================== --- head/sys/boot/common/self_reloc.c Thu Dec 1 12:32:52 2016 (r309359) +++ head/sys/boot/common/self_reloc.c Thu Dec 1 14:28:37 2016 (r309360) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__aarch64__) +#if defined(__aarch64__) || defined(__amd64__) #define ElfW_Rel Elf64_Rela #define ElfW_Dyn Elf64_Dyn #define ELFW_R_TYPE ELF64_R_TYPE @@ -40,10 +40,6 @@ __FBSDID("$FreeBSD$"); #define ElfW_Rel Elf32_Rel #define ElfW_Dyn Elf32_Dyn #define ELFW_R_TYPE ELF32_R_TYPE -#elif defined(__amd64__) -#define ElfW_Rel Elf64_Rel -#define ElfW_Dyn Elf64_Dyn -#define ELFW_R_TYPE ELF64_R_TYPE #else #error architecture not supported #endif @@ -99,7 +95,9 @@ self_reloc(Elf_Addr baseaddr, ElfW_Dyn * } /* - * Perform the actual relocation. + * Perform the actual relocation. We rely on the object having been + * linked at 0, so that the difference between the load and link + * address is the same as the load address. */ for (; relsz > 0; relsz -= relent) { switch (ELFW_R_TYPE(rel->r_info)) { @@ -110,12 +108,7 @@ self_reloc(Elf_Addr baseaddr, ElfW_Dyn * case RELOC_TYPE_RELATIVE: newaddr = (Elf_Addr *)(rel->r_offset + baseaddr); #ifdef ELF_RELA - /* - * For R_AARCH64_RELATIVE we need to calculate the - * delta between the address we are run from and the - * address we are linked at. As the latter is 0 we - * just use the address we are run from for this. - */ + /* Addend relative to the base address. */ *newaddr = baseaddr + rel->r_addend; #else /* Address relative to the base address. */ From owner-svn-src-all@freebsd.org Thu Dec 1 14:31:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7496C603EB; Thu, 1 Dec 2016 14:31:06 +0000 (UTC) (envelope-from danfe@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 5D2251CC8; Thu, 1 Dec 2016 14:31:06 +0000 (UTC) (envelope-from danfe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB1EV5ed063981; Thu, 1 Dec 2016 14:31:05 GMT (envelope-from danfe@FreeBSD.org) Received: (from danfe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1EV54J063980; Thu, 1 Dec 2016 14:31:05 GMT (envelope-from danfe@FreeBSD.org) Message-Id: <201612011431.uB1EV54J063980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: danfe set sender to danfe@FreeBSD.org using -f From: Alexey Dokuchaev Date: Thu, 1 Dec 2016 14:31:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309361 - head/sys/x86/cpufreq X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 14:31:06 -0000 Author: danfe (ports committer) Date: Thu Dec 1 14:31:05 2016 New Revision: 309361 URL: https://svnweb.freebsd.org/changeset/base/309361 Log: - Mention mismatching numbers in MSR vs. ACPI _PSS count warning: seeing actual numbers would help debugging (also, `MSR' and `ACPI' are standard abbreviations and thus should be properly capitalized) - Rephrase unsupported AMD CPUs message and wrap as an overly long line: `sorry' 1) is wrongly spelled after period (starts with a small letter) and 2) carries emotional "tinge" that is unnecessary and even bogus in debug message; `implemented' is not the best word as `supported' suits better in this context - Improve readability when reporting resulted P-state transition (debug) Approved by: jhb Modified: head/sys/x86/cpufreq/hwpstate.c Modified: head/sys/x86/cpufreq/hwpstate.c ============================================================================== --- head/sys/x86/cpufreq/hwpstate.c Thu Dec 1 14:28:37 2016 (r309360) +++ head/sys/x86/cpufreq/hwpstate.c Thu Dec 1 14:31:05 2016 (r309361) @@ -198,7 +198,7 @@ hwpstate_goto_pstate(device_t dev, int p } DELAY(100); } - HWPSTATE_DEBUG(dev, "result P%d-state on cpu%d\n", + HWPSTATE_DEBUG(dev, "result: P%d-state on cpu%d\n", (int)msr, PCPU_GET(cpuid)); if (msr != id) { HWPSTATE_DEBUG(dev, "error: loop is not enough.\n"); @@ -367,7 +367,8 @@ hwpstate_probe(device_t dev) */ msr = rdmsr(MSR_AMD_10H_11H_LIMIT); if (sc->cfnum != 1 + AMD_10H_11H_GET_PSTATE_MAX_VAL(msr)) { - HWPSTATE_DEBUG(dev, "msr and acpi _PSS count mismatch.\n"); + HWPSTATE_DEBUG(dev, "MSR (%jd) and ACPI _PSS (%d)" + " count mismatch\n", (intmax_t)msr, sc->cfnum); error = TRUE; } } @@ -427,7 +428,8 @@ hwpstate_get_info_from_msr(device_t dev) hwpstate_set[i].freq = (100 * (fid + 0x10)) >> did; break; default: - HWPSTATE_DEBUG(dev, "get_info_from_msr: AMD family 0x%02x CPU's are not implemented yet. sorry.\n", family); + HWPSTATE_DEBUG(dev, "get_info_from_msr: AMD family" + " 0x%02x CPUs are not supported yet\n", family); return (ENXIO); } hwpstate_set[i].pstate_id = i; From owner-svn-src-all@freebsd.org Thu Dec 1 15:39:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7BE5C61A3C; Thu, 1 Dec 2016 15:39:35 +0000 (UTC) (envelope-from mm@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 B62621EF7; Thu, 1 Dec 2016 15:39:35 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB1FdZdh091126; Thu, 1 Dec 2016 15:39:35 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1FdXRF091114; Thu, 1 Dec 2016 15:39:33 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201612011539.uB1FdXRF091114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Thu, 1 Dec 2016 15:39:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r309362 - in vendor/libarchive/dist: . libarchive libarchive/test tar tar/test X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 15:39:36 -0000 Author: mm Date: Thu Dec 1 15:39:33 2016 New Revision: 309362 URL: https://svnweb.freebsd.org/changeset/base/309362 Log: Update vendor/libarchive to git 2d2b3e928605f795515b03f060fd638c265b0778 Small improvements, style fixes, bugfixes. Important vendor bugfixes: Restore compatibility with Perl Archive::Tar that was broken with #825 Added: vendor/libarchive/dist/libarchive/test/test_compat_perl_archive_tar.c (contents, props changed) vendor/libarchive/dist/libarchive/test/test_compat_perl_archive_tar.tar.uu Modified: vendor/libarchive/dist/Makefile.am vendor/libarchive/dist/libarchive/archive.h vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c vendor/libarchive/dist/libarchive/test/CMakeLists.txt vendor/libarchive/dist/tar/creation_set.c vendor/libarchive/dist/tar/test/main.c vendor/libarchive/dist/tar/test/test_copy.c vendor/libarchive/dist/tar/test/test_windows.c vendor/libarchive/dist/tar/write.c Modified: vendor/libarchive/dist/Makefile.am ============================================================================== --- vendor/libarchive/dist/Makefile.am Thu Dec 1 14:31:05 2016 (r309361) +++ vendor/libarchive/dist/Makefile.am Thu Dec 1 15:39:33 2016 (r309362) @@ -370,6 +370,7 @@ libarchive_test_SOURCES= \ libarchive/test/test_compat_lzop.c \ libarchive/test/test_compat_mac.c \ libarchive/test/test_compat_pax_libarchive_2x.c \ + libarchive/test/test_compat_perl_archive_tar.c \ libarchive/test/test_compat_solaris_tar_acl.c \ libarchive/test/test_compat_solaris_pax_sparse.c \ libarchive/test/test_compat_star_acl_posix1e.c \ @@ -599,6 +600,7 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_compat_bzip2_2.tbz.uu \ libarchive/test/test_compat_cpio_1.cpio.uu \ libarchive/test/test_compat_gtar_1.tar.uu \ + libarchive/test/test_compat_gtar_2.tar.uu \ libarchive/test/test_compat_gzip_1.tgz.uu \ libarchive/test/test_compat_gzip_2.tgz.uu \ libarchive/test/test_compat_lz4_1.tar.lz4.uu \ @@ -624,6 +626,7 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_compat_mac-1.tar.Z.uu \ libarchive/test/test_compat_mac-2.tar.Z.uu \ libarchive/test/test_compat_pax_libarchive_2x.tar.Z.uu \ + libarchive/test/test_compat_perl_archive_tar.tar.uu \ libarchive/test/test_compat_solaris_pax_sparse_1.pax.Z.uu \ libarchive/test/test_compat_solaris_pax_sparse_2.pax.Z.uu \ libarchive/test/test_compat_solaris_tar_acl.tar.uu \ @@ -769,6 +772,7 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_read_format_rar_subblock.rar.uu \ libarchive/test/test_read_format_rar_unicode.rar.uu \ libarchive/test/test_read_format_rar_windows.rar.uu \ + libarchive/test/test_read_format_raw.bufr.uu \ libarchive/test/test_read_format_raw.data.Z.uu \ libarchive/test/test_read_format_raw.data.uu \ libarchive/test/test_read_format_tar_concatenated.tar.uu \ Modified: vendor/libarchive/dist/libarchive/archive.h ============================================================================== --- vendor/libarchive/dist/libarchive/archive.h Thu Dec 1 14:31:05 2016 (r309361) +++ vendor/libarchive/dist/libarchive/archive.h Thu Dec 1 15:39:33 2016 (r309362) @@ -562,7 +562,7 @@ __LA_DECL la_int64_t archive_read_head * we cannot say whether there are encrypted entries, then * ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW is returned. * In general, this function will return values below zero when the - * reader is uncertain or totally uncapable of encryption support. + * reader is uncertain or totally incapable of encryption support. * When this function returns 0 you can be sure that the reader * supports encryption detection but no encrypted entries have * been found yet. @@ -984,12 +984,12 @@ __LA_DECL int archive_read_disk_can_desc __LA_DECL int archive_read_disk_current_filesystem(struct archive *); __LA_DECL int archive_read_disk_current_filesystem_is_synthetic(struct archive *); __LA_DECL int archive_read_disk_current_filesystem_is_remote(struct archive *); -/* Request that the access time of the entry visited by travesal be restored. */ +/* Request that the access time of the entry visited by traversal be restored. */ __LA_DECL int archive_read_disk_set_atime_restored(struct archive *); /* * Set behavior. The "flags" argument selects optional behavior. */ -/* Request that the access time of the entry visited by travesal be restored. +/* Request that the access time of the entry visited by traversal be restored. * This is the same as archive_read_disk_set_atime_restored. */ #define ARCHIVE_READDISK_RESTORE_ATIME (0x0001) /* Default: Do not skip an entry which has nodump flags. */ @@ -1124,7 +1124,7 @@ __LA_DECL int archive_match_time_exclude /* * Flags to tell a matching type of time stamps. These are used for - * following functinos. + * following functions. */ /* Time flag: mtime to be tested. */ #define ARCHIVE_MATCH_MTIME (0x0100) @@ -1144,7 +1144,7 @@ __LA_DECL int archive_match_include_date const char *_datestr); __LA_DECL int archive_match_include_date_w(struct archive *, int _flag, const wchar_t *_datestr); -/* Set inclusion time by a particluar file. */ +/* Set inclusion time by a particular file. */ __LA_DECL int archive_match_include_file_time(struct archive *, int _flag, const char *_pathname); __LA_DECL int archive_match_include_file_time_w(struct archive *, Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c Thu Dec 1 14:31:05 2016 (r309361) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c Thu Dec 1 15:39:33 2016 (r309362) @@ -75,6 +75,8 @@ __FBSDID("$FreeBSD: head/lib/libarchive/ #define MTREE_HAS_OPTIONAL 0x0800 #define MTREE_HAS_NOCHANGE 0x1000 /* FreeBSD specific */ +#define MTREE_HASHTABLE_SIZE 1024 + struct mtree_option { struct mtree_option *next; char *value; @@ -86,6 +88,8 @@ struct mtree_entry { char *name; char full; char used; + unsigned int name_hash; + struct mtree_entry *hashtable_next; }; struct mtree { @@ -98,6 +102,7 @@ struct mtree { const char *archive_format_name; struct mtree_entry *entries; struct mtree_entry *this_entry; + struct mtree_entry *entry_hashtable[MTREE_HASHTABLE_SIZE]; struct archive_string current_dir; struct archive_string contents_name; @@ -110,6 +115,7 @@ struct mtree { static int bid_keycmp(const char *, const char *, ssize_t); static int cleanup(struct archive_read *); static int detect_form(struct archive_read *, int *); +static unsigned int hash(const char *); static int mtree_bid(struct archive_read *, int); static int parse_file(struct archive_read *, struct archive_entry *, struct mtree *, struct mtree_entry *, int *); @@ -862,11 +868,12 @@ process_add_entry(struct archive_read *a struct mtree_option **global, const char *line, ssize_t line_len, struct mtree_entry **last_entry, int is_form_d) { - struct mtree_entry *entry; + struct mtree_entry *entry, *ht_iter; struct mtree_option *iter; const char *next, *eq, *name, *end; size_t name_len, len; int r, i; + unsigned int ht_idx; if ((entry = malloc(sizeof(*entry))) == NULL) { archive_set_error(&a->archive, errno, "Can't allocate memory"); @@ -877,6 +884,8 @@ process_add_entry(struct archive_read *a entry->name = NULL; entry->used = 0; entry->full = 0; + entry->name_hash = 0; + entry->hashtable_next = NULL; /* Add this entry to list. */ if (*last_entry == NULL) @@ -929,6 +938,16 @@ process_add_entry(struct archive_read *a memcpy(entry->name, name, name_len); entry->name[name_len] = '\0'; parse_escapes(entry->name, entry); + entry->name_hash = hash(entry->name); + + ht_idx = entry->name_hash % MTREE_HASHTABLE_SIZE; + if ((ht_iter = mtree->entry_hashtable[ht_idx]) != NULL) { + while (ht_iter->hashtable_next) + ht_iter = ht_iter->hashtable_next; + ht_iter->hashtable_next = entry; + } else { + mtree->entry_hashtable[ht_idx] = entry; + } for (iter = *global; iter != NULL; iter = iter->next) { r = add_option(a, &entry->options, iter->value, @@ -1122,9 +1141,10 @@ parse_file(struct archive_read *a, struc * with pathname canonicalization, which is a very * tricky subject.) */ - for (mp = mentry->next; mp != NULL; mp = mp->next) { + for (mp = mentry->hashtable_next; mp != NULL; mp = mp->hashtable_next) { if (mp->full && !mp->used - && strcmp(mentry->name, mp->name) == 0) { + && mentry->name_hash == mp->name_hash + && strcmp(mentry->name, mp->name) == 0) { /* Later lines override earlier ones. */ mp->used = 1; r1 = parse_line(a, entry, mtree, mp, @@ -2000,3 +2020,19 @@ readline(struct archive_read *a, struct find_off = u - mtree->line.s; } } + +static unsigned int +hash(const char *p) +{ + /* A 32-bit version of Peter Weinberger's (PJW) hash algorithm, + as used by ELF for hashing function names. */ + unsigned g, h = 0; + while (*p != '\0') { + h = (h << 4) + *p++; + if ((g = h & 0xF0000000) != 0) { + h ^= g >> 24; + h &= 0x0FFFFFFF; + } + } + return h; +} Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c Thu Dec 1 14:31:05 2016 (r309361) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c Thu Dec 1 15:39:33 2016 (r309362) @@ -294,8 +294,14 @@ archive_read_format_tar_cleanup(struct a return (ARCHIVE_OK); } +/* + * Validate number field + * + * Flags: + * 1 - allow double \0 at field end + */ static int -validate_number_field(const char* p_field, size_t i_size) +validate_number_field(const char* p_field, size_t i_size, int flags) { unsigned char marker = (unsigned char)p_field[0]; /* octal? */ @@ -305,14 +311,24 @@ validate_number_field(const char* p_fiel for (i = 0; i < i_size; ++i) { switch (p_field[i]) { - case ' ': /* skip any leading spaces and trailing space*/ + case ' ': + /* skip any leading spaces and trailing space */ if (octal_found == 0 || i == i_size - 1) { continue; } break; - case '\0': /* null is allowed only at the end */ + case '\0': + /* + * null should be allowed only at the end + * + * Perl Archive::Tar terminates some fields + * with two nulls. We must allow this to stay + * compatible. + */ if (i != i_size - 1) { - return 0; + if (((flags & 1) == 0) + || i != i_size - 2) + return 0; } break; /* rest must be octal digits */ @@ -390,18 +406,25 @@ archive_read_format_tar_bid(struct archi * Check format of mode/uid/gid/mtime/size/rdevmajor/rdevminor fields. * These are usually octal numbers but GNU tar encodes "big" values as * base256 and leading zeroes are sometimes replaced by spaces. - * Even the null terminator is sometimes omitted. Anyway, must be checked - * to avoid false positives. + * Even the null terminator is sometimes omitted. Anyway, must be + * checked to avoid false positives. + * + * Perl Archive::Tar does not follow the spec and terminates mode, uid, + * gid, rdevmajor and rdevminor with a double \0. For compatibility + * reasons we allow this deviation. */ - if (bid > 0 && - (validate_number_field(header->mode, sizeof(header->mode)) == 0 || - validate_number_field(header->uid, sizeof(header->uid)) == 0 || - validate_number_field(header->gid, sizeof(header->gid)) == 0 || - validate_number_field(header->mtime, sizeof(header->mtime)) == 0 || - validate_number_field(header->size, sizeof(header->size)) == 0 || - validate_number_field(header->rdevmajor, sizeof(header->rdevmajor)) == 0 || - validate_number_field(header->rdevminor, sizeof(header->rdevminor)) == 0)) { - bid = 0; + if (bid > 0 && ( + validate_number_field(header->mode, sizeof(header->mode), 1) == 0 + || validate_number_field(header->uid, sizeof(header->uid), 1) == 0 + || validate_number_field(header->gid, sizeof(header->gid), 1) == 0 + || validate_number_field(header->mtime, sizeof(header->mtime), + 0) == 0 + || validate_number_field(header->size, sizeof(header->size), 0) == 0 + || validate_number_field(header->rdevmajor, + sizeof(header->rdevmajor), 1) == 0 + || validate_number_field(header->rdevminor, + sizeof(header->rdevminor), 1) == 0)) { + bid = 0; } return (bid); Modified: vendor/libarchive/dist/libarchive/test/CMakeLists.txt ============================================================================== --- vendor/libarchive/dist/libarchive/test/CMakeLists.txt Thu Dec 1 14:31:05 2016 (r309361) +++ vendor/libarchive/dist/libarchive/test/CMakeLists.txt Thu Dec 1 15:39:33 2016 (r309362) @@ -58,6 +58,7 @@ IF(ENABLE_TEST) test_compat_lzop.c test_compat_mac.c test_compat_pax_libarchive_2x.c + test_compat_perl_archive_tar.c test_compat_solaris_pax_sparse.c test_compat_solaris_tar_acl.c test_compat_star_acl_posix1e.c Added: vendor/libarchive/dist/libarchive/test/test_compat_perl_archive_tar.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/libarchive/test/test_compat_perl_archive_tar.c Thu Dec 1 15:39:33 2016 (r309362) @@ -0,0 +1,66 @@ +/*- + * Copyright (c) 2016 Martin Matuska + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD"); + +/* + * Verify our ability to read sample files created by Perl module Archive::Tar + */ + +DEFINE_TEST(test_compat_perl_archive_tar) +{ + char name[] = "test_compat_perl_archive_tar.tar"; + struct archive_entry *ae; + struct archive *a; + int r; + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + extract_reference_file(name); + assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, + 10240)); + + /* Read first entry. */ + assertEqualIntA(a, ARCHIVE_OK, r = archive_read_next_header(a, &ae)); + if (r != ARCHIVE_OK) { + archive_read_free(a); + return; + } + assertEqualString("file1", archive_entry_pathname(ae)); + assertEqualInt(1480603099, archive_entry_mtime(ae)); + assertEqualInt(1000, archive_entry_uid(ae)); + assertEqualString("john", archive_entry_uname(ae)); + assertEqualInt(1000, archive_entry_gid(ae)); + assertEqualString("john", archive_entry_gname(ae)); + assertEqualInt(0100644, archive_entry_mode(ae)); + + /* Verify that the format detection worked. */ + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_NONE); + assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR); + + assertEqualInt(ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} Added: vendor/libarchive/dist/libarchive/test/test_compat_perl_archive_tar.tar.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libarchive/dist/libarchive/test/test_compat_perl_archive_tar.tar.uu Thu Dec 1 15:39:33 2016 (r309362) @@ -0,0 +1,49 @@ +begin 644 test_compat_perl_archive_tar.tar +M9FEL93$````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````#`P,#8T-```,#`Q-S4P```P,#$W-3```"`@("`@("`@("`U +M`#$S,#(P,#,R-S,S`"`Q,3$R,P`@,``````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````!Ufilter_count); @@ -308,7 +308,7 @@ cset_auto_compress(struct creation_set * cset->filters = v; return (1); } else { - /* Put previos filters back. */ + /* Put previous filters back. */ cset->filters = old_filters; cset->filter_count = old_filter_count; return (0); Modified: vendor/libarchive/dist/tar/test/main.c ============================================================================== --- vendor/libarchive/dist/tar/test/main.c Thu Dec 1 14:31:05 2016 (r309361) +++ vendor/libarchive/dist/tar/test/main.c Thu Dec 1 15:39:33 2016 (r309362) @@ -521,7 +521,7 @@ _utf8_to_unicode(uint32_t *pwc, const ch return (0); /* Standard: return 0 for end-of-string. */ cnt = utf8_count[ch]; - /* Invalide sequence or there are not plenty bytes. */ + /* Invalid sequence or there are not plenty bytes. */ if (n < (size_t)cnt) return (-1); @@ -560,7 +560,7 @@ _utf8_to_unicode(uint32_t *pwc, const ch return (-1); } - /* The code point larger than 0x10FFFF is not leagal + /* The code point larger than 0x10FFFF is not legal * Unicode values. */ if (wc > 0x10FFFF) return (-1); Modified: vendor/libarchive/dist/tar/test/test_copy.c ============================================================================== --- vendor/libarchive/dist/tar/test/test_copy.c Thu Dec 1 14:31:05 2016 (r309361) +++ vendor/libarchive/dist/tar/test/test_copy.c Thu Dec 1 15:39:33 2016 (r309362) @@ -285,7 +285,7 @@ copy_basic(void) /* NOTE: for proper operation on cygwin-1.5 and windows, the * length of the name of the directory below, "plain", must be - * less than or equal to the lengthe of the name of the original + * less than or equal to the length of the name of the original * directory, "original" This restriction derives from the * extremely limited pathname lengths on those platforms. */ @@ -327,7 +327,7 @@ copy_ustar(void) /* NOTE: for proper operation on cygwin-1.5 and windows, the * length of the name of the directory below, "ustar", must be - * less than or equal to the lengthe of the name of the original + * less than or equal to the length of the name of the original * directory, "original" This restriction derives from the * extremely limited pathname lengths on those platforms. */ Modified: vendor/libarchive/dist/tar/test/test_windows.c ============================================================================== --- vendor/libarchive/dist/tar/test/test_windows.c Thu Dec 1 14:31:05 2016 (r309361) +++ vendor/libarchive/dist/tar/test/test_windows.c Thu Dec 1 15:39:33 2016 (r309362) @@ -133,7 +133,7 @@ DEFINE_TEST(test_windows) char *fp1, *fp2; /* - * Preparre tests. + * Prepare tests. * Create directories and files. */ assertMakeDir("tmp", 0775); Modified: vendor/libarchive/dist/tar/write.c ============================================================================== --- vendor/libarchive/dist/tar/write.c Thu Dec 1 14:31:05 2016 (r309361) +++ vendor/libarchive/dist/tar/write.c Thu Dec 1 15:39:33 2016 (r309362) @@ -527,7 +527,7 @@ write_archive(struct archive *a, struct struct archive *disk = bsdtar->diskreader; /* - * This tricky code here is to correctly read the cotents + * This tricky code here is to correctly read the contents * of the entry because the disk reader bsdtar->diskreader * is pointing at does not have any information about the * entry by this time and using archive_read_data_block() From owner-svn-src-all@freebsd.org Thu Dec 1 15:46:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFC3AC61DBC; Thu, 1 Dec 2016 15:46:28 +0000 (UTC) (envelope-from mm@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 A822614E0; Thu, 1 Dec 2016 15:46:28 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB1FkR58095097; Thu, 1 Dec 2016 15:46:27 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1FkRYZ095087; Thu, 1 Dec 2016 15:46:27 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201612011546.uB1FkRYZ095087@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Thu, 1 Dec 2016 15:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309363 - in head: contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchive/tar/test lib/libarchive/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 15:46:29 -0000 Author: mm Date: Thu Dec 1 15:46:26 2016 New Revision: 309363 URL: https://svnweb.freebsd.org/changeset/base/309363 Log: MFC r309362: Sync libarchive with vendor. Small improvements, style fixes, bugfixes. Restores compatibility with tar archives created with Perl Archive::Tar (1) MFC after: 1 week Reported by: Matthew Seaman (1) Added: head/contrib/libarchive/libarchive/test/test_compat_perl_archive_tar.c - copied unchanged from r309362, vendor/libarchive/dist/libarchive/test/test_compat_perl_archive_tar.c head/contrib/libarchive/libarchive/test/test_compat_perl_archive_tar.tar.uu - copied unchanged from r309362, vendor/libarchive/dist/libarchive/test/test_compat_perl_archive_tar.tar.uu Modified: head/contrib/libarchive/libarchive/archive.h head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c head/contrib/libarchive/libarchive/archive_read_support_format_tar.c head/contrib/libarchive/tar/creation_set.c head/contrib/libarchive/tar/test/main.c head/contrib/libarchive/tar/test/test_copy.c head/contrib/libarchive/tar/write.c head/lib/libarchive/tests/Makefile Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/libarchive/archive.h ============================================================================== --- head/contrib/libarchive/libarchive/archive.h Thu Dec 1 15:39:33 2016 (r309362) +++ head/contrib/libarchive/libarchive/archive.h Thu Dec 1 15:46:26 2016 (r309363) @@ -562,7 +562,7 @@ __LA_DECL la_int64_t archive_read_head * we cannot say whether there are encrypted entries, then * ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW is returned. * In general, this function will return values below zero when the - * reader is uncertain or totally uncapable of encryption support. + * reader is uncertain or totally incapable of encryption support. * When this function returns 0 you can be sure that the reader * supports encryption detection but no encrypted entries have * been found yet. @@ -984,12 +984,12 @@ __LA_DECL int archive_read_disk_can_desc __LA_DECL int archive_read_disk_current_filesystem(struct archive *); __LA_DECL int archive_read_disk_current_filesystem_is_synthetic(struct archive *); __LA_DECL int archive_read_disk_current_filesystem_is_remote(struct archive *); -/* Request that the access time of the entry visited by travesal be restored. */ +/* Request that the access time of the entry visited by traversal be restored. */ __LA_DECL int archive_read_disk_set_atime_restored(struct archive *); /* * Set behavior. The "flags" argument selects optional behavior. */ -/* Request that the access time of the entry visited by travesal be restored. +/* Request that the access time of the entry visited by traversal be restored. * This is the same as archive_read_disk_set_atime_restored. */ #define ARCHIVE_READDISK_RESTORE_ATIME (0x0001) /* Default: Do not skip an entry which has nodump flags. */ @@ -1124,7 +1124,7 @@ __LA_DECL int archive_match_time_exclude /* * Flags to tell a matching type of time stamps. These are used for - * following functinos. + * following functions. */ /* Time flag: mtime to be tested. */ #define ARCHIVE_MATCH_MTIME (0x0100) @@ -1144,7 +1144,7 @@ __LA_DECL int archive_match_include_date const char *_datestr); __LA_DECL int archive_match_include_date_w(struct archive *, int _flag, const wchar_t *_datestr); -/* Set inclusion time by a particluar file. */ +/* Set inclusion time by a particular file. */ __LA_DECL int archive_match_include_file_time(struct archive *, int _flag, const char *_pathname); __LA_DECL int archive_match_include_file_time_w(struct archive *, Modified: head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Thu Dec 1 15:39:33 2016 (r309362) +++ head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Thu Dec 1 15:46:26 2016 (r309363) @@ -75,6 +75,8 @@ __FBSDID("$FreeBSD$"); #define MTREE_HAS_OPTIONAL 0x0800 #define MTREE_HAS_NOCHANGE 0x1000 /* FreeBSD specific */ +#define MTREE_HASHTABLE_SIZE 1024 + struct mtree_option { struct mtree_option *next; char *value; @@ -86,6 +88,8 @@ struct mtree_entry { char *name; char full; char used; + unsigned int name_hash; + struct mtree_entry *hashtable_next; }; struct mtree { @@ -98,6 +102,7 @@ struct mtree { const char *archive_format_name; struct mtree_entry *entries; struct mtree_entry *this_entry; + struct mtree_entry *entry_hashtable[MTREE_HASHTABLE_SIZE]; struct archive_string current_dir; struct archive_string contents_name; @@ -110,6 +115,7 @@ struct mtree { static int bid_keycmp(const char *, const char *, ssize_t); static int cleanup(struct archive_read *); static int detect_form(struct archive_read *, int *); +static unsigned int hash(const char *); static int mtree_bid(struct archive_read *, int); static int parse_file(struct archive_read *, struct archive_entry *, struct mtree *, struct mtree_entry *, int *); @@ -862,11 +868,12 @@ process_add_entry(struct archive_read *a struct mtree_option **global, const char *line, ssize_t line_len, struct mtree_entry **last_entry, int is_form_d) { - struct mtree_entry *entry; + struct mtree_entry *entry, *ht_iter; struct mtree_option *iter; const char *next, *eq, *name, *end; size_t name_len, len; int r, i; + unsigned int ht_idx; if ((entry = malloc(sizeof(*entry))) == NULL) { archive_set_error(&a->archive, errno, "Can't allocate memory"); @@ -877,6 +884,8 @@ process_add_entry(struct archive_read *a entry->name = NULL; entry->used = 0; entry->full = 0; + entry->name_hash = 0; + entry->hashtable_next = NULL; /* Add this entry to list. */ if (*last_entry == NULL) @@ -929,6 +938,16 @@ process_add_entry(struct archive_read *a memcpy(entry->name, name, name_len); entry->name[name_len] = '\0'; parse_escapes(entry->name, entry); + entry->name_hash = hash(entry->name); + + ht_idx = entry->name_hash % MTREE_HASHTABLE_SIZE; + if ((ht_iter = mtree->entry_hashtable[ht_idx]) != NULL) { + while (ht_iter->hashtable_next) + ht_iter = ht_iter->hashtable_next; + ht_iter->hashtable_next = entry; + } else { + mtree->entry_hashtable[ht_idx] = entry; + } for (iter = *global; iter != NULL; iter = iter->next) { r = add_option(a, &entry->options, iter->value, @@ -1122,9 +1141,10 @@ parse_file(struct archive_read *a, struc * with pathname canonicalization, which is a very * tricky subject.) */ - for (mp = mentry->next; mp != NULL; mp = mp->next) { + for (mp = mentry->hashtable_next; mp != NULL; mp = mp->hashtable_next) { if (mp->full && !mp->used - && strcmp(mentry->name, mp->name) == 0) { + && mentry->name_hash == mp->name_hash + && strcmp(mentry->name, mp->name) == 0) { /* Later lines override earlier ones. */ mp->used = 1; r1 = parse_line(a, entry, mtree, mp, @@ -2000,3 +2020,19 @@ readline(struct archive_read *a, struct find_off = u - mtree->line.s; } } + +static unsigned int +hash(const char *p) +{ + /* A 32-bit version of Peter Weinberger's (PJW) hash algorithm, + as used by ELF for hashing function names. */ + unsigned g, h = 0; + while (*p != '\0') { + h = (h << 4) + *p++; + if ((g = h & 0xF0000000) != 0) { + h ^= g >> 24; + h &= 0x0FFFFFFF; + } + } + return h; +} Modified: head/contrib/libarchive/libarchive/archive_read_support_format_tar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Thu Dec 1 15:39:33 2016 (r309362) +++ head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Thu Dec 1 15:46:26 2016 (r309363) @@ -294,8 +294,14 @@ archive_read_format_tar_cleanup(struct a return (ARCHIVE_OK); } +/* + * Validate number field + * + * Flags: + * 1 - allow double \0 at field end + */ static int -validate_number_field(const char* p_field, size_t i_size) +validate_number_field(const char* p_field, size_t i_size, int flags) { unsigned char marker = (unsigned char)p_field[0]; /* octal? */ @@ -305,14 +311,24 @@ validate_number_field(const char* p_fiel for (i = 0; i < i_size; ++i) { switch (p_field[i]) { - case ' ': /* skip any leading spaces and trailing space*/ + case ' ': + /* skip any leading spaces and trailing space */ if (octal_found == 0 || i == i_size - 1) { continue; } break; - case '\0': /* null is allowed only at the end */ + case '\0': + /* + * null should be allowed only at the end + * + * Perl Archive::Tar terminates some fields + * with two nulls. We must allow this to stay + * compatible. + */ if (i != i_size - 1) { - return 0; + if (((flags & 1) == 0) + || i != i_size - 2) + return 0; } break; /* rest must be octal digits */ @@ -390,18 +406,25 @@ archive_read_format_tar_bid(struct archi * Check format of mode/uid/gid/mtime/size/rdevmajor/rdevminor fields. * These are usually octal numbers but GNU tar encodes "big" values as * base256 and leading zeroes are sometimes replaced by spaces. - * Even the null terminator is sometimes omitted. Anyway, must be checked - * to avoid false positives. + * Even the null terminator is sometimes omitted. Anyway, must be + * checked to avoid false positives. + * + * Perl Archive::Tar does not follow the spec and terminates mode, uid, + * gid, rdevmajor and rdevminor with a double \0. For compatibility + * reasons we allow this deviation. */ - if (bid > 0 && - (validate_number_field(header->mode, sizeof(header->mode)) == 0 || - validate_number_field(header->uid, sizeof(header->uid)) == 0 || - validate_number_field(header->gid, sizeof(header->gid)) == 0 || - validate_number_field(header->mtime, sizeof(header->mtime)) == 0 || - validate_number_field(header->size, sizeof(header->size)) == 0 || - validate_number_field(header->rdevmajor, sizeof(header->rdevmajor)) == 0 || - validate_number_field(header->rdevminor, sizeof(header->rdevminor)) == 0)) { - bid = 0; + if (bid > 0 && ( + validate_number_field(header->mode, sizeof(header->mode), 1) == 0 + || validate_number_field(header->uid, sizeof(header->uid), 1) == 0 + || validate_number_field(header->gid, sizeof(header->gid), 1) == 0 + || validate_number_field(header->mtime, sizeof(header->mtime), + 0) == 0 + || validate_number_field(header->size, sizeof(header->size), 0) == 0 + || validate_number_field(header->rdevmajor, + sizeof(header->rdevmajor), 1) == 0 + || validate_number_field(header->rdevminor, + sizeof(header->rdevminor), 1) == 0)) { + bid = 0; } return (bid); Copied: head/contrib/libarchive/libarchive/test/test_compat_perl_archive_tar.c (from r309362, vendor/libarchive/dist/libarchive/test/test_compat_perl_archive_tar.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/test/test_compat_perl_archive_tar.c Thu Dec 1 15:46:26 2016 (r309363, copy of r309362, vendor/libarchive/dist/libarchive/test/test_compat_perl_archive_tar.c) @@ -0,0 +1,66 @@ +/*- + * Copyright (c) 2016 Martin Matuska + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD"); + +/* + * Verify our ability to read sample files created by Perl module Archive::Tar + */ + +DEFINE_TEST(test_compat_perl_archive_tar) +{ + char name[] = "test_compat_perl_archive_tar.tar"; + struct archive_entry *ae; + struct archive *a; + int r; + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + extract_reference_file(name); + assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, + 10240)); + + /* Read first entry. */ + assertEqualIntA(a, ARCHIVE_OK, r = archive_read_next_header(a, &ae)); + if (r != ARCHIVE_OK) { + archive_read_free(a); + return; + } + assertEqualString("file1", archive_entry_pathname(ae)); + assertEqualInt(1480603099, archive_entry_mtime(ae)); + assertEqualInt(1000, archive_entry_uid(ae)); + assertEqualString("john", archive_entry_uname(ae)); + assertEqualInt(1000, archive_entry_gid(ae)); + assertEqualString("john", archive_entry_gname(ae)); + assertEqualInt(0100644, archive_entry_mode(ae)); + + /* Verify that the format detection worked. */ + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_NONE); + assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR); + + assertEqualInt(ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} Copied: head/contrib/libarchive/libarchive/test/test_compat_perl_archive_tar.tar.uu (from r309362, vendor/libarchive/dist/libarchive/test/test_compat_perl_archive_tar.tar.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/test/test_compat_perl_archive_tar.tar.uu Thu Dec 1 15:46:26 2016 (r309363, copy of r309362, vendor/libarchive/dist/libarchive/test/test_compat_perl_archive_tar.tar.uu) @@ -0,0 +1,49 @@ +begin 644 test_compat_perl_archive_tar.tar +M9FEL93$````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````#`P,#8T-```,#`Q-S4P```P,#$W-3```"`@("`@("`@("`U +M`#$S,#(P,#,R-S,S`"`Q,3$R,P`@,``````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````!Ufilter_count); @@ -308,7 +308,7 @@ cset_auto_compress(struct creation_set * cset->filters = v; return (1); } else { - /* Put previos filters back. */ + /* Put previous filters back. */ cset->filters = old_filters; cset->filter_count = old_filter_count; return (0); Modified: head/contrib/libarchive/tar/test/main.c ============================================================================== --- head/contrib/libarchive/tar/test/main.c Thu Dec 1 15:39:33 2016 (r309362) +++ head/contrib/libarchive/tar/test/main.c Thu Dec 1 15:46:26 2016 (r309363) @@ -521,7 +521,7 @@ _utf8_to_unicode(uint32_t *pwc, const ch return (0); /* Standard: return 0 for end-of-string. */ cnt = utf8_count[ch]; - /* Invalide sequence or there are not plenty bytes. */ + /* Invalid sequence or there are not plenty bytes. */ if (n < (size_t)cnt) return (-1); @@ -560,7 +560,7 @@ _utf8_to_unicode(uint32_t *pwc, const ch return (-1); } - /* The code point larger than 0x10FFFF is not leagal + /* The code point larger than 0x10FFFF is not legal * Unicode values. */ if (wc > 0x10FFFF) return (-1); Modified: head/contrib/libarchive/tar/test/test_copy.c ============================================================================== --- head/contrib/libarchive/tar/test/test_copy.c Thu Dec 1 15:39:33 2016 (r309362) +++ head/contrib/libarchive/tar/test/test_copy.c Thu Dec 1 15:46:26 2016 (r309363) @@ -285,7 +285,7 @@ copy_basic(void) /* NOTE: for proper operation on cygwin-1.5 and windows, the * length of the name of the directory below, "plain", must be - * less than or equal to the lengthe of the name of the original + * less than or equal to the length of the name of the original * directory, "original" This restriction derives from the * extremely limited pathname lengths on those platforms. */ @@ -327,7 +327,7 @@ copy_ustar(void) /* NOTE: for proper operation on cygwin-1.5 and windows, the * length of the name of the directory below, "ustar", must be - * less than or equal to the lengthe of the name of the original + * less than or equal to the length of the name of the original * directory, "original" This restriction derives from the * extremely limited pathname lengths on those platforms. */ Modified: head/contrib/libarchive/tar/write.c ============================================================================== --- head/contrib/libarchive/tar/write.c Thu Dec 1 15:39:33 2016 (r309362) +++ head/contrib/libarchive/tar/write.c Thu Dec 1 15:46:26 2016 (r309363) @@ -527,7 +527,7 @@ write_archive(struct archive *a, struct struct archive *disk = bsdtar->diskreader; /* - * This tricky code here is to correctly read the cotents + * This tricky code here is to correctly read the contents * of the entry because the disk reader bsdtar->diskreader * is pointing at does not have any information about the * entry by this time and using archive_read_data_block() Modified: head/lib/libarchive/tests/Makefile ============================================================================== --- head/lib/libarchive/tests/Makefile Thu Dec 1 15:39:33 2016 (r309362) +++ head/lib/libarchive/tests/Makefile Thu Dec 1 15:46:26 2016 (r309363) @@ -71,6 +71,7 @@ TESTS_SRCS= \ test_compat_lzop.c \ test_compat_mac.c \ test_compat_pax_libarchive_2x.c \ + test_compat_perl_archive_tar.c \ test_compat_solaris_tar_acl.c \ test_compat_solaris_pax_sparse.c \ test_compat_star_acl_posix1e.c \ @@ -348,6 +349,7 @@ ${PACKAGE}FILES+= test_compat_lzop_3.tar ${PACKAGE}FILES+= test_compat_mac-1.tar.Z.uu ${PACKAGE}FILES+= test_compat_mac-2.tar.Z.uu ${PACKAGE}FILES+= test_compat_pax_libarchive_2x.tar.Z.uu +${PACKAGE}FILES+= test_compat_perl_archive_tar.tar.uu ${PACKAGE}FILES+= test_compat_solaris_pax_sparse_1.pax.Z.uu ${PACKAGE}FILES+= test_compat_solaris_pax_sparse_2.pax.Z.uu ${PACKAGE}FILES+= test_compat_solaris_tar_acl.tar.uu From owner-svn-src-all@freebsd.org Thu Dec 1 16:32:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F3C9C60E49 for ; Thu, 1 Dec 2016 16:32:16 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (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 003BC1CD3 for ; Thu, 1 Dec 2016 16:32:15 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: b6b4de07-b7e3-11e6-9f67-d3961ed5a660 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id b6b4de07-b7e3-11e6-9f67-d3961ed5a660; Thu, 01 Dec 2016 16:32:13 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id uB1GW7IP003818; Thu, 1 Dec 2016 09:32:07 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1480609927.1889.189.camel@freebsd.org> Subject: Re: svn commit: r309344 - head/lib/libutil From: Ian Lepore To: Ngie Cooper , "Conrad E. Meyer" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 01 Dec 2016 09:32:07 -0700 In-Reply-To: <4DFE017D-90FD-44F4-8FE7-7EE53D499F7B@gmail.com> References: <201612010221.uB12Lb6x067202@repo.freebsd.org> <4DFE017D-90FD-44F4-8FE7-7EE53D499F7B@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 16:32:16 -0000 On Wed, 2016-11-30 at 19:07 -0800, Ngie Cooper wrote: > > > > On Nov 30, 2016, at 18:21, Conrad E. Meyer wrote: > > > > Author: cem > > Date: Thu Dec  1 02:21:36 2016 > > New Revision: 309344 > > URL: https://svnweb.freebsd.org/changeset/base/309344 > > > > Log: > >  Remove a death threat from the FreeBSD sources > > > >  Reported by:    koobs@, araujo@, linimon@, bjk@, emaste@, jhb@, > > ngie@, cem@ > >  Maintainer timeout:    des@ > Really?? I wish you hadn't added me to this list.. I don't in any way > endorse the way that you went about dealing with this disagreement. > You kind of just pissed all over what des@ did out of spite. > > Really?  Well then feel free to ADD my name to the list of people who found that comment, and the subsequent non-response to the complaints about it, completely inappropriate.   -- Ian > > > > > > Modified: > >  head/lib/libutil/flopen.c > > > > Modified: head/lib/libutil/flopen.c > > =================================================================== > > =========== > > --- head/lib/libutil/flopen.c    Thu Dec  1 01:56:34 > > 2016    (r309343) > > +++ head/lib/libutil/flopen.c    Thu Dec  1 02:21:36 > > 2016    (r309344) > > @@ -40,10 +40,10 @@ __FBSDID("$FreeBSD$"); > > /* > >  * Reliably open and lock a file. > >  * > > - * DO NOT, UNDER PAIN OF DEATH, modify this code without first > > reading the > > - * revision history and discussing your changes with > org>. > > - * Don't be fooled by the code's apparent simplicity; there would > > be no > > - * need for this function if it was as easy to get right as you > > think. > > + * Please do not modify this code without first reading the > > revision history > > + * and discussing your changes with .  Don't be > > fooled by the > > + * code's apparent simplicity; there would be no need for this > > function if it > > + * was easy to get right. > >  */ > > int > > flopen(const char *path, int flags, ...) > > @@ -108,7 +108,11 @@ flopen(const char *path, int flags, ...) > >            errno = serrno; > >            return (-1); > >        } > > -#ifdef DONT_EVEN_THINK_ABOUT_IT > > +        /* > > +         * The following change is provided as a specific example > > to > > +         * avoid. > > +         */ > > +#if 0 > >        if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) { > >            serrno = errno; > >            (void)close(fd); > > > From owner-svn-src-all@freebsd.org Thu Dec 1 16:36:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD551C60F69 for ; Thu, 1 Dec 2016 16:36:36 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (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 509F61EC9 for ; Thu, 1 Dec 2016 16:36:35 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 4e1c8f3f-b7e4-11e6-9673-39b5816e8152 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 4e1c8f3f-b7e4-11e6-9673-39b5816e8152; Thu, 01 Dec 2016 16:36:28 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id uB1GaMNu003826; Thu, 1 Dec 2016 09:36:22 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1480610182.1889.192.camel@freebsd.org> Subject: Re: svn commit: r309350 - head/etc From: Ian Lepore To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 01 Dec 2016 09:36:22 -0700 In-Reply-To: <201612010435.uB14Zfgu020006@repo.freebsd.org> References: <201612010435.uB14Zfgu020006@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 16:36:36 -0000 On Thu, 2016-12-01 at 04:35 +0000, Warner Losh wrote: > Author: imp > Date: Thu Dec  1 04:35:41 2016 > New Revision: 309350 > URL: https://svnweb.freebsd.org/changeset/base/309350 > > Log: >   If the kenv variable rc_debug is set, turn on rc_debug. > > Modified: >   head/etc/rc.subr > > Modified: head/etc/rc.subr > ===================================================================== > ========= > --- head/etc/rc.subr Thu Dec  1 04:35:38 2016 (r309349) > +++ head/etc/rc.subr Thu Dec  1 04:35:41 2016 (r309350) > @@ -2119,6 +2119,12 @@ _echoonce() >   esac >  } >   > +# If the loader env variable rc.debug is set, turn on debugging. > rc.conf will > +# still override this, but /etc/defaults/rc.conf.a > +if kenv -q rc.debug > /dev/null ; then > + rc_debug=YES > +fi > + >  fi # [ -z "${_rc_subr_loaded}" ] >   >  _rc_subr_loaded=: > The commit message says rc_debug but the env var in your code is rc.debug.  I think rc_debug would be better -- easier than remembering two different names for the same functionality. BTW, thanks for this, it's a great idea. -- Ian From owner-svn-src-all@freebsd.org Thu Dec 1 16:48:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 083DBC61429; Thu, 1 Dec 2016 16:48:15 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id EE72D1822; Thu, 1 Dec 2016 16:48:14 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id EC84A17BAD; Thu, 1 Dec 2016 08:48:07 -0800 (PST) Date: Thu, 1 Dec 2016 08:48:07 -0800 From: hiren panchasara To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309351 - head/etc/defaults Message-ID: <20161201164807.GE27291@strugglingcoder.info> References: <201612010435.uB14Zh21020050@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="10jrOL3x2xqLmOsH" Content-Disposition: inline In-Reply-To: <201612010435.uB14Zh21020050@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 16:48:15 -0000 --10jrOL3x2xqLmOsH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 12/01/16 at 04:35P, Warner Losh wrote: > Author: imp > Date: Thu Dec 1 04:35:43 2016 > New Revision: 309351 > URL: https://svnweb.freebsd.org/changeset/base/309351 >=20 > Log: > Revert the 'performance' setting to 'NONE' from C2. Just a note that this commit reverts r282110. Cheers, Hiren --10jrOL3x2xqLmOsH Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJYQFRFXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lVuAH/0szA/r+Wz158bGbtawLxZ43 v5TgaH+wsrBa8NnPtIOISloIEwHshes0e6H1SQf4Ow6ligDi89pJ1ANCDdJyYKSZ grENUh0CAMHenJDJgfC9RDG1IqxjzrJIAxQ31j4gRd6OgRB2TPgxdjXsbwkfrrJM Dds8tnwaBcSGojfPhJvZ88WNFZVdHyEfstmagEPSogL5Os7TB5pYbn5z6oEXSppU bCWGUK3gKfOSxZjQwo4zhBTXwD6h82Wr01/YDVeMx3gVmPlTcBmzJh0Rjzut6Ar5 +sqT6Ul1YIt0/7Vf4vI9yS6Tv+E7tznW2JOIbeQapv+3xC+2rOjAA7adsxwLijM= =25wp -----END PGP SIGNATURE----- --10jrOL3x2xqLmOsH-- From owner-svn-src-all@freebsd.org Thu Dec 1 16:54:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F255AC617D2; Thu, 1 Dec 2016 16:54:03 +0000 (UTC) (envelope-from vangyzen@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 C1D241DC2; Thu, 1 Dec 2016 16:54:03 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB1Gs2XC023356; Thu, 1 Dec 2016 16:54:02 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1Gs2s4023355; Thu, 1 Dec 2016 16:54:02 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201612011654.uB1Gs2s4023355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Thu, 1 Dec 2016 16:54:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309364 - head/usr.bin/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 16:54:04 -0000 Author: vangyzen Date: Thu Dec 1 16:54:02 2016 New Revision: 309364 URL: https://svnweb.freebsd.org/changeset/base/309364 Log: locale: fix buffer management Also, handle signed and unsigned chars, and more gracefully handle invalid input. Submitted by: bde in response to r309331 MFC after: 1 week Sponsored by: Dell EMC Modified: head/usr.bin/locale/locale.c Modified: head/usr.bin/locale/locale.c ============================================================================== --- head/usr.bin/locale/locale.c Thu Dec 1 15:46:26 2016 (r309363) +++ head/usr.bin/locale/locale.c Thu Dec 1 16:54:02 2016 (r309364) @@ -495,29 +495,29 @@ format_grouping(const char *binary) { static char rval[64]; const char *cp; - size_t len; + size_t roff; + int len; rval[0] = '\0'; + roff = 0; for (cp = binary; *cp != '\0'; ++cp) { - char group[sizeof("127;")]; - snprintf(group, sizeof(group), "%hhd;", *cp); - len = strlcat(rval, group, sizeof(rval)); - if (len >= sizeof(rval)) { - len = sizeof(rval) - 1; - break; - } - if (*cp == CHAR_MAX) { - break; - } + if (*cp < 0) + break; /* garbage input */ + len = snprintf(&rval[roff], sizeof(rval) - roff, "%u;", *cp); + if (len < 0 || (unsigned)len >= sizeof(rval) - roff) + break; /* insufficient space for output */ + roff += len; + if (*cp == CHAR_MAX) + break; /* special termination */ } - /* Remove the trailing ';'. */ - rval[len - 1] = '\0'; + /* Truncate at the last successfully snprintf()ed semicolon. */ + if (roff != 0) + rval[roff - 1] = '\0'; - return (rval); + return (&rval[0]); } - /* * keyword value lookup helper (via localeconv()) */ From owner-svn-src-all@freebsd.org Thu Dec 1 16:54:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34F4BC6186B; Thu, 1 Dec 2016 16:54:42 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id 231A51FE4; Thu, 1 Dec 2016 16:54:41 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id 4DD8217BC3; Thu, 1 Dec 2016 08:54:41 -0800 (PST) Date: Thu, 1 Dec 2016 08:54:41 -0800 From: hiren panchasara To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309351 - head/etc/defaults Message-ID: <20161201165441.GF27291@strugglingcoder.info> References: <201612010435.uB14Zh21020050@repo.freebsd.org> <20161201164807.GE27291@strugglingcoder.info> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Zs/RYxT/hKAHzkfQ" Content-Disposition: inline In-Reply-To: <20161201164807.GE27291@strugglingcoder.info> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 16:54:42 -0000 --Zs/RYxT/hKAHzkfQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 12/01/16 at 08:48P, hiren panchasara wrote: > On 12/01/16 at 04:35P, Warner Losh wrote: > > Author: imp > > Date: Thu Dec 1 04:35:43 2016 > > New Revision: 309351 > > URL: https://svnweb.freebsd.org/changeset/base/309351 > >=20 > > Log: > > Revert the 'performance' setting to 'NONE' from C2. >=20 > Just a note that this commit reverts r282110. Ah, my bad. performance_cx_lowest has more history than that. :-)=20 (HIGH -> Cmax -> C2 -> NONE) Cheers, Hiren --Zs/RYxT/hKAHzkfQ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJYQFXRXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lv5gIAJLwn53t7uLQAZx/6CZhJYW7 kGzdNmng6IR1ZpZJ6EXCQLe/wPSi2yvvxscuWBgMgWhEsSm/BsiqXsBX7F79iga7 X6zlw3gleadA3IFG0l5vdVtEQ4eqL9ikJg94510FVoMFEhcx1iapbHm4M4j0xQmD Y3l7VAU+/yHDCjvThgjPO5CWlD+o1QizHIIshSltTjAVyEG0oF6Jv/xp/m3vNDia DRnJaH7zb199BuPoPv+B81ddxaZnSVaHIJS4B3ddXDEIuREYRDImhCiqWf/EeRcq 5Zsus7EWkY+8QIbSyOjpiq+cQV3f90Hv50N3uiZwL1dZqOOTVkVbjeS0ydNpEjY= =xO0l -----END PGP SIGNATURE----- --Zs/RYxT/hKAHzkfQ-- From owner-svn-src-all@freebsd.org Thu Dec 1 16:58:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE838C619F0; Thu, 1 Dec 2016 16:58:18 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f]) by mx1.freebsd.org (Postfix) with ESMTP id A9D171235; Thu, 1 Dec 2016 16:58:18 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id CFE0C5648E; Thu, 1 Dec 2016 10:58:17 -0600 (CST) Subject: Re: svn commit: r309331 - head/usr.bin/locale To: Bruce Evans References: <201611301834.uAUIYfQs075427@repo.freebsd.org> <20161201082459.T1285@besplex.bde.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eric van Gyzen Message-ID: Date: Thu, 1 Dec 2016 10:58:13 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 In-Reply-To: <20161201082459.T1285@besplex.bde.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 16:58:18 -0000 On 11/30/2016 18:19, Bruce Evans wrote: > On Wed, 30 Nov 2016, Eric van Gyzen wrote: > >> Log: >> Include limits.h for CHAR_MAX >> >> This was needed on stable/10. Apparently, sys/param.h supplies CHAR_MAX >> on head. Include limits.h anyway, for consistency, and because C >> says so. > > sys/param.actually supplies CHAR_MAX (undocumented namespace pollution) in > all versions of FreeBSD. Yes, I was too terse. I meant, locale.c gets CHAR_MAX from sys/param.h on head (and 11), but does not include sys/param.h on 10. > Untested fixes and cleanups: > > Y diff -u2 locale.c~ locale.c Thanks. Committed. Eric From owner-svn-src-all@freebsd.org Thu Dec 1 17:01:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B4F5C61CF7; Thu, 1 Dec 2016 17:01:25 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (mail.soaustin.net [192.108.105.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.soaustin.net", Issuer "StartCom Class 2 IV Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5FD571614; Thu, 1 Dec 2016 17:01:25 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from lonesome.com (bones.soaustin.net [192.108.105.22]) by mail.soaustin.net (Postfix) with ESMTPSA id D47A15F2; Thu, 1 Dec 2016 11:01:17 -0600 (CST) Date: Thu, 1 Dec 2016 11:01:16 -0600 From: Mark Linimon To: Ian Lepore Cc: Ngie Cooper , "Conrad E. Meyer" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r309344 - head/lib/libutil Message-ID: <20161201170116.GA20872@lonesome.com> References: <201612010221.uB12Lb6x067202@repo.freebsd.org> <4DFE017D-90FD-44F4-8FE7-7EE53D499F7B@gmail.com> <1480609927.1889.189.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1480609927.1889.189.camel@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 17:01:25 -0000 On Thu, Dec 01, 2016 at 09:32:07AM -0700, Ian Lepore wrote: > On Wed, 2016-11-30 at 19:07 -0800, Ngie Cooper wrote: > > Really?? I wish you hadn't added me to this list.. I don't in any way > > endorse the way that you went about dealing with this disagreement. > > Really?  Well then feel free to ADD my name to the list of people who > found that comment, and the subsequent non-response to the complaints > about it, completely inappropriate.   I expressed an opinion on an IRC channel that I found the comment offensive. But I would rather my permission had been asked ahead of time before having that comment attached to a public commit log. I think this is part of the point that ngie is trying to make. I'm well-known for my wish that core took a more active, public, stance on such matters, but I think here that two wrongs may not have made a right. mcl From owner-svn-src-all@freebsd.org Thu Dec 1 17:26:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BC9CC607C2; Thu, 1 Dec 2016 17:26:39 +0000 (UTC) (envelope-from alc@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 F0B551630; Thu, 1 Dec 2016 17:26:38 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB1HQcSB035592; Thu, 1 Dec 2016 17:26:38 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1HQbkC035589; Thu, 1 Dec 2016 17:26:37 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201612011726.uB1HQbkC035589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Thu, 1 Dec 2016 17:26:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309365 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 17:26:39 -0000 Author: alc Date: Thu Dec 1 17:26:37 2016 New Revision: 309365 URL: https://svnweb.freebsd.org/changeset/base/309365 Log: During vm_page_cache()'s call to vm_radix_insert(), if vm_page_alloc() was called to allocate a new page of radix trie nodes, there could be a call to vm_radix_remove() on the same trie (of PG_CACHED pages) as the in-progress vm_radix_insert(). With the removal of PG_CACHED pages, we can simplify vm_radix_insert() and vm_radix_remove() by removing the flags on the root of the trie that were used to detect this case and the code for restarting vm_radix_insert() when it happened. Reviewed by: kib, markj Tested by: pho Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8664 Modified: head/sys/vm/_vm_radix.h head/sys/vm/vm_object.c head/sys/vm/vm_radix.c Modified: head/sys/vm/_vm_radix.h ============================================================================== --- head/sys/vm/_vm_radix.h Thu Dec 1 16:54:02 2016 (r309364) +++ head/sys/vm/_vm_radix.h Thu Dec 1 17:26:37 2016 (r309365) @@ -36,12 +36,8 @@ */ struct vm_radix { uintptr_t rt_root; - uint8_t rt_flags; }; -#define RT_INSERT_INPROG 0x01 -#define RT_TRIE_MODIFIED 0x02 - #ifdef _KERNEL static __inline boolean_t Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Thu Dec 1 16:54:02 2016 (r309364) +++ head/sys/vm/vm_object.c Thu Dec 1 17:26:37 2016 (r309365) @@ -205,7 +205,6 @@ vm_object_zinit(void *mem, int size, int object->type = OBJT_DEAD; object->ref_count = 0; object->rtree.rt_root = 0; - object->rtree.rt_flags = 0; object->paging_in_progress = 0; object->resident_page_count = 0; object->shadow_count = 0; Modified: head/sys/vm/vm_radix.c ============================================================================== --- head/sys/vm/vm_radix.c Thu Dec 1 16:54:02 2016 (r309364) +++ head/sys/vm/vm_radix.c Thu Dec 1 17:26:37 2016 (r309365) @@ -341,8 +341,6 @@ vm_radix_insert(struct vm_radix *rtree, index = page->pindex; -restart: - /* * The owner of record for root is not really important because it * will never be used. @@ -360,32 +358,10 @@ restart: panic("%s: key %jx is already present", __func__, (uintmax_t)index); clev = vm_radix_keydiff(m->pindex, index); - - /* - * During node allocation the trie that is being - * walked can be modified because of recursing radix - * trie operations. - * If this is the case, the recursing functions signal - * such situation and the insert operation must - * start from scratch again. - * The freed radix node will then be in the UMA - * caches very likely to avoid the same situation - * to happen. - */ - rtree->rt_flags |= RT_INSERT_INPROG; tmp = vm_radix_node_get(vm_radix_trimkey(index, clev + 1), 2, clev); - rtree->rt_flags &= ~RT_INSERT_INPROG; - if (tmp == NULL) { - rtree->rt_flags &= ~RT_TRIE_MODIFIED; + if (tmp == NULL) return (ENOMEM); - } - if ((rtree->rt_flags & RT_TRIE_MODIFIED) != 0) { - rtree->rt_flags &= ~RT_TRIE_MODIFIED; - tmp->rn_count = 0; - vm_radix_node_put(tmp); - goto restart; - } *parentp = tmp; vm_radix_addpage(tmp, index, clev, page); vm_radix_addpage(tmp, m->pindex, clev, m); @@ -409,21 +385,9 @@ restart: */ newind = rnode->rn_owner; clev = vm_radix_keydiff(newind, index); - - /* See the comments above. */ - rtree->rt_flags |= RT_INSERT_INPROG; tmp = vm_radix_node_get(vm_radix_trimkey(index, clev + 1), 2, clev); - rtree->rt_flags &= ~RT_INSERT_INPROG; - if (tmp == NULL) { - rtree->rt_flags &= ~RT_TRIE_MODIFIED; + if (tmp == NULL) return (ENOMEM); - } - if ((rtree->rt_flags & RT_TRIE_MODIFIED) != 0) { - rtree->rt_flags &= ~RT_TRIE_MODIFIED; - tmp->rn_count = 0; - vm_radix_node_put(tmp); - goto restart; - } *parentp = tmp; vm_radix_addpage(tmp, index, clev, page); slot = vm_radix_slot(newind, clev); @@ -708,20 +672,6 @@ vm_radix_remove(struct vm_radix *rtree, vm_page_t m; int i, slot; - /* - * Detect if a page is going to be removed from a trie which is - * already undergoing another trie operation. - * Right now this is only possible for vm_radix_remove() recursing - * into vm_radix_insert(). - * If this is the case, the caller must be notified about this - * situation. It will also takecare to update the RT_TRIE_MODIFIED - * accordingly. - * The RT_TRIE_MODIFIED bit is set here because the remove operation - * will always succeed. - */ - if ((rtree->rt_flags & RT_INSERT_INPROG) != 0) - rtree->rt_flags |= RT_TRIE_MODIFIED; - rnode = vm_radix_getroot(rtree); if (vm_radix_isleaf(rnode)) { m = vm_radix_topage(rnode); @@ -776,9 +726,6 @@ vm_radix_reclaim_allnodes(struct vm_radi { struct vm_radix_node *root; - KASSERT((rtree->rt_flags & RT_INSERT_INPROG) == 0, - ("vm_radix_reclaim_allnodes: unexpected trie recursion")); - root = vm_radix_getroot(rtree); if (root == NULL) return; From owner-svn-src-all@freebsd.org Thu Dec 1 17:28:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8FEFC60837; Thu, 1 Dec 2016 17:28:46 +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 88B7C17D9; Thu, 1 Dec 2016 17:28:46 +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 uB1HSjiQ035694; Thu, 1 Dec 2016 17:28:45 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1HSjBZ035693; Thu, 1 Dec 2016 17:28:45 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201612011728.uB1HSjBZ035693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 1 Dec 2016 17:28:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309366 - head/lib/libcapsicum X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 17:28:46 -0000 Author: cem Date: Thu Dec 1 17:28:45 2016 New Revision: 309366 URL: https://svnweb.freebsd.org/changeset/base/309366 Log: capsicum_helpers: Squash errors from closed fds Squash EBADF from closed stdin, stdout, or stderr in caph_limit_stdio(). Any program used during special shell scripts may commonly be forked from a parent process with closed standard stream. Do the common sense thing for this common use. Reported by: Iblis Lin Reviewed by: oshogbo@ (earlier version) Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8657 Modified: head/lib/libcapsicum/capsicum_helpers.h Modified: head/lib/libcapsicum/capsicum_helpers.h ============================================================================== --- head/lib/libcapsicum/capsicum_helpers.h Thu Dec 1 17:26:37 2016 (r309365) +++ head/lib/libcapsicum/capsicum_helpers.h Thu Dec 1 17:28:45 2016 (r309366) @@ -94,12 +94,12 @@ caph_limit_stdout(void) static __inline int caph_limit_stdio(void) { + const int iebadf = CAPH_IGNORE_EBADF; - if (caph_limit_stdin() == -1 || caph_limit_stdout() == -1 || - caph_limit_stderr() == -1) { + if (caph_limit_stream(STDIN_FILENO, CAPH_READ | iebadf) == -1 || + caph_limit_stream(STDOUT_FILENO, CAPH_WRITE | iebadf) == -1 || + caph_limit_stream(STDERR_FILENO, CAPH_WRITE | iebadf) == -1) return (-1); - } - return (0); } From owner-svn-src-all@freebsd.org Thu Dec 1 17:33:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE947C60BC2; Thu, 1 Dec 2016 17:33:24 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x241.google.com (mail-pf0-x241.google.com [IPv6:2607:f8b0:400e:c00::241]) (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 AD4761E53; Thu, 1 Dec 2016 17:33:24 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x241.google.com with SMTP id c4so12241660pfb.3; Thu, 01 Dec 2016 09:33:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=b+UZPQpj8mbJg7yr9rF7WSN5dE46SDA/LHYekYT5lq0=; b=XFO5pPtP4Q+R3915250PXmmZrhoaoRxSBwssyMGujaSONiZtia6XmD/O20t6PGUDsz KSoSBPr0sFdt4umWrn2M5HfYz3JWCuNfkEq71/ZhjUBwmtogagNsSxAR7AolxBXo2vyA hXlcZIq49fZSEpIlUGnrHkiUO3gA9cuAk+14E7KHGaCqtChVtjw7jGGA+iWna7p47hfC bLQy4pgOExU0hNTHFvPy3fdI9eyQLxIL1IWehpb2FsI1VSgMPaJe6d8y3+t/yOJCBZry Omioe0vPW0O/COej/jLOWWAUQQqeUNrBTxILeJ+OUT2+02gPeeKqEW3HFS+bdg/VfXyq l7Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=b+UZPQpj8mbJg7yr9rF7WSN5dE46SDA/LHYekYT5lq0=; b=BrrnPrQ8k2DNznkFHmo2dQ0zBc4AeMxMS0mMLf07XrMUVHhSUmk4bJHuzN7NqXHuIn vreAn4ISk240nnPviVaEn1hs91tWp1jctrbaTySCBREMGwWy/VSsjP7XN14tCLxD6W4D ZEo/liTai9N1uPXjdJDX9rXLyn+jnTMJMleVWqDMoP4ZCTlWGC+/PE7B/6z8Ju9ulfWr y1jTTocS3LepN0qoOhMEN+PjMv3Jf4+4naKVtAibYyzepbEozNXnp7l1Qn8NQdjhPivN Cusw8OB76p4LFlEST+VLB+N/XoFtN8Wp0+BHTGB5MlCmIcwgNMpKOTIU28ZRoZF4e3RW 0JJA== X-Gm-Message-State: AKaTC03k7GSdaklxACiSe6Lb3iQB7rT2153HG0ASWLAuoL01KQgYKmSaVYpIa6tWWxwusw== X-Received: by 10.99.237.69 with SMTP id m5mr71056363pgk.94.1480613604320; Thu, 01 Dec 2016 09:33:24 -0800 (PST) Received: from fuji-wireless.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id q26sm1533523pfk.94.2016.12.01.09.33.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Dec 2016 09:33:23 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: svn commit: r309344 - head/lib/libutil From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <20161201170116.GA20872@lonesome.com> Date: Thu, 1 Dec 2016 09:33:22 -0800 Cc: Ian Lepore , "Conrad E. Meyer" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <5B2D372D-52AB-42FB-B0AA-942A75466602@gmail.com> References: <201612010221.uB12Lb6x067202@repo.freebsd.org> <4DFE017D-90FD-44F4-8FE7-7EE53D499F7B@gmail.com> <1480609927.1889.189.camel@freebsd.org> <20161201170116.GA20872@lonesome.com> To: Mark Linimon X-Mailer: Apple Mail (2.3251) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 17:33:25 -0000 > On Dec 1, 2016, at 9:01 AM, Mark Linimon wrote: >=20 > On Thu, Dec 01, 2016 at 09:32:07AM -0700, Ian Lepore wrote: >> On Wed, 2016-11-30 at 19:07 -0800, Ngie Cooper wrote: >>> Really?? I wish you hadn't added me to this list.. I don't in any = way >>> endorse the way that you went about dealing with this disagreement. >>=20 >> Really? Well then feel free to ADD my name to the list of people who >> found that comment, and the subsequent non-response to the complaints >> about it, completely inappropriate. =20 >=20 > I expressed an opinion on an IRC channel that I found the comment > offensive. >=20 > But I would rather my permission had been asked ahead of time before > having that comment attached to a public commit log. I think this is > part of the point that ngie is trying to make. >=20 > I'm well-known for my wish that core took a more active, public, = stance > on such matters, but I think here that two wrongs may not have made a > right. Yes. And more importantly, the new comment doesn=E2=80=99t tell me *why* I = shouldn=E2=80=99t use FD_CLOEXEC. The owness is still on the reader to = figure out why using `fcntl(fd, F_SETFD, FD_CLOEXEC)` is wrong. All the new commit does is makes the commit that des@ made more = palatable and benign to readers. Thanks, -Ngie= From owner-svn-src-all@freebsd.org Thu Dec 1 17:36:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA900C60DA1; Thu, 1 Dec 2016 17:36:32 +0000 (UTC) (envelope-from vangyzen@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 955F81098; Thu, 1 Dec 2016 17:36:32 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB1HaVcH039473; Thu, 1 Dec 2016 17:36:31 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1HaVEq039471; Thu, 1 Dec 2016 17:36:31 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201612011736.uB1HaVEq039471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Thu, 1 Dec 2016 17:36:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309367 - head/usr.bin/locale X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 17:36:32 -0000 Author: vangyzen Date: Thu Dec 1 17:36:31 2016 New Revision: 309367 URL: https://svnweb.freebsd.org/changeset/base/309367 Log: locale: enable more warnings; fix them Do not set WARNS, so it gets the current default of 6. Fix the warnings by sprinkling static, const, or strdup. Make some constant data tables const. Fix whitespace. MFC after: 1 week Sponsored by: Dell EMC Modified: head/usr.bin/locale/Makefile head/usr.bin/locale/locale.c Modified: head/usr.bin/locale/Makefile ============================================================================== --- head/usr.bin/locale/Makefile Thu Dec 1 17:28:45 2016 (r309366) +++ head/usr.bin/locale/Makefile Thu Dec 1 17:36:31 2016 (r309367) @@ -1,7 +1,6 @@ # $FreeBSD$ PROG= locale -WARNS?= 3 CFLAGS+= -I${.CURDIR}/../../lib/libc/locale .include Modified: head/usr.bin/locale/locale.c ============================================================================== --- head/usr.bin/locale/locale.c Thu Dec 1 17:28:45 2016 (r309366) +++ head/usr.bin/locale/locale.c Thu Dec 1 17:36:31 2016 (r309367) @@ -57,8 +57,8 @@ void list_charmaps(void); void list_locales(void); const char *lookup_localecat(int); char *kwval_lconv(int); -int kwval_lookup(char *, char **, int *, int *); -void showdetails(char *); +int kwval_lookup(const char *, char **, int *, int *); +void showdetails(const char *); void showkeywordslist(char *substring); void showlocale(void); void usage(void); @@ -66,13 +66,12 @@ void usage(void); /* Global variables */ static StringList *locales = NULL; -int all_locales = 0; -int all_charmaps = 0; -int prt_categories = 0; -int prt_keywords = 0; -int more_params = 0; +static int all_locales = 0; +static int all_charmaps = 0; +static int prt_categories = 0; +static int prt_keywords = 0; -struct _lcinfo { +static const struct _lcinfo { const char *name; int id; } lcinfo [] = { @@ -110,7 +109,7 @@ struct _lcinfo { #define KW_INT_P_SIGN_POSN (KW_ZERO+21) #define KW_INT_N_SIGN_POSN (KW_ZERO+22) -struct _kwinfo { +static const struct _kwinfo { const char *name; int isstr; /* true - string, false - number */ int catid; /* LC_* */ @@ -224,7 +223,7 @@ struct _kwinfo { }; #define NKWINFO (nitems(kwinfo)) -const char *boguslocales[] = { "UTF-8" }; +static const char *boguslocales[] = { "UTF-8" }; #define NBOGUS (nitems(boguslocales)) int @@ -296,7 +295,7 @@ main(int argc, char *argv[]) } else { uint i; for (i = 0; i < nitems(kwinfo); i++) - showdetails ((char *)kwinfo [i].name); + showdetails(kwinfo[i].name); } exit(0); } @@ -341,7 +340,7 @@ list_locales(void) static int scmp(const void *s1, const void *s2) { - return strcmp(*(const char **)s1, *(const char **)s2); + return strcmp(*(const char * const *)s1, *(const char * const *)s2); } /* @@ -378,7 +377,7 @@ list_charmaps(void) /* add US-ASCII, if not yet added */ if (sl_find(charmaps, "US-ASCII") == NULL) - sl_add(charmaps, "US-ASCII"); + sl_add(charmaps, strdup("US-ASCII")); /* sort the list */ qsort(charmaps->sl_str, charmaps->sl_cur, sizeof(char *), scmp); @@ -437,10 +436,10 @@ init_locales_list(void) * we also list 'C' for constistency */ if (sl_find(locales, "POSIX") == NULL) - sl_add(locales, "POSIX"); + sl_add(locales, strdup("POSIX")); if (sl_find(locales, "C") == NULL) - sl_add(locales, "C"); + sl_add(locales, strdup("C")); /* make output nicer, sort the list */ qsort(locales->sl_str, locales->sl_cur, sizeof(char *), scmp); @@ -606,7 +605,7 @@ kwval_lconv(int id) * keyword value and properties lookup */ int -kwval_lookup(char *kwname, char **kwval, int *cat, int *isstr) +kwval_lookup(const char *kwname, char **kwval, int *cat, int *isstr) { int rval; size_t i; @@ -634,7 +633,7 @@ kwval_lookup(char *kwname, char **kwval, * command line options specified. */ void -showdetails(char *kw) +showdetails(const char *kw) { int isstr, cat, tmpval; char *kwval; @@ -649,9 +648,9 @@ showdetails(char *kw) } if (prt_categories) { - if (prt_keywords) + if (prt_keywords) printf("%-20s ", lookup_localecat(cat)); - else + else printf("%-20s\t%s\n", kw, lookup_localecat(cat)); } From owner-svn-src-all@freebsd.org Thu Dec 1 18:32:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E470C6134D for ; Thu, 1 Dec 2016 18:32:22 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (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 190661FC2 for ; Thu, 1 Dec 2016 18:32:21 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 7ca46bdd-b7f4-11e6-9673-39b5816e8152 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 7ca46bdd-b7f4-11e6-9673-39b5816e8152; Thu, 01 Dec 2016 18:32:18 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id uB1IWCdu004011; Thu, 1 Dec 2016 11:32:12 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1480617132.1889.196.camel@freebsd.org> Subject: Re: svn commit: r309344 - head/lib/libutil From: Ian Lepore To: "Ngie Cooper (yaneurabeya)" , Mark Linimon Cc: "Conrad E. Meyer" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Date: Thu, 01 Dec 2016 11:32:12 -0700 In-Reply-To: <5B2D372D-52AB-42FB-B0AA-942A75466602@gmail.com> References: <201612010221.uB12Lb6x067202@repo.freebsd.org> <4DFE017D-90FD-44F4-8FE7-7EE53D499F7B@gmail.com> <1480609927.1889.189.camel@freebsd.org> <20161201170116.GA20872@lonesome.com> <5B2D372D-52AB-42FB-B0AA-942A75466602@gmail.com> Content-Type: text/plain; charset="iso-8859-7" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 18:32:22 -0000 On Thu, 2016-12-01 at 09:33 -0800, Ngie Cooper (yaneurabeya) wrote: > > > > On Dec 1, 2016, at 9:01 AM, Mark Linimon > > wrote: > > > > On Thu, Dec 01, 2016 at 09:32:07AM -0700, Ian Lepore wrote: > > > > > > On Wed, 2016-11-30 at 19:07 -0800, Ngie Cooper wrote: > > > > > > > > Really?? I wish you hadn't added me to this list.. I don't in > > > > any way > > > > endorse the way that you went about dealing with this > > > > disagreement. > > > Really?  Well then feel free to ADD my name to the list of people > > > who > > > found that comment, and the subsequent non-response to the > > > complaints > > > about it, completely inappropriate.   > > I expressed an opinion on an IRC channel that I found the comment > > offensive. > > > > But I would rather my permission had been asked ahead of time > > before > > having that comment attached to a public commit log.  I think this > > is > > part of the point that ngie is trying to make. > > > > I'm well-known for my wish that core took a more active, public, > > stance > > on such matters, but I think here that two wrongs may not have made > > a > > right. > Yes. > > And more importantly, the new comment doesn¢t tell me *why* I > shouldn¢t use FD_CLOEXEC. The owness is still on the reader to figure > out why using `fcntl(fd, F_SETFD, FD_CLOEXEC)` is wrong. > > All the new commit does is makes the commit that des@ made more > palatable and benign to readers. And how is that a bad thing, compared to the prior situation?  Insult has been removed and information has been added.  You complain that the information that was added was incomplete.  Well, there is one person who could fix that, and he has apparently chosen not to.  So perhaps your ongoing complaint should be directed accordingly. -- Ian From owner-svn-src-all@freebsd.org Thu Dec 1 19:06:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88593C61D09; Thu, 1 Dec 2016 19:06:10 +0000 (UTC) (envelope-from tsoome@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 579D110D0; Thu, 1 Dec 2016 19:06:10 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB1J69CR076482; Thu, 1 Dec 2016 19:06:09 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1J69XK076481; Thu, 1 Dec 2016 19:06:09 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201612011906.uB1J69XK076481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 1 Dec 2016 19:06:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309368 - stable/11/sys/boot/zfs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 19:06:10 -0000 Author: tsoome Date: Thu Dec 1 19:06:09 2016 New Revision: 309368 URL: https://svnweb.freebsd.org/changeset/base/309368 Log: MFC r308776 loader: zfs toplevel vdev must have spa set. PR: 214375 Reported by: lstewart Reviewed by: allanjude, imp Approved by: allanjude (mentor), imp (mentor) Differential Revision: https://reviews.freebsd.org/D8487 Modified: stable/11/sys/boot/zfs/zfsimpl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/zfs/zfsimpl.c ============================================================================== --- stable/11/sys/boot/zfs/zfsimpl.c Thu Dec 1 17:36:31 2016 (r309367) +++ stable/11/sys/boot/zfs/zfsimpl.c Thu Dec 1 19:06:09 2016 (r309368) @@ -1017,8 +1017,10 @@ vdev_probe(vdev_phys_read_t *read, void STAILQ_FOREACH(pool_vdev, &spa->spa_vdevs, v_childlink) if (top_vdev == pool_vdev) break; - if (!pool_vdev && top_vdev) + if (!pool_vdev && top_vdev) { + top_vdev->spa = spa; STAILQ_INSERT_TAIL(&spa->spa_vdevs, top_vdev, v_childlink); + } /* * We should already have created an incomplete vdev for this From owner-svn-src-all@freebsd.org Thu Dec 1 19:19:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A082C612B7; Thu, 1 Dec 2016 19:19:21 +0000 (UTC) (envelope-from tsoome@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 5C50819B7; Thu, 1 Dec 2016 19:19:21 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB1JJKaR080637; Thu, 1 Dec 2016 19:19:20 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1JJKrL080636; Thu, 1 Dec 2016 19:19:20 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201612011919.uB1JJKrL080636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 1 Dec 2016 19:19:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309369 - head/lib/libstand X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 19:19:21 -0000 Author: tsoome Date: Thu Dec 1 19:19:20 2016 New Revision: 309369 URL: https://svnweb.freebsd.org/changeset/base/309369 Log: libstand: dosfs cstyle cleanup for return keyword. Reviewed by: bapt, imp, allanjude Approved by: imp (mentor), allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D8678 Modified: head/lib/libstand/dosfs.c Modified: head/lib/libstand/dosfs.c ============================================================================== --- head/lib/libstand/dosfs.c Thu Dec 1 19:06:09 2016 (r309368) +++ head/lib/libstand/dosfs.c Thu Dec 1 19:19:20 2016 (r309369) @@ -204,7 +204,7 @@ dos_mount(DOS_FS *fs, struct open_file * if (buf != NULL) free(buf); (void)dosunmount(fs); - return(err); + return (err); } free(buf); @@ -219,7 +219,7 @@ dos_mount(DOS_FS *fs, struct open_file * fs->root.dex.h_clus[0] = (fs->rdcl >> 16) & 0xff; fs->root.dex.h_clus[1] = (fs->rdcl >> 24) & 0xff; } - return 0; + return (0); } /* @@ -231,10 +231,10 @@ dos_unmount(DOS_FS *fs) int err; if (fs->links) - return(EBUSY); + return (EBUSY); if ((err = dosunmount(fs))) - return(err); - return 0; + return (err); + return (0); } /* @@ -244,7 +244,7 @@ static int dosunmount(DOS_FS *fs) { free(fs); - return(0); + return (0); } /* @@ -285,7 +285,7 @@ dos_open(const char *path, struct open_f fd->f_fsdata = (void *)f; out: - return(err); + return (err); } /* @@ -307,7 +307,7 @@ dos_read(struct open_file *fd, void *buf twiddle(4); nb = (u_int)nbyte; if ((size = fsize(f->fs, &f->de)) == -1) - return EINVAL; + return (EINVAL); if (nb > (n = size - f->offset)) nb = n; off = f->offset; @@ -344,7 +344,7 @@ dos_read(struct open_file *fd, void *buf out: if (resid) *resid = nbyte - nb + cnt; - return(err); + return (err); } /* @@ -370,16 +370,16 @@ dos_seek(struct open_file *fd, off_t off break; default: errno = EINVAL; - return(-1); + return (-1); } off += offset; if (off < 0 || off > size) { errno = EINVAL; - return(-1); + return (-1); } f->offset = (u_int)off; f->c = 0; - return(off); + return (off); } /* @@ -394,7 +394,7 @@ dos_close(struct open_file *fd) f->fs->links--; free(f); dos_unmount(fs); - return 0; + return (0); } /* @@ -411,7 +411,7 @@ dos_stat(struct open_file *fd, struct st sb->st_uid = 0; sb->st_gid = 0; if ((sb->st_size = fsize(f->fs, &f->de)) == -1) - return EINVAL; + return (EINVAL); return (0); } @@ -501,7 +501,7 @@ dos_readdir(struct open_file *fd, struct d->d_reclen = sizeof(*d); d->d_type = (dd.de.attr & FA_DIR) ? DT_DIR : DT_REG; memcpy(d->d_name, fn, sizeof(d->d_name)); - return(0); + return (0); } /* @@ -516,41 +516,41 @@ parsebs(DOS_FS *fs, DOS_BS *bs) bs->jmp[0] != 0xe9 && (bs->jmp[0] != 0xeb || bs->jmp[2] != 0x90)) || bs->bpb.media < 0xf0) - return EINVAL; + return (EINVAL); if (cv2(bs->bpb.secsiz) != SECSIZ) - return EINVAL; + return (EINVAL); if (!(fs->spc = bs->bpb.spc) || fs->spc & (fs->spc - 1)) - return EINVAL; + return (EINVAL); fs->bsize = secbyt(fs->spc); fs->bshift = ffs(fs->bsize) - 1; if ((fs->spf = cv2(bs->bpb.spf))) { if (bs->bpb.fats != 2) - return EINVAL; + return (EINVAL); if (!(fs->dirents = cv2(bs->bpb.dirents))) - return EINVAL; + return (EINVAL); } else { if (!(fs->spf = cv4(bs->bpb.lspf))) - return EINVAL; + return (EINVAL); if (!bs->bpb.fats || bs->bpb.fats > 16) - return EINVAL; + return (EINVAL); if ((fs->rdcl = cv4(bs->bpb.rdcl)) < LOCLUS) - return EINVAL; + return (EINVAL); } if (!(fs->lsnfat = cv2(bs->bpb.ressec))) - return EINVAL; + return (EINVAL); fs->lsndir = fs->lsnfat + fs->spf * bs->bpb.fats; fs->lsndta = fs->lsndir + entsec(fs->dirents); if (!(sc = cv2(bs->bpb.secs)) && !(sc = cv4(bs->bpb.lsecs))) - return EINVAL; + return (EINVAL); if (fs->lsndta > sc) - return EINVAL; + return (EINVAL); if ((fs->xclus = secblk(fs, sc - fs->lsndta) + 1) < LOCLUS) - return EINVAL; + return (EINVAL); fs->fatsz = fs->dirents ? fs->xclus < 0xff6 ? 12 : 16 : 32; sc = (secbyt(fs->spf) << 1) / (fs->fatsz >> 2) - 1; if (fs->xclus > sc) fs->xclus = sc; - return 0; + return (0); } /* @@ -575,17 +575,17 @@ namede(DOS_FS *fs, const char *path, DOS if (!(s = strchr(path, '/'))) s = strchr(path, 0); if ((n = s - path) > 255) - return ENAMETOOLONG; + return (ENAMETOOLONG); memcpy(name, path, n); name[n] = 0; path = s; if (!(de->attr & FA_DIR)) - return ENOTDIR; + return (ENOTDIR); if ((err = lookup(fs, stclus(fs->fatsz, de), name, &de))) - return err; + return (err); } *dep = de; - return 0; + return (0); } /* @@ -604,7 +604,7 @@ lookup(DOS_FS *fs, u_int clus, const cha for (ent = 0; ent < 2; ent++) if (!strcasecmp(name, dotstr[ent])) { *dep = dot + ent; - return 0; + return (0); } if (!clus && fs->fatsz == 32) clus = fs->rdcl; @@ -617,13 +617,13 @@ lookup(DOS_FS *fs, u_int clus, const cha else if (okclus(fs, clus)) lsec = blklsn(fs, clus); else - return EINVAL; + return (EINVAL); for (sec = 0; sec < nsec; sec++) { if ((err = ioget(fs->fd, lsec + sec, 0, dir, secbyt(1)))) - return err; + return (err); for (ent = 0; ent < DEPSEC; ent++) { if (!*dir[ent].de.name) - return ENOENT; + return (ENOENT); if (*dir[ent].de.name != 0xe5) { if ((dir[ent].de.attr & FA_MASK) == FA_XDE) { x = dir[ent].xde.seq; @@ -651,7 +651,7 @@ lookup(DOS_FS *fs, u_int clus, const cha } if (ok) { *dep = &dir[ent].de; - return 0; + return (0); } } } @@ -661,11 +661,11 @@ lookup(DOS_FS *fs, u_int clus, const cha if (!clus) break; if ((err = fatget(fs, &clus))) - return err; + return (err); if (fatend(fs->fatsz, clus)) break; } - return ENOENT; + return (ENOENT); } /* @@ -739,11 +739,11 @@ fsize(DOS_FS *fs, DOS_DE *de) size = fs->dirents * sizeof(DOS_DE); else { if ((n = fatcnt(fs, c)) == -1) - return n; + return (n); size = blkbyt(fs, n); } } - return size; + return (size); } /* @@ -756,8 +756,8 @@ fatcnt(DOS_FS *fs, u_int c) for (n = 0; okclus(fs, c); n++) if (fatget(fs, &c)) - return -1; - return fatend(fs->fatsz, c) ? n : -1; + return (-1); + return (fatend(fs->fatsz, c) ? n : -1); } /* @@ -815,7 +815,7 @@ fatget(DOS_FS *fs, u_int *c) static int fatend(u_int sz, u_int c) { - return c > (sz == 12 ? 0xff7U : sz == 16 ? 0xfff7U : 0xffffff7); + return (c > (sz == 12 ? 0xff7U : sz == 16 ? 0xfff7U : 0xffffff7)); } /* @@ -834,7 +834,7 @@ ioread(DOS_FS *fs, u_int offset, void *b if ((n = SECSIZ - off) > nbyte) n = nbyte; if ((err = ioget(fs->fd, bytsec(offset), off, s, n))) - return err; + return (err); offset += SECSIZ; s += n; nbyte -= n; @@ -842,15 +842,15 @@ ioread(DOS_FS *fs, u_int offset, void *b n = nbyte & (SECSIZ - 1); if (nbyte -= n) { if ((err = ioget(fs->fd, bytsec(offset), 0, s, nbyte))) - return err; + return (err); offset += nbyte; s += nbyte; } if (n) { if ((err = ioget(fs->fd, bytsec(offset), 0, s, n))) - return err; + return (err); } - return 0; + return (0); } /* From owner-svn-src-all@freebsd.org Thu Dec 1 20:01:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76F7AC61154; Thu, 1 Dec 2016 20:01:57 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (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 5D33D100B; Thu, 1 Dec 2016 20:01:57 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from [208.184.220.60] (helo=nmamm-mbp2.dolby.net) by id.bluezbox.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87 (FreeBSD)) (envelope-from ) id 1cCXYF-000OSA-43; Thu, 01 Dec 2016 12:01:51 -0800 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: svn commit: r309368 - stable/11/sys/boot/zfs From: Oleksandr Tymoshenko In-Reply-To: <201612011906.uB1J69XK076481@repo.freebsd.org> Date: Thu, 1 Dec 2016 12:01:20 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <186048AF-0A74-4DCD-8A54-1DCE26CCE9D3@bluezbox.com> References: <201612011906.uB1J69XK076481@repo.freebsd.org> To: Toomas Soome X-Mailer: Apple Mail (2.3251) Sender: gonzo@id.bluezbox.com X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: > On Dec 1, 2016, at 11:06 AM, Toomas Soome wrote: > > Author: tsoome > Date: Thu Dec 1 19:06:09 2016 > New Revision: 309368 > URL: https://svnweb.freebsd.org/changeset/base/309368 > > Log: > MFC r308776 > > loader: zfs toplevel vdev must have spa set. > > PR: 214375 > Reported by: lstewart > Reviewed by: allanjude, imp > Approved by: allanjude (mentor), imp (mentor) > Differential Revision: https://reviews.freebsd.org/D8487 [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 20:01:57 -0000 > On Dec 1, 2016, at 11:06 AM, Toomas Soome wrote: >=20 > Author: tsoome > Date: Thu Dec 1 19:06:09 2016 > New Revision: 309368 > URL: https://svnweb.freebsd.org/changeset/base/309368 >=20 > Log: > MFC r308776 >=20 > loader: zfs toplevel vdev must have spa set. >=20 > PR: 214375 > Reported by: lstewart > Reviewed by: allanjude, imp > Approved by: allanjude (mentor), imp (mentor) > Differential Revision: https://reviews.freebsd.org/D8487 Hi Tom, Looks like this commit breaks the build: In file included from = /src/FreeBSD/11/sys/boot/efi/loader/../../zfs/zfs.c:49: /src/FreeBSD/11/sys/boot/efi/loader/../../zfs/zfsimpl.c:1021:13: error: = no membe r named 'spa' in 'struct vdev' top_vdev->spa =3D spa; ~~~~~~~~ ^ From owner-svn-src-all@freebsd.org Thu Dec 1 20:05:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8088AC61360; Thu, 1 Dec 2016 20:05:07 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (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 5E60B1290; Thu, 1 Dec 2016 20:05:07 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from [208.184.220.60] (helo=nmamm-mbp2.dolby.net) by id.bluezbox.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87 (FreeBSD)) (envelope-from ) id 1cCXbO-000OSc-2O; Thu, 01 Dec 2016 12:05:06 -0800 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: svn commit: r309368 - stable/11/sys/boot/zfs From: Oleksandr Tymoshenko In-Reply-To: <186048AF-0A74-4DCD-8A54-1DCE26CCE9D3@bluezbox.com> Date: Thu, 1 Dec 2016 12:04:35 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201612011906.uB1J69XK076481@repo.freebsd.org> <186048AF-0A74-4DCD-8A54-1DCE26CCE9D3@bluezbox.com> To: Toomas Soome X-Mailer: Apple Mail (2.3251) Sender: gonzo@id.bluezbox.com X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: > On Dec 1, 2016, at 12:01 PM, Oleksandr Tymoshenko wrote: > > >> On Dec 1, 2016, at 11:06 AM, Toomas Soome wrote: >> >> Author: tsoome >> Date: Thu Dec 1 19:06:09 2016 >> New Revision: 309368 >> URL: https://svnweb.freebsd.org/changeset/base/309368 >> >> Log: >> MFC r308776 >> >> loader: zfs toplevel vdev must have spa set. >> >> PR: 214375 >> Reported by: lstewart >> Reviewed by: allanjude, imp >> Approved by: allanjude (mentor), imp (mentor) >> Differential Revision: https://reviews.freebsd.org/D8487 > > Hi Tom, [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 20:05:07 -0000 > On Dec 1, 2016, at 12:01 PM, Oleksandr Tymoshenko = wrote: >=20 >=20 >> On Dec 1, 2016, at 11:06 AM, Toomas Soome wrote: >>=20 >> Author: tsoome >> Date: Thu Dec 1 19:06:09 2016 >> New Revision: 309368 >> URL: https://svnweb.freebsd.org/changeset/base/309368 >>=20 >> Log: >> MFC r308776 >>=20 >> loader: zfs toplevel vdev must have spa set. >>=20 >> PR: 214375 >> Reported by: lstewart >> Reviewed by: allanjude, imp >> Approved by: allanjude (mentor), imp (mentor) >> Differential Revision: https://reviews.freebsd.org/D8487 >=20 > Hi Tom, I am sorry, this should have been Toomas, not Tom.=20= From owner-svn-src-all@freebsd.org Thu Dec 1 20:31:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F1D1C61ED0; Thu, 1 Dec 2016 20:31:38 +0000 (UTC) (envelope-from tsoome@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 3E6641253; Thu, 1 Dec 2016 20:31:38 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB1KVb2x009639; Thu, 1 Dec 2016 20:31:37 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1KVbpW009638; Thu, 1 Dec 2016 20:31:37 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201612012031.uB1KVbpW009638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 1 Dec 2016 20:31:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309370 - stable/11/sys/boot/zfs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 20:31:38 -0000 Author: tsoome Date: Thu Dec 1 20:31:37 2016 New Revision: 309370 URL: https://svnweb.freebsd.org/changeset/base/309370 Log: Backing out r309368 as it got commited prematurely as we still do not provide skein feature support in boot loader. Approved by: allanjude (mentor) Modified: stable/11/sys/boot/zfs/zfsimpl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/zfs/zfsimpl.c ============================================================================== --- stable/11/sys/boot/zfs/zfsimpl.c Thu Dec 1 19:19:20 2016 (r309369) +++ stable/11/sys/boot/zfs/zfsimpl.c Thu Dec 1 20:31:37 2016 (r309370) @@ -1017,10 +1017,8 @@ vdev_probe(vdev_phys_read_t *read, void STAILQ_FOREACH(pool_vdev, &spa->spa_vdevs, v_childlink) if (top_vdev == pool_vdev) break; - if (!pool_vdev && top_vdev) { - top_vdev->spa = spa; + if (!pool_vdev && top_vdev) STAILQ_INSERT_TAIL(&spa->spa_vdevs, top_vdev, v_childlink); - } /* * We should already have created an incomplete vdev for this From owner-svn-src-all@freebsd.org Thu Dec 1 20:34:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D4D9C60101; Thu, 1 Dec 2016 20:34:28 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st13p35im-asmtp003.me.com (st13p35im-asmtp003.me.com [17.164.199.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 462661654; Thu, 1 Dec 2016 20:34:28 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.st13p35im-asmtp003.me.com by st13p35im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OHI00M00WV9EX00@st13p35im-asmtp003.me.com>; Thu, 01 Dec 2016 20:34:21 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=4d515a; t=1480624461; bh=mKPyQ53cBWg8XSE9UfO3r06Qs21e0rAaVuQsNM40nHU=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=LCwZwSkZP2RU6/3ZRczYMcV6Hm4j30c/uSIoLWhOTSYBNeeSXErMi67E4QsjtuXGP FcfVkQZMmh42gRt4C+6QHVHYhpPWfcCwOe2X4nOEN4xFZ6kfB+axeNXxXWoUnCkxYl +sQEdI7oihRs9Uu5yHYO3BGYRdEuIpjcxYhmkN/lYAoWDE/GS/CHlpu2r71paqdCuq bt7bmj5VRsrBlT6DE+vs0GH9oerVb4M1e4etPu/vcm7wTNh+exQrx/TL6MF9VI9Ua7 SOtBt0kKlWfI10NF4BgJitxT8TlKDSZqK51ImipMRroANNFp8/Vh7lG9kgXA9QmQ9Q ADDArprOvq2eg== Received: from nazgul.lan (220-90-235-80.dyn.estpak.ee [80.235.90.220]) by st13p35im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OHI00JOUX563400@st13p35im-asmtp003.me.com>; Thu, 01 Dec 2016 20:34:20 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-12-01_18:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1034 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1612010334 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: svn commit: r309368 - stable/11/sys/boot/zfs From: Toomas Soome In-reply-to: <186048AF-0A74-4DCD-8A54-1DCE26CCE9D3@bluezbox.com> Date: Thu, 01 Dec 2016 22:34:17 +0200 Cc: Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-transfer-encoding: quoted-printable Message-id: <75AD339A-FECF-4C82-ADF1-FACDF0FDD2B6@me.com> References: <201612011906.uB1J69XK076481@repo.freebsd.org> <186048AF-0A74-4DCD-8A54-1DCE26CCE9D3@bluezbox.com> To: Oleksandr Tymoshenko X-Mailer: Apple Mail (2.3251) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 20:34:28 -0000 > On 1. dets 2016, at 22:01, Oleksandr Tymoshenko = wrote: >=20 >=20 >> On Dec 1, 2016, at 11:06 AM, Toomas Soome wrote: >>=20 >> Author: tsoome >> Date: Thu Dec 1 19:06:09 2016 >> New Revision: 309368 >> URL: https://svnweb.freebsd.org/changeset/base/309368 >>=20 >> Log: >> MFC r308776 >>=20 >> loader: zfs toplevel vdev must have spa set. >>=20 >> PR: 214375 >> Reported by: lstewart >> Reviewed by: allanjude, imp >> Approved by: allanjude (mentor), imp (mentor) >> Differential Revision: https://reviews.freebsd.org/D8487 >=20 > Hi Tom, >=20 > Looks like this commit breaks the build: >=20 > In file included from = /src/FreeBSD/11/sys/boot/efi/loader/../../zfs/zfs.c:49: > /src/FreeBSD/11/sys/boot/efi/loader/../../zfs/zfsimpl.c:1021:13: = error: no membe > r named 'spa' in 'struct vdev' > top_vdev->spa =3D spa; > ~~~~~~~~ ^ >=20 >=20 >=20 Yes, I am so sorry for this confusion, I did back it out; somehow the = impression was the skein boot support is already in 11=E2=80=A6 my = apologies. rgds, toomas= From owner-svn-src-all@freebsd.org Thu Dec 1 20:36:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84171C60270; Thu, 1 Dec 2016 20:36:49 +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 3877C185C; Thu, 1 Dec 2016 20:36:49 +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 uB1KamJH012900; Thu, 1 Dec 2016 20:36:48 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1Kamke012898; Thu, 1 Dec 2016 20:36:48 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612012036.uB1Kamke012898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 1 Dec 2016 20:36:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309371 - in stable: 10/libexec/rtld-elf 10/libexec/rtld-elf/sparc64 11/libexec/rtld-elf 11/libexec/rtld-elf/sparc64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 20:36:49 -0000 Author: jhb Date: Thu Dec 1 20:36:48 2016 New Revision: 309371 URL: https://svnweb.freebsd.org/changeset/base/309371 Log: MFC 308456: Pass the correct flag to find_symdef() from _rtld_bind(). When symbol versioning was added to rtld, the boolean 'in_plt' argument to find_symdef() was converted to a bitmask of flags. The first flag added was 'SYMLOOK_IN_PLT' which replaced the 'in_plt' bool. This happened to still work by accident as SYMLOOK_IN_PLT had the value of 1 which is the same as 'true', so there should be no functional change. Modified: stable/10/libexec/rtld-elf/rtld.c stable/10/libexec/rtld-elf/sparc64/reloc.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/libexec/rtld-elf/rtld.c stable/11/libexec/rtld-elf/sparc64/reloc.c Directory Properties: stable/11/ (props changed) Modified: stable/10/libexec/rtld-elf/rtld.c ============================================================================== --- stable/10/libexec/rtld-elf/rtld.c Thu Dec 1 20:31:37 2016 (r309370) +++ stable/10/libexec/rtld-elf/rtld.c Thu Dec 1 20:36:48 2016 (r309371) @@ -707,8 +707,8 @@ _rtld_bind(Obj_Entry *obj, Elf_Size relo rel = (const Elf_Rel *) ((caddr_t) obj->pltrela + reloff); where = (Elf_Addr *) (obj->relocbase + rel->r_offset); - def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj, true, NULL, - &lockstate); + def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj, SYMLOOK_IN_PLT, + NULL, &lockstate); if (def == NULL) rtld_die(); if (ELF_ST_TYPE(def->st_info) == STT_GNU_IFUNC) Modified: stable/10/libexec/rtld-elf/sparc64/reloc.c ============================================================================== --- stable/10/libexec/rtld-elf/sparc64/reloc.c Thu Dec 1 20:31:37 2016 (r309370) +++ stable/10/libexec/rtld-elf/sparc64/reloc.c Thu Dec 1 20:36:48 2016 (r309371) @@ -503,7 +503,7 @@ reloc_plt(Obj_Entry *obj) assert(ELF64_R_TYPE_ID(rela->r_info) == R_SPARC_JMP_SLOT); where = (Elf_Addr *)(obj->relocbase + rela->r_offset); def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - true, NULL, lockstate); + SYMLOOK_IN_PLT, NULL, lockstate); value = (Elf_Addr)(defobj->relocbase + def->st_value); *where = value; } From owner-svn-src-all@freebsd.org Thu Dec 1 20:36:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3C8DC60275; Thu, 1 Dec 2016 20:36:49 +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 89A9F185D; Thu, 1 Dec 2016 20:36:49 +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 uB1KamlP012907; Thu, 1 Dec 2016 20:36:48 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1Kamca012905; Thu, 1 Dec 2016 20:36:48 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612012036.uB1Kamca012905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 1 Dec 2016 20:36:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309371 - in stable: 10/libexec/rtld-elf 10/libexec/rtld-elf/sparc64 11/libexec/rtld-elf 11/libexec/rtld-elf/sparc64 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 20:36:49 -0000 Author: jhb Date: Thu Dec 1 20:36:48 2016 New Revision: 309371 URL: https://svnweb.freebsd.org/changeset/base/309371 Log: MFC 308456: Pass the correct flag to find_symdef() from _rtld_bind(). When symbol versioning was added to rtld, the boolean 'in_plt' argument to find_symdef() was converted to a bitmask of flags. The first flag added was 'SYMLOOK_IN_PLT' which replaced the 'in_plt' bool. This happened to still work by accident as SYMLOOK_IN_PLT had the value of 1 which is the same as 'true', so there should be no functional change. Modified: stable/11/libexec/rtld-elf/rtld.c stable/11/libexec/rtld-elf/sparc64/reloc.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/libexec/rtld-elf/rtld.c stable/10/libexec/rtld-elf/sparc64/reloc.c Directory Properties: stable/10/ (props changed) Modified: stable/11/libexec/rtld-elf/rtld.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld.c Thu Dec 1 20:31:37 2016 (r309370) +++ stable/11/libexec/rtld-elf/rtld.c Thu Dec 1 20:36:48 2016 (r309371) @@ -714,8 +714,8 @@ _rtld_bind(Obj_Entry *obj, Elf_Size relo rel = (const Elf_Rel *) ((caddr_t) obj->pltrela + reloff); where = (Elf_Addr *) (obj->relocbase + rel->r_offset); - def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj, true, NULL, - &lockstate); + def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj, SYMLOOK_IN_PLT, + NULL, &lockstate); if (def == NULL) rtld_die(); if (ELF_ST_TYPE(def->st_info) == STT_GNU_IFUNC) Modified: stable/11/libexec/rtld-elf/sparc64/reloc.c ============================================================================== --- stable/11/libexec/rtld-elf/sparc64/reloc.c Thu Dec 1 20:31:37 2016 (r309370) +++ stable/11/libexec/rtld-elf/sparc64/reloc.c Thu Dec 1 20:36:48 2016 (r309371) @@ -503,7 +503,7 @@ reloc_plt(Obj_Entry *obj) assert(ELF64_R_TYPE_ID(rela->r_info) == R_SPARC_JMP_SLOT); where = (Elf_Addr *)(obj->relocbase + rela->r_offset); def = find_symdef(ELF_R_SYM(rela->r_info), obj, &defobj, - true, NULL, lockstate); + SYMLOOK_IN_PLT, NULL, lockstate); value = (Elf_Addr)(defobj->relocbase + def->st_value); *where = value; } From owner-svn-src-all@freebsd.org Thu Dec 1 20:43:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8D60C6067D; Thu, 1 Dec 2016 20:43:41 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [45.55.20.155]) (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 869A31EC1; Thu, 1 Dec 2016 20:43:41 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from [208.184.220.60] (helo=nmamm-mbp2.dolby.net) by id.bluezbox.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87 (FreeBSD)) (envelope-from ) id 1cCYCe-000OYr-IW; Thu, 01 Dec 2016 12:43:40 -0800 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: svn commit: r309368 - stable/11/sys/boot/zfs From: Oleksandr Tymoshenko In-Reply-To: <75AD339A-FECF-4C82-ADF1-FACDF0FDD2B6@me.com> Date: Thu, 1 Dec 2016 12:43:05 -0800 Cc: Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201612011906.uB1J69XK076481@repo.freebsd.org> <186048AF-0A74-4DCD-8A54-1DCE26CCE9D3@bluezbox.com> <75AD339A-FECF-4C82-ADF1-FACDF0FDD2B6@me.com> To: Toomas Soome X-Mailer: Apple Mail (2.3251) Sender: gonzo@id.bluezbox.com X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: > On Dec 1, 2016, at 12:34 PM, Toomas Soome wrote: > > >> On 1. dets 2016, at 22:01, Oleksandr Tymoshenko wrote: >> >> >>> On Dec 1, 2016, at 11:06 AM, Toomas Soome wrote: >>> >>> Author: tsoome >>> Date: Thu Dec 1 19:06:09 2016 >>> New Revision: 309368 >>> URL: https://svnweb.freebsd.org/changeset/base/309368 >>> >>> Log: >>> MFC r308776 >>> >>> loader: zfs toplevel vdev must have spa set. >>> >>> PR: 214375 >>> Reported by: lstewart >>> Reviewed by: allanjude, imp >>> Approved by: allanjude (mentor), imp (mentor) >>> Differential Revision: https://reviews.freebsd.org/D8487 >> >> Hi Tom, >> >> Looks like this commit breaks the build: >> >> In file included from /src/FreeBSD/11/sys/boot/efi/loader/../../zfs/zfs.c:49: >> /src/FreeBSD/11/sys/boot/efi/loader/../../zfs/zfsimpl.c:1021:13: error: no membe >> r named 'spa' in 'struct vdev' >> top_vdev->spa = spa; >> ~~~~~~~~ ^ >> >> >> > > Yes, I am so sorry for this confusion, I did back it out; somehow the impression was the skein boot support is already in 11… my apologies. [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 20:43:41 -0000 > On Dec 1, 2016, at 12:34 PM, Toomas Soome wrote: >=20 >=20 >> On 1. dets 2016, at 22:01, Oleksandr Tymoshenko = wrote: >>=20 >>=20 >>> On Dec 1, 2016, at 11:06 AM, Toomas Soome = wrote: >>>=20 >>> Author: tsoome >>> Date: Thu Dec 1 19:06:09 2016 >>> New Revision: 309368 >>> URL: https://svnweb.freebsd.org/changeset/base/309368 >>>=20 >>> Log: >>> MFC r308776 >>>=20 >>> loader: zfs toplevel vdev must have spa set. >>>=20 >>> PR: 214375 >>> Reported by: lstewart >>> Reviewed by: allanjude, imp >>> Approved by: allanjude (mentor), imp (mentor) >>> Differential Revision: https://reviews.freebsd.org/D8487 >>=20 >> Hi Tom, >>=20 >> Looks like this commit breaks the build: >>=20 >> In file included from = /src/FreeBSD/11/sys/boot/efi/loader/../../zfs/zfs.c:49: >> /src/FreeBSD/11/sys/boot/efi/loader/../../zfs/zfsimpl.c:1021:13: = error: no membe >> r named 'spa' in 'struct vdev' >> top_vdev->spa =3D spa; >> ~~~~~~~~ ^ >>=20 >>=20 >>=20 >=20 > Yes, I am so sorry for this confusion, I did back it out; somehow the = impression was the skein boot support is already in 11=E2=80=A6 my = apologies. No problem. Thanks for fixing.=20= From owner-svn-src-all@freebsd.org Thu Dec 1 21:06:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BE50C6113C; Thu, 1 Dec 2016 21:06:34 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st13p35im-asmtp004.me.com (st13p35im-asmtp004.me.com [17.164.199.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 13B3B1155; Thu, 1 Dec 2016 21:06:34 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.st13p35im-asmtp004.me.com by st13p35im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OHI00G00VUGB600@st13p35im-asmtp004.me.com>; Thu, 01 Dec 2016 20:06:27 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=4d515a; t=1480622787; bh=w25AXsepPebbDXhThzSKe0U5fu5rJT7GToVoogtr8gI=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=dtFNVtbDcVS+osF8RQ83RYOXuBmkCD8NthhxhIz627DhyHn0B0lomIJrxMLstyeK9 cJdsAqKtIgw9dfRznhCRO76eX/SNlfzjyQ7I1SAfqmW4I8vH4fojPAYDqw2JcIcMcp /HhbJJmSmzEHZq4t1areriDwkg/J5AhQUpDZdoU77hjXdWzGdgb24vqHuRnMbJO5Of 81cgWuw2/RaGYOMzPpHjpDKyAG8lviinrjEK2Ffzo1p8m60gIkQTffJ4iYeUInkuVg UUqVxHl1bBEsTJXcQeC2teq59cEA5Ye9wcpH6Wa6I5ICYx5JO3XCFMji3yRlumlRco wF/9uXhBNZLvg== Received: from nazgul.lan (220-90-235-80.dyn.estpak.ee [80.235.90.220]) by st13p35im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OHI00OB8VUK8M10@st13p35im-asmtp004.me.com>; Thu, 01 Dec 2016 20:06:26 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-12-01_17:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1034 suspectscore=2 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1612010327 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 10.1 \(3251\)) Subject: Re: svn commit: r309368 - stable/11/sys/boot/zfs From: Toomas Soome In-reply-to: Date: Thu, 01 Dec 2016 22:06:20 +0200 Cc: Toomas Soome , src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-transfer-encoding: quoted-printable Message-id: <057D89C5-C409-4540-A9FC-EC0A3F0801E5@me.com> References: <201612011906.uB1J69XK076481@repo.freebsd.org> <186048AF-0A74-4DCD-8A54-1DCE26CCE9D3@bluezbox.com> To: Oleksandr Tymoshenko X-Mailer: Apple Mail (2.3251) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 21:06:34 -0000 > On 1. dets 2016, at 22:04, Oleksandr Tymoshenko = wrote: >=20 >=20 >> On Dec 1, 2016, at 12:01 PM, Oleksandr Tymoshenko = wrote: >>=20 >>=20 >>> On Dec 1, 2016, at 11:06 AM, Toomas Soome = wrote: >>>=20 >>> Author: tsoome >>> Date: Thu Dec 1 19:06:09 2016 >>> New Revision: 309368 >>> URL: https://svnweb.freebsd.org/changeset/base/309368 >>>=20 >>> Log: >>> MFC r308776 >>>=20 >>> loader: zfs toplevel vdev must have spa set. >>>=20 >>> PR: 214375 >>> Reported by: lstewart >>> Reviewed by: allanjude, imp >>> Approved by: allanjude (mentor), imp (mentor) >>> Differential Revision: https://reviews.freebsd.org/D8487 >>=20 >> Hi Tom, >=20 > I am sorry, this should have been Toomas, not Tom. no problem, and sorry, I=E2=80=99m already checking=E2=80=A6=20 rgds, toomas= From owner-svn-src-all@freebsd.org Thu Dec 1 21:08:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6127EC61266; Thu, 1 Dec 2016 21:08:43 +0000 (UTC) (envelope-from rstone@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 309E313D1; Thu, 1 Dec 2016 21:08:43 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB1L8gBs026076; Thu, 1 Dec 2016 21:08:42 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1L8g19026075; Thu, 1 Dec 2016 21:08:42 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201612012108.uB1L8g19026075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Thu, 1 Dec 2016 21:08:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309372 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 21:08:43 -0000 Author: rstone Date: Thu Dec 1 21:08:42 2016 New Revision: 309372 URL: https://svnweb.freebsd.org/changeset/base/309372 Log: Fix a false positive in a buf_ring assert buf_ring contains an assert that checks whether an item being enqueued already exists on the ring. There is a subtle bug in this assert. An item can be returned by a peek() function and freed, and then the consumer thread can be preempted before calling advance(). If this happens the item appears to still be on the queue, but another thread may allocate the item from the free pool and wind up trying to enqueue it again, causing the assert to trigger incorrectly. Fix this by skipping the head of the consumer's portion of the ring, as this index is what will be returned by peek(). Sponsored by: Dell EMC Isilon MFC After: 1 week Differential Revision: https://reviews.freebsd.org/D8685 Reviewed by: hselasky Modified: head/sys/sys/buf_ring.h Modified: head/sys/sys/buf_ring.h ============================================================================== --- head/sys/sys/buf_ring.h Thu Dec 1 20:36:48 2016 (r309371) +++ head/sys/sys/buf_ring.h Thu Dec 1 21:08:42 2016 (r309372) @@ -67,11 +67,13 @@ buf_ring_enqueue(struct buf_ring *br, vo uint32_t prod_head, prod_next, cons_tail; #ifdef DEBUG_BUFRING int i; - for (i = br->br_cons_head; i != br->br_prod_head; - i = ((i + 1) & br->br_cons_mask)) - if(br->br_ring[i] == buf) - panic("buf=%p already enqueue at %d prod=%d cons=%d", - buf, i, br->br_prod_tail, br->br_cons_tail); + if (br->br_cons_head != br->br_prod_head) { + for (i = (br->br_cons_head + 1) & br->br_cons_mask; i != br->br_prod_head; + i = ((i + 1) & br->br_cons_mask)) + if(br->br_ring[i] == buf) + panic("buf=%p already enqueue at %d prod=%d cons=%d", + buf, i, br->br_prod_tail, br->br_cons_tail); + } #endif critical_enter(); do { From owner-svn-src-all@freebsd.org Thu Dec 1 21:41:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC1D4C61FE9 for ; Thu, 1 Dec 2016 21:41:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::229]) (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 ABD96195C for ; Thu, 1 Dec 2016 21:41:42 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x229.google.com with SMTP id a124so448743486ioe.2 for ; Thu, 01 Dec 2016 13:41:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=9D9ZSTqAF5Glu9GpOe0YOBuqDAgxeZURoWricEHCePU=; b=U2Av6UqPOuirpjLgqEb6J+naiPJOe/AznbeeTbvWXxEsCmOFSk4j3rHys+mk/i00zo QIKRhE78hvJrxzF+X/0adse0PGh9c27v9zdXODHIFHo32WJMdqQc+cXn1ems2s3t7tTD 4/741OaNkOLXb0yEAdYnCol+dxiTJlWDhM08pgi06YAScfSXAC64JOMi2KvLALktrvvG 7u7S89l+SHgoQXAZuE8LaMM6D/G/Zp1zIHAUZld/UpXT3/NciM9maXo7FJG98LZutQ/m C8sK9JSS+GiD3VjJxz3kt9VJrfeK1gABgX3JHeEGh2bAC6FEPdywz8oqoU8Gk4+kyszo iTJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=9D9ZSTqAF5Glu9GpOe0YOBuqDAgxeZURoWricEHCePU=; b=iIywV+tK33PQ57S428/DCporlz6Ix4nne4hKNzwovODiVJNS4xNzeBgwJ4r7Wasxbe gbseud5CJ4Vhq6goSPzUF6shc7TBSAbHq3NZltRLhjgObSqIQoAbFgI91kGqNmlPXg8X 7RHlrHwBtvf5OWBwdHNM9BIvjCQnP9+TACKofuItg+CkT6w8p/tWp3irjgQVEsmIZAvK g+Uv1wHLleZN4gnjgvGtH7rfX8v1/UbrU8YkO4swEALRx+L9HMOhzh2jHmPEIO8FxmRm /ewkO33C+aoVjFwEvqg++G8+8/Q6DlX6d3GeF5kc4AH5J+37vJhRZCoPmriF9y5NDTLL 8H3A== X-Gm-Message-State: AKaTC02ZtX935zWcmKnavV4+6BvWbSZBDkVs6N0lkyMyYHB1LP7mDR06nOHCxwAnIfMVW4Biiu6+m1Gy7qywPg== X-Received: by 10.36.84.138 with SMTP id t132mr35191448ita.103.1480628502004; Thu, 01 Dec 2016 13:41:42 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.31.199 with HTTP; Thu, 1 Dec 2016 13:41:41 -0800 (PST) X-Originating-IP: [69.53.245.200] In-Reply-To: <20161201164807.GE27291@strugglingcoder.info> References: <201612010435.uB14Zh21020050@repo.freebsd.org> <20161201164807.GE27291@strugglingcoder.info> From: Warner Losh Date: Thu, 1 Dec 2016 14:41:41 -0700 X-Google-Sender-Auth: ZMWV2R-qg6DwPeAZbuR09usPZOg Message-ID: Subject: Re: svn commit: r309351 - head/etc/defaults To: hiren panchasara Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 21:41:43 -0000 On Thu, Dec 1, 2016 at 9:48 AM, hiren panchasara wrote: > On 12/01/16 at 04:35P, Warner Losh wrote: >> Author: imp >> Date: Thu Dec 1 04:35:43 2016 >> New Revision: 309351 >> URL: https://svnweb.freebsd.org/changeset/base/309351 >> >> Log: >> Revert the 'performance' setting to 'NONE' from C2. > > Just a note that this commit reverts r282110. Yea, it's good for laptops, bad for servers. At least there's some Intel CPUs that this causes corruption with USB. That's being sorted out, but until that's done we need to fail more safe for our primary market. Warner From owner-svn-src-all@freebsd.org Thu Dec 1 22:12:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF467C61ABD; Thu, 1 Dec 2016 22:12:59 +0000 (UTC) (envelope-from bdrewery@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 B00651A4C; Thu, 1 Dec 2016 22:12:59 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB1MCwqb054485; Thu, 1 Dec 2016 22:12:58 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1MCwcl054481; Thu, 1 Dec 2016 22:12:58 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201612012212.uB1MCwcl054481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 1 Dec 2016 22:12:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309373 - in head: contrib/netbsd-tests/lib/libc/sys lib/libc/tests/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 22:13:00 -0000 Author: bdrewery Date: Thu Dec 1 22:12:58 2016 New Revision: 309373 URL: https://svnweb.freebsd.org/changeset/base/309373 Log: Fix setrlimit_test:setrlimit_memlock when the system has exceeded vm.max_wired. This uses the same fix as r294894 did for the mlock test. The code from that commit is moved into a common object file which PROGS supports building first. Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D8689 Added: head/lib/libc/tests/sys/mlock_helper.c (contents, props changed) Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c head/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c head/lib/libc/tests/sys/Makefile Modified: head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c Thu Dec 1 21:08:42 2016 (r309372) +++ head/contrib/netbsd-tests/lib/libc/sys/t_mlock.c Thu Dec 1 22:12:58 2016 (r309373) @@ -50,86 +50,13 @@ __RCSID("$NetBSD: t_mlock.c,v 1.6 2016/0 #include #define _KMEMUSER #include + +void set_vm_max_wired(int); +void restore_vm_max_wired(void); #endif static long page = 0; -#ifdef __FreeBSD__ -#define VM_MAX_WIRED "vm.max_wired" - -static void -vm_max_wired_sysctl(int *old_value, int *new_value) -{ - size_t old_len; - size_t new_len = (new_value == NULL ? 0 : sizeof(int)); - - if (old_value == NULL) - printf("Setting the new value to %d\n", *new_value); - else { - ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, NULL, &old_len, - new_value, new_len) == 0, - "sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno)); - } - - ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, old_value, &old_len, - new_value, new_len) == 0, - "sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno)); - - if (old_value != NULL) - printf("Saved the old value (%d)\n", *old_value); -} - -static void -set_vm_max_wired(int new_value) -{ - FILE *fp; - int old_value; - - fp = fopen(VM_MAX_WIRED, "w"); - if (fp == NULL) { - atf_tc_skip("could not open %s for writing: %s", - VM_MAX_WIRED, strerror(errno)); - return; - } - - vm_max_wired_sysctl(&old_value, NULL); - - ATF_REQUIRE_MSG(fprintf(fp, "%d", old_value) > 0, - "saving %s failed", VM_MAX_WIRED); - - fclose(fp); - - vm_max_wired_sysctl(NULL, &new_value); -} - -static void -restore_vm_max_wired(void) -{ - FILE *fp; - int saved_max_wired; - - fp = fopen(VM_MAX_WIRED, "r"); - if (fp == NULL) { - perror("fopen failed\n"); - return; - } - - if (fscanf(fp, "%d", &saved_max_wired) != 1) { - perror("fscanf failed\n"); - fclose(fp); - return; - } - - fclose(fp); - printf("old value in %s: %d\n", VM_MAX_WIRED, saved_max_wired); - - if (saved_max_wired == 0) /* This will cripple the test host */ - return; - - vm_max_wired_sysctl(NULL, &saved_max_wired); -} -#endif - ATF_TC(mlock_clip); ATF_TC_HEAD(mlock_clip, tc) { Modified: head/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c Thu Dec 1 21:08:42 2016 (r309372) +++ head/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c Thu Dec 1 22:12:58 2016 (r309373) @@ -50,6 +50,11 @@ __RCSID("$NetBSD: t_setrlimit.c,v 1.5 20 #include #include +#ifdef __FreeBSD__ +void set_vm_max_wired(int); +void restore_vm_max_wired(void); +#endif + static void sighandler(int); static const char path[] = "setrlimit"; @@ -235,10 +240,18 @@ sighandler(int signo) _exit(EXIT_SUCCESS); } +#ifdef __FreeBSD__ +ATF_TC_WITH_CLEANUP(setrlimit_memlock); +#else ATF_TC(setrlimit_memlock); +#endif ATF_TC_HEAD(setrlimit_memlock, tc) { atf_tc_set_md_var(tc, "descr", "Test setrlimit(2), RLIMIT_MEMLOCK"); +#ifdef __FreeBSD__ + atf_tc_set_md_var(tc, "require.config", "allow_sysctl_side_effects"); + atf_tc_set_md_var(tc, "require.user", "root"); +#endif } ATF_TC_BODY(setrlimit_memlock, tc) @@ -249,6 +262,11 @@ ATF_TC_BODY(setrlimit_memlock, tc) pid_t pid; int sta; +#ifdef __FreeBSD__ + /* Set max_wired really really high to avoid EAGAIN */ + set_vm_max_wired(INT_MAX); +#endif + page = sysconf(_SC_PAGESIZE); ATF_REQUIRE(page >= 0); @@ -292,6 +310,14 @@ ATF_TC_BODY(setrlimit_memlock, tc) atf_tc_fail("RLIMIT_MEMLOCK not enforced"); } +#ifdef __FreeBSD__ +ATF_TC_CLEANUP(setrlimit_memlock, tc) +{ + + restore_vm_max_wired(); +} +#endif + ATF_TC(setrlimit_nofile_1); ATF_TC_HEAD(setrlimit_nofile_1, tc) { Modified: head/lib/libc/tests/sys/Makefile ============================================================================== --- head/lib/libc/tests/sys/Makefile Thu Dec 1 21:08:42 2016 (r309372) +++ head/lib/libc/tests/sys/Makefile Thu Dec 1 22:12:58 2016 (r309373) @@ -68,6 +68,9 @@ LIBADD.timer_create_test+= rt .include "../Makefile.netbsd-tests" +SRCS.mlock_test+= mlock_helper.c +SRCS.setrlimit_test+= mlock_helper.c + .if ${COMPILER_TYPE} == "gcc" WARNS?= 3 .else Added: head/lib/libc/tests/sys/mlock_helper.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/tests/sys/mlock_helper.c Thu Dec 1 22:12:58 2016 (r309373) @@ -0,0 +1,114 @@ +/*- + * Copyright (C) 2016 Bryan Drewery + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * Helper for mlock(3) to avoid EAGAIN errors + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include + +#define VM_MAX_WIRED "vm.max_wired" + +static void +vm_max_wired_sysctl(int *old_value, int *new_value) +{ + size_t old_len; + size_t new_len = (new_value == NULL ? 0 : sizeof(int)); + + if (old_value == NULL) + printf("Setting the new value to %d\n", *new_value); + else { + ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, NULL, &old_len, + new_value, new_len) == 0, + "sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno)); + } + + ATF_REQUIRE_MSG(sysctlbyname(VM_MAX_WIRED, old_value, &old_len, + new_value, new_len) == 0, + "sysctlbyname(%s) failed: %s", VM_MAX_WIRED, strerror(errno)); + + if (old_value != NULL) + printf("Saved the old value (%d)\n", *old_value); +} + +void +set_vm_max_wired(int new_value) +{ + FILE *fp; + int old_value; + + fp = fopen(VM_MAX_WIRED, "w"); + if (fp == NULL) { + atf_tc_skip("could not open %s for writing: %s", + VM_MAX_WIRED, strerror(errno)); + return; + } + + vm_max_wired_sysctl(&old_value, NULL); + + ATF_REQUIRE_MSG(fprintf(fp, "%d", old_value) > 0, + "saving %s failed", VM_MAX_WIRED); + + fclose(fp); + + vm_max_wired_sysctl(NULL, &new_value); +} + +void +restore_vm_max_wired(void) +{ + FILE *fp; + int saved_max_wired; + + fp = fopen(VM_MAX_WIRED, "r"); + if (fp == NULL) { + perror("fopen failed\n"); + return; + } + + if (fscanf(fp, "%d", &saved_max_wired) != 1) { + perror("fscanf failed\n"); + fclose(fp); + return; + } + + fclose(fp); + printf("old value in %s: %d\n", VM_MAX_WIRED, saved_max_wired); + + if (saved_max_wired == 0) /* This will cripple the test host */ + return; + + vm_max_wired_sysctl(NULL, &saved_max_wired); +} From owner-svn-src-all@freebsd.org Thu Dec 1 22:20:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4223C61C1D; Thu, 1 Dec 2016 22:20:29 +0000 (UTC) (envelope-from ken@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 830521D44; Thu, 1 Dec 2016 22:20:29 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB1MKSHv054948; Thu, 1 Dec 2016 22:20:28 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1MKSbR054941; Thu, 1 Dec 2016 22:20:28 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201612012220.uB1MKSbR054941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Thu, 1 Dec 2016 22:20:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309374 - in head: sbin/camcontrol sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 22:20:29 -0000 Author: ken Date: Thu Dec 1 22:20:27 2016 New Revision: 309374 URL: https://svnweb.freebsd.org/changeset/base/309374 Log: Add SCSI REPORT TIMESTAMP and SET TIMESTAMP support. This adds support to camcontrol(8) and libcam(3) for getting and setting the time on SCSI protocol drives. This is more commonly found on tape drives, but is a SPC (SCSI Primary Commands) command, and may be found on any device that speaks SCSI. The new camcontrol timestamp subcommand allows getting the current device time or setting the time to the current system time or any arbitrary time. sbin/camcontrol/Makefile: Add timestamp.c. sbin/camcontrol/camcontrol.8: Document the new timestamp subcommand. sbin/camcontrol/camcontrol.c: Add the timestamp subcommand to camcontrol. sbin/camcontrol/camcontrol.h: Add the timestamp() function prototype. sbin/camcontrol/timestamp.c: Timestamp setting and reporting functionality. sys/cam/scsi/scsi_all.c: Add two new CCB building functions, scsi_set_timestamp() and scsi_report_timestamp(). Also, add a new helper function, scsi_create_timestamp(). sys/cam/scsi/scsi_all.h: Add CDB and parameter data for the the set and report timestamp commands. Add function declarations for the new CCB building and helper functions. Submitted by: Sam Klopsch Sponsored by: Spectra Logic MFC After: 2 weeks Added: head/sbin/camcontrol/timestamp.c (contents, props changed) Modified: head/sbin/camcontrol/Makefile head/sbin/camcontrol/camcontrol.8 head/sbin/camcontrol/camcontrol.c head/sbin/camcontrol/camcontrol.h head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_all.h Modified: head/sbin/camcontrol/Makefile ============================================================================== --- head/sbin/camcontrol/Makefile Thu Dec 1 22:12:58 2016 (r309373) +++ head/sbin/camcontrol/Makefile Thu Dec 1 22:20:27 2016 (r309374) @@ -4,7 +4,7 @@ PACKAGE=runtime PROG= camcontrol SRCS= camcontrol.c util.c .if !defined(RELEASE_CRUNCH) -SRCS+= attrib.c epc.c fwdownload.c modeedit.c persist.c progress.c zone.c +SRCS+= attrib.c epc.c fwdownload.c modeedit.c persist.c progress.c timestamp.c zone.c .else CFLAGS+= -DMINIMALISTIC .endif Modified: head/sbin/camcontrol/camcontrol.8 ============================================================================== --- head/sbin/camcontrol/camcontrol.8 Thu Dec 1 22:12:58 2016 (r309373) +++ head/sbin/camcontrol/camcontrol.8 Thu Dec 1 22:20:27 2016 (r309374) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2016 +.Dd November 30, 2016 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -343,6 +343,11 @@ .Op Fl S Ar power_src .Op Fl T Ar timer .Nm +.Ic timestamp +.Op device id +.Op generic args +.Ao Fl r Oo Ns Fl f Ar format | Fl m | Fl U Oc | Fl s Ao Fl f Ar format Fl T Ar time | Fl U Ac Ac +.Nm .Ic help .Sh DESCRIPTION The @@ -2417,6 +2422,54 @@ supports, and a number of parameters abo whether it is enabled and what the timer value is. .El .El +.It Ic timestamp +Issue REPORT TIMESTAMP or SET TIMESTAMP +.Tn SCSI +commands. Either the +.Fl r +option or the +.Fl s +option must be specified. +.Bl -tag -width 6n +.It Fl r +Report the device's timestamp. +If no more arguments are specified, the timestamp will be reported using +the national representation of the date and time, followed by the time +zone. +.Bl -tag -width 9n +.It Fl f Ar format +Specify the strftime format string, as documented in strftime(3), to be used +to format the reported timestamp. +.It Fl m +Report the timestamp as milliseconds since the epoch. +.It Fl U +Report the timestamp using the national representation of the date and +time, but override the system time zone and use UTC instead. +.El +.El +.Bl -tag -width 6n +.It Fl s +Set the device's timestamp. Either the +.Fl f +and +.Fl T +options or the +.Fl U +option must be specified. +.Bl -tag -width 9n +.It Fl f Ar format +Specify the strptime format string, as documented in strptime(3). +The time must also be specified with the +.Fl T +option. +.It Fl T +Provide the time in the format specified with the +.Fl f +option. +.It Fl U +Set the timestamp to the host system's time in UTC. +.El +.El .It Ic help Print out verbose usage information. .El @@ -2730,6 +2783,18 @@ camcontrol epc ada0 -c list Display the ATA Power Conditions log (Log Address 0x08) for drive .Pa ada0 . +.Pp +.Bd -literal -offset indent +camcontrol timestamp sa0 -s -f "%A %c" \e + -T "Wednesday Wed Oct 26 21:43:57 2016" +.Ed +.Pp +Set the timestamp of drive +.Pa sa0 +using a +.Xr strptime 3 +format string followed by a time string +that was created using this format string. .Sh SEE ALSO .Xr cam 3 , .Xr cam_cdbparse 3 , Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Thu Dec 1 22:12:58 2016 (r309373) +++ head/sbin/camcontrol/camcontrol.c Thu Dec 1 22:20:27 2016 (r309374) @@ -103,7 +103,8 @@ typedef enum { CAM_CMD_OPCODES = 0x00000024, CAM_CMD_REPROBE = 0x00000025, CAM_CMD_ZONE = 0x00000026, - CAM_CMD_EPC = 0x00000027 + CAM_CMD_EPC = 0x00000027, + CAM_CMD_TIMESTAMP = 0x00000028 } cam_cmdmask; typedef enum { @@ -234,6 +235,7 @@ static struct camcontrol_opts option_tab {"opcodes", CAM_CMD_OPCODES, CAM_ARG_NONE, "No:s:T"}, {"zone", CAM_CMD_ZONE, CAM_ARG_NONE, "ac:l:No:P:"}, {"epc", CAM_CMD_EPC, CAM_ARG_NONE, "c:dDeHp:Pr:sS:T:"}, + {"timestamp", CAM_CMD_TIMESTAMP, CAM_ARG_NONE, "f:mrsUT:"}, #endif /* MINIMALISTIC */ {"help", CAM_CMD_USAGE, CAM_ARG_NONE, NULL}, {"-?", CAM_CMD_USAGE, CAM_ARG_NONE, NULL}, @@ -8922,6 +8924,9 @@ usage(int printlong) " camcontrol epc [dev_id][generic_args]<-c cmd> [-d] [-D] [-e]\n" " [-H] [-p power_cond] [-P] [-r rst_src] [-s]\n" " [-S power_src] [-T timer]\n" +" camcontrol timestamp [dev_id][generic_args] <-r [-f format|-m|-U]>|\n" +" <-s <-f format -T time | -U >>\n" +" \n" #endif /* MINIMALISTIC */ " camcontrol help\n"); if (!printlong) @@ -8966,6 +8971,7 @@ usage(int printlong) "opcodes send the SCSI REPORT SUPPORTED OPCODES command\n" "zone manage Zoned Block (Shingled) devices\n" "epc send ATA Extended Power Conditions commands\n" +"timestamp report or set the device's timestamp\n" "help this message\n" "Device Identifiers:\n" "bus:target specify the bus and target, lun defaults to 0\n" @@ -9157,6 +9163,17 @@ usage(int printlong) "-s save mode (timer, state, restore)\n" "-S power_src set power source: battery, nonbattery (source)\n" "-T timer set timer, seconds, .1 sec resolution (timer)\n" +"timestamp arguments:\n" +"-r report the timestamp of the device\n" +"-f format report the timestamp of the device with the given\n" +" strftime(3) format string\n" +"-m report the timestamp of the device as milliseconds since\n" +" January 1st, 1970\n" +"-U report the time with UTC instead of the local time zone\n" +"-s set the timestamp of the device\n" +"-f format the format of the time string passed into strptime(3)\n" +"-T time the time value passed into strptime(3)\n" +"-U set the timestamp of the device to UTC time\n" ); #endif /* MINIMALISTIC */ } @@ -9520,6 +9537,10 @@ main(int argc, char **argv) error = epc(cam_dev, argc, argv, combinedopt, retry_count, timeout, arglist & CAM_ARG_VERBOSE); break; + case CAM_CMD_TIMESTAMP: + error = timestamp(cam_dev, argc, argv, combinedopt, + retry_count, timeout, arglist & CAM_ARG_VERBOSE); + break; #endif /* MINIMALISTIC */ case CAM_CMD_USAGE: usage(1); Modified: head/sbin/camcontrol/camcontrol.h ============================================================================== --- head/sbin/camcontrol/camcontrol.h Thu Dec 1 22:12:58 2016 (r309373) +++ head/sbin/camcontrol/camcontrol.h Thu Dec 1 22:20:27 2016 (r309374) @@ -81,6 +81,9 @@ int zone(struct cam_device *device, int int retry_count, int timeout, int verbosemode); int epc(struct cam_device *device, int argc, char **argv, char *combinedopt, int retry_count, int timeout, int verbosemode); +int timestamp(struct cam_device *device, int argc, char **argv, + char *combinedopt, int retry_count, int timeout, + int verbosemode); void mode_sense(struct cam_device *device, int mode_page, int page_control, int dbd, int retry_count, int timeout, u_int8_t *data, int datalen); Added: head/sbin/camcontrol/timestamp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/camcontrol/timestamp.c Thu Dec 1 22:20:27 2016 (r309374) @@ -0,0 +1,494 @@ +/*- + * Copyright (c) 2016 Spectra Logic Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + * + * Authors: Ken Merry (Spectra Logic Corporation) + * Reid Linnemann (Spectra Logic Corporation) + * Samuel Klopsch (Spectra Logic Corporation) + */ +/* + * SCSI tape drive timestamp support + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include "camcontrol.h" + +#define TIMESTAMP_REPORT 0 +#define TIMESTAMP_SET 1 +#define MIL "milliseconds" +#define UTC "utc" + +static int set_restore_flags(struct cam_device *device, uint8_t *flags, + int set_flag, int retry_count, int timeout); +static int report_timestamp(struct cam_device *device, uint64_t *ts, + int retry_count, int timeout); +static int set_timestamp(struct cam_device *device, char *format_string, + char *timestamp_string, + int retry_count, int timeout); + +static int +set_restore_flags(struct cam_device *device, uint8_t *flags, int set_flag, + int retry_count, int timeout) +{ + unsigned long blk_desc_length, hdr_and_blk_length; + int error = 0; + struct scsi_control_ext_page *control_page = NULL; + struct scsi_mode_header_10 *mode_hdr = NULL; + struct scsi_mode_sense_10 *cdb = NULL; + union ccb *ccb = NULL; + unsigned long mode_buf_size = sizeof(struct scsi_mode_header_10) + + sizeof(struct scsi_mode_blk_desc) + + sizeof(struct scsi_control_ext_page); + uint8_t mode_buf[mode_buf_size]; + + ccb = cam_getccb(device); + if (ccb == NULL) { + warnx("%s: error allocating CCB", __func__); + error = 1; + goto bailout; + } + /* + * Get the control extension subpage, we'll send it back modified to + * enable SCSI control over the tape drive's timestamp + */ + scsi_mode_sense_len(&ccb->csio, + /*retries*/ retry_count, + /*cbfcnp*/ NULL, + /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*dbd*/ 0, + /*page_control*/ SMS_PAGE_CTRL_CURRENT, + /*page*/ SCEP_PAGE_CODE, + /*param_buf*/ &mode_buf[0], + /*param_len*/ mode_buf_size, + /*minimum_cmd_size*/ 10, + /*sense_len*/ SSD_FULL_SIZE, + /*timeout*/ timeout ? timeout : 5000); + /* + * scsi_mode_sense_len does not have a subpage argument at the moment, + * so we have to manually set the subpage code before calling + * cam_send_ccb(). + */ + cdb = (struct scsi_mode_sense_10 *)ccb->csio.cdb_io.cdb_bytes; + cdb->subpage = SCEP_SUBPAGE_CODE; + + ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; + if (retry_count > 0) + ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; + + error = cam_send_ccb(device, ccb); + if (error != 0) { + warn("error sending Mode Sense"); + goto bailout; + } + + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + error = 1; + goto bailout; + } + + mode_hdr = (struct scsi_mode_header_10 *)&mode_buf[0]; + blk_desc_length = scsi_2btoul(mode_hdr->blk_desc_len); + hdr_and_blk_length = sizeof(struct scsi_mode_header_10)+blk_desc_length; + /* + * Create the control page at the correct point in the mode_buf, it + * starts after the header and the blk description. + */ + control_page = (struct scsi_control_ext_page *)&mode_buf + [hdr_and_blk_length]; + if (set_flag != 0) { + *flags = control_page->flags; + /* + * Set the SCSIP flag to enable SCSI to change the + * tape drive's timestamp. + */ + control_page->flags |= SCEP_SCSIP; + } else { + control_page->flags = *flags; + } + + scsi_mode_select_len(&ccb->csio, + /*retries*/ retry_count, + /*cbfcnp*/ NULL, + /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*scsi_page_fmt*/ 1, + /*save_pages*/ 0, + /*param_buf*/ &mode_buf[0], + /*param_len*/ mode_buf_size, + /*minimum_cmd_size*/ 10, + /*sense_len*/ SSD_FULL_SIZE, + /*timeout*/ timeout ? timeout : 5000); + + ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; + if (retry_count > 0) + ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; + + error = cam_send_ccb(device, ccb); + if (error != 0) { + warn("error sending Mode Select"); + goto bailout; + } + + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + error = 1; + goto bailout; + } + +bailout: + if (ccb != NULL) + cam_freeccb(ccb); + + return error; +} + +static int +report_timestamp(struct cam_device *device, uint64_t *ts, + int retry_count, int timeout) +{ + int error = 0; + struct scsi_report_timestamp_data *report_buf = malloc( + sizeof(struct scsi_report_timestamp_data)); + uint8_t temp_timestamp[8]; + uint32_t report_buf_size = sizeof( + struct scsi_report_timestamp_data); + union ccb *ccb = NULL; + + ccb = cam_getccb(device); + if (ccb == NULL) { + warnx("%s: error allocating CCB", __func__); + error = 1; + goto bailout; + } + + scsi_report_timestamp(&ccb->csio, + /*retries*/ retry_count, + /*cbfcnp*/ NULL, + /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*pdf*/ 0, + /*buf*/ report_buf, + /*buf_len*/ report_buf_size, + /*sense_len*/ SSD_FULL_SIZE, + /*timeout*/ timeout ? timeout : 5000); + + ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; + if (retry_count > 0) + ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; + + error = cam_send_ccb(device, ccb); + if (error != 0) { + warn("error sending Report Timestamp"); + goto bailout; + } + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + error = 1; + goto bailout; + } + + bzero(temp_timestamp, sizeof(temp_timestamp)); + memcpy(&temp_timestamp[2], &report_buf->timestamp, 6); + + *ts = scsi_8btou64(temp_timestamp); + +bailout: + if (ccb != NULL) + cam_freeccb(ccb); + + return error; +} + +static int +set_timestamp(struct cam_device *device, char *format_string, + char *timestamp_string, int retry_count, + int timeout) +{ + struct scsi_set_timestamp_parameters ts_p; + time_t time_value; + struct tm time_struct; + uint8_t flags = 0; + int error = 0; + uint64_t ts = 0; + union ccb *ccb = NULL; + int do_restore_flags = 0; + + error = set_restore_flags(device, &flags, /*set_flag*/ 1, retry_count, + timeout); + if (error != 0) + goto bailout; + + do_restore_flags = 1; + + ccb = cam_getccb(device); + if (ccb == NULL) { + warnx("%s: error allocating CCB", __func__); + error = 1; + goto bailout; + } + + if (strcmp(format_string, UTC) == 0) { + time(&time_value); + ts = (uint64_t) time_value; + } else { + bzero(&time_struct, sizeof(struct tm)); + strptime(timestamp_string, format_string, &time_struct); + time_value = mktime(&time_struct); + ts = (uint64_t) time_value; + } + /* Convert time from seconds to milliseconds */ + ts *= 1000; + scsi_create_timestamp(ts_p.timestamp, ts); + + scsi_set_timestamp(&ccb->csio, + /*retries*/ retry_count, + /*cbfcnp*/ NULL, + /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*buf*/ &ts_p, + /*buf_len*/ sizeof(ts_p), + /*sense_len*/ SSD_FULL_SIZE, + /*timeout*/ timeout ? timeout : 5000); + + ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; + if (retry_count > 0) + ccb->ccb_h.flags |= CAM_PASS_ERR_RECOVER; + + error = cam_send_ccb(device, ccb); + if (error != 0) { + warn("error sending Set Timestamp"); + goto bailout; + } + + if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + cam_error_print(device, ccb, CAM_ESF_ALL, + CAM_EPF_ALL, stderr); + error = 1; + goto bailout; + } + + printf("Timestamp set to %ju\n", (uintmax_t)ts); + +bailout: + if (do_restore_flags != 0) + error = set_restore_flags(device, &flags, /*set_flag*/ 0, + retry_count, timeout); + if (ccb != NULL) + cam_freeccb(ccb); + + return error; +} + +int +timestamp(struct cam_device *device, int argc, char **argv, char *combinedopt, + int retry_count, int timeout, int verbosemode __unused) +{ + int c; + uint64_t ts; + char *format_string = NULL; + char *timestamp_string = NULL; + int action = -1; + int error = 0; + int single_arg = 0; + int do_utc = 0; + + while ((c = getopt(argc, argv, combinedopt)) != -1) { + switch (c) { + case 'r': { + if (action != -1) { + warnx("Use only one -r or only one -s"); + error =1; + goto bailout; + } + action = TIMESTAMP_REPORT; + break; + } + case 's': { + if (action != -1) { + warnx("Use only one -r or only one -s"); + error = 1; + goto bailout; + } + action = TIMESTAMP_SET; + break; + } + case 'f': { + single_arg++; + format_string = strdup(optarg); + if (format_string == NULL) { + warn("Error allocating memory for format " + "argument"); + error = 1; + goto bailout; + } + break; + } + case 'm': { + single_arg++; + format_string = strdup(MIL); + if (format_string == NULL) { + warn("Error allocating memory"); + error = 1; + goto bailout; + } + break; + } + case 'U': { + do_utc = 1; + break; + } + case 'T': + timestamp_string = strdup(optarg); + if (timestamp_string == NULL) { + warn("Error allocating memory for format " + "argument"); + error = 1; + goto bailout; + } + break; + default: + break; + } + } + + if (action == -1) { + warnx("Must specify an action, either -r or -s"); + error = 1; + goto bailout; + } + + if (single_arg > 1) { + warnx("Select only one: %s", + (action == TIMESTAMP_REPORT) ? + "-f format or -m for the -r flag" : + "-f format -T time or -U for the -s flag"); + error = 1; + goto bailout; + } + + if (action == TIMESTAMP_SET) { + if ((format_string == NULL) + && (do_utc == 0)) { + warnx("Must specify either -f format or -U for " + "setting the timestamp"); + error = 1; + } else if ((format_string != NULL) + && (do_utc != 0)) { + warnx("Must specify only one of -f or -U to set " + "the timestamp"); + error = 1; + } else if ((format_string != NULL) + && (strcmp(format_string, MIL) == 0)) { + warnx("-m is not allowed for setting the " + "timestamp"); + error = 1; + } else if ((do_utc == 0) + && (timestamp_string == NULL)) { + warnx("Must specify the time (-T) to set as the " + "timestamp"); + error = 1; + } + if (error != 0) + goto bailout; + } else if (action == TIMESTAMP_REPORT) { + if (format_string == NULL) { + format_string = strdup("%c %Z"); + if (format_string == NULL) { + warn("Error allocating memory for format " + "string"); + error = 1; + goto bailout; + } + } + } + + if (action == TIMESTAMP_REPORT) { + error = report_timestamp(device, &ts, retry_count, + timeout); + if (error != 0) { + goto bailout; + } else if (strcmp(format_string, MIL) == 0) { + printf("Timestamp in milliseconds: %ju\n", + (uintmax_t)ts); + } else { + char temp_timestamp_string[100]; + time_t time_var = ts / 1000; + const struct tm *restrict cur_time; + + setlocale(LC_TIME, ""); + if (do_utc != 0) + cur_time = gmtime(&time_var); + else + cur_time = localtime(&time_var); + + strftime(temp_timestamp_string, + sizeof(temp_timestamp_string), format_string, + cur_time); + printf("Formatted timestamp: %s\n", + temp_timestamp_string); + } + } else if (action == TIMESTAMP_SET) { + if (do_utc != 0) { + format_string = strdup(UTC); + if (format_string == NULL) { + warn("Error allocating memory for format " + "string"); + error = 1; + goto bailout; + } + } + + error = set_timestamp(device, format_string, timestamp_string, + retry_count, timeout); + } + +bailout: + free(format_string); + free(timestamp_string); + + return (error); +} Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Thu Dec 1 22:12:58 2016 (r309373) +++ head/sys/cam/scsi/scsi_all.c Thu Dec 1 22:20:27 2016 (r309374) @@ -7947,6 +7947,32 @@ scsi_report_target_group(struct ccb_scsi } void +scsi_report_timestamp(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, u_int8_t pdf, + void *buf, u_int32_t alloc_len, + u_int8_t sense_len, u_int32_t timeout) +{ + struct scsi_timestamp *scsi_cmd; + + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_IN, + tag_action, + /*data_ptr*/(u_int8_t *)buf, + /*dxfer_len*/alloc_len, + sense_len, + sizeof(*scsi_cmd), + timeout); + scsi_cmd = (struct scsi_timestamp *)&csio->cdb_io.cdb_bytes; + bzero(scsi_cmd, sizeof(*scsi_cmd)); + scsi_cmd->opcode = MAINTENANCE_IN; + scsi_cmd->service_action = REPORT_TIMESTAMP | pdf; + scsi_ulto4b(alloc_len, scsi_cmd->length); +} + +void scsi_set_target_group(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, void *buf, u_int32_t alloc_len, @@ -7971,6 +7997,45 @@ scsi_set_target_group(struct ccb_scsiio scsi_ulto4b(alloc_len, scsi_cmd->length); } +void +scsi_create_timestamp(uint8_t *timestamp_6b_buf, + uint64_t timestamp) +{ + uint8_t buf[8]; + scsi_u64to8b(timestamp, buf); + /* + * Using memcopy starting at buf[2] because the set timestamp parameters + * only has six bytes for the timestamp to fit into, and we don't have a + * scsi_u64to6b function. + */ + memcpy(timestamp_6b_buf, &buf[2], 6); +} + +void +scsi_set_timestamp(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, union ccb *), + u_int8_t tag_action, void *buf, u_int32_t alloc_len, + u_int8_t sense_len, u_int32_t timeout) +{ + struct scsi_timestamp *scsi_cmd; + + cam_fill_csio(csio, + retries, + cbfcnp, + /*flags*/CAM_DIR_OUT, + tag_action, + /*data_ptr*/(u_int8_t *) buf, + /*dxfer_len*/alloc_len, + sense_len, + sizeof(*scsi_cmd), + timeout); + scsi_cmd = (struct scsi_timestamp *)&csio->cdb_io.cdb_bytes; + bzero(scsi_cmd, sizeof(*scsi_cmd)); + scsi_cmd->opcode = MAINTENANCE_OUT; + scsi_cmd->service_action = SET_TIMESTAMP; + scsi_ulto4b(alloc_len, scsi_cmd->length); +} + /* * Syncronize the media to the contents of the cache for * the given lba/count pair. Specifying 0/0 means sync Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Thu Dec 1 22:12:58 2016 (r309373) +++ head/sys/cam/scsi/scsi_all.h Thu Dec 1 22:20:27 2016 (r309374) @@ -702,7 +702,9 @@ struct scsi_control_page { struct scsi_control_ext_page { uint8_t page_code; +#define SCEP_PAGE_CODE 0x0a uint8_t subpage_code; +#define SCEP_SUBPAGE_CODE 0x01 uint8_t page_length[2]; uint8_t flags; #define SCEP_TCMOS 0x04 /* Timestamp Changeable by */ @@ -2971,6 +2973,31 @@ struct scsi_target_group uint8_t control; }; +struct scsi_timestamp +{ + uint8_t opcode; + uint8_t service_action; + uint8_t reserved1[4]; + uint8_t length[4]; + uint8_t reserved2; + uint8_t control; +}; + +struct scsi_set_timestamp_parameters +{ + uint8_t reserved1[4]; + uint8_t timestamp[6]; + uint8_t reserved2[4]; +}; + +struct scsi_report_timestamp_parameter_data +{ + uint8_t length[2]; + uint8_t reserved1[2]; + uint8_t timestamp[6]; + uint8_t reserved2[2]; +}; + struct scsi_target_port_descriptor { uint8_t reserved[2]; uint8_t relative_target_port_identifier[2]; @@ -3966,12 +3993,29 @@ void scsi_report_target_group(struct cc u_int32_t alloc_len, u_int8_t sense_len, u_int32_t timeout); +void scsi_report_timestamp(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, + union ccb *), u_int8_t tag_action, + u_int8_t pdf, + void *buf, + u_int32_t alloc_len, u_int8_t sense_len, + u_int32_t timeout); + void scsi_set_target_group(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), u_int8_t tag_action, void *buf, u_int32_t alloc_len, u_int8_t sense_len, u_int32_t timeout); +void scsi_create_timestamp(uint8_t *timestamp_6b_buf, + uint64_t timestamp); + +void scsi_set_timestamp(struct ccb_scsiio *csio, u_int32_t retries, + void (*cbfcnp)(struct cam_periph *, + union ccb *), u_int8_t tag_action, + void *buf, u_int32_t alloc_len, + u_int8_t sense_len, u_int32_t timeout); + void scsi_synchronize_cache(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, From owner-svn-src-all@freebsd.org Thu Dec 1 22:22:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD561C61E3C; Thu, 1 Dec 2016 22:22:20 +0000 (UTC) (envelope-from gonzo@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 ABE7D1025; Thu, 1 Dec 2016 22:22:20 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB1MMJEv056797; Thu, 1 Dec 2016 22:22:19 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1MMJE8056794; Thu, 1 Dec 2016 22:22:19 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201612012222.uB1MMJE8056794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Thu, 1 Dec 2016 22:22:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309375 - in stable/11/sys: dev/gpio modules modules/bytgpio X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 22:22:21 -0000 Author: gonzo Date: Thu Dec 1 22:22:19 2016 New Revision: 309375 URL: https://svnweb.freebsd.org/changeset/base/309375 Log: MFC r308898, r308940, r308942, r308944, r309112 r308898: [bytgpio] Fix USB disconnect event after listsing pins on gpioc2 - Do not set input flag when reading value from GPIO pin, it is not required and for gpioc2(S5 bank) setting both input and output flags leads to some kind of electric interference (curren drop?) that causes USB devices to disconnect - Check pad configuration when attaching device and provide IN/OUT capabilities only for pads that are configured as GPIO. Do not let user code to configure or change value of non-GPIO pads. There is no information for NC bank in intel's datasheet so for now function check is ignored for pins in it Reported by: Frank H. MFC after: 3 days r308940: [bytgpio] prepare bytgpio(4) for modularization - Add detach method - module should depend on gpiobus, not gpio r308942: [bytgpio] Add module for bytgpio(4) MFC after: 3 days r308944 by hiren@: r308942 broke kernel build. Add acpi_if.h to module makefile to fix it. Submitted by: peter r309112: [bytgpio] Fix pc98 build by disabling bytgpio module for this platform Reported by: dim Added: stable/11/sys/modules/bytgpio/ - copied from r308942, head/sys/modules/bytgpio/ Modified: stable/11/sys/dev/gpio/bytgpio.c stable/11/sys/modules/Makefile stable/11/sys/modules/bytgpio/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/gpio/bytgpio.c ============================================================================== --- stable/11/sys/dev/gpio/bytgpio.c Thu Dec 1 22:20:27 2016 (r309374) +++ stable/11/sys/dev/gpio/bytgpio.c Thu Dec 1 22:22:19 2016 (r309375) @@ -60,6 +60,16 @@ __FBSDID("$FreeBSD$"); #define BYTGPIO_ASSERT_LOCKED(_sc) mtx_assert(&(_sc)->sc_mtx, MA_OWNED) #define BYTGPIO_ASSERT_UNLOCKED(_sc) mtx_assert(&(_sc)->sc_mtx, MA_NOTOWNED) +struct pinmap_info { + int reg; + int pad_func; +}; + +/* Ignore function check, no info is available at the moment */ +#define PADCONF_FUNC_ANY -1 + +#define GPIO_PIN_MAP(r, f) { .reg = (r), .pad_func = (f) } + struct bytgpio_softc { ACPI_HANDLE sc_handle; device_t sc_dev; @@ -69,44 +79,212 @@ struct bytgpio_softc { struct resource *sc_mem_res; int sc_npins; const char* sc_bank_prefix; - const int *sc_pinpad_map; + const struct pinmap_info *sc_pinpad_map; + /* List of current functions for pads shared by GPIO */ + int *sc_pad_funcs; }; static int bytgpio_probe(device_t dev); static int bytgpio_attach(device_t dev); +static int bytgpio_detach(device_t dev); -#define SCORE_UID 1 -#define SCORE_BANK_PREFIX "GPIO_S0_SC" -const int bytgpio_score_pins[] = { - 85, 89, 93, 96, 99, 102, 98, 101, 34, 37, 36, 38, 39, 35, 40, - 84, 62, 61, 64, 59, 54, 56, 60, 55, 63, 57, 51, 50, 53, 47, - 52, 49, 48, 43, 46, 41, 45, 42, 58, 44, 95, 105, 70, 68, 67, - 66, 69, 71, 65, 72, 86, 90, 88, 92, 103, 77, 79, 83, 78, 81, - 80, 82, 13, 12, 15, 14, 17, 18, 19, 16, 2, 1, 0, 4, 6, 7, 9, - 8, 33, 32, 31, 30, 29, 27, 25, 28, 26, 23, 21, 20, 24, 22, 5, - 3, 10, 11, 106, 87, 91, 104, 97, 100 +#define SCORE_UID 1 +#define SCORE_BANK_PREFIX "GPIO_S0_SC" +const struct pinmap_info bytgpio_score_pins[] = { + GPIO_PIN_MAP(85, 0), + GPIO_PIN_MAP(89, 0), + GPIO_PIN_MAP(93, 0), + GPIO_PIN_MAP(96, 0), + GPIO_PIN_MAP(99, 0), + GPIO_PIN_MAP(102, 0), + GPIO_PIN_MAP(98, 0), + GPIO_PIN_MAP(101, 0), + GPIO_PIN_MAP(34, 0), + GPIO_PIN_MAP(37, 0), + GPIO_PIN_MAP(36, 0), + GPIO_PIN_MAP(38, 0), + GPIO_PIN_MAP(39, 0), + GPIO_PIN_MAP(35, 0), + GPIO_PIN_MAP(40, 0), + GPIO_PIN_MAP(84, 0), + GPIO_PIN_MAP(62, 0), + GPIO_PIN_MAP(61, 0), + GPIO_PIN_MAP(64, 0), + GPIO_PIN_MAP(59, 0), + GPIO_PIN_MAP(54, 0), + GPIO_PIN_MAP(56, 0), + GPIO_PIN_MAP(60, 0), + GPIO_PIN_MAP(55, 0), + GPIO_PIN_MAP(63, 0), + GPIO_PIN_MAP(57, 0), + GPIO_PIN_MAP(51, 0), + GPIO_PIN_MAP(50, 0), + GPIO_PIN_MAP(53, 0), + GPIO_PIN_MAP(47, 0), + GPIO_PIN_MAP(52, 0), + GPIO_PIN_MAP(49, 0), + GPIO_PIN_MAP(48, 0), + GPIO_PIN_MAP(43, 0), + GPIO_PIN_MAP(46, 0), + GPIO_PIN_MAP(41, 0), + GPIO_PIN_MAP(45, 0), + GPIO_PIN_MAP(42, 0), + GPIO_PIN_MAP(58, 0), + GPIO_PIN_MAP(44, 0), + GPIO_PIN_MAP(95, 0), + GPIO_PIN_MAP(105, 0), + GPIO_PIN_MAP(70, 0), + GPIO_PIN_MAP(68, 0), + GPIO_PIN_MAP(67, 0), + GPIO_PIN_MAP(66, 0), + GPIO_PIN_MAP(69, 0), + GPIO_PIN_MAP(71, 0), + GPIO_PIN_MAP(65, 0), + GPIO_PIN_MAP(72, 0), + GPIO_PIN_MAP(86, 0), + GPIO_PIN_MAP(90, 0), + GPIO_PIN_MAP(88, 0), + GPIO_PIN_MAP(92, 0), + GPIO_PIN_MAP(103, 0), + GPIO_PIN_MAP(77, 0), + GPIO_PIN_MAP(79, 0), + GPIO_PIN_MAP(83, 0), + GPIO_PIN_MAP(78, 0), + GPIO_PIN_MAP(81, 0), + GPIO_PIN_MAP(80, 0), + GPIO_PIN_MAP(82, 0), + GPIO_PIN_MAP(13, 0), + GPIO_PIN_MAP(12, 0), + GPIO_PIN_MAP(15, 0), + GPIO_PIN_MAP(14, 0), + GPIO_PIN_MAP(17, 0), + GPIO_PIN_MAP(18, 0), + GPIO_PIN_MAP(19, 0), + GPIO_PIN_MAP(16, 0), + GPIO_PIN_MAP(2, 0), + GPIO_PIN_MAP(1, 0), + GPIO_PIN_MAP(0, 0), + GPIO_PIN_MAP(4, 0), + GPIO_PIN_MAP(6, 0), + GPIO_PIN_MAP(7, 0), + GPIO_PIN_MAP(9, 0), + GPIO_PIN_MAP(8, 0), + GPIO_PIN_MAP(33, 0), + GPIO_PIN_MAP(32, 0), + GPIO_PIN_MAP(31, 0), + GPIO_PIN_MAP(30, 0), + GPIO_PIN_MAP(29, 0), + GPIO_PIN_MAP(27, 0), + GPIO_PIN_MAP(25, 0), + GPIO_PIN_MAP(28, 0), + GPIO_PIN_MAP(26, 0), + GPIO_PIN_MAP(23, 0), + GPIO_PIN_MAP(21, 0), + GPIO_PIN_MAP(20, 0), + GPIO_PIN_MAP(24, 0), + GPIO_PIN_MAP(22, 0), + GPIO_PIN_MAP(5, 1), + GPIO_PIN_MAP(3, 1), + GPIO_PIN_MAP(10, 0), + GPIO_PIN_MAP(11, 0), + GPIO_PIN_MAP(106, 0), + GPIO_PIN_MAP(87, 0), + GPIO_PIN_MAP(91, 0), + GPIO_PIN_MAP(104, 0), + GPIO_PIN_MAP(97, 0), + GPIO_PIN_MAP(100, 0) }; -#define SCORE_PINS nitems(bytgpio_score_pins) -#define NCORE_UID 2 -#define NCORE_BANK_PREFIX "GPIO_S0_NC" -const int bytgpio_ncore_pins[] = { - 19, 18, 17, 20, 21, 22, 24, 25, 23, 16, 14, 15, 12, 26, 27, - 1, 4, 8, 11, 0, 3, 6, 10, 13, 2, 5, 9, 7 +#define SCORE_PINS nitems(bytgpio_score_pins) + +#define NCORE_UID 2 +#define NCORE_BANK_PREFIX "GPIO_S0_NC" +const struct pinmap_info bytgpio_ncore_pins[] = { + GPIO_PIN_MAP(19, PADCONF_FUNC_ANY), + GPIO_PIN_MAP(18, PADCONF_FUNC_ANY), + GPIO_PIN_MAP(17, PADCONF_FUNC_ANY), + GPIO_PIN_MAP(20, PADCONF_FUNC_ANY), + GPIO_PIN_MAP(21, PADCONF_FUNC_ANY), + GPIO_PIN_MAP(22, PADCONF_FUNC_ANY), + GPIO_PIN_MAP(24, PADCONF_FUNC_ANY), + GPIO_PIN_MAP(25, PADCONF_FUNC_ANY), + GPIO_PIN_MAP(23, PADCONF_FUNC_ANY), + GPIO_PIN_MAP(16, PADCONF_FUNC_ANY), + GPIO_PIN_MAP(14, PADCONF_FUNC_ANY), + GPIO_PIN_MAP(15, PADCONF_FUNC_ANY), + GPIO_PIN_MAP(12, PADCONF_FUNC_ANY), + GPIO_PIN_MAP(26, PADCONF_FUNC_ANY), + GPIO_PIN_MAP(27, PADCONF_FUNC_ANY), + GPIO_PIN_MAP(1, PADCONF_FUNC_ANY), + GPIO_PIN_MAP(4, PADCONF_FUNC_ANY), + GPIO_PIN_MAP(8, PADCONF_FUNC_ANY), + GPIO_PIN_MAP(11, PADCONF_FUNC_ANY), + GPIO_PIN_MAP(0, PADCONF_FUNC_ANY), + GPIO_PIN_MAP(3, PADCONF_FUNC_ANY), + GPIO_PIN_MAP(6, PADCONF_FUNC_ANY), + GPIO_PIN_MAP(10, PADCONF_FUNC_ANY), + GPIO_PIN_MAP(13, PADCONF_FUNC_ANY), + GPIO_PIN_MAP(2, PADCONF_FUNC_ANY), + GPIO_PIN_MAP(5, PADCONF_FUNC_ANY), + GPIO_PIN_MAP(9, PADCONF_FUNC_ANY), + GPIO_PIN_MAP(7, PADCONF_FUNC_ANY) }; #define NCORE_PINS nitems(bytgpio_ncore_pins) -#define SUS_UID 3 -#define SUS_BANK_PREFIX "GPIO_S5_" -const int bytgpio_sus_pins[] = { - 29, 33, 30, 31, 32, 34, 36, 35, 38, 37, 18, 7, 11, 20, 17, 1, - 8, 10, 19, 12, 0, 2, 23, 39, 28, 27, 22, 21, 24, 25, 26, 51, - 56, 54, 49, 55, 48, 57, 50, 58, 52, 53, 59, 40 +#define SUS_UID 3 +#define SUS_BANK_PREFIX "GPIO_S5_" +const struct pinmap_info bytgpio_sus_pins[] = { + GPIO_PIN_MAP(29, 0), + GPIO_PIN_MAP(33, 0), + GPIO_PIN_MAP(30, 0), + GPIO_PIN_MAP(31, 0), + GPIO_PIN_MAP(32, 0), + GPIO_PIN_MAP(34, 0), + GPIO_PIN_MAP(36, 0), + GPIO_PIN_MAP(35, 0), + GPIO_PIN_MAP(38, 0), + GPIO_PIN_MAP(37, 0), + GPIO_PIN_MAP(18, 0), + GPIO_PIN_MAP(7, 1), + GPIO_PIN_MAP(11, 1), + GPIO_PIN_MAP(20, 1), + GPIO_PIN_MAP(17, 1), + GPIO_PIN_MAP(1, 1), + GPIO_PIN_MAP(8, 1), + GPIO_PIN_MAP(10, 1), + GPIO_PIN_MAP(19, 1), + GPIO_PIN_MAP(12, 1), + GPIO_PIN_MAP(0, 1), + GPIO_PIN_MAP(2, 1), + GPIO_PIN_MAP(23, 0), + GPIO_PIN_MAP(39, 0), + GPIO_PIN_MAP(28, 0), + GPIO_PIN_MAP(27, 0), + GPIO_PIN_MAP(22, 0), + GPIO_PIN_MAP(21, 0), + GPIO_PIN_MAP(24, 0), + GPIO_PIN_MAP(25, 0), + GPIO_PIN_MAP(26, 0), + GPIO_PIN_MAP(51, 0), + GPIO_PIN_MAP(56, 0), + GPIO_PIN_MAP(54, 0), + GPIO_PIN_MAP(49, 0), + GPIO_PIN_MAP(55, 0), + GPIO_PIN_MAP(48, 0), + GPIO_PIN_MAP(57, 0), + GPIO_PIN_MAP(50, 0), + GPIO_PIN_MAP(58, 0), + GPIO_PIN_MAP(52, 0), + GPIO_PIN_MAP(53, 0), + GPIO_PIN_MAP(59, 0), + GPIO_PIN_MAP(40, 0) }; + #define SUS_PINS nitems(bytgpio_sus_pins) -#define BYGPIO_PIN_REGISTER(sc, pin, reg) ((sc)->sc_pinpad_map[(pin)] * 16 + (reg)) +#define BYGPIO_PIN_REGISTER(sc, pin, r) ((sc)->sc_pinpad_map[(pin)].reg * 16 + (r)) #define BYTGPIO_PCONF0 0x0000 +#define BYTGPIO_PCONF0_FUNC_MASK 7 #define BYTGPIO_PAD_VAL 0x0008 #define BYTGPIO_PAD_VAL_LEVEL (1 << 0) #define BYTGPIO_PAD_VAL_I_OUTPUT_ENABLED (1 << 1) @@ -158,6 +336,19 @@ bytgpio_valid_pin(struct bytgpio_softc * return (0); } +/* + * Returns true if pad configured to be used as GPIO + */ +static bool +bytgpio_pad_is_gpio(struct bytgpio_softc *sc, int pin) +{ + if ((sc->sc_pinpad_map[pin].pad_func == PADCONF_FUNC_ANY) || + (sc->sc_pad_funcs[pin] == sc->sc_pinpad_map[pin].pad_func)) + return (true); + else + return (false); +} + static int bytgpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps) { @@ -167,7 +358,9 @@ bytgpio_pin_getcaps(device_t dev, uint32 if (bytgpio_valid_pin(sc, pin) != 0) return (EINVAL); - *caps = GPIO_PIN_INPUT | GPIO_PIN_OUTPUT; + *caps = 0; + if (bytgpio_pad_is_gpio(sc, pin)) + *caps = GPIO_PIN_INPUT | GPIO_PIN_OUTPUT; return (0); } @@ -182,11 +375,14 @@ bytgpio_pin_getflags(device_t dev, uint3 if (bytgpio_valid_pin(sc, pin) != 0) return (EINVAL); + *flags = 0; + if (!bytgpio_pad_is_gpio(sc, pin)) + return (0); + /* Get the current pin state */ BYTGPIO_LOCK(sc); reg = BYGPIO_PIN_REGISTER(sc, pin, BYTGPIO_PAD_VAL); val = bytgpio_read_4(sc, reg); - *flags = 0; if ((val & BYTGPIO_PAD_VAL_I_OUTPUT_ENABLED) == 0) *flags |= GPIO_PIN_OUTPUT; /* @@ -211,7 +407,10 @@ bytgpio_pin_setflags(device_t dev, uint3 if (bytgpio_valid_pin(sc, pin) != 0) return (EINVAL); - allowed = GPIO_PIN_INPUT | GPIO_PIN_OUTPUT; + if (bytgpio_pad_is_gpio(sc, pin)) + allowed = GPIO_PIN_INPUT | GPIO_PIN_OUTPUT; + else + allowed = 0; /* * Only directtion flag allowed @@ -266,6 +465,9 @@ bytgpio_pin_set(device_t dev, uint32_t p if (bytgpio_valid_pin(sc, pin) != 0) return (EINVAL); + if (!bytgpio_pad_is_gpio(sc, pin)) + return (EINVAL); + BYTGPIO_LOCK(sc); reg = BYGPIO_PIN_REGISTER(sc, pin, BYTGPIO_PAD_VAL); val = bytgpio_read_4(sc, reg); @@ -288,16 +490,17 @@ bytgpio_pin_get(device_t dev, uint32_t p sc = device_get_softc(dev); if (bytgpio_valid_pin(sc, pin) != 0) return (EINVAL); + /* + * Report non-GPIO pads as pin LOW + */ + if (!bytgpio_pad_is_gpio(sc, pin)) { + *value = GPIO_PIN_LOW; + return (0); + } BYTGPIO_LOCK(sc); reg = BYGPIO_PIN_REGISTER(sc, pin, BYTGPIO_PAD_VAL); /* - * Enable input to read current value - */ - val = bytgpio_read_4(sc, reg); - val = val & ~BYTGPIO_PAD_VAL_I_INPUT_ENABLED; - bytgpio_write_4(sc, reg, val); - /* * And read actual value */ val = bytgpio_read_4(sc, reg); @@ -320,6 +523,9 @@ bytgpio_pin_toggle(device_t dev, uint32_ if (bytgpio_valid_pin(sc, pin) != 0) return (EINVAL); + if (!bytgpio_pad_is_gpio(sc, pin)) + return (EINVAL); + /* Toggle the pin */ BYTGPIO_LOCK(sc); reg = BYGPIO_PIN_REGISTER(sc, pin, BYTGPIO_PAD_VAL); @@ -350,6 +556,8 @@ bytgpio_attach(device_t dev) struct bytgpio_softc *sc; ACPI_STATUS status; int uid; + int pin; + uint32_t reg, val; sc = device_get_softc(dev); sc->sc_dev = dev; @@ -360,6 +568,8 @@ bytgpio_attach(device_t dev) return (ENXIO); } + BYTGPIO_LOCK_INIT(sc); + switch (uid) { case SCORE_UID: sc->sc_npins = SCORE_PINS; @@ -378,8 +588,12 @@ bytgpio_attach(device_t dev) break; default: device_printf(dev, "invalid _UID value: %d\n", uid); + goto error; } + sc->sc_pad_funcs = malloc(sizeof(int)*sc->sc_npins, M_DEVBUF, + M_WAITOK | M_ZERO); + sc->sc_mem_rid = 0; sc->sc_mem_res = bus_alloc_resource_any(sc->sc_dev, SYS_RES_MEMORY, &sc->sc_mem_rid, RF_ACTIVE); @@ -388,7 +602,11 @@ bytgpio_attach(device_t dev) goto error; } - BYTGPIO_LOCK_INIT(sc); + for (pin = 0; pin < sc->sc_npins; pin++) { + reg = BYGPIO_PIN_REGISTER(sc, pin, BYTGPIO_PCONF0); + val = bytgpio_read_4(sc, reg); + sc->sc_pad_funcs[pin] = val & BYTGPIO_PCONF0_FUNC_MASK; + } sc->sc_busdev = gpiobus_attach_bus(dev); if (sc->sc_busdev == NULL) { @@ -401,13 +619,39 @@ bytgpio_attach(device_t dev) return (0); error: + BYTGPIO_LOCK_DESTROY(sc); + return (ENXIO); } + +static int +bytgpio_detach(device_t dev) +{ + struct bytgpio_softc *sc; + + sc = device_get_softc(dev); + + if (sc->sc_busdev) + gpiobus_detach_bus(dev); + + BYTGPIO_LOCK_DESTROY(sc); + + if (sc->sc_pad_funcs) + free(sc->sc_pad_funcs, M_DEVBUF); + + if (sc->sc_mem_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, + sc->sc_mem_rid, sc->sc_mem_res); + + return (0); +} + static device_method_t bytgpio_methods[] = { /* Device interface */ DEVMETHOD(device_probe, bytgpio_probe), DEVMETHOD(device_attach, bytgpio_attach), + DEVMETHOD(device_detach, bytgpio_detach), /* GPIO protocol */ DEVMETHOD(gpio_get_bus, bytgpio_get_bus), @@ -432,4 +676,4 @@ static driver_t bytgpio_driver = { static devclass_t bytgpio_devclass; DRIVER_MODULE(bytgpio, acpi, bytgpio_driver, bytgpio_devclass, 0, 0); MODULE_DEPEND(bytgpio, acpi, 1, 1, 1); -MODULE_DEPEND(bytgpio, gpio, 1, 1, 1); +MODULE_DEPEND(bytgpio, gpiobus, 1, 1, 1); Modified: stable/11/sys/modules/Makefile ============================================================================== --- stable/11/sys/modules/Makefile Thu Dec 1 22:20:27 2016 (r309374) +++ stable/11/sys/modules/Makefile Thu Dec 1 22:22:19 2016 (r309375) @@ -61,6 +61,7 @@ SUBDIR= \ bwi \ bwn \ bwn_pci \ + ${_bytgpio} \ cam \ ${_canbepm} \ ${_canbus} \ @@ -601,6 +602,7 @@ _amdsbwd= amdsbwd _amdtemp= amdtemp _arcmsr= arcmsr _asmc= asmc +_bytgpio= bytgpio _ciss= ciss _cmx= cmx _coretemp= coretemp Modified: stable/11/sys/modules/bytgpio/Makefile ============================================================================== --- head/sys/modules/bytgpio/Makefile Mon Nov 21 19:47:37 2016 (r308942) +++ stable/11/sys/modules/bytgpio/Makefile Thu Dec 1 22:22:19 2016 (r309375) @@ -3,6 +3,6 @@ .PATH: ${.CURDIR}/../../dev/gpio KMOD= bytgpio SRCS= bytgpio.c -SRCS+= device_if.h bus_if.h gpio_if.h +SRCS+= acpi_if.h device_if.h bus_if.h gpio_if.h .include From owner-svn-src-all@freebsd.org Thu Dec 1 22:50:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90336C61B04; Thu, 1 Dec 2016 22:50:48 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-qt0-x229.google.com (mail-qt0-x229.google.com [IPv6:2607:f8b0:400d:c0d::229]) (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 49D531511; Thu, 1 Dec 2016 22:50:48 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-qt0-x229.google.com with SMTP id w33so235637505qtc.3; Thu, 01 Dec 2016 14:50:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=uJs9+Eh4l6p5V3QIoJy8M4hJvlF9LY4hhl5MyKWX7Y8=; b=YmnKguSxuYuYorF3gh+EoWSjd1inD3vCNih7oOLC6M559efLWsPebCyyUFHZdMWaol BL9uLFruVln+BPYGush/3dhwww+SKvhxTSScdzNZaonz3wD6EMCnZKAgYw8TAgGWbUb0 0untLFlSciOdUPIAi56RUscawcl3H7XLjWjhimj6Bh5fAJBY4DIzcqoBalbA7n3xoYHF QgMAMUyS4Z2OwjzVeGjFOiB4cK5IAoWeP/HjIqn3KqbR9VUCc0p30qLehfW/v76ABEok 63Q1n7+7CR+I0S9sHWDr8QW+A3OVWX9hW/aZ2fGBhUzHJrK5/AIV+jXzF802CnP1t4Wn UOCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=uJs9+Eh4l6p5V3QIoJy8M4hJvlF9LY4hhl5MyKWX7Y8=; b=WULE+dwL1n2hYzdPC/sTxVinaeHhChs4aZ9D7oczChVnOonl+c2ZqtkSVslzTY8ArW GEcjwAP7DX8EZ6+5qEOz9r2ocqR7ozbRBgm6fYX3rWdrYh3wmCESgT/Bxk9Jrn6fKL6/ Z92Fl0JlG4vULniXWxiD6agz5svyEyXqJM9RBhAlO19RhwSYzoPvbdn82eno2bFoeQre m1WO0fX+AbotO+wbRPLr8J7JpfLivWrPwBzxATkYSA0JNncpRfp3gDz33yR59ppwiO5B kg7f66u7/YrqG90n+CG0QK1Z1+r93dwAjahnYJa9UvYgEGRHHLc6KW/zECoR7k79iFZL vmng== X-Gm-Message-State: AKaTC00pkMvgwRblnAtOHmcT5fnnASl/i1s8wKAJQz01c1Gq3T1Fmpgow3PtYOjcchhuoJbEOVHLC7AvQ4TZVQ== X-Received: by 10.237.38.37 with SMTP id z34mr40530092qtc.73.1480632647160; Thu, 01 Dec 2016 14:50:47 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.83.133 with HTTP; Thu, 1 Dec 2016 14:50:46 -0800 (PST) In-Reply-To: <1480617132.1889.196.camel@freebsd.org> References: <201612010221.uB12Lb6x067202@repo.freebsd.org> <4DFE017D-90FD-44F4-8FE7-7EE53D499F7B@gmail.com> <1480609927.1889.189.camel@freebsd.org> <20161201170116.GA20872@lonesome.com> <5B2D372D-52AB-42FB-B0AA-942A75466602@gmail.com> <1480617132.1889.196.camel@freebsd.org> From: Ngie Cooper Date: Thu, 1 Dec 2016 14:50:46 -0800 Message-ID: Subject: Re: svn commit: r309344 - head/lib/libutil To: Ian Lepore Cc: Mark Linimon , "Conrad E. Meyer" , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 22:50:48 -0000 On Thu, Dec 1, 2016 at 10:32 AM, Ian Lepore wrote: ... > And how is that a bad thing, compared to the prior situation? Insult > has been removed and information has been added. You complain that the > information that was added was incomplete. Well, there is one person > who could fix that, and he has apparently chosen not to. So perhaps > your ongoing complaint should be directed accordingly. Maybe. But this is a useless bikeshed. I've said my piece. -Ngie From owner-svn-src-all@freebsd.org Thu Dec 1 23:28:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 492B5C61755; Thu, 1 Dec 2016 23:28:00 +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 185A41905; Thu, 1 Dec 2016 23:28:00 +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 uB1NRxf8083120; Thu, 1 Dec 2016 23:27:59 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1NRxt5083119; Thu, 1 Dec 2016 23:27:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612012327.uB1NRxt5083119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 1 Dec 2016 23:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309376 - stable/11/sys/ofed/drivers/infiniband/core X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 23:28:00 -0000 Author: jhb Date: Thu Dec 1 23:27:59 2016 New Revision: 309376 URL: https://svnweb.freebsd.org/changeset/base/309376 Log: MFC 304838: Do not free an uninitialized pointer on soaccept failure in the iWARP connection manager. Sponsored by: Chelsio Communications Modified: stable/11/sys/ofed/drivers/infiniband/core/iwcm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ofed/drivers/infiniband/core/iwcm.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/core/iwcm.c Thu Dec 1 22:22:19 2016 (r309375) +++ stable/11/sys/ofed/drivers/infiniband/core/iwcm.c Thu Dec 1 23:27:59 2016 (r309376) @@ -438,6 +438,7 @@ dequeue_socket(struct socket *head) so->so_state |= SS_NBIO; SOCK_UNLOCK(so); ACCEPT_UNLOCK(); + remote = NULL; soaccept(so, (struct sockaddr **)&remote); free(remote, M_SONAME); From owner-svn-src-all@freebsd.org Thu Dec 1 23:30:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1B19C61843; Thu, 1 Dec 2016 23:30:34 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id BDB171A87; Thu, 1 Dec 2016 23:30:34 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c110-21-100-78.carlnfd1.nsw.optusnet.com.au [110.21.100.78]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id DC3E67859BC; Fri, 2 Dec 2016 10:30:31 +1100 (AEDT) Date: Fri, 2 Dec 2016 10:30:31 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eric van Gyzen cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309364 - head/usr.bin/locale In-Reply-To: <201612011654.uB1Gs2s4023355@repo.freebsd.org> Message-ID: <20161202094516.Q1025@besplex.bde.org> References: <201612011654.uB1Gs2s4023355@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=K7JSJ2eI c=1 sm=1 tr=0 a=uGjuzT6u7JdBDS7kH8taPg==:117 a=uGjuzT6u7JdBDS7kH8taPg==:17 a=kj9zAlcOel0A:10 a=Yu1A3NVHZ7LbY86qSIgA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 23:30:35 -0000 On Thu, 1 Dec 2016, Eric van Gyzen wrote: > Log: > locale: fix buffer management > > Also, handle signed and unsigned chars, and more gracefully handle > invalid input. > > Submitted by: bde in response to r309331 > MFC after: 1 week > Sponsored by: Dell EMC Thanks. > Modified: head/usr.bin/locale/locale.c > ============================================================================== > --- head/usr.bin/locale/locale.c Thu Dec 1 15:46:26 2016 (r309363) > +++ head/usr.bin/locale/locale.c Thu Dec 1 16:54:02 2016 (r309364) > @@ -495,29 +495,29 @@ format_grouping(const char *binary) > { > static char rval[64]; > const char *cp; > - size_t len; > + size_t roff; > + int len; > ... > + if (*cp < 0) > + break; /* garbage input */ > + len = snprintf(&rval[roff], sizeof(rval) - roff, "%u;", *cp); > + if (len < 0 || (unsigned)len >= sizeof(rval) - roff) > + break; /* insufficient space for output */ I don't like casting len to fix compiler warnings, and intentionally left out this cast. len < 0 ensures that there is no sign extension bug or dependency on sign extension bugs. snprintf() returns < 0 if an encoding error occurs, and the check is mainly to detect this unlikely error (the comment is too short to describe this), but the check also allows compilers to easily see that there is no sign extension bug and only low-quality ones warn. I used the bogus type size_t instead of int for roff since I didn't want to fight possible compiler warnings about sign extension in the expression sizeof(rval) - roff. Here it is not so easy to see that roff <= sizeof(rval). You didn't do anything to avoid bad -Wtautological-compare compiler warnings for (*cp < 0). I think such warnings occur at high WARNS on arches with unsigned char. These warnings are bad since the comparison is only tautological on some arches so it is not really tautological. Avoiding it requires code like '#if CHAR_MIN < 0', but that is equally tautological and only escapes the warning because cpp expressions are weaker than C expressions. clang -Wall -Wtautological-compare doesn't actually warn for either (*cp < 0) (where cp is unsigned char *) or (1 < 0). gcc-4.2.1 -Wall warns for the former but not for the latter. This seems sort of backwards, but ISTR discussions in gcc lists ~20 years ago about it being intentional. Warning for (1 < 0) mainly breaks conditional compilation where the condtions are intentially written using C const expressions instead of cpp expressions since cpp is harder to work with. (*cp < 0) is more likely to be a bug. Bruce From owner-svn-src-all@freebsd.org Thu Dec 1 23:37:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 185DDC61B98; Thu, 1 Dec 2016 23:37:20 +0000 (UTC) (envelope-from shurd@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 D4F5C10D1; Thu, 1 Dec 2016 23:37:19 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB1NbJWB087222; Thu, 1 Dec 2016 23:37:19 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1NbI8O087212; Thu, 1 Dec 2016 23:37:18 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201612012337.uB1NbI8O087212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Thu, 1 Dec 2016 23:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309377 - in stable/11: release/doc/en_US.ISO8859-1/hardware share/man/man4 sys/boot/forth sys/conf sys/dev/bnxt sys/modules sys/modules/bnxt X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 23:37:20 -0000 Author: shurd (ports committer) Date: Thu Dec 1 23:37:17 2016 New Revision: 309377 URL: https://svnweb.freebsd.org/changeset/base/309377 Log: MFC r308696, r308729, r308787, r308813, r309028, r309073, r309078: r308696: New driver for Broadcom NetXtreme-C and NetXtreme-E devices. r308729: Add bnxt(4) to the hardware notes. r308787: Add missing newline in error mesage r308813: Check link status after init r309028: Add missing break to switch statement r309073: Fix version string r309078: Add new device IDs Approved by: sbruno Relnotes: yes Sponsored by: Broadcom Limited Added: stable/11/share/man/man4/bnxt.4 - copied unchanged from r308696, head/share/man/man4/bnxt.4 stable/11/sys/dev/bnxt/ - copied from r308696, head/sys/dev/bnxt/ stable/11/sys/modules/bnxt/ - copied from r308696, head/sys/modules/bnxt/ Modified: stable/11/release/doc/en_US.ISO8859-1/hardware/article.xml stable/11/share/man/man4/Makefile stable/11/sys/boot/forth/loader.conf stable/11/sys/conf/NOTES stable/11/sys/conf/files stable/11/sys/dev/bnxt/bnxt.h stable/11/sys/dev/bnxt/bnxt_hwrm.c stable/11/sys/dev/bnxt/if_bnxt.c stable/11/sys/modules/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/hardware/article.xml Thu Dec 1 23:27:59 2016 (r309376) +++ stable/11/release/doc/en_US.ISO8859-1/hardware/article.xml Thu Dec 1 23:37:17 2016 (r309377) @@ -817,6 +817,8 @@ &hwlist.bge; + &hwlist.bnxt; + &hwlist.bxe; &hwlist.cas; Modified: stable/11/share/man/man4/Makefile ============================================================================== --- stable/11/share/man/man4/Makefile Thu Dec 1 23:27:59 2016 (r309376) +++ stable/11/share/man/man4/Makefile Thu Dec 1 23:37:17 2016 (r309377) @@ -79,6 +79,7 @@ MAN= aac.4 \ bhndb.4 \ bktr.4 \ blackhole.4 \ + bnxt.4 \ bpf.4 \ bridge.4 \ bt.4 \ @@ -593,6 +594,7 @@ MLINKS+=bce.4 if_bce.4 MLINKS+=bfe.4 if_bfe.4 MLINKS+=bge.4 if_bge.4 MLINKS+=bktr.4 brooktree.4 +MLINKS+=bnxt.4 if_bnxt.4 MLINKS+=bridge.4 if_bridge.4 MLINKS+=bwi.4 if_bwi.4 MLINKS+=bwn.4 if_bwn.4 Copied: stable/11/share/man/man4/bnxt.4 (from r308696, head/share/man/man4/bnxt.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/share/man/man4/bnxt.4 Thu Dec 1 23:37:17 2016 (r309377, copy of r308696, head/share/man/man4/bnxt.4) @@ -0,0 +1,222 @@ +.\" Copyright (c) 2016 Broadcom, All Rights Reserved. +.\" The term Broadcom refers to Broadcom Limited and/or its subsidiaries +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS' +.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +.\" THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 12, 2016 +.Dt BNXT 4 +.Os +.Sh NAME +.Nm bnxt +.Nd "Broadcom NetXtreme-C/NetXtreme-E Family Ethernet driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device bnxt" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_bnxt_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for various NICs based on the Broadcom BCM57301/2/4, +and BCM57402/4/6 Ethernet controller chips. +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.Sh HARDWARE +The +.Nm +driver provides support for various NICs based on the Broadcom NetXtreme-C and +NetXtreme-E families of Gigabit Ethernet controller chips, including the +following: +.Pp +.Bl -bullet -compact +.It +Broadcom BCM57301 NetXtreme-C 10Gb Ethernet Controller +.It +Broadcom BCM57302 NetXtreme-C 10Gb/25Gb Ethernet Controller +.It +Broadcom BCM57304 NetXtreme-C 10Gb/25Gb/40Gb/50Gb Ethernet Controller +.It +Broadcom BCM57402 NetXtreme-E 10Gb Ethernet Controller +.It +Broadcom BCM57404 NetXtreme-E 10Gb/25Gb Ethernet Controller +.It +Broadcom BCM57406 NetXtreme-E 10GBase-T Ethernet Controller +.It +Broadcom BCM57402 NetXtreme-E Partition +.It +Broadcom BCM57407 NetXtreme-E 10GBase-T Ethernet Controller +.It +Broadcom BCM57404 NetXtreme-E Partition +.It +Broadcom BCM57406 NetXtreme-E Partition +.It +Broadcom BCM57407 NetXtreme-E 25Gb Ethernet Controller +.It +Broadcom BCM57304 NetXtreme-C Virtual Function +.It +Broadcom BCM57404 NetXtreme-E Virtual Function +.El +.Sh SYSCTL VARIABLES +These variables must be set before loading the driver, either via +.Xr loader.conf 5 +or through the use of +.Xr kenv 1 . +These are provided by the +.Xr iflib 9 +framework, and might be better documented there. +.Bl -tag -width indent +.It Va dev.bnxt.X.iflib.override_nrxds +Override the number of RX descriptors for each queue. +The value is a comma separated list of three positive integers: the size of the +completion ring, +the size of the receive ring, and the size of the aggregation ring respectively. +The completion ring should be at least the size of the aggregation ring plus +four times the size of the receive ring. +These numbers must be powers of two, and zero means to use the default. +Defaults to 0,0,0. +.It Va dev.bnxt.X.iflib.override_ntxds +Override the number of TX descriptors for each queue. +The value is a comma separated list of two positive integers: the size of the +completion ring, and the size of the transmit ring respectively. +The completion ring should be at least twice the size of the transmit ring. +These numbers must be powers of two, and zero means to use the default. +Defaults to 0,0. +.It Va override_qs_enable +When set, allows the number of transmit and receive queues to be different. +If not set, the lower of the number of TX or RX queues will be used for both. +.It Va override_nrxqs +Set the number of RX queues. +If zero, the number of RX queues is derived from the number of cores on the +socket connected to the controller. +Defaults to 0. +.It Va override_ntxqs +Set the number of TX queues. +If zero, the number of TX queues is derived from the number of cores on the +socket connected to the controller. +.El +.Pp +These +.Xr sysctl 8 +variables can be changed at any time: +.Bl -tag -width indent +.It Va dev.bnxt.X.vlan_only +Require that incoming frames must have a VLAN tag on them that matches one that +is configured for the NIC. +Normally, both frames that have a matching VLAN tag and frames that have no +VLAN tag are accepted. +Defaults to 0. +.It Va dev.bnxt.X.vlan_strip +When non-zero the NIC strips VLAN tags on receive. +Defaults to 0. +.It Va dev.bnxt.X.rx_stall +Enable buffering rather than dropping frames when there are no available host +RX buffers for DMA. +Defaults to 0. +.It Va dev.bnxt.X.rss_type +Comma-separated list of RSS hash types to support. +Default is all types. +Defaults to ipv4,tcp_ipv4,udp_ipv4,ipv6,tcp_ipv6,udp_ipv6. +.It Va dev.bnxt.X.rss_key +Current RSS key. +Defaults to a randomly generated value which is generated for each device +during attach. +.It Va dev.bnxt.X.ver.hwrm_min_ver +Minimum HWRM (HardWare Resource Manager) firmware API to support. +If the firmware implements an older version, a warning will be printed, and the +firmware should be upgraded. +Defaults to 1.2.2. +.El +.Pp +These +.Xr sysctl 8 +variables are read-only: +.Bl -tag -width indent +.It Va dev.bnxt.X.if_name +Current interface name of the device. +This will normally be +.Va bnxtX , +but this can be changed using +.Cm ifconfig name . +This sysctl allows correlating an interface with a child of dev.bnxt. +.It Va dev.bnxt.X.nvram.* +Information about the NVRAM device which contains the device firmware. +.It Va dev.bnxt.X.ver.* +Version-related information about the device and firmware: +.It Va dev.bnxt.X.ver.hwrm_if +Supported HWRM API version of the currently running firmware. +.It Va dev.bnxt.X.ver.driver_hwrm_if +HWRM API version the driver was built to support. +.It Va dev.bnxt.X.hwstats.* +Per-queue statistics tracked by the hardware. +.It Va dev.bnxt.X.hwstats.rxq0.drop_pkts +Number of packets dropped by hardware on queue zero. +This number might seem high, but the count includes packets dropped due to +incorrect destination MAC, unsubscribed multicast address, and other normal +reasons to ignore Ethernet frames. +.El +.Sh DIAGNOSTICS +.Bl -diag +.It "bnxt%d: %s command returned %s error." +Device firmware rejected a command from the driver. +There might be a driver/firmware HWRM API mismatch. +.It "bnxt%d: Timeout sending %s (timeout: %d) seq %d\n" +Device firmware unresponsive. +A PCI device reset is likely needed. +.It "bnxt%d: Timeout sending %s (timeout: %d) msg {0x%x 0x%x} len:%d v: %d\n" +Partial firmware response. +A PCI device reset is likely needed. +.Pp +As of this writing, the system must be rebooted to initiate a PCI device reset. +.El +.Sh SEE ALSO +.Xr altq 4 , +.Xr arp 4 , +.Xr netintro 4 , +.Xr ng_ether 4 , +.Xr vlan 4 , +.Xr ifconfig 8 , +.Xr iflib 4 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 12.0 . +.Sh AUTHORS +The +.Nm +driver was written by +.An Jack Vogel Aq Mt jfvogel@gmail.com . +and is currently maintained by +.An Stephen Hurd Aq Mt stephen.hurd@broadcom.com . Modified: stable/11/sys/boot/forth/loader.conf ============================================================================== --- stable/11/sys/boot/forth/loader.conf Thu Dec 1 23:27:59 2016 (r309376) +++ stable/11/sys/boot/forth/loader.conf Thu Dec 1 23:37:17 2016 (r309377) @@ -312,6 +312,7 @@ if_axe_load="NO" # ASIX Electronics AX8 if_bce_load="NO" # Broadcom NetXtreme II Gigabit Ethernet if_bfe_load="NO" # Broadcom BCM4401 if_bge_load="NO" # Broadcom BCM570x PCI Gigabit Ethernet +if_bnxt_load="NO" # Broadcom NetXtreme-C/NetXtreme-E if_bridge_load="NO" # if_bridge(4) devices if_bwi_load="NO" # Broadcom BCM53xx IEEE 802.11b/g wireness NICs if_bwn_load="NO" # Broadcom BCM43xx IEEE 802.11 wireless NICs Modified: stable/11/sys/conf/NOTES ============================================================================== --- stable/11/sys/conf/NOTES Thu Dec 1 23:27:59 2016 (r309376) +++ stable/11/sys/conf/NOTES Thu Dec 1 23:37:17 2016 (r309377) @@ -1900,6 +1900,7 @@ device amphy # AMD AM79c873 / Davicom device atphy # Attansic/Atheros F1 device axphy # Asix Semiconductor AX88x9x device bmtphy # Broadcom BCM5201/BCM5202 and 3Com 3c905C +device bnxt # Broadcom NetXtreme-C/NetXtreme-E device brgphy # Broadcom BCM54xx/57xx 1000baseTX device ciphy # Cicada/Vitesse CS/VSC8xxx device e1000phy # Marvell 88E1000 1000/100/10-BT @@ -1940,6 +1941,7 @@ device xmphy # XaQti XMAC II # BCM570x family of controllers, including the 3Com 3c996-T, # the Netgear GA302T, the SysKonnect SK-9D21 and SK-9D41, and # the embedded gigE NICs on Dell PowerEdge 2550 servers. +# bnxt: Broadcom NetXtreme-C and NetXtreme-E PCIe 10/25/50G Ethernet adapters. # bxe: Broadcom NetXtreme II (BCM5771X/BCM578XX) PCIe 10Gb Ethernet # adapters. # bwi: Broadcom BCM430* and BCM431* family of wireless adapters. Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Thu Dec 1 23:27:59 2016 (r309376) +++ stable/11/sys/conf/files Thu Dec 1 23:37:17 2016 (r309377) @@ -1187,6 +1187,10 @@ dev/bktr/bktr_i2c.c optional bktr pci s dev/bktr/bktr_os.c optional bktr pci dev/bktr/bktr_tuner.c optional bktr pci dev/bktr/msp34xx.c optional bktr pci +dev/bnxt/bnxt_hwrm.c optional bnxt iflib pci +dev/bnxt/bnxt_sysctl.c optional bnxt iflib pci +dev/bnxt/bnxt_txrx.c optional bnxt iflib pci +dev/bnxt/if_bnxt.c optional bnxt iflib pci dev/buslogic/bt.c optional bt dev/buslogic/bt_eisa.c optional bt eisa dev/buslogic/bt_isa.c optional bt isa Modified: stable/11/sys/dev/bnxt/bnxt.h ============================================================================== --- head/sys/dev/bnxt/bnxt.h Tue Nov 15 20:35:29 2016 (r308696) +++ stable/11/sys/dev/bnxt/bnxt.h Thu Dec 1 23:37:17 2016 (r309377) @@ -52,16 +52,39 @@ __FBSDID("$FreeBSD$"); #define BCM57301 0x16c8 #define BCM57302 0x16c9 #define BCM57304 0x16ca +#define BCM57311 0x16ce +#define BCM57312 0x16cf +#define BCM57314 0x16df #define BCM57402 0x16d0 -#define BCM57404 0x16d1 -#define BCM57406 0x16d2 #define BCM57402_NPAR 0x16d4 -#define BCM57407 0x16d5 +#define BCM57404 0x16d1 #define BCM57404_NPAR 0x16e7 +#define BCM57406 0x16d2 #define BCM57406_NPAR 0x16e8 +#define BCM57407 0x16d5 +#define BCM57407_NPAR 0x16ea #define BCM57407_SFP 0x16e9 -#define BCM57304_VF 0x16cb -#define BCM57404_VF 0x16d3 +#define BCM57412 0x16d6 +#define BCM57412_NPAR1 0x16de +#define BCM57412_NPAR2 0x16eb +#define BCM57414 0x16d7 +#define BCM57414_NPAR1 0x16ec +#define BCM57414_NPAR2 0x16ed +#define BCM57416 0x16d8 +#define BCM57416_NPAR1 0x16ee +#define BCM57416_NPAR2 0x16ef +#define BCM57416_SFP 0x16e3 +#define BCM57417 0x16d9 +#define BCM57417_NPAR1 0x16c0 +#define BCM57417_NPAR2 0x16cc +#define BCM57417_SFP 0x16e2 +#define BCM58700 0x16cd +#define NETXTREME_C_VF1 0x16cb +#define NETXTREME_C_VF2 0x16e1 +#define NETXTREME_C_VF3 0x16e5 +#define NETXTREME_E_VF1 0x16c1 +#define NETXTREME_E_VF2 0x16d3 +#define NETXTREME_E_VF3 0x16dc #define CSUM_OFFLOAD (CSUM_IP_TSO|CSUM_IP6_TSO|CSUM_IP| \ CSUM_IP_UDP|CSUM_IP_TCP|CSUM_IP_SCTP| \ Modified: stable/11/sys/dev/bnxt/bnxt_hwrm.c ============================================================================== --- head/sys/dev/bnxt/bnxt_hwrm.c Tue Nov 15 20:35:29 2016 (r308696) +++ stable/11/sys/dev/bnxt/bnxt_hwrm.c Thu Dec 1 23:37:17 2016 (r309377) @@ -424,7 +424,7 @@ bnxt_hwrm_func_qcaps(struct bnxt_softc * pf->max_rx_wm_flows = le32toh(resp->max_rx_wm_flows); } if (!_is_valid_ether_addr(func->mac_addr)) { - device_printf(softc->dev, "Invalid ethernet address, generating random locally administered address"); + device_printf(softc->dev, "Invalid ethernet address, generating random locally administered address\n"); get_random_ether_addr(func->mac_addr); } Modified: stable/11/sys/dev/bnxt/if_bnxt.c ============================================================================== --- head/sys/dev/bnxt/if_bnxt.c Tue Nov 15 20:35:29 2016 (r308696) +++ stable/11/sys/dev/bnxt/if_bnxt.c Thu Dec 1 23:37:17 2016 (r309377) @@ -75,26 +75,72 @@ static pci_vendor_info_t bnxt_vendor_inf "Broadcom BCM57302 NetXtreme-C 10Gb/25Gb Ethernet Controller"), PVID(BROADCOM_VENDOR_ID, BCM57304, "Broadcom BCM57304 NetXtreme-C 10Gb/25Gb/40Gb/50Gb Ethernet Controller"), + PVID(BROADCOM_VENDOR_ID, BCM57311, + "Broadcom BCM57311 NetXtreme-C 10Gb Ethernet"), + PVID(BROADCOM_VENDOR_ID, BCM57312, + "Broadcom BCM57312 NetXtreme-C 10Gb/25Gb Ethernet"), + PVID(BROADCOM_VENDOR_ID, BCM57314, + "Broadcom BCM57314 NetXtreme-C 10Gb/25Gb/40Gb/50Gb Ethernet"), PVID(BROADCOM_VENDOR_ID, BCM57402, "Broadcom BCM57402 NetXtreme-E 10Gb Ethernet Controller"), - PVID(BROADCOM_VENDOR_ID, BCM57404, - "Broadcom BCM57404 NetXtreme-E 10Gb/25Gb Ethernet Controller"), - PVID(BROADCOM_VENDOR_ID, BCM57406, - "Broadcom BCM57406 NetXtreme-E 10GBase-T Ethernet Controller"), PVID(BROADCOM_VENDOR_ID, BCM57402_NPAR, "Broadcom BCM57402 NetXtreme-E Partition"), - PVID(BROADCOM_VENDOR_ID, BCM57407, - "Broadcom BCM57407 NetXtreme-E 10GBase-T Ethernet Controller"), + PVID(BROADCOM_VENDOR_ID, BCM57404, + "Broadcom BCM57404 NetXtreme-E 10Gb/25Gb Ethernet Controller"), PVID(BROADCOM_VENDOR_ID, BCM57404_NPAR, "Broadcom BCM57404 NetXtreme-E Partition"), + PVID(BROADCOM_VENDOR_ID, BCM57406, + "Broadcom BCM57406 NetXtreme-E 10GBase-T Ethernet Controller"), PVID(BROADCOM_VENDOR_ID, BCM57406_NPAR, "Broadcom BCM57406 NetXtreme-E Partition"), + PVID(BROADCOM_VENDOR_ID, BCM57407, + "Broadcom BCM57407 NetXtreme-E 10GBase-T Ethernet Controller"), + PVID(BROADCOM_VENDOR_ID, BCM57407_NPAR, + "Broadcom BCM57407 NetXtreme-E Ethernet Partition"), PVID(BROADCOM_VENDOR_ID, BCM57407_SFP, "Broadcom BCM57407 NetXtreme-E 25Gb Ethernet Controller"), - PVID(BROADCOM_VENDOR_ID, BCM57304_VF, - "Broadcom BCM57304 NetXtreme-C Virtual Function"), - PVID(BROADCOM_VENDOR_ID, BCM57404_VF, - "Broadcom BCM57404 NetXtreme-E Virtual Function"), + PVID(BROADCOM_VENDOR_ID, BCM57412, + "Broadcom BCM57412 NetXtreme-E 10Gb Ethernet"), + PVID(BROADCOM_VENDOR_ID, BCM57412_NPAR1, + "Broadcom BCM57412 NetXtreme-E Ethernet Partition"), + PVID(BROADCOM_VENDOR_ID, BCM57412_NPAR2, + "Broadcom BCM57412 NetXtreme-E Ethernet Partition"), + PVID(BROADCOM_VENDOR_ID, BCM57414, + "Broadcom BCM57414 NetXtreme-E 10Gb/25Gb Ethernet"), + PVID(BROADCOM_VENDOR_ID, BCM57414_NPAR1, + "Broadcom BCM57414 NetXtreme-E Ethernet Partition"), + PVID(BROADCOM_VENDOR_ID, BCM57414_NPAR2, + "Broadcom BCM57414 NetXtreme-E Ethernet Partition"), + PVID(BROADCOM_VENDOR_ID, BCM57416, + "Broadcom BCM57416 NetXtreme-E 10GBase-T Ethernet"), + PVID(BROADCOM_VENDOR_ID, BCM57416_NPAR1, + "Broadcom BCM57416 NetXtreme-E Ethernet Partition"), + PVID(BROADCOM_VENDOR_ID, BCM57416_NPAR2, + "Broadcom BCM57416 NetXtreme-E Ethernet Partition"), + PVID(BROADCOM_VENDOR_ID, BCM57416_SFP, + "Broadcom BCM57416 NetXtreme-E 10Gb Ethernet"), + PVID(BROADCOM_VENDOR_ID, BCM57417, + "Broadcom BCM57417 NetXtreme-E 10GBase-T Ethernet"), + PVID(BROADCOM_VENDOR_ID, BCM57417_NPAR1, + "Broadcom BCM57417 NetXtreme-E Ethernet Partition"), + PVID(BROADCOM_VENDOR_ID, BCM57417_NPAR2, + "Broadcom BCM57417 NetXtreme-E Ethernet Partition"), + PVID(BROADCOM_VENDOR_ID, BCM57417_SFP, + "Broadcom BCM57417 NetXtreme-E 10Gb/25Gb Ethernet"), + PVID(BROADCOM_VENDOR_ID, BCM58700, + "Broadcom BCM58700 Nitro 1Gb/2.5Gb/10Gb Ethernet"), + PVID(BROADCOM_VENDOR_ID, NETXTREME_C_VF1, + "Broadcom NetXtreme-C Ethernet Virtual Function"), + PVID(BROADCOM_VENDOR_ID, NETXTREME_C_VF2, + "Broadcom NetXtreme-C Ethernet Virtual Function"), + PVID(BROADCOM_VENDOR_ID, NETXTREME_C_VF3, + "Broadcom NetXtreme-C Ethernet Virtual Function"), + PVID(BROADCOM_VENDOR_ID, NETXTREME_E_VF1, + "Broadcom NetXtreme-E Ethernet Virtual Function"), + PVID(BROADCOM_VENDOR_ID, NETXTREME_E_VF2, + "Broadcom NetXtreme-E Ethernet Virtual Function"), + PVID(BROADCOM_VENDOR_ID, NETXTREME_E_VF3, + "Broadcom NetXtreme-E Ethernet Virtual Function"), /* required last entry */ PVID_END @@ -227,7 +273,7 @@ static driver_t bnxt_iflib_driver = { * iflib shared context */ -char bnxt_driver_version[] = "https://github.com/Broadcom/freebsd-nxt/commits/bnxt-dev"; +char bnxt_driver_version[] = "FreeBSD base"; extern struct if_txrx bnxt_txrx; static struct if_shared_ctx bnxt_sctx_init = { .isc_magic = IFLIB_MAGIC, @@ -540,14 +586,26 @@ bnxt_attach_pre(if_ctx_t ctx) softc->sctx = iflib_get_sctx(ctx); scctx = softc->scctx; + /* TODO: Better way of detecting NPAR/VF is needed */ switch (softc->sctx->isc_vendor_info->pvi_device_id) { case BCM57402_NPAR: case BCM57404_NPAR: case BCM57406_NPAR: + case BCM57407_NPAR: + case BCM57412_NPAR1: + case BCM57412_NPAR2: + case BCM57414_NPAR1: + case BCM57414_NPAR2: + case BCM57416_NPAR1: + case BCM57416_NPAR2: softc->flags |= BNXT_FLAG_NPAR; break; - case BCM57304_VF: - case BCM57404_VF: + case NETXTREME_C_VF1: + case NETXTREME_C_VF2: + case NETXTREME_C_VF3: + case NETXTREME_E_VF1: + case NETXTREME_E_VF2: + case NETXTREME_E_VF3: softc->flags |= BNXT_FLAG_VF; break; } @@ -822,6 +880,7 @@ static void bnxt_init(if_ctx_t ctx) { struct bnxt_softc *softc = iflib_get_softc(ctx); + struct ifmediareq ifmr; int i, j; int rc; @@ -975,6 +1034,7 @@ bnxt_init(if_ctx_t ctx) } bnxt_do_enable_intr(&softc->def_cp_ring); + bnxt_media_status(softc->ctx, &ifmr); return; fail: @@ -1910,6 +1970,7 @@ bnxt_add_media_types(struct bnxt_softc * if (supported & HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_10GB) ifmedia_add(softc->media, IFM_ETHER | IFM_10G_KR, 0, NULL); + break; case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASELR: if (supported & HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_100GB) ifmedia_add(softc->media, IFM_ETHER | IFM_100G_LR4, 0, Modified: stable/11/sys/modules/Makefile ============================================================================== --- stable/11/sys/modules/Makefile Thu Dec 1 23:27:59 2016 (r309376) +++ stable/11/sys/modules/Makefile Thu Dec 1 23:37:17 2016 (r309377) @@ -57,6 +57,7 @@ SUBDIR= \ ${_bios} \ ${_bktr} \ ${_bm} \ + bnxt \ bridgestp \ bwi \ bwn \ From owner-svn-src-all@freebsd.org Thu Dec 1 23:38:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25AECC61D99; Thu, 1 Dec 2016 23:38:55 +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 E2245146A; Thu, 1 Dec 2016 23:38:54 +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 uB1NcsqM087325; Thu, 1 Dec 2016 23:38:54 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB1NcrBF087312; Thu, 1 Dec 2016 23:38:53 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612012338.uB1NcrBF087312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 1 Dec 2016 23:38:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309378 - in stable/10: contrib/ofed/libcxgb4 contrib/ofed/libcxgb4/src contrib/ofed/usr.lib contrib/ofed/usr.lib/libcxgb4 sys/dev/cxgb/ulp/iw_cxgb sys/dev/cxgbe/iw_cxgbe sys/ofed/drive... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Dec 2016 23:38:55 -0000 Author: jhb Date: Thu Dec 1 23:38:52 2016 New Revision: 309378 URL: https://svnweb.freebsd.org/changeset/base/309378 Log: MFC 273806,289103,289201,289338,289578,293185,294474,294610,297124,297368, 297406,300875,300888,301158,301896,301897,304838: Pull in most of the Chelsio and iWARP related changes from stable/11 into stable/10. A few changes from 278886 (OFED 1.2) were also included though the full merge is not: - The find_gid_port() function in infiband/core/cma.c. - Addition of the 'ord' and 'ird' fields to 'struct iw_cm_event'. 273806: Userspace library for Chelsio's Terminator 5 based iWARP RNICs (pretty much every T5 card that does _not_ have "-SO" in its name is RDMA capable). This plugs into the OFED verbs framework and allows userspace RDMA applications to work over T5 RNICs. Tested with rping. 289103: iw_cxgbe: fix for page fault in cm_close_handler(). This is roughly the iw_cxgbe equivalent of https://github.com/torvalds/linux/commit/be13b2dff8c4e41846477b22cc5c164ea5a6ac2e ----------------- RDMA/cxgb4: Connect_request_upcall fixes When processing an MPA Start Request, if the listening endpoint is DEAD, then abort the connection. If the IWCM returns an error, then we must abort the connection and release resources. Also abort_connection() should not post a CLOSE event, so clean that up too. Signed-off-by: Steve Wise Signed-off-by: Roland Dreier ----------------- 289201: iw_cxgbe: MPA v2 is always available. 289338: iw_cxgbe: use correct RFC number. 289578: Merge LinuxKPI changes from DragonflyBSD: - Define the kref structure identical to the one found in Linux. - Update clients referring inside the kref structure. - Implement kref_sub() for FreeBSD. 293185: iw_cxgbe: Shut down the socket but do not close the fd in case of error. The fd is closed later in this case. This fixes a "SS_NOFDREF on enter" panic. 294474: iw_cxgbe: fix a couple of problems int the RDMA_TERMINATE handler. a) Look for the CPL in the payload buffer instead of the descriptor. b) Retrieve the socket associated with the tid with the inpcb lock held. 294610: Fix for iWARP servers that listen on INADDR_ANY. The iWARP Connection Manager (CM) on FreeBSD creates a TCP socket to represent an iWARP endpoint when the connection is over TCP. For servers the current approach is to invoke create_listen callback for each iWARP RNIC registered with the CM. This doesn't work too well for INADDR_ANY because a listen on any TCP socket already notifies all hardware TOEs/RNICs of the new listener. This patch fixes the server side of things for FreeBSD. We've tried to keep all these modifications in the iWARP/TCP specific parts of the OFED infrastructure as much as possible. 297124: iw_cxgbe/libcxgb4: Pull in many applicable fixes from the upstream Linux iWARP driver and userspace library to the FreeBSD iw_cxgbe and libcxgb4. This commit includes internal changesets 6785 8111 8149 8478 8617 8648 8650 9110 9143 9440 9511 9894 10164 10261 10450 10980 10981 10982 11730 11792 12218 12220 12222 12223 12225 12226 12227 12228 12229 12654. 297368: cxgbe/iw_cxgbe: Fix for stray "start_ep_timer timer already started!" messages. 297406: Remove unnecessary dequeue_mutex (added in r294610) from the iWARP connection manager. Examining so_comp without synchronization with iw_so_event_handler is a harmless race. 300875: iw_cxgbe: Use vmem(9) to manage PBL and RQT allocations. 300888: iw_cxgbe: Plug a lock leak in process_mpa_request(). If the parent is DEAD or connect_request_upcall() fails, the parent mutex is left locked. This leads to a hang when process_mpa_request() is called again for another child of the listening endpoint. 301158: iw_cxgbe: Fix panic that occurs when c4iw_ev_handler tries to acquire comp_handler_lock but c4iw_destroy_cq has already freed the CQ memory (which is where the lock resides). 301896: Fix bug in iwcm that caused a panic in iw_cm_wq when krping is run repeatedly in a tight loop. 301897: iw_cxgbe: Make sure that send_abort results in a TCP RST and not a FIN. Release the hold on ep->com immediately after sending the RST. This fixes a bug that sometimes leaves userspace iWARP tools hung when the user presses ^C. 304838: Do not free an uninitialized pointer on soaccept failure in the iWARP connection manager. Submitted by: Krishnamraju Eraparaju @ Chelsio (original patch) Sponsored by: Chelsio Communications Added: stable/10/contrib/ofed/libcxgb4/ - copied from r273806, head/contrib/ofed/libcxgb4/ stable/10/contrib/ofed/usr.lib/libcxgb4/ - copied from r273806, head/contrib/ofed/usr.lib/libcxgb4/ Modified: stable/10/contrib/ofed/libcxgb4/src/cq.c stable/10/contrib/ofed/libcxgb4/src/dev.c stable/10/contrib/ofed/libcxgb4/src/libcxgb4.h stable/10/contrib/ofed/libcxgb4/src/qp.c stable/10/contrib/ofed/libcxgb4/src/t4.h stable/10/contrib/ofed/libcxgb4/src/verbs.c stable/10/contrib/ofed/usr.lib/Makefile stable/10/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.h stable/10/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c stable/10/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.h stable/10/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c stable/10/sys/dev/cxgbe/iw_cxgbe/cq.c stable/10/sys/dev/cxgbe/iw_cxgbe/ev.c stable/10/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h stable/10/sys/dev/cxgbe/iw_cxgbe/mem.c stable/10/sys/dev/cxgbe/iw_cxgbe/provider.c stable/10/sys/dev/cxgbe/iw_cxgbe/qp.c stable/10/sys/dev/cxgbe/iw_cxgbe/resource.c stable/10/sys/dev/cxgbe/iw_cxgbe/t4.h stable/10/sys/dev/cxgbe/iw_cxgbe/user.h stable/10/sys/ofed/drivers/infiniband/core/cma.c stable/10/sys/ofed/drivers/infiniband/core/iwcm.c stable/10/sys/ofed/include/linux/kref.h stable/10/sys/ofed/include/rdma/iw_cm.h stable/10/sys/ofed/include/rdma/rdma_cm.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/ofed/libcxgb4/src/cq.c ============================================================================== --- head/contrib/ofed/libcxgb4/src/cq.c Wed Oct 29 01:15:48 2014 (r273806) +++ stable/10/contrib/ofed/libcxgb4/src/cq.c Thu Dec 1 23:38:52 2016 (r309378) @@ -697,7 +697,7 @@ static int c4iw_poll_cq_one(struct c4iw_ default: PDBG("Unexpected cqe_status 0x%x for QPID=0x%0x\n", CQE_STATUS(&cqe), CQE_QPID(&cqe)); - ret = -EINVAL; + wc->status = IBV_WC_FATAL_ERR; } } if (wc->status && wc->status != IBV_WC_WR_FLUSH_ERR) Modified: stable/10/contrib/ofed/libcxgb4/src/dev.c ============================================================================== --- head/contrib/ofed/libcxgb4/src/dev.c Wed Oct 29 01:15:48 2014 (r273806) +++ stable/10/contrib/ofed/libcxgb4/src/dev.c Thu Dec 1 23:38:52 2016 (r309378) @@ -54,7 +54,6 @@ struct { \ unsigned vendor; \ unsigned device; \ - unsigned chip_version; \ } hca_table[] = { #define CH_PCI_DEVICE_ID_FUNCTION \ @@ -64,7 +63,6 @@ { \ .vendor = PCI_VENDOR_ID_CHELSIO, \ .device = (__DeviceID), \ - .chip_version = CHELSIO_PCI_ID_CHIP_VERSION(__DeviceID), \ } #define CH_PCI_DEVICE_ID_TABLE_DEFINE_END \ @@ -493,7 +491,8 @@ found: } PDBG("%s found vendor %d device %d type %d\n", - __FUNCTION__, vendor, device, hca_table[i].chip_version); + __FUNCTION__, vendor, device, + CHELSIO_PCI_ID_CHIP_VERSION(hca_table[i].device)); dev = calloc(1, sizeof *dev); if (!dev) { @@ -502,7 +501,7 @@ found: pthread_spin_init(&dev->lock, PTHREAD_PROCESS_PRIVATE); dev->ibv_dev.ops = c4iw_dev_ops; - dev->chip_version = hca_table[i].chip_version; + dev->chip_version = CHELSIO_PCI_ID_CHIP_VERSION(hca_table[i].device); dev->abi_version = abi_version; PDBG("%s device claimed\n", __FUNCTION__); Modified: stable/10/contrib/ofed/libcxgb4/src/libcxgb4.h ============================================================================== --- head/contrib/ofed/libcxgb4/src/libcxgb4.h Wed Oct 29 01:15:48 2014 (r273806) +++ stable/10/contrib/ofed/libcxgb4/src/libcxgb4.h Thu Dec 1 23:38:52 2016 (r309378) @@ -69,6 +69,11 @@ static inline int dev_is_t5(struct c4iw_ return dev->chip_version == CHELSIO_T5; } +static inline int dev_is_t4(struct c4iw_dev *dev) +{ + return dev->chip_version == CHELSIO_T4; +} + struct c4iw_context { struct ibv_context ibv_ctx; struct t4_dev_status_page *status_page; Modified: stable/10/contrib/ofed/libcxgb4/src/qp.c ============================================================================== --- head/contrib/ofed/libcxgb4/src/qp.c Wed Oct 29 01:15:48 2014 (r273806) +++ stable/10/contrib/ofed/libcxgb4/src/qp.c Thu Dec 1 23:38:52 2016 (r309378) @@ -362,7 +362,7 @@ int c4iw_post_send(struct ibv_qp *ibqp, err = build_rdma_read(wqe, wr, &len16); if (err) break; - swsqe->read_len = wr->sg_list[0].length; + swsqe->read_len = wr->sg_list ? wr->sg_list[0].length : 0; if (!qhp->wq.sq.oldest_read) qhp->wq.sq.oldest_read = swsqe; break; Modified: stable/10/contrib/ofed/libcxgb4/src/t4.h ============================================================================== --- head/contrib/ofed/libcxgb4/src/t4.h Wed Oct 29 01:15:48 2014 (r273806) +++ stable/10/contrib/ofed/libcxgb4/src/t4.h Thu Dec 1 23:38:52 2016 (r309378) @@ -328,6 +328,7 @@ struct t4_sq { volatile u32 *udb; size_t memsize; u32 qid; + u32 bar2_qid; void *ma_sync; u16 in_use; u16 size; @@ -336,6 +337,7 @@ struct t4_sq { u16 wq_pidx; u16 flags; short flush_cidx; + int wc_reg_available; }; struct t4_swrqe { @@ -348,6 +350,7 @@ struct t4_rq { volatile u32 *udb; size_t memsize; u32 qid; + u32 bar2_qid; u32 msn; u32 rqt_hwaddr; u16 rqt_size; @@ -356,6 +359,7 @@ struct t4_rq { u16 cidx; u16 pidx; u16 wq_pidx; + int wc_reg_available; }; struct t4_wq { @@ -485,14 +489,14 @@ static inline void t4_ring_sq_db(struct { wc_wmb(); if (t5) { - if (t5_en_wc && inc == 1) { + if (t5_en_wc && inc == 1 && wq->sq.wc_reg_available) { PDBG("%s: WC wq->sq.pidx = %d; len16=%d\n", __func__, wq->sq.pidx, len16); copy_wqe_to_udb(wq->sq.udb + 14, wqe); } else { PDBG("%s: DB wq->sq.pidx = %d; len16=%d\n", __func__, wq->sq.pidx, len16); - writel(V_PIDX_T5(inc), wq->sq.udb); + writel(V_QID(wq->sq.bar2_qid) | V_PIDX_T5(inc), wq->sq.udb); } wc_wmb(); return; @@ -518,14 +522,14 @@ static inline void t4_ring_rq_db(struct { wc_wmb(); if (t5) { - if (t5_en_wc && inc == 1) { + if (t5_en_wc && inc == 1 && wq->sq.wc_reg_available) { PDBG("%s: WC wq->rq.pidx = %d; len16=%d\n", __func__, wq->rq.pidx, len16); copy_wqe_to_udb(wq->rq.udb + 14, wqe); } else { PDBG("%s: DB wq->rq.pidx = %d; len16=%d\n", __func__, wq->rq.pidx, len16); - writel(V_PIDX_T5(inc), wq->rq.udb); + writel(V_QID(wq->rq.bar2_qid) | V_PIDX_T5(inc), wq->rq.udb); } wc_wmb(); return; Modified: stable/10/contrib/ofed/libcxgb4/src/verbs.c ============================================================================== --- head/contrib/ofed/libcxgb4/src/verbs.c Wed Oct 29 01:15:48 2014 (r273806) +++ stable/10/contrib/ofed/libcxgb4/src/verbs.c Thu Dec 1 23:38:52 2016 (r309378) @@ -213,7 +213,7 @@ struct ibv_cq *c4iw_create_cq(struct ibv goto err3; if (dev_is_t5(chp->rhp)) - chp->cq.ugts += 3; + chp->cq.ugts += 5; else chp->cq.ugts += 1; chp->cq.sw_queue = calloc(chp->cq.size, sizeof *chp->cq.queue); @@ -460,8 +460,14 @@ static struct ibv_qp *create_qp(struct i goto err3; } qhp->wq.sq.udb = dbva; - if (dev_is_t5(qhp->rhp)) { - qhp->wq.sq.udb += (128*(qhp->wq.sq.qid & qhp->wq.qid_mask))/4; + if (!dev_is_t4(qhp->rhp)) { + unsigned long segment_offset = 128 * (qhp->wq.sq.qid & qhp->wq.qid_mask); + + if (segment_offset < c4iw_page_size) { + qhp->wq.sq.udb += segment_offset / 4; + qhp->wq.sq.wc_reg_available = 1; + } else + qhp->wq.sq.bar2_qid = qhp->wq.sq.qid & qhp->wq.qid_mask; qhp->wq.sq.udb += 2; } @@ -479,8 +485,14 @@ static struct ibv_qp *create_qp(struct i if (dbva == MAP_FAILED) goto err5; qhp->wq.rq.udb = dbva; - if (dev_is_t5(qhp->rhp)) { - qhp->wq.rq.udb += (128*(qhp->wq.rq.qid & qhp->wq.qid_mask))/4; + if (!dev_is_t4(qhp->rhp)) { + unsigned long segment_offset = 128 * (qhp->wq.rq.qid & qhp->wq.qid_mask); + + if (segment_offset < c4iw_page_size) { + qhp->wq.rq.udb += segment_offset / 4; + qhp->wq.rq.wc_reg_available = 1; + } else + qhp->wq.rq.bar2_qid = qhp->wq.rq.qid & qhp->wq.qid_mask; qhp->wq.rq.udb += 2; } qhp->wq.rq.queue = mmap(NULL, qhp->wq.rq.memsize, Modified: stable/10/contrib/ofed/usr.lib/Makefile ============================================================================== --- stable/10/contrib/ofed/usr.lib/Makefile Thu Dec 1 23:37:17 2016 (r309377) +++ stable/10/contrib/ofed/usr.lib/Makefile Thu Dec 1 23:38:52 2016 (r309378) @@ -1,6 +1,4 @@ SUBDIR= libibcommon libibmad libibumad libibverbs libmlx4 libmthca \ - libopensm libosmcomp libosmvendor libibcm librdmacm libsdp - -SUBDIR_PARALLEL= + libopensm libosmcomp libosmvendor libibcm librdmacm libsdp libcxgb4 .include Modified: stable/10/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.h ============================================================================== --- stable/10/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.h Thu Dec 1 23:37:17 2016 (r309377) +++ stable/10/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.h Thu Dec 1 23:38:52 2016 (r309378) @@ -174,4 +174,5 @@ static inline void remove_handle(struct } void iwch_ev_dispatch(struct iwch_dev *, struct mbuf *); +void process_newconn(struct iw_cm_id *parent_cm_id, struct socket *child_so); #endif Modified: stable/10/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c ============================================================================== --- stable/10/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c Thu Dec 1 23:37:17 2016 (r309377) +++ stable/10/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.c Thu Dec 1 23:38:52 2016 (r309378) @@ -267,7 +267,6 @@ alloc_ep(int size, int flags) void __free_ep(struct iwch_ep_common *epc) { CTR3(KTR_IW_CXGB, "%s ep %p state %s", __FUNCTION__, epc, states[state_read(epc)]); - KASSERT(!epc->so, ("%s warning ep->so %p \n", __FUNCTION__, epc->so)); KASSERT(!epc->entry.tqe_prev, ("%s epc %p still on req list!\n", __FUNCTION__, epc)); free(epc, M_DEVBUF); } @@ -1374,7 +1373,7 @@ out: } int -iwch_create_listen(struct iw_cm_id *cm_id, int backlog) +iwch_create_listen_ep(struct iw_cm_id *cm_id, int backlog) { int err = 0; struct iwch_listen_ep *ep; @@ -1394,35 +1393,22 @@ iwch_create_listen(struct iw_cm_id *cm_i state_set(&ep->com, LISTEN); ep->com.so = cm_id->so; - err = init_sock(&ep->com); - if (err) - goto fail; - - err = solisten(ep->com.so, ep->backlog, ep->com.thread); - if (!err) { - cm_id->provider_data = ep; - goto out; - } - close_socket(&ep->com, 0); -fail: - cm_id->rem_ref(cm_id); - put_ep(&ep->com); + cm_id->provider_data = ep; out: return err; } -int -iwch_destroy_listen(struct iw_cm_id *cm_id) +void +iwch_destroy_listen_ep(struct iw_cm_id *cm_id) { struct iwch_listen_ep *ep = to_listen_ep(cm_id); CTR2(KTR_IW_CXGB, "%s ep %p", __FUNCTION__, ep); state_set(&ep->com, DEAD); - close_socket(&ep->com, 0); cm_id->rem_ref(cm_id); put_ep(&ep->com); - return 0; + return; } int @@ -1539,54 +1525,32 @@ process_connected(struct iwch_ep *ep) } } -static struct socket * -dequeue_socket(struct socket *head, struct sockaddr_in **remote, struct iwch_ep *child_ep) -{ - struct socket *so; - - ACCEPT_LOCK(); - so = TAILQ_FIRST(&head->so_comp); - if (!so) { - ACCEPT_UNLOCK(); - return NULL; - } - TAILQ_REMOVE(&head->so_comp, so, so_list); - head->so_qlen--; - SOCK_LOCK(so); - so->so_qstate &= ~SQ_COMP; - so->so_head = NULL; - soref(so); - soupcall_set(so, SO_RCV, iwch_so_upcall, child_ep); - so->so_state |= SS_NBIO; - PANIC_IF(!(so->so_state & SS_ISCONNECTED)); - PANIC_IF(so->so_error); - SOCK_UNLOCK(so); - ACCEPT_UNLOCK(); - soaccept(so, (struct sockaddr **)remote); - return so; -} - -static void -process_newconn(struct iwch_ep *parent_ep) +void +process_newconn(struct iw_cm_id *parent_cm_id, struct socket *child_so) { - struct socket *child_so; struct iwch_ep *child_ep; + struct sockaddr_in *local; struct sockaddr_in *remote; + struct iwch_ep *parent_ep = parent_cm_id->provider_data; CTR3(KTR_IW_CXGB, "%s parent ep %p so %p", __FUNCTION__, parent_ep, parent_ep->com.so); + if (!child_so) { + log(LOG_ERR, "%s - invalid child socket!\n", __func__); + return; + } child_ep = alloc_ep(sizeof(*child_ep), M_NOWAIT); if (!child_ep) { log(LOG_ERR, "%s - failed to allocate ep entry!\n", __FUNCTION__); return; } - child_so = dequeue_socket(parent_ep->com.so, &remote, child_ep); - if (!child_so) { - log(LOG_ERR, "%s - failed to dequeue child socket!\n", - __FUNCTION__); - __free_ep(&child_ep->com); - return; - } + SOCKBUF_LOCK(&child_so->so_rcv); + soupcall_set(child_so, SO_RCV, iwch_so_upcall, child_ep); + SOCKBUF_UNLOCK(&child_so->so_rcv); + + in_getsockaddr(child_so, (struct sockaddr **)&local); + in_getpeeraddr(child_so, (struct sockaddr **)&remote); + CTR3(KTR_IW_CXGB, "%s remote addr %s port %d", __FUNCTION__, inet_ntoa(remote->sin_addr), ntohs(remote->sin_port)); child_ep->com.tdev = parent_ep->com.tdev; @@ -1603,9 +1567,9 @@ process_newconn(struct iwch_ep *parent_e child_ep->com.thread = parent_ep->com.thread; child_ep->parent_ep = parent_ep; + free(local, M_SONAME); free(remote, M_SONAME); get_ep(&parent_ep->com); - child_ep->parent_ep = parent_ep; callout_init(&child_ep->timer, TRUE); state_set(&child_ep->com, MPA_REQ_WAIT); start_ep_timer(child_ep); @@ -1643,7 +1607,10 @@ process_socket_event(struct iwch_ep *ep) } if (state == LISTEN) { - process_newconn(ep); + /* socket listening events are handled at IWCM */ + CTR3(KTR_IW_CXGB, "%s Invalid ep state:%u, ep:%p", __func__, + ep->com.state, ep); + BUG(); return; } Modified: stable/10/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.h ============================================================================== --- stable/10/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.h Thu Dec 1 23:37:17 2016 (r309377) +++ stable/10/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_cm.h Thu Dec 1 23:38:52 2016 (r309378) @@ -231,8 +231,8 @@ iwch_wakeup(struct cv *cv, struct mtx *l /* CM prototypes */ int iwch_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param); -int iwch_create_listen(struct iw_cm_id *cm_id, int backlog); -int iwch_destroy_listen(struct iw_cm_id *cm_id); +int iwch_create_listen_ep(struct iw_cm_id *cm_id, int backlog); +void iwch_destroy_listen_ep(struct iw_cm_id *cm_id); int iwch_reject_cr(struct iw_cm_id *cm_id, const void *pdata, u8 pdata_len); int iwch_accept_cr(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param); int iwch_ep_disconnect(struct iwch_ep *ep, int abrupt, int flags); Modified: stable/10/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c ============================================================================== --- stable/10/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c Thu Dec 1 23:37:17 2016 (r309377) +++ stable/10/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c Thu Dec 1 23:38:52 2016 (r309378) @@ -1131,8 +1131,9 @@ int iwch_register_device(struct iwch_dev dev->ibdev.iwcm->connect = iwch_connect; dev->ibdev.iwcm->accept = iwch_accept_cr; dev->ibdev.iwcm->reject = iwch_reject_cr; - dev->ibdev.iwcm->create_listen = iwch_create_listen; - dev->ibdev.iwcm->destroy_listen = iwch_destroy_listen; + dev->ibdev.iwcm->create_listen_ep = iwch_create_listen_ep; + dev->ibdev.iwcm->destroy_listen_ep = iwch_destroy_listen_ep; + dev->ibdev.iwcm->newconn = process_newconn; dev->ibdev.iwcm->add_ref = iwch_qp_add_ref; dev->ibdev.iwcm->rem_ref = iwch_qp_rem_ref; dev->ibdev.iwcm->get_qp = iwch_get_qp; Modified: stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c Thu Dec 1 23:37:17 2016 (r309377) +++ stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c Thu Dec 1 23:38:52 2016 (r309378) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2013 Chelsio, Inc. All rights reserved. + * Copyright (c) 2009-2013, 2016 Chelsio, Inc. All rights reserved. * * This software is available to you under a choice of one of two * licenses. You may choose to be licensed under the terms of the GNU @@ -79,7 +79,7 @@ static spinlock_t timeout_lock; static void process_req(struct work_struct *ctx); static void start_ep_timer(struct c4iw_ep *ep); -static void stop_ep_timer(struct c4iw_ep *ep); +static int stop_ep_timer(struct c4iw_ep *ep); static int set_tcpinfo(struct c4iw_ep *ep); static enum c4iw_ep_state state_read(struct c4iw_ep_common *epc); static void __state_set(struct c4iw_ep_common *epc, enum c4iw_ep_state tostate); @@ -95,14 +95,14 @@ static void send_mpa_req(struct c4iw_ep static int send_mpa_reject(struct c4iw_ep *ep, const void *pdata, u8 plen); static int send_mpa_reply(struct c4iw_ep *ep, const void *pdata, u8 plen); static void close_complete_upcall(struct c4iw_ep *ep, int status); -static int abort_connection(struct c4iw_ep *ep); +static int send_abort(struct c4iw_ep *ep); static void peer_close_upcall(struct c4iw_ep *ep); static void peer_abort_upcall(struct c4iw_ep *ep); static void connect_reply_upcall(struct c4iw_ep *ep, int status); -static void connect_request_upcall(struct c4iw_ep *ep); +static int connect_request_upcall(struct c4iw_ep *ep); static void established_upcall(struct c4iw_ep *ep); -static void process_mpa_reply(struct c4iw_ep *ep); -static void process_mpa_request(struct c4iw_ep *ep); +static int process_mpa_reply(struct c4iw_ep *ep); +static int process_mpa_request(struct c4iw_ep *ep); static void process_peer_close(struct c4iw_ep *ep); static void process_conn_error(struct c4iw_ep *ep); static void process_close_complete(struct c4iw_ep *ep); @@ -110,8 +110,6 @@ static void ep_timeout(unsigned long arg static void init_sock(struct c4iw_ep_common *epc); static void process_data(struct c4iw_ep *ep); static void process_connected(struct c4iw_ep *ep); -static struct socket * dequeue_socket(struct socket *head, struct sockaddr_in **remote, struct c4iw_ep *child_ep); -static void process_newconn(struct c4iw_ep *parent_ep); static int c4iw_so_upcall(struct socket *so, void *arg, int waitflag); static void process_socket_event(struct c4iw_ep *ep); static void release_ep_resources(struct c4iw_ep *ep); @@ -124,11 +122,11 @@ static void release_ep_resources(struct } while (0) #define STOP_EP_TIMER(ep) \ - do { \ + ({ \ CTR3(KTR_IW_CXGBE, "stop_ep_timer (%s:%d) ep %p", \ __func__, __LINE__, (ep)); \ stop_ep_timer(ep); \ - } while (0) + }) #ifdef KTR static char *states[] = { @@ -148,6 +146,34 @@ static char *states[] = { }; #endif + +static void deref_cm_id(struct c4iw_ep_common *epc) +{ + epc->cm_id->rem_ref(epc->cm_id); + epc->cm_id = NULL; + set_bit(CM_ID_DEREFED, &epc->history); +} + +static void ref_cm_id(struct c4iw_ep_common *epc) +{ + set_bit(CM_ID_REFED, &epc->history); + epc->cm_id->add_ref(epc->cm_id); +} + +static void deref_qp(struct c4iw_ep *ep) +{ + c4iw_qp_rem_ref(&ep->com.qp->ibqp); + clear_bit(QP_REFERENCED, &ep->com.flags); + set_bit(QP_DEREFED, &ep->com.history); +} + +static void ref_qp(struct c4iw_ep *ep) +{ + set_bit(QP_REFERENCED, &ep->com.flags); + set_bit(QP_REFED, &ep->com.history); + c4iw_qp_add_ref(&ep->com.qp->ibqp); +} + static void process_req(struct work_struct *ctx) { @@ -307,9 +333,7 @@ process_peer_close(struct c4iw_ep *ep) disconnect = 0; STOP_EP_TIMER(ep); close_socket(&ep->com, 0); - ep->com.cm_id->rem_ref(ep->com.cm_id); - ep->com.cm_id = NULL; - ep->com.qp = NULL; + deref_cm_id(&ep->com); release = 1; break; @@ -474,7 +498,7 @@ process_conn_error(struct c4iw_ep *ep) if (state != ABORTING) { CTR2(KTR_IW_CXGBE, "%s:pce1 %p", __func__, ep); - close_socket(&ep->com, 1); + close_socket(&ep->com, 0); state_set(&ep->com, DEAD); c4iw_put_ep(&ep->com); } @@ -493,6 +517,7 @@ process_close_complete(struct c4iw_ep *e /* The cm_id may be null if we failed to connect */ mutex_lock(&ep->com.mutex); + set_bit(CLOSE_CON_RPL, &ep->com.history); switch (ep->com.state) { @@ -583,13 +608,14 @@ static void process_data(struct c4iw_ep *ep) { struct sockaddr_in *local, *remote; + int disconnect = 0; CTR5(KTR_IW_CXGBE, "%s: so %p, ep %p, state %s, sb_cc %d", __func__, ep->com.so, ep, states[ep->com.state], ep->com.so->so_rcv.sb_cc); switch (state_read(&ep->com)) { case MPA_REQ_SENT: - process_mpa_reply(ep); + disconnect = process_mpa_reply(ep); break; case MPA_REQ_WAIT: in_getsockaddr(ep->com.so, (struct sockaddr **)&local); @@ -598,7 +624,7 @@ process_data(struct c4iw_ep *ep) ep->com.remote_addr = *remote; free(local, M_SONAME); free(remote, M_SONAME); - process_mpa_request(ep); + disconnect = process_mpa_request(ep); break; default: if (ep->com.so->so_rcv.sb_cc) @@ -608,6 +634,9 @@ process_data(struct c4iw_ep *ep) ep->com.so->so_state, ep->com.so->so_rcv.sb_cc); break; } + if (disconnect) + c4iw_ep_disconnect(ep, disconnect == 2, GFP_KERNEL); + } static void @@ -624,40 +653,21 @@ process_connected(struct c4iw_ep *ep) } } -static struct socket * -dequeue_socket(struct socket *head, struct sockaddr_in **remote, - struct c4iw_ep *child_ep) -{ - struct socket *so; - - ACCEPT_LOCK(); - so = TAILQ_FIRST(&head->so_comp); - if (!so) { - ACCEPT_UNLOCK(); - return (NULL); - } - TAILQ_REMOVE(&head->so_comp, so, so_list); - head->so_qlen--; - SOCK_LOCK(so); - so->so_qstate &= ~SQ_COMP; - so->so_head = NULL; - soref(so); - soupcall_set(so, SO_RCV, c4iw_so_upcall, child_ep); - so->so_state |= SS_NBIO; - SOCK_UNLOCK(so); - ACCEPT_UNLOCK(); - soaccept(so, (struct sockaddr **)remote); - - return (so); -} - -static void -process_newconn(struct c4iw_ep *parent_ep) +void +process_newconn(struct iw_cm_id *parent_cm_id, struct socket *child_so) { - struct socket *child_so; struct c4iw_ep *child_ep; + struct sockaddr_in *local; struct sockaddr_in *remote; + struct c4iw_ep *parent_ep = parent_cm_id->provider_data; + if (!child_so) { + CTR4(KTR_IW_CXGBE, + "%s: parent so %p, parent ep %p, child so %p, invalid so", + __func__, parent_ep->com.so, parent_ep, child_so); + log(LOG_ERR, "%s: invalid child socket\n", __func__); + return; + } child_ep = alloc_ep(sizeof(*child_ep), M_NOWAIT); if (!child_ep) { CTR3(KTR_IW_CXGBE, "%s: parent so %p, parent ep %p, ENOMEM", @@ -665,23 +675,18 @@ process_newconn(struct c4iw_ep *parent_e log(LOG_ERR, "%s: failed to allocate ep entry\n", __func__); return; } - - child_so = dequeue_socket(parent_ep->com.so, &remote, child_ep); - if (!child_so) { - CTR4(KTR_IW_CXGBE, - "%s: parent so %p, parent ep %p, child ep %p, dequeue err", - __func__, parent_ep->com.so, parent_ep, child_ep); - log(LOG_ERR, "%s: failed to dequeue child socket\n", __func__); - __free_ep(&child_ep->com); - return; - - } + SOCKBUF_LOCK(&child_so->so_rcv); + soupcall_set(child_so, SO_RCV, c4iw_so_upcall, child_ep); + SOCKBUF_UNLOCK(&child_so->so_rcv); CTR5(KTR_IW_CXGBE, "%s: parent so %p, parent ep %p, child so %p, child ep %p", __func__, parent_ep->com.so, parent_ep, child_so, child_ep); - child_ep->com.local_addr = parent_ep->com.local_addr; + in_getsockaddr(child_so, (struct sockaddr **)&local); + in_getpeeraddr(child_so, (struct sockaddr **)&remote); + + child_ep->com.local_addr = *local; child_ep->com.remote_addr = *remote; child_ep->com.dev = parent_ep->com.dev; child_ep->com.so = child_so; @@ -689,15 +694,17 @@ process_newconn(struct c4iw_ep *parent_e child_ep->com.thread = parent_ep->com.thread; child_ep->parent_ep = parent_ep; + free(local, M_SONAME); free(remote, M_SONAME); + c4iw_get_ep(&parent_ep->com); - child_ep->parent_ep = parent_ep; init_timer(&child_ep->timer); state_set(&child_ep->com, MPA_REQ_WAIT); START_EP_TIMER(child_ep); /* maybe the request has already been queued up on the socket... */ process_mpa_request(child_ep); + return; } static int @@ -739,7 +746,10 @@ process_socket_event(struct c4iw_ep *ep) } if (state == LISTEN) { - process_newconn(ep); + /* socket listening events are handled at IWCM */ + CTR3(KTR_IW_CXGBE, "%s Invalid ep state:%u, ep:%p", __func__, + ep->com.state, ep); + BUG(); return; } @@ -750,7 +760,7 @@ process_socket_event(struct c4iw_ep *ep) } /* peer close */ - if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) && state < CLOSING) { + if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) && state <= CLOSING) { process_peer_close(ep); return; } @@ -772,10 +782,10 @@ TUNABLE_INT("hw.iw_cxgbe.db_delay_usecs" SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, db_delay_usecs, CTLFLAG_RW, &db_delay_usecs, 0, "Usecs to delay awaiting db fifo to drain"); -static int dack_mode = 1; +static int dack_mode = 0; TUNABLE_INT("hw.iw_cxgbe.dack_mode", &dack_mode); SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, dack_mode, CTLFLAG_RW, &dack_mode, 0, - "Delayed ack mode (default = 1)"); + "Delayed ack mode (default = 0)"); int c4iw_max_read_depth = 8; TUNABLE_INT("hw.iw_cxgbe.c4iw_max_read_depth", &c4iw_max_read_depth); @@ -802,10 +812,10 @@ TUNABLE_INT("hw.iw_cxgbe.c4iw_debug", &c SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, c4iw_debug, CTLFLAG_RW, &c4iw_debug, 0, "Enable debug logging (default = 0)"); -static int peer2peer; +static int peer2peer = 1; TUNABLE_INT("hw.iw_cxgbe.peer2peer", &peer2peer); SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, peer2peer, CTLFLAG_RW, &peer2peer, 0, - "Support peer2peer ULPs (default = 0)"); + "Support peer2peer ULPs (default = 1)"); static int p2p_type = FW_RI_INIT_P2PTYPE_READ_REQ; TUNABLE_INT("hw.iw_cxgbe.p2p_type", &p2p_type); @@ -819,13 +829,8 @@ SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, ep_ti static int mpa_rev = 1; TUNABLE_INT("hw.iw_cxgbe.mpa_rev", &mpa_rev); -#ifdef IW_CM_MPAV2 -SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, mpa_rev, CTLFLAG_RW, &mpa_rev, 0, - "MPA Revision, 0 supports amso1100, 1 is RFC0544 spec compliant, 2 is IETF MPA Peer Connect Draft compliant (default = 1)"); -#else SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, mpa_rev, CTLFLAG_RW, &mpa_rev, 0, - "MPA Revision, 0 supports amso1100, 1 is RFC0544 spec compliant (default = 1)"); -#endif + "MPA Revision, 0 supports amso1100, 1 is RFC5044 spec compliant, 2 is IETF MPA Peer Connect Draft compliant (default = 1)"); static int markers_enabled; TUNABLE_INT("hw.iw_cxgbe.markers_enabled", &markers_enabled); @@ -870,14 +875,16 @@ start_ep_timer(struct c4iw_ep *ep) add_timer(&ep->timer); } -static void +static int stop_ep_timer(struct c4iw_ep *ep) { del_timer_sync(&ep->timer); if (!test_and_set_bit(TIMEOUT, &ep->com.flags)) { c4iw_put_ep(&ep->com); + return 0; } + return 1; } static enum @@ -941,9 +948,10 @@ void _c4iw_free_ep(struct kref *kref) ep = container_of(kref, struct c4iw_ep, com.kref); epc = &ep->com; - KASSERT(!epc->so, ("%s ep->so %p", __func__, epc->so)); KASSERT(!epc->entry.tqe_prev, ("%s epc %p still on req list", __func__, epc)); + if (test_bit(QP_REFERENCED, &ep->com.flags)) + deref_qp(ep); kfree(ep); } @@ -1219,25 +1227,35 @@ static void close_complete_upcall(struct CTR2(KTR_IW_CXGBE, "%s:ccu1 %1", __func__, ep); ep->com.cm_id->event_handler(ep->com.cm_id, &event); - ep->com.cm_id->rem_ref(ep->com.cm_id); - ep->com.cm_id = NULL; - ep->com.qp = NULL; + deref_cm_id(&ep->com); set_bit(CLOSE_UPCALL, &ep->com.history); } CTR2(KTR_IW_CXGBE, "%s:ccuE %p", __func__, ep); } -static int abort_connection(struct c4iw_ep *ep) +static int send_abort(struct c4iw_ep *ep) { int err; CTR2(KTR_IW_CXGBE, "%s:abB %p", __func__, ep); - close_complete_upcall(ep, -ECONNRESET); - state_set(&ep->com, ABORTING); abort_socket(ep); - err = close_socket(&ep->com, 0); + + /* + * Since socket options were set as l_onoff=1 and l_linger=0 in in + * abort_socket, invoking soclose here sends a RST (reset) to the peer. + */ + err = close_socket(&ep->com, 1); set_bit(ABORT_CONN, &ep->com.history); CTR2(KTR_IW_CXGBE, "%s:abE %p", __func__, ep); + + /* + * TBD: iw_cgbe driver should receive ABORT reply for every ABORT + * request it has sent. But the current TOE driver is not propagating + * this ABORT reply event (via do_abort_rpl) to iw_cxgbe. So as a work- + * around de-refer 'ep' (which was refered before sending ABORT request) + * here instead of doing it in abort_rpl() handler of iw_cxgbe driver. + */ + c4iw_put_ep(&ep->com); return err; } @@ -1271,9 +1289,7 @@ static void peer_abort_upcall(struct c4i CTR2(KTR_IW_CXGBE, "%s:pau1 %p", __func__, ep); ep->com.cm_id->event_handler(ep->com.cm_id, &event); - ep->com.cm_id->rem_ref(ep->com.cm_id); - ep->com.cm_id = NULL; - ep->com.qp = NULL; + deref_cm_id(&ep->com); set_bit(ABORT_UPCALL, &ep->com.history); } CTR2(KTR_IW_CXGBE, "%s:pauE %p", __func__, ep); @@ -1327,17 +1343,16 @@ static void connect_reply_upcall(struct if (status < 0) { CTR3(KTR_IW_CXGBE, "%s:cru4 %p %d", __func__, ep, status); - ep->com.cm_id->rem_ref(ep->com.cm_id); - ep->com.cm_id = NULL; - ep->com.qp = NULL; + deref_cm_id(&ep->com); } CTR2(KTR_IW_CXGBE, "%s:cruE %p", __func__, ep); } -static void connect_request_upcall(struct c4iw_ep *ep) +static int connect_request_upcall(struct c4iw_ep *ep) { struct iw_cm_event event; + int ret; CTR3(KTR_IW_CXGBE, "%s: ep %p, mpa_v1 %d", __func__, ep, ep->tried_with_mpa_v1); @@ -1351,10 +1366,8 @@ static void connect_request_upcall(struc if (!ep->tried_with_mpa_v1) { /* this means MPA_v2 is used */ -#ifdef IW_CM_MPAV2 event.ord = ep->ord; event.ird = ep->ird; -#endif event.private_data_len = ep->plen - sizeof(struct mpa_v2_conn_params); event.private_data = ep->mpa_pkt + sizeof(struct mpa_message) + @@ -1362,19 +1375,21 @@ static void connect_request_upcall(struc } else { /* this means MPA_v1 is used. Send max supported */ -#ifdef IW_CM_MPAV2 event.ord = c4iw_max_read_depth; event.ird = c4iw_max_read_depth; -#endif event.private_data_len = ep->plen; event.private_data = ep->mpa_pkt + sizeof(struct mpa_message); } c4iw_get_ep(&ep->com); - ep->parent_ep->com.cm_id->event_handler(ep->parent_ep->com.cm_id, + ret = ep->parent_ep->com.cm_id->event_handler(ep->parent_ep->com.cm_id, &event); + if(ret) + c4iw_put_ep(&ep->com); + set_bit(CONNREQ_UPCALL, &ep->com.history); c4iw_put_ep(&ep->parent_ep->com); + return ret; } static void established_upcall(struct c4iw_ep *ep) @@ -1384,10 +1399,9 @@ static void established_upcall(struct c4 CTR2(KTR_IW_CXGBE, "%s:euB %p", __func__, ep); memset(&event, 0, sizeof(event)); event.event = IW_CM_EVENT_ESTABLISHED; -#ifdef IW_CM_MPAV2 event.ird = ep->ird; event.ord = ep->ord; -#endif + if (ep->com.cm_id) { CTR2(KTR_IW_CXGBE, "%s:eu1 %p", __func__, ep); @@ -1398,8 +1412,19 @@ static void established_upcall(struct c4 } - -static void process_mpa_reply(struct c4iw_ep *ep) +/* + * process_mpa_reply - process streaming mode MPA reply + * + * Returns: + * + * 0 upon success indicating a connect request was delivered to the ULP + * or the mpa request is incomplete but valid so far. + * + * 1 if a failure requires the caller to close the connection. + * + * 2 if a failure requires the caller to abort the connection. + */ +static int process_mpa_reply(struct c4iw_ep *ep) { struct mpa_message *mpa; struct mpa_v2_conn_params *mpa_v2_params; @@ -1412,17 +1437,17 @@ static void process_mpa_reply(struct c4i struct mbuf *top, *m; int flags = MSG_DONTWAIT; struct uio uio; + int disconnect = 0; CTR2(KTR_IW_CXGBE, "%s:pmrB %p", __func__, ep); /* - * Stop mpa timer. If it expired, then the state has - * changed and we bail since ep_timeout already aborted - * the connection. + * Stop mpa timer. If it expired, then + * we ignore the MPA reply. process_timeout() + * will abort the connection. */ - STOP_EP_TIMER(ep); - if (state_read(&ep->com) != MPA_REQ_SENT) - return; + if (STOP_EP_TIMER(ep)) + return 0; uio.uio_resid = 1000000; uio.uio_td = ep->com.thread; @@ -1434,7 +1459,7 @@ static void process_mpa_reply(struct c4i CTR2(KTR_IW_CXGBE, "%s:pmr1 %p", __func__, ep); START_EP_TIMER(ep); - return; + return 0; } err = -err; CTR2(KTR_IW_CXGBE, "%s:pmr2 %p", __func__, ep); @@ -1462,7 +1487,7 @@ static void process_mpa_reply(struct c4i CTR3(KTR_IW_CXGBE, "%s:pmr5 %p %d", __func__, ep, ep->mpa_pkt_len + m->m_len); err = (-EINVAL); - goto err; + goto err_stop_timer; } /* @@ -1480,8 +1505,9 @@ static void process_mpa_reply(struct c4i /* * if we don't even have the mpa message, then bail. */ - if (ep->mpa_pkt_len < sizeof(*mpa)) - return; + if (ep->mpa_pkt_len < sizeof(*mpa)) { + return 0; + } mpa = (struct mpa_message *) ep->mpa_pkt; /* Validate MPA header. */ @@ -1492,14 +1518,14 @@ static void process_mpa_reply(struct c4i printk(KERN_ERR MOD "%s MPA version mismatch. Local = %d, " " Received = %d\n", __func__, mpa_rev, mpa->revision); err = -EPROTO; - goto err; + goto err_stop_timer; } if (memcmp(mpa->key, MPA_KEY_REP, sizeof(mpa->key))) { CTR2(KTR_IW_CXGBE, "%s:pmr7 %p", __func__, ep); err = -EPROTO; - goto err; + goto err_stop_timer; } plen = ntohs(mpa->private_data_size); @@ -1511,7 +1537,7 @@ static void process_mpa_reply(struct c4i CTR2(KTR_IW_CXGBE, "%s:pmr8 %p", __func__, ep); err = -EPROTO; - goto err; + goto err_stop_timer; } /* @@ -1520,8 +1546,9 @@ static void process_mpa_reply(struct c4i if (ep->mpa_pkt_len > (sizeof(*mpa) + plen)) { CTR2(KTR_IW_CXGBE, "%s:pmr9 %p", __func__, ep); + STOP_EP_TIMER(ep); err = -EPROTO; - goto err; + goto err_stop_timer; } ep->plen = (u8) plen; @@ -1533,14 +1560,14 @@ static void process_mpa_reply(struct c4i if (ep->mpa_pkt_len < (sizeof(*mpa) + plen)) { CTR2(KTR_IW_CXGBE, "%s:pmra %p", __func__, ep); - return; + return 0; } if (mpa->flags & MPA_REJECT) { CTR2(KTR_IW_CXGBE, "%s:pmrb %p", __func__, ep); err = -ECONNREFUSED; - goto err; + goto err_stop_timer; } /* @@ -1683,6 +1710,7 @@ static void process_mpa_reply(struct c4i err = c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, C4IW_QP_ATTR_NEXT_STATE, &attrs, 0); err = -ENOMEM; + disconnect = 1; goto out; } @@ -1703,19 +1731,33 @@ static void process_mpa_reply(struct c4i err = c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, C4IW_QP_ATTR_NEXT_STATE, &attrs, 0); err = -ENOMEM; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Dec 2 00:00:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81A5DC628D2; Fri, 2 Dec 2016 00:00:53 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (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 536BC1A50; Fri, 2 Dec 2016 00:00:53 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x22c.google.com with SMTP id j65so454378431iof.0; Thu, 01 Dec 2016 16:00:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Qo+m2sRUaqxfQq6+L+bDw7EdL5fxy3G+C4tDWquptPM=; b=ytbo5LFzgYql6RlW6VPb7ejEpNVAiIit0W7GdqoOqE3N5I5lCaCWmfN+WPFBRmfGlL a5pSMNxitybO6oHT3cqv+MYWS+5zn6l4PbUS9Uxof91ZoBCe3/QARh0JU5LhvJFKEwT2 fjbEbf6LjzZ0ggwJXWozfBSh0lwqDDXsDHHTJzng7jJcknR4ZJvf7mc+EsEtmzBukTy7 EvyW7TmrMxITxHORWhtB/dDDbwjwxlCSiUfcO88Pz7WcgXQyzD8O5nh2wCUpse5cUvBl pbvKWk+taH4wxJVlzTukvx5VvGNydYXnM8yo1jC861q9xCGZ9NgyxBjfPo3anPxKoofM f0RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Qo+m2sRUaqxfQq6+L+bDw7EdL5fxy3G+C4tDWquptPM=; b=fAaatYBtvZ/pmAHz/b2EH6smUWKo5aJg2Eos4bdYCBZxPPwZUcDQEdy6bHEL0HzlGe qarUngYKGSkSj3fq2g0i0lq+kea3tc6aHAQL+TIRqQRoL6SpT1+s8Z8vWSzXBUSi7r+d 1O8yrR/Mv5Y3pNsjDvbBfV3H9gV+WfeEWK4b1JDMUGSv8xvKXqzYjEmu7A+CuAYiDgpj fHoOjP6Imk6rAHJXjWp4cemT/cN3K78CzAvQJbwRMs0npxTMvMdbTs1t9RrBzIJ3mQmC tmxTGSXFoET83A8l5g4VZRdwiLnt9bHLq6HBYnX1bDleKl/qsJAUAmeSCjerVVrb4RVd aJ+g== X-Gm-Message-State: AKaTC02wPw0C6K32Bb6dggWT5ppKy6pcrcOoWRCMjZV+J1D74ADFFAv1xfSs8GudYyC7N6WRxqnPC7NiUFCNRQ== X-Received: by 10.107.181.77 with SMTP id e74mr2680818iof.99.1480636852685; Thu, 01 Dec 2016 16:00:52 -0800 (PST) MIME-Version: 1.0 Received: by 10.36.150.129 with HTTP; Thu, 1 Dec 2016 16:00:52 -0800 (PST) In-Reply-To: References: <201612010435.uB14Zh21020050@repo.freebsd.org> <20161201164807.GE27291@strugglingcoder.info> From: Adrian Chadd Date: Thu, 1 Dec 2016 16:00:52 -0800 Message-ID: Subject: Re: svn commit: r309351 - head/etc/defaults To: Warner Losh Cc: hiren panchasara , Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 00:00:53 -0000 +1 for reverting it from now (from the causer of the pain...) -a On 1 December 2016 at 13:41, Warner Losh wrote: > On Thu, Dec 1, 2016 at 9:48 AM, hiren panchasara > wrote: >> On 12/01/16 at 04:35P, Warner Losh wrote: >>> Author: imp >>> Date: Thu Dec 1 04:35:43 2016 >>> New Revision: 309351 >>> URL: https://svnweb.freebsd.org/changeset/base/309351 >>> >>> Log: >>> Revert the 'performance' setting to 'NONE' from C2. >> >> Just a note that this commit reverts r282110. > > Yea, it's good for laptops, bad for servers. At least there's some > Intel CPUs that this causes corruption with USB. That's being sorted > out, but until that's done we need to fail more safe for our primary > market. > > Warner > From owner-svn-src-all@freebsd.org Fri Dec 2 00:23:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F88AC62DEB; Fri, 2 Dec 2016 00:23:11 +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 5ED3B15D2; Fri, 2 Dec 2016 00:23:11 +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 uB20NALQ007732; Fri, 2 Dec 2016 00:23:10 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB20NA8l007731; Fri, 2 Dec 2016 00:23:10 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612020023.uB20NA8l007731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 2 Dec 2016 00:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309379 - stable/10/sys/dev/cxgbe/firmware X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 00:23:11 -0000 Author: jhb Date: Fri Dec 2 00:23:10 2016 New Revision: 309379 URL: https://svnweb.freebsd.org/changeset/base/309379 Log: MFC 297797: cxgbe(4): Provide an explicit value for nqpcq in the firmware configuration file. Sponsored by: Chelsio Communications Modified: stable/10/sys/dev/cxgbe/firmware/t5fw_cfg.txt Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/firmware/t5fw_cfg.txt ============================================================================== --- stable/10/sys/dev/cxgbe/firmware/t5fw_cfg.txt Thu Dec 1 23:38:52 2016 (r309378) +++ stable/10/sys/dev/cxgbe/firmware/t5fw_cfg.txt Fri Dec 2 00:23:10 2016 (r309379) @@ -131,6 +131,7 @@ niqflint = 512 nethctrl = 1024 neq = 2048 + nqpcq = 8192 nexactf = 328 cmask = all pmask = all @@ -215,7 +216,7 @@ [fini] version = 0x1 - checksum = 0xebb87494 + checksum = 0x168d5243 # # $FreeBSD$ # From owner-svn-src-all@freebsd.org Fri Dec 2 01:25:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC928C61610; Fri, 2 Dec 2016 01:25:52 +0000 (UTC) (envelope-from pfg@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 872DA15C2; Fri, 2 Dec 2016 01:25:52 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB21Pp9B032019; Fri, 2 Dec 2016 01:25:51 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB21PpaF032015; Fri, 2 Dec 2016 01:25:51 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612020125.uB21PpaF032015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 2 Dec 2016 01:25:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309380 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 01:25:52 -0000 Author: pfg Date: Fri Dec 2 01:25:51 2016 New Revision: 309380 URL: https://svnweb.freebsd.org/changeset/base/309380 Log: indent(1): Fix indent's confusion about custom FreeBSD macros. Teach indent(1) about storage-class specifiers. Don't assume "in_parameter_declaration" state if "in_decl" hasn't been set. Don't set "in_decl" for storage-class specifiers. That set of changes helps with recognizing the difference between file scope declarations like this: static LIST_HEAD(, alq) ald_active; static int ald_shuttingdown = 0; struct thread *ald_thread; and old style function declarators like this: static int do_execve(td, args, mac_p) struct thread *td; struct image_args *args; struct mac *mac_p; { Unfortunately, at the same time this change makes indent(1) require explicit int in declarations like "static a;", in order to understand that it's part of a declaration. On the other hand, declarations like in the first example are no longer indented as if ald_shuttingdown and ald_thread were parameters of a function named LIST_HEAD. Submitted by: Piotr Stefaniak Modified: head/usr.bin/indent/indent.c head/usr.bin/indent/indent_codes.h head/usr.bin/indent/lexi.c Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Fri Dec 2 00:23:10 2016 (r309379) +++ head/usr.bin/indent/indent.c Fri Dec 2 01:25:51 2016 (r309380) @@ -920,8 +920,11 @@ check_type: } goto copy_id; /* move the token into line */ - case decl: /* we have a declaration type (int, register, - * etc.) */ + case storage: + prefix_blankline_requested = 0; + goto copy_id; + + case decl: /* we have a declaration type (int, etc.) */ parse(decl); /* let parser worry about indentation */ if (ps.last_token == rparen && ps.tos <= 1) { ps.in_parameter_declaration = 1; Modified: head/usr.bin/indent/indent_codes.h ============================================================================== --- head/usr.bin/indent/indent_codes.h Fri Dec 2 00:23:10 2016 (r309379) +++ head/usr.bin/indent/indent_codes.h Fri Dec 2 01:25:51 2016 (r309380) @@ -69,3 +69,4 @@ #define elsehead 31 #define period 32 #define strpfx 33 +#define storage 34 Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Fri Dec 2 00:23:10 2016 (r309379) +++ head/usr.bin/indent/lexi.c Fri Dec 2 01:25:51 2016 (r309380) @@ -70,6 +70,7 @@ struct templ { */ struct templ specials[] = { + {"auto", 10}, {"break", 9}, {"case", 8}, {"char", 4}, @@ -79,7 +80,7 @@ struct templ specials[] = {"double", 4}, {"else", 6}, {"enum", 3}, - {"extern", 4}, + {"extern", 10}, {"float", 4}, {"for", 5}, {"global", 4}, @@ -88,14 +89,14 @@ struct templ specials[] = {"int", 4}, {"long", 4}, {"offsetof", 1}, - {"register", 4}, + {"register", 10}, {"return", 9}, {"short", 4}, {"sizeof", 2}, - {"static", 4}, + {"static", 10}, {"struct", 3}, {"switch", 7}, - {"typedef", 4}, + {"typedef", 10}, {"union", 3}, {"unsigned", 4}, {"void", 4}, @@ -312,6 +313,9 @@ lexi(void) case 6: /* do, else */ return (sp_nparen); + case 10: /* storage class specifier */ + return (storage); + default: /* all others are treated like any other * identifier */ return (ident); @@ -323,7 +327,8 @@ lexi(void) if (*tp++ == ')' && (*tp == ';' || *tp == ',')) goto not_proc; strncpy(ps.procname, token, sizeof ps.procname - 1); - ps.in_parameter_declaration = 1; + if (ps.in_decl) + ps.in_parameter_declaration = 1; rparen_count = 1; not_proc:; } From owner-svn-src-all@freebsd.org Fri Dec 2 01:38:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F32ECC6188E; Fri, 2 Dec 2016 01:38:41 +0000 (UTC) (envelope-from gonzo@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 CD9D01A53; Fri, 2 Dec 2016 01:38:41 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB21cfKW036169; Fri, 2 Dec 2016 01:38:41 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB21ce3W036166; Fri, 2 Dec 2016 01:38:40 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201612020138.uB21ce3W036166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 2 Dec 2016 01:38:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309381 - stable/11/share/man/man4 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 01:38:42 -0000 Author: gonzo Date: Fri Dec 2 01:38:40 2016 New Revision: 309381 URL: https://svnweb.freebsd.org/changeset/base/309381 Log: MFC r308941: [bytgpio] Add bytgpio(4) man page with general description of the driver Added: stable/11/share/man/man4/bytgpio.4 - copied unchanged from r308941, head/share/man/man4/bytgpio.4 Modified: stable/11/share/man/man4/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/Makefile ============================================================================== --- stable/11/share/man/man4/Makefile Fri Dec 2 01:25:51 2016 (r309380) +++ stable/11/share/man/man4/Makefile Fri Dec 2 01:38:40 2016 (r309381) @@ -85,6 +85,7 @@ MAN= aac.4 \ bt.4 \ bwi.4 \ bwn.4 \ + ${_bytgpio.4} \ capsicum.4 \ cardbus.4 \ carp.4 \ @@ -769,6 +770,7 @@ _amdsmb.4= amdsmb.4 _amdtemp.4= amdtemp.4 _asmc.4= asmc.4 _bxe.4= bxe.4 +_bytgpio.4= bytgpio.4 _coretemp.4= coretemp.4 _cpuctl.4= cpuctl.4 _dpms.4= dpms.4 Copied: stable/11/share/man/man4/bytgpio.4 (from r308941, head/share/man/man4/bytgpio.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/share/man/man4/bytgpio.4 Fri Dec 2 01:38:40 2016 (r309381, copy of r308941, head/share/man/man4/bytgpio.4) @@ -0,0 +1,55 @@ +.\" Copyright (c) 2016 +.\" Oleksandr Tymoshenko . All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd November 20, 2016 +.Dt BYTGPIO 4 +.Os +.Sh NAME +.Nm bytgpio +.Nd Intel Bay Trail SoC GPIO controller +.Sh SYNOPSIS +.Cd "device gpio" +.Cd "device bytgpio" +.Sh DESCRIPTION +The +.Nm +is a driver for GPIO controller that can be found in Intel's Bay Trail SoC family. +.Pp +Bay Trail SoC has three banks of GPIO pins exposed to userland as /dev/gpiocN, +where N is 0, 1, and 2. Pins in each bank are pre-named to match names +on boards schematics: GPIO_S0_SCnn, GPIO_S0_NCnn, and GPIO_S5_nn. +.Sh SEE ALSO +.Xr gpio 3 , +.Xr gpio 4 , +.Xr gpioctl 8 +.Sh HISTORY +The +.Nm +manual page first appeared in +.Fx 12.0 . +.Sh AUTHORS +This driver and man page was written by +.An Oleksandr Tymoshenko Aq Mt gonzo@FreeBSD.org . From owner-svn-src-all@freebsd.org Fri Dec 2 01:52:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73E82C61E75; Fri, 2 Dec 2016 01:52:33 +0000 (UTC) (envelope-from pfg@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 362ED1388; Fri, 2 Dec 2016 01:52:33 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB21qWcZ043813; Fri, 2 Dec 2016 01:52:32 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB21qWkb043812; Fri, 2 Dec 2016 01:52:32 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612020152.uB21qWkb043812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 2 Dec 2016 01:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309382 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 01:52:33 -0000 Author: pfg Date: Fri Dec 2 01:52:32 2016 New Revision: 309382 URL: https://svnweb.freebsd.org/changeset/base/309382 Log: indent(1): Do not define opchar unless it will be used. "opchar" is only used once depending on "undef" macro being defined. Conditionalize it in the same way. Submitted by: Piotr Sephaniak Modified: head/usr.bin/indent/lexi.c Modified: head/usr.bin/indent/lexi.c ============================================================================== --- head/usr.bin/indent/lexi.c Fri Dec 2 01:38:40 2016 (r309381) +++ head/usr.bin/indent/lexi.c Fri Dec 2 01:52:32 2016 (r309382) @@ -57,7 +57,9 @@ __FBSDID("$FreeBSD$"); #include "indent.h" #define alphanum 1 +#ifdef undef #define opchar 3 +#endif struct templ { const char *rwd; From owner-svn-src-all@freebsd.org Fri Dec 2 02:25:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E145AC6274B; Fri, 2 Dec 2016 02:25:28 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 90F1F1142; Fri, 2 Dec 2016 02:25:27 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id CdXLcSRvrKQ1GCdXMcia4w; Thu, 01 Dec 2016 19:25:21 -0700 X-Authority-Analysis: v=2.2 cv=RsK1FGuK c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=n5n_aSjo0skA:10 a=6I5d2MoRAAAA:8 a=NEAV23lmAAAA:8 a=YxBL1-UpAAAA:8 a=q2U9Gq7pqrimPw9a1TIA:9 a=X8FCfygWxkzDMqUL:21 a=HV8EdFySohd3zm9c:21 a=pynXk66uh0YmACDl:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Bn2pgwyD2vrAyMmN8A2t:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 976C4C64; Thu, 1 Dec 2016 17:11:36 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id uB22PIQl039020; Thu, 1 Dec 2016 18:25:18 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201612020225.uB22PIQl039020@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Martin Matuska cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309300 - in head: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar/test lib/libarchive/tests In-Reply-To: Message from Martin Matuska of "Tue, 29 Nov 2016 22:14:42 +0000." <201611292214.uATMEgQH079904@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 01 Dec 2016 18:25:18 -0800 X-CMAE-Envelope: MS4wfBuonkZQIrdWp+8IpGq6JZp5QQ5uyRBzNJR9HmNMMz/4jEensFfk4G1S4tmXNjhK2rShjRO7Rbh8jMYxyLnHWswG4yyIBiEWvQ2vxMVcx6zkmCkU8rmn mFbb4Hd5PR2XnZCZqIkcFEqppyNZJ3oudOqjtDrgeCjq8FG5GzLUgXjeCqtiT/i50ag554b4VveRttCAKG/+CtR1YYA5DVWSFCzSMQOhCi2yXo/KP9PwpBGh 4qCSwsXy96sFR52wBb7r+6t3B5A3tMUBz0Ss3DfZwUzoOuGm5G/Y0BCEgMYoPwdA X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 02:25:29 -0000 In message <201611292214.uATMEgQH079904@repo.freebsd.org>, Martin Matuska write s: > Author: mm > Date: Tue Nov 29 22:14:42 2016 > New Revision: 309300 > URL: https://svnweb.freebsd.org/changeset/base/309300 > > Log: > MFV r309299: > Sync libarchive with vendor. > > Important vendor bugfixes (relevant to FreeBSD): > #821: tar -P cannot extract hardlinks through symlinks > #825: Add sanity check of tar "uid, "gid" and "mtime" fields > > PR: 213255 > Reported by: Tijl Coosemans > MFC after: 1 week > > Added: > head/contrib/libarchive/libarchive/test/test_compat_gtar_2.tar.uu > - copied unchanged from r309299, vendor/libarchive/dist/libarchive/test/ > test_compat_gtar_2.tar.uu > head/contrib/libarchive/libarchive/test/test_compat_star_acl_posix1e.c > - copied unchanged from r309299, vendor/libarchive/dist/libarchive/test/ > test_compat_star_acl_posix1e.c > head/contrib/libarchive/libarchive/test/test_compat_star_acl_posix1e.tar.uu > - copied unchanged from r309299, vendor/libarchive/dist/libarchive/test/ > test_compat_star_acl_posix1e.tar.uu > head/contrib/libarchive/libarchive/test/test_read_format_raw.bufr.uu > - copied unchanged from r309299, vendor/libarchive/dist/libarchive/test/ > test_read_format_raw.bufr.uu > Modified: > head/contrib/libarchive/NEWS > head/contrib/libarchive/libarchive/archive_acl.c > head/contrib/libarchive/libarchive/archive_entry.c > head/contrib/libarchive/libarchive/archive_entry.h > head/contrib/libarchive/libarchive/archive_entry_acl.3 > head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c > head/contrib/libarchive/libarchive/archive_read_support_filter_xz.c > head/contrib/libarchive/libarchive/archive_read_support_format_tar.c > head/contrib/libarchive/libarchive/archive_read_support_format_xar.c > head/contrib/libarchive/libarchive/archive_write_disk_posix.c > head/contrib/libarchive/libarchive/test/test_compat_gtar.c > head/contrib/libarchive/libarchive/test/test_read_format_raw.c > head/contrib/libarchive/libarchive/test/test_sparse_basic.c > head/contrib/libarchive/tar/test/test_symlink_dir.c > head/lib/libarchive/tests/Makefile > Directory Properties: > head/contrib/libarchive/ (props changed) > [...] > Modified: head/contrib/libarchive/libarchive/archive_read_support_format_tar. > c > ============================================================================= > = > --- head/contrib/libarchive/libarchive/archive_read_support_format_tar.c > Tue Nov 29 21:53:16 2016 (r309299) > +++ head/contrib/libarchive/libarchive/archive_read_support_format_tar.c > Tue Nov 29 22:14:42 2016 (r309300) > @@ -294,6 +294,46 @@ archive_read_format_tar_cleanup(struct a > return (ARCHIVE_OK); > } > > +static int > +validate_number_field(const char* p_field, size_t i_size) > +{ > + unsigned char marker = (unsigned char)p_field[0]; > + /* octal? */ > + if ((marker >= '0' && marker <= '7') || marker == ' ') { > + size_t i = 0; > + int octal_found = 0; > + for (i = 0; i < i_size; ++i) { > + switch (p_field[i]) > + { > + case ' ': /* skip any leading spaces and trailing space > */ > + if (octal_found == 0 || i == i_size - 1) { > + continue; > + } > + break; > + case '\0': /* null is allowed only at the end */ > + if (i != i_size - 1) { > + return 0; > + } > + break; > + /* rest must be octal digits */ > + case '0': case '1': case '2': case '3': > + case '4': case '5': case '6': case '7': > + ++octal_found; > + break; > + } > + } > + return octal_found > 0; > + } > + /* base 256 (i.e. binary number) */ > + else if (marker == 128 || marker == 255 || marker == 0) { > + /* nothing to check */ > + return 1; > + } > + /* not a number field */ > + else { > + return 0; > + } > +} > > static int > archive_read_format_tar_bid(struct archive_read *a, int best_bid) > @@ -346,23 +386,23 @@ archive_read_format_tar_bid(struct archi > return (0); > bid += 2; /* 6 bits of variation in an 8-bit field leaves 2 bits. */ > > - /* Sanity check: Look at first byte of mode field. */ > - switch (255 & (unsigned)header->mode[0]) { > - case 0: case 255: > - /* Base-256 value: No further verification possible! */ > - break; > - case ' ': /* Not recommended, but not illegal, either. */ > - break; > - case '0': case '1': case '2': case '3': > - case '4': case '5': case '6': case '7': > - /* Octal Value. */ > - /* TODO: Check format of remainder of this field. */ > - break; > - default: > - /* Not a valid mode; bail out here. */ > - return (0); > + /* > + * Check format of mode/uid/gid/mtime/size/rdevmajor/rdevminor fields. > + * These are usually octal numbers but GNU tar encodes "big" values as > + * base256 and leading zeroes are sometimes replaced by spaces. > + * Even the null terminator is sometimes omitted. Anyway, must be check > ed > + * to avoid false positives. > + */ > + if (bid > 0 && > + (validate_number_field(header->mode, sizeof(header->mode)) == 0 > || > + validate_number_field(header->uid, sizeof(header->uid)) == 0 | > | > + validate_number_field(header->gid, sizeof(header->gid)) == 0 | > | > + validate_number_field(header->mtime, sizeof(header->mtime)) == > 0 || > + validate_number_field(header->size, sizeof(header->size)) == 0 > || > + validate_number_field(header->rdevmajor, sizeof(header->rdevma > jor)) == 0 || > + validate_number_field(header->rdevminor, sizeof(header->rdevmi > nor)) == 0)) { > + bid = 0; > } > - /* TODO: Sanity test uid/gid/size/mtime/rdevmajor/rdevminor fields. */ > > return (bid); > } > Hi, This broke extract of older tarballs and compatibility with Perl Archive::Tar. You can test this by trying to extract ports/net/tcpview. The following patch fixes it: https://github.com/libarchive/libarchive/commit/2d2b3e928605f795515b03f060fd638c265b0778#diff-845deb76aa98ded5cb2860ded3e19dfb The relevant part of the patch follows: diff --git a/libarchive/archive_read_support_format_tar.c b/libarchive/archive_read_support_format_tar.c index 0ee511e..b977cb7 100644 --- libarchive/archive_read_support_format_tar.c +++ libarchive/archive_read_support_format_tar.c @@ -294,8 +294,14 @@ archive_read_format_tar_cleanup(struct archive_read *a) return (ARCHIVE_OK); } +/* + * Validate number field + * + * Flags: + * 1 - allow double \0 at field end + */ static int -validate_number_field(const char* p_field, size_t i_size) +validate_number_field(const char* p_field, size_t i_size, int flags) { unsigned char marker = (unsigned char)p_field[0]; /* octal? */ @@ -305,14 +311,24 @@ validate_number_field(const char* p_field, size_t i_size) for (i = 0; i < i_size; ++i) { switch (p_field[i]) { - case ' ': /* skip any leading spaces and trailing space*/ + case ' ': + /* skip any leading spaces and trailing space */ if (octal_found == 0 || i == i_size - 1) { continue; } break; - case '\0': /* null is allowed only at the end */ + case '\0': + /* + * null should be allowed only at the end + * + * Perl Archive::Tar terminates some fields + * with two nulls. We must allow this to stay + * compatible. + */ if (i != i_size - 1) { - return 0; + if (((flags & 1) == 0) + || i != i_size - 2) + return 0; } break; /* rest must be octal digits */ @@ -390,18 +406,25 @@ archive_read_format_tar_bid(struct archive_read *a, int best_bid) * Check format of mode/uid/gid/mtime/size/rdevmajor/rdevminor fields. * These are usually octal numbers but GNU tar encodes "big" values as * base256 and leading zeroes are sometimes replaced by spaces. - * Even the null terminator is sometimes omitted. Anyway, must be checked - * to avoid false positives. + * Even the null terminator is sometimes omitted. Anyway, must be + * checked to avoid false positives. + * + * Perl Archive::Tar does not follow the spec and terminates mode, uid, + * gid, rdevmajor and rdevminor with a double \0. For compatibility + * reasons we allow this deviation. */ - if (bid > 0 && - (validate_number_field(header->mode, sizeof(header->mode)) == 0 || - validate_number_field(header->uid, sizeof(header->uid)) == 0 || - validate_number_field(header->gid, sizeof(header->gid)) == 0 || - validate_number_field(header->mtime, sizeof(header->mtime)) == 0 || - validate_number_field(header->size, sizeof(header->size)) == 0 || - validate_number_field(header->rdevmajor, sizeof(header->rdevmajor)) == 0 || - validate_number_field(header->rdevminor, sizeof(header->rdevminor)) == 0)) { - bid = 0; + if (bid > 0 && ( + validate_number_field(header->mode, sizeof(header->mode), 1) == 0 + || validate_number_field(header->uid, sizeof(header->uid), 1) == 0 + || validate_number_field(header->gid, sizeof(header->gid), 1) == 0 + || validate_number_field(header->mtime, sizeof(header->mtime), + 0) == 0 + || validate_number_field(header->size, sizeof(header->size), 0) == 0 + || validate_number_field(header->rdevmajor, + sizeof(header->rdevmajor), 1) == 0 + || validate_number_field(header->rdevminor, + sizeof(header->rdevminor), 1) == 0)) { + bid = 0; } return (bid); Updating to git 2d2b3e928605f795515b03f060fd638c265b0778 or later probably makes the most sense. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Fri Dec 2 02:46:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DDFDC62C92; Fri, 2 Dec 2016 02:46:36 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EC0431B81; Fri, 2 Dec 2016 02:46:35 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id CdrncbTunIwqSCdrocdIXH; Thu, 01 Dec 2016 19:46:29 -0700 X-Authority-Analysis: v=2.2 cv=cNuQihWN c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=n5n_aSjo0skA:10 a=VxmjJ2MpAAAA:8 a=6I5d2MoRAAAA:8 a=NEAV23lmAAAA:8 a=YxBL1-UpAAAA:8 a=dPdGhu47XFbj6EuJ0X4A:9 a=N4WJNfBsDPN8pCut:21 a=5hvrOP4l-_IyPNkK:21 a=pynXk66uh0YmACDl:21 a=CjuIK1q_8ugA:10 a=7gXAzLPJhVmCkEl4_tsf:22 a=IjZwj45LgO3ly-622nXo:22 a=Bn2pgwyD2vrAyMmN8A2t:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 5F5AFC7B; Thu, 1 Dec 2016 17:32:44 -0800 (PST) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id uB22kPal051798; Thu, 1 Dec 2016 18:46:25 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201612020246.uB22kPal051798@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Cy Schubert cc: Martin Matuska , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309300 - in head: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar/test lib/libarchive/tests In-Reply-To: Message from Cy Schubert of "Thu, 01 Dec 2016 18:25:18 -0800." <201612020225.uB22PIQl039020@slippy.cwsent.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 01 Dec 2016 18:46:25 -0800 X-CMAE-Envelope: MS4wfEizk5up1OXAZWECNpCHdLpi/W4xDMK55jro6rSToR8XNzsF41D1WjQai/V9jlQKJdcMwsWH5AOVSLCHQDkBiYWw/xn5bvqwbKO8WyXgJdvrlBykQqf1 x8/U+vCKnZTZ+rcL6AhGmrHk1MWzecSAIbgQ4XOi9z14NwjNgfwKsGLgUpOEY+1YMwYBJNVfBZVtH76ED61uQfIRDHgCjWSWedhuLV0aWt/E3omxYvc0UYfi OUZNF/KWFn+R6A+3ytoJtdV0DZNn28ksF7asDgVWrhN16iQMZNKOPGvqmeble50S X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 02:46:36 -0000 In message <201612020225.uB22PIQl039020@slippy.cwsent.com>, Cy Schubert writes: > In message <201611292214.uATMEgQH079904@repo.freebsd.org>, Martin Matuska > write > s: > > Author: mm > > Date: Tue Nov 29 22:14:42 2016 > > New Revision: 309300 > > URL: https://svnweb.freebsd.org/changeset/base/309300 > > > > Log: > > MFV r309299: > > Sync libarchive with vendor. > > > > Important vendor bugfixes (relevant to FreeBSD): > > #821: tar -P cannot extract hardlinks through symlinks > > #825: Add sanity check of tar "uid, "gid" and "mtime" fields > > > > PR: 213255 > > Reported by: Tijl Coosemans > > MFC after: 1 week > > > > Added: > > head/contrib/libarchive/libarchive/test/test_compat_gtar_2.tar.uu > > - copied unchanged from r309299, vendor/libarchive/dist/libarchive/tes > t/ > > test_compat_gtar_2.tar.uu > > head/contrib/libarchive/libarchive/test/test_compat_star_acl_posix1e.c > > - copied unchanged from r309299, vendor/libarchive/dist/libarchive/tes > t/ > > test_compat_star_acl_posix1e.c > > head/contrib/libarchive/libarchive/test/test_compat_star_acl_posix1e.tar. > uu > > - copied unchanged from r309299, vendor/libarchive/dist/libarchive/tes > t/ > > test_compat_star_acl_posix1e.tar.uu > > head/contrib/libarchive/libarchive/test/test_read_format_raw.bufr.uu > > - copied unchanged from r309299, vendor/libarchive/dist/libarchive/tes > t/ > > test_read_format_raw.bufr.uu > > Modified: > > head/contrib/libarchive/NEWS > > head/contrib/libarchive/libarchive/archive_acl.c > > head/contrib/libarchive/libarchive/archive_entry.c > > head/contrib/libarchive/libarchive/archive_entry.h > > head/contrib/libarchive/libarchive/archive_entry_acl.3 > > head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c > > head/contrib/libarchive/libarchive/archive_read_support_filter_xz.c > > head/contrib/libarchive/libarchive/archive_read_support_format_tar.c > > head/contrib/libarchive/libarchive/archive_read_support_format_xar.c > > head/contrib/libarchive/libarchive/archive_write_disk_posix.c > > head/contrib/libarchive/libarchive/test/test_compat_gtar.c > > head/contrib/libarchive/libarchive/test/test_read_format_raw.c > > head/contrib/libarchive/libarchive/test/test_sparse_basic.c > > head/contrib/libarchive/tar/test/test_symlink_dir.c > > head/lib/libarchive/tests/Makefile > > Directory Properties: > > head/contrib/libarchive/ (props changed) > > > [...] > > Modified: head/contrib/libarchive/libarchive/archive_read_support_format_ta > r. > > c > > =========================================================================== > == > > = > > --- head/contrib/libarchive/libarchive/archive_read_support_format_tar.c > > Tue Nov 29 21:53:16 2016 (r309299) > > +++ head/contrib/libarchive/libarchive/archive_read_support_format_tar.c > > Tue Nov 29 22:14:42 2016 (r309300) > > @@ -294,6 +294,46 @@ archive_read_format_tar_cleanup(struct a > > return (ARCHIVE_OK); > > } > > > > +static int > > +validate_number_field(const char* p_field, size_t i_size) > > +{ > > + unsigned char marker = (unsigned char)p_field[0]; > > + /* octal? */ > > + if ((marker >= '0' && marker <= '7') || marker == ' ') { > > + size_t i = 0; > > + int octal_found = 0; > > + for (i = 0; i < i_size; ++i) { > > + switch (p_field[i]) > > + { > > + case ' ': /* skip any leading spaces and trailing space > > */ > > + if (octal_found == 0 || i == i_size - 1) { > > + continue; > > + } > > + break; > > + case '\0': /* null is allowed only at the end */ > > + if (i != i_size - 1) { > > + return 0; > > + } > > + break; > > + /* rest must be octal digits */ > > + case '0': case '1': case '2': case '3': > > + case '4': case '5': case '6': case '7': > > + ++octal_found; > > + break; > > + } > > + } > > + return octal_found > 0; > > + } > > + /* base 256 (i.e. binary number) */ > > + else if (marker == 128 || marker == 255 || marker == 0) { > > + /* nothing to check */ > > + return 1; > > + } > > + /* not a number field */ > > + else { > > + return 0; > > + } > > +} > > > > static int > > archive_read_format_tar_bid(struct archive_read *a, int best_bid) > > @@ -346,23 +386,23 @@ archive_read_format_tar_bid(struct archi > > return (0); > > bid += 2; /* 6 bits of variation in an 8-bit field leaves 2 bits. */ > > > > - /* Sanity check: Look at first byte of mode field. */ > > - switch (255 & (unsigned)header->mode[0]) { > > - case 0: case 255: > > - /* Base-256 value: No further verification possible! */ > > - break; > > - case ' ': /* Not recommended, but not illegal, either. */ > > - break; > > - case '0': case '1': case '2': case '3': > > - case '4': case '5': case '6': case '7': > > - /* Octal Value. */ > > - /* TODO: Check format of remainder of this field. */ > > - break; > > - default: > > - /* Not a valid mode; bail out here. */ > > - return (0); > > + /* > > + * Check format of mode/uid/gid/mtime/size/rdevmajor/rdevminor fields. > > + * These are usually octal numbers but GNU tar encodes "big" values as > > + * base256 and leading zeroes are sometimes replaced by spaces. > > + * Even the null terminator is sometimes omitted. Anyway, must be check > > ed > > + * to avoid false positives. > > + */ > > + if (bid > 0 && > > + (validate_number_field(header->mode, sizeof(header->mode)) == 0 > > || > > + validate_number_field(header->uid, sizeof(header->uid)) == 0 | > > | > > + validate_number_field(header->gid, sizeof(header->gid)) == 0 | > > | > > + validate_number_field(header->mtime, sizeof(header->mtime)) == > > 0 || > > + validate_number_field(header->size, sizeof(header->size)) == 0 > > || > > + validate_number_field(header->rdevmajor, sizeof(header->rdevma > > jor)) == 0 || > > + validate_number_field(header->rdevminor, sizeof(header->rdevmi > > nor)) == 0)) { > > + bid = 0; > > } > > - /* TODO: Sanity test uid/gid/size/mtime/rdevmajor/rdevminor fields. */ > > > > return (bid); > > } > > > > Hi, > > This broke extract of older tarballs and compatibility with Perl > Archive::Tar. You can test this by trying to extract ports/net/tcpview. > > The following patch fixes it: > > https://github.com/libarchive/libarchive/commit/2d2b3e928605f795515b03f060fd6 > 38c265b0778#diff-845deb76aa98ded5cb2860ded3e19dfb > > The relevant part of the patch follows: > > diff --git a/libarchive/archive_read_support_format_tar.c b/libarchive/archiv > e_read_support_format_tar.c > index 0ee511e..b977cb7 100644 > --- libarchive/archive_read_support_format_tar.c > +++ libarchive/archive_read_support_format_tar.c > @@ -294,8 +294,14 @@ archive_read_format_tar_cleanup(struct archive_read *a) > return (ARCHIVE_OK); > } > > +/* > + * Validate number field > + * > + * Flags: > + * 1 - allow double \0 at field end > + */ > static int > -validate_number_field(const char* p_field, size_t i_size) > +validate_number_field(const char* p_field, size_t i_size, int flags) > { > unsigned char marker = (unsigned char)p_field[0]; > /* octal? */ > @@ -305,14 +311,24 @@ validate_number_field(const char* p_field, size_t i_siz > e) > for (i = 0; i < i_size; ++i) { > switch (p_field[i]) > { > - case ' ': /* skip any leading spaces and trailing space > */ > + case ' ': > + /* skip any leading spaces and trailing space * > / > if (octal_found == 0 || i == i_size - 1) { > continue; > } > break; > - case '\0': /* null is allowed only at the end */ > + case '\0': > + /* > + * null should be allowed only at the end > + * > + * Perl Archive::Tar terminates some fields > + * with two nulls. We must allow this to stay > + * compatible. > + */ > if (i != i_size - 1) { > - return 0; > + if (((flags & 1) == 0) > + || i != i_size - 2) > + return 0; > } > break; > /* rest must be octal digits */ > @@ -390,18 +406,25 @@ archive_read_format_tar_bid(struct archive_read *a, int > best_bid) > * Check format of mode/uid/gid/mtime/size/rdevmajor/rdevminor fields. > * These are usually octal numbers but GNU tar encodes "big" values as > * base256 and leading zeroes are sometimes replaced by spaces. > - * Even the null terminator is sometimes omitted. Anyway, must be check > ed > - * to avoid false positives. > + * Even the null terminator is sometimes omitted. Anyway, must be > + * checked to avoid false positives. > + * > + * Perl Archive::Tar does not follow the spec and terminates mode, uid, > + * gid, rdevmajor and rdevminor with a double \0. For compatibility > + * reasons we allow this deviation. > */ > - if (bid > 0 && > - (validate_number_field(header->mode, sizeof(header->mode)) == 0 > || > - validate_number_field(header->uid, sizeof(header->uid)) == 0 | > | > - validate_number_field(header->gid, sizeof(header->gid)) == 0 | > | > - validate_number_field(header->mtime, sizeof(header->mtime)) == > 0 || > - validate_number_field(header->size, sizeof(header->size)) == 0 > || > - validate_number_field(header->rdevmajor, sizeof(header->rdevma > jor)) == 0 || > - validate_number_field(header->rdevminor, sizeof(header->rdevmi > nor)) == 0)) { > - bid = 0; > + if (bid > 0 && ( > + validate_number_field(header->mode, sizeof(header->mode), 1) == 0 > + || validate_number_field(header->uid, sizeof(header->uid), 1) == 0 > + || validate_number_field(header->gid, sizeof(header->gid), 1) == 0 > + || validate_number_field(header->mtime, sizeof(header->mtime), > + 0) == 0 > + || validate_number_field(header->size, sizeof(header->size), 0) == > 0 > + || validate_number_field(header->rdevmajor, > + sizeof(header->rdevmajor), 1) == 0 > + || validate_number_field(header->rdevminor, > + sizeof(header->rdevminor), 1) == 0)) { > + bid = 0; > } > > return (bid); > > Updating to git 2d2b3e928605f795515b03f060fd638c265b0778 or later probably > makes the most sense. Sorry for the spam. I'm a day out of date. :( -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Fri Dec 2 05:24:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0E54C618A2; Fri, 2 Dec 2016 05:24:52 +0000 (UTC) (envelope-from julian@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 8004E1FA3; Fri, 2 Dec 2016 05:24:52 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB25OpmP028722; Fri, 2 Dec 2016 05:24:51 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB25OpVd028721; Fri, 2 Dec 2016 05:24:51 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201612020524.uB25OpVd028721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Fri, 2 Dec 2016 05:24:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309383 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 05:24:52 -0000 Author: julian Date: Fri Dec 2 05:24:51 2016 New Revision: 309383 URL: https://svnweb.freebsd.org/changeset/base/309383 Log: MFH: r306306 Give the user a clue as to which process hit maxfiles. Sponsored by: Panzura Modified: stable/10/sys/kern/kern_descrip.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_descrip.c ============================================================================== --- stable/10/sys/kern/kern_descrip.c Fri Dec 2 01:52:32 2016 (r309382) +++ stable/10/sys/kern/kern_descrip.c Fri Dec 2 05:24:51 2016 (r309383) @@ -1780,8 +1780,8 @@ falloc_noinstall(struct thread *td, stru priv_check(td, PRIV_MAXFILES) != 0) || openfiles >= maxfiles) { if (ppsratecheck(&lastfail, &curfail, 1)) { - printf("kern.maxfiles limit exceeded by uid %i, " - "please see tuning(7).\n", td->td_ucred->cr_ruid); + printf("kern.maxfiles limit exceeded by uid %i, (%s) " + "please see tuning(7).\n", td->td_ucred->cr_ruid, td->td_proc->p_comm); } return (ENFILE); } From owner-svn-src-all@freebsd.org Fri Dec 2 05:25:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09568C61904; Fri, 2 Dec 2016 05:25:34 +0000 (UTC) (envelope-from julian@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 CCD2E113C; Fri, 2 Dec 2016 05:25:33 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB25PXfQ028831; Fri, 2 Dec 2016 05:25:33 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB25PXut028830; Fri, 2 Dec 2016 05:25:33 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201612020525.uB25PXut028830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Fri, 2 Dec 2016 05:25:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309384 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 05:25:34 -0000 Author: julian Date: Fri Dec 2 05:25:32 2016 New Revision: 309384 URL: https://svnweb.freebsd.org/changeset/base/309384 Log: MFH: r306306 Give the user a clue as to which process hit maxfiles. Sponsored by: Panzura Modified: stable/11/sys/kern/kern_descrip.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_descrip.c ============================================================================== --- stable/11/sys/kern/kern_descrip.c Fri Dec 2 05:24:51 2016 (r309383) +++ stable/11/sys/kern/kern_descrip.c Fri Dec 2 05:25:32 2016 (r309384) @@ -1758,8 +1758,8 @@ falloc_noinstall(struct thread *td, stru priv_check(td, PRIV_MAXFILES) != 0) || openfiles >= maxfiles) { if (ppsratecheck(&lastfail, &curfail, 1)) { - printf("kern.maxfiles limit exceeded by uid %i, " - "please see tuning(7).\n", td->td_ucred->cr_ruid); + printf("kern.maxfiles limit exceeded by uid %i, (%s) " + "please see tuning(7).\n", td->td_ucred->cr_ruid, td->td_proc->p_comm); } return (ENFILE); } From owner-svn-src-all@freebsd.org Fri Dec 2 05:36:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 601C7C61BF2; Fri, 2 Dec 2016 05:36:38 +0000 (UTC) (envelope-from julian@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 28963167A; Fri, 2 Dec 2016 05:36:38 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB25abcK032947; Fri, 2 Dec 2016 05:36:37 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB25abkk032945; Fri, 2 Dec 2016 05:36:37 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201612020536.uB25abkk032945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Fri, 2 Dec 2016 05:36:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309385 - in stable/11/sys: modules/netgraph/checksum netgraph X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 05:36:38 -0000 Author: julian Date: Fri Dec 2 05:36:37 2016 New Revision: 309385 URL: https://svnweb.freebsd.org/changeset/base/309385 Log: MFH: r303612 netgraph module for reconstructing checksums PR: 206108 Submitted by: Dmitry Vagin daemon.hammer@ya.ru Added: stable/11/sys/modules/netgraph/checksum/ - copied from r303612, head/sys/modules/netgraph/checksum/ stable/11/sys/netgraph/ng_checksum.c - copied unchanged from r303612, head/sys/netgraph/ng_checksum.c stable/11/sys/netgraph/ng_checksum.h - copied unchanged from r303612, head/sys/netgraph/ng_checksum.h Modified: Directory Properties: stable/11/ (props changed) Copied: stable/11/sys/netgraph/ng_checksum.c (from r303612, head/sys/netgraph/ng_checksum.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/netgraph/ng_checksum.c Fri Dec 2 05:36:37 2016 (r309385, copy of r303612, head/sys/netgraph/ng_checksum.c) @@ -0,0 +1,729 @@ +/*- + * Copyright (c) 2015 Dmitry Vagin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_inet.h" +#include "opt_inet6.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +/* private data */ +struct ng_checksum_priv { + hook_p in; + hook_p out; + uint8_t dlt; /* DLT_XXX from bpf.h */ + struct ng_checksum_config *conf; + struct ng_checksum_stats stats; +}; + +typedef struct ng_checksum_priv *priv_p; + +/* Netgraph methods */ +static ng_constructor_t ng_checksum_constructor; +static ng_rcvmsg_t ng_checksum_rcvmsg; +static ng_shutdown_t ng_checksum_shutdown; +static ng_newhook_t ng_checksum_newhook; +static ng_rcvdata_t ng_checksum_rcvdata; +static ng_disconnect_t ng_checksum_disconnect; + +#define ERROUT(x) { error = (x); goto done; } + +static const struct ng_parse_struct_field ng_checksum_config_type_fields[] + = NG_CHECKSUM_CONFIG_TYPE; +static const struct ng_parse_type ng_checksum_config_type = { + &ng_parse_struct_type, + &ng_checksum_config_type_fields +}; + +static const struct ng_parse_struct_field ng_checksum_stats_fields[] + = NG_CHECKSUM_STATS_TYPE; +static const struct ng_parse_type ng_checksum_stats_type = { + &ng_parse_struct_type, + &ng_checksum_stats_fields +}; + +static const struct ng_cmdlist ng_checksum_cmdlist[] = { + { + NGM_CHECKSUM_COOKIE, + NGM_CHECKSUM_GETDLT, + "getdlt", + NULL, + &ng_parse_uint8_type + }, + { + NGM_CHECKSUM_COOKIE, + NGM_CHECKSUM_SETDLT, + "setdlt", + &ng_parse_uint8_type, + NULL + }, + { + NGM_CHECKSUM_COOKIE, + NGM_CHECKSUM_GETCONFIG, + "getconfig", + NULL, + &ng_checksum_config_type + }, + { + NGM_CHECKSUM_COOKIE, + NGM_CHECKSUM_SETCONFIG, + "setconfig", + &ng_checksum_config_type, + NULL + }, + { + NGM_CHECKSUM_COOKIE, + NGM_CHECKSUM_GET_STATS, + "getstats", + NULL, + &ng_checksum_stats_type + }, + { + NGM_CHECKSUM_COOKIE, + NGM_CHECKSUM_CLR_STATS, + "clrstats", + NULL, + NULL + }, + { + NGM_CHECKSUM_COOKIE, + NGM_CHECKSUM_GETCLR_STATS, + "getclrstats", + NULL, + &ng_checksum_stats_type + }, + { 0 } +}; + +static struct ng_type typestruct = { + .version = NG_ABI_VERSION, + .name = NG_CHECKSUM_NODE_TYPE, + .constructor = ng_checksum_constructor, + .rcvmsg = ng_checksum_rcvmsg, + .shutdown = ng_checksum_shutdown, + .newhook = ng_checksum_newhook, + .rcvdata = ng_checksum_rcvdata, + .disconnect = ng_checksum_disconnect, + .cmdlist = ng_checksum_cmdlist, +}; + +NETGRAPH_INIT(checksum, &typestruct); + +static int +ng_checksum_constructor(node_p node) +{ + priv_p priv; + + priv = malloc(sizeof(*priv), M_NETGRAPH, M_WAITOK|M_ZERO); + priv->dlt = DLT_RAW; + + NG_NODE_SET_PRIVATE(node, priv); + + return (0); +} + +static int +ng_checksum_newhook(node_p node, hook_p hook, const char *name) +{ + const priv_p priv = NG_NODE_PRIVATE(node); + + if (strncmp(name, NG_CHECKSUM_HOOK_IN, strlen(NG_CHECKSUM_HOOK_IN)) == 0) { + priv->in = hook; + } else if (strncmp(name, NG_CHECKSUM_HOOK_OUT, strlen(NG_CHECKSUM_HOOK_OUT)) == 0) { + priv->out = hook; + } else + return (EINVAL); + + return (0); +} + +static int +ng_checksum_rcvmsg(node_p node, item_p item, hook_p lasthook) +{ + const priv_p priv = NG_NODE_PRIVATE(node); + struct ng_checksum_config *conf, *newconf; + struct ng_mesg *msg; + struct ng_mesg *resp = NULL; + int error = 0; + + NGI_GET_MSG(item, msg); + + if (msg->header.typecookie != NGM_CHECKSUM_COOKIE) + ERROUT(EINVAL); + + switch (msg->header.cmd) + { + case NGM_CHECKSUM_GETDLT: + NG_MKRESPONSE(resp, msg, sizeof(uint8_t), M_WAITOK); + + if (resp == NULL) + ERROUT(ENOMEM); + + *((uint8_t *) resp->data) = priv->dlt; + + break; + + case NGM_CHECKSUM_SETDLT: + if (msg->header.arglen != sizeof(uint8_t)) + ERROUT(EINVAL); + + switch (*(uint8_t *) msg->data) + { + case DLT_EN10MB: + case DLT_RAW: + priv->dlt = *(uint8_t *) msg->data; + break; + + default: + ERROUT(EINVAL); + } + + break; + + case NGM_CHECKSUM_GETCONFIG: + if (priv->conf == NULL) + ERROUT(0); + + NG_MKRESPONSE(resp, msg, sizeof(struct ng_checksum_config), M_WAITOK); + + if (resp == NULL) + ERROUT(ENOMEM); + + bcopy(priv->conf, resp->data, sizeof(struct ng_checksum_config)); + + break; + + case NGM_CHECKSUM_SETCONFIG: + conf = (struct ng_checksum_config *) msg->data; + + if (msg->header.arglen != sizeof(struct ng_checksum_config)) + ERROUT(EINVAL); + + conf->csum_flags &= NG_CHECKSUM_CSUM_IPV4|NG_CHECKSUM_CSUM_IPV6; + conf->csum_offload &= NG_CHECKSUM_CSUM_IPV4|NG_CHECKSUM_CSUM_IPV6; + + newconf = malloc(sizeof(struct ng_checksum_config), M_NETGRAPH, M_WAITOK|M_ZERO); + + bcopy(conf, newconf, sizeof(struct ng_checksum_config)); + + if (priv->conf) + free(priv->conf, M_NETGRAPH); + + priv->conf = newconf; + + break; + + case NGM_CHECKSUM_GET_STATS: + case NGM_CHECKSUM_CLR_STATS: + case NGM_CHECKSUM_GETCLR_STATS: + if (msg->header.cmd != NGM_CHECKSUM_CLR_STATS) { + NG_MKRESPONSE(resp, msg, sizeof(struct ng_checksum_stats), M_WAITOK); + + if (resp == NULL) + ERROUT(ENOMEM); + + bcopy(&(priv->stats), resp->data, sizeof(struct ng_checksum_stats)); + } + + if (msg->header.cmd != NGM_CHECKSUM_GET_STATS) + bzero(&(priv->stats), sizeof(struct ng_checksum_stats)); + + break; + + default: + ERROUT(EINVAL); + } + +done: + NG_RESPOND_MSG(error, node, item, resp); + NG_FREE_MSG(msg); + + return (error); +} + +#define PULLUP_CHECK(mbuf, length) do { \ + pullup_len += length; \ + if (((mbuf)->m_pkthdr.len < pullup_len) || \ + (pullup_len > MHLEN)) { \ + return (EINVAL); \ + } \ + if ((mbuf)->m_len < pullup_len && \ + (((mbuf) = m_pullup((mbuf), pullup_len)) == NULL)) { \ + return (ENOBUFS); \ + } \ +} while (0) + +#ifdef INET +static int +checksum_ipv4(priv_p priv, struct mbuf *m, int l3_offset) +{ + struct ip *ip4; + int pullup_len; + int hlen, plen; + int processed = 0; + + pullup_len = l3_offset; + + PULLUP_CHECK(m, sizeof(struct ip)); + ip4 = (struct ip *) mtodo(m, l3_offset); + + if (ip4->ip_v != IPVERSION) + return (EOPNOTSUPP); + + hlen = ip4->ip_hl << 2; + plen = ntohs(ip4->ip_len); + + if (hlen < sizeof(struct ip) || m->m_pkthdr.len < l3_offset + plen) + return (EINVAL); + + if (m->m_pkthdr.csum_flags & CSUM_IP) { + ip4->ip_sum = 0; + + if ((priv->conf->csum_offload & CSUM_IP) == 0) { + if (hlen == sizeof(struct ip)) + ip4->ip_sum = in_cksum_hdr(ip4); + else + ip4->ip_sum = in_cksum_skip(m, l3_offset + hlen, l3_offset); + + m->m_pkthdr.csum_flags &= ~CSUM_IP; + } + + processed = 1; + } + + pullup_len = l3_offset + hlen; + + /* We can not calculate a checksum fragmented packets */ + if (ip4->ip_off & htons(IP_MF|IP_OFFMASK)) { + m->m_pkthdr.csum_flags &= ~(CSUM_TCP|CSUM_UDP); + return (0); + } + + switch (ip4->ip_p) + { + case IPPROTO_TCP: + if (m->m_pkthdr.csum_flags & CSUM_TCP) { + struct tcphdr *th; + + PULLUP_CHECK(m, sizeof(struct tcphdr)); + th = (struct tcphdr *) mtodo(m, l3_offset + hlen); + + th->th_sum = in_pseudo(ip4->ip_src.s_addr, + ip4->ip_dst.s_addr, htons(ip4->ip_p + plen - hlen)); + + if ((priv->conf->csum_offload & CSUM_TCP) == 0) { + th->th_sum = in_cksum_skip(m, l3_offset + plen, l3_offset + hlen); + m->m_pkthdr.csum_flags &= ~CSUM_TCP; + } + + processed = 1; + } + + m->m_pkthdr.csum_flags &= ~CSUM_UDP; + break; + + case IPPROTO_UDP: + if (m->m_pkthdr.csum_flags & CSUM_UDP) { + struct udphdr *uh; + + PULLUP_CHECK(m, sizeof(struct udphdr)); + uh = (struct udphdr *) mtodo(m, l3_offset + hlen); + + uh->uh_sum = in_pseudo(ip4->ip_src.s_addr, + ip4->ip_dst.s_addr, htons(ip4->ip_p + plen - hlen)); + + if ((priv->conf->csum_offload & CSUM_UDP) == 0) { + uh->uh_sum = in_cksum_skip(m, + l3_offset + plen, l3_offset + hlen); + + if (uh->uh_sum == 0) + uh->uh_sum = 0xffff; + + m->m_pkthdr.csum_flags &= ~CSUM_UDP; + } + + processed = 1; + } + + m->m_pkthdr.csum_flags &= ~CSUM_TCP; + break; + + default: + m->m_pkthdr.csum_flags &= ~(CSUM_TCP|CSUM_UDP); + break; + } + + m->m_pkthdr.csum_flags &= ~NG_CHECKSUM_CSUM_IPV6; + + if (processed) + priv->stats.processed++; + + return (0); +} +#endif /* INET */ + +#ifdef INET6 +static int +checksum_ipv6(priv_p priv, struct mbuf *m, int l3_offset) +{ + struct ip6_hdr *ip6; + struct ip6_ext *ip6e = NULL; + int pullup_len; + int hlen, plen; + int nxt; + int processed = 0; + + pullup_len = l3_offset; + + PULLUP_CHECK(m, sizeof(struct ip6_hdr)); + ip6 = (struct ip6_hdr *) mtodo(m, l3_offset); + + if ((ip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) + return (EOPNOTSUPP); + + hlen = sizeof(struct ip6_hdr); + plen = ntohs(ip6->ip6_plen) + hlen; + + if (m->m_pkthdr.len < l3_offset + plen) + return (EINVAL); + + nxt = ip6->ip6_nxt; + + for (;;) { + switch (nxt) + { + case IPPROTO_DSTOPTS: + case IPPROTO_HOPOPTS: + case IPPROTO_ROUTING: + PULLUP_CHECK(m, sizeof(struct ip6_ext)); + ip6e = (struct ip6_ext *) mtodo(m, l3_offset + hlen); + nxt = ip6e->ip6e_nxt; + hlen += (ip6e->ip6e_len + 1) << 3; + pullup_len = l3_offset + hlen; + break; + + case IPPROTO_AH: + PULLUP_CHECK(m, sizeof(struct ip6_ext)); + ip6e = (struct ip6_ext *) mtodo(m, l3_offset + hlen); + nxt = ip6e->ip6e_nxt; + hlen += (ip6e->ip6e_len + 2) << 2; + pullup_len = l3_offset + hlen; + break; + + case IPPROTO_FRAGMENT: + /* We can not calculate a checksum fragmented packets */ + m->m_pkthdr.csum_flags &= ~(CSUM_TCP_IPV6|CSUM_UDP_IPV6); + return (0); + + default: + goto loopend; + } + + if (nxt == 0) + return (EINVAL); + } + +loopend: + + switch (nxt) + { + case IPPROTO_TCP: + if (m->m_pkthdr.csum_flags & CSUM_TCP_IPV6) { + struct tcphdr *th; + + PULLUP_CHECK(m, sizeof(struct tcphdr)); + th = (struct tcphdr *) mtodo(m, l3_offset + hlen); + + th->th_sum = in6_cksum_pseudo(ip6, plen - hlen, nxt, 0); + + if ((priv->conf->csum_offload & CSUM_TCP_IPV6) == 0) { + th->th_sum = in_cksum_skip(m, l3_offset + plen, l3_offset + hlen); + m->m_pkthdr.csum_flags &= ~CSUM_TCP_IPV6; + } + + processed = 1; + } + + m->m_pkthdr.csum_flags &= ~CSUM_UDP_IPV6; + break; + + case IPPROTO_UDP: + if (m->m_pkthdr.csum_flags & CSUM_UDP_IPV6) { + struct udphdr *uh; + + PULLUP_CHECK(m, sizeof(struct udphdr)); + uh = (struct udphdr *) mtodo(m, l3_offset + hlen); + + uh->uh_sum = in6_cksum_pseudo(ip6, plen - hlen, nxt, 0); + + if ((priv->conf->csum_offload & CSUM_UDP_IPV6) == 0) { + uh->uh_sum = in_cksum_skip(m, + l3_offset + plen, l3_offset + hlen); + + if (uh->uh_sum == 0) + uh->uh_sum = 0xffff; + + m->m_pkthdr.csum_flags &= ~CSUM_UDP_IPV6; + } + + processed = 1; + } + + m->m_pkthdr.csum_flags &= ~CSUM_TCP_IPV6; + break; + + default: + m->m_pkthdr.csum_flags &= ~(CSUM_TCP_IPV6|CSUM_UDP_IPV6); + break; + } + + m->m_pkthdr.csum_flags &= ~NG_CHECKSUM_CSUM_IPV4; + + if (processed) + priv->stats.processed++; + + return (0); +} +#endif /* INET6 */ + +#undef PULLUP_CHECK + +static int +ng_checksum_rcvdata(hook_p hook, item_p item) +{ + const priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); + struct mbuf *m; + hook_p out; + int error = 0; + + priv->stats.received++; + + NGI_GET_M(item, m); + +#define PULLUP_CHECK(mbuf, length) do { \ + pullup_len += length; \ + if (((mbuf)->m_pkthdr.len < pullup_len) || \ + (pullup_len > MHLEN)) { \ + error = EINVAL; \ + goto bypass; \ + } \ + if ((mbuf)->m_len < pullup_len && \ + (((mbuf) = m_pullup((mbuf), pullup_len)) == NULL)) { \ + error = ENOBUFS; \ + goto drop; \ + } \ +} while (0) + + if (!(priv->conf && hook == priv->in && m && (m->m_flags & M_PKTHDR))) + goto bypass; + + m->m_pkthdr.csum_flags |= priv->conf->csum_flags; + + if (m->m_pkthdr.csum_flags & (NG_CHECKSUM_CSUM_IPV4|NG_CHECKSUM_CSUM_IPV6)) + { + struct ether_header *eh; + struct ng_checksum_vlan_header *vh; + int pullup_len = 0; + uint16_t etype; + + m = m_unshare(m, M_NOWAIT); + + if (m == NULL) + ERROUT(ENOMEM); + + switch (priv->dlt) + { + case DLT_EN10MB: + PULLUP_CHECK(m, sizeof(struct ether_header)); + eh = mtod(m, struct ether_header *); + etype = ntohs(eh->ether_type); + + for (;;) { /* QinQ support */ + switch (etype) + { + case 0x8100: + case 0x88A8: + case 0x9100: + PULLUP_CHECK(m, sizeof(struct ng_checksum_vlan_header)); + vh = (struct ng_checksum_vlan_header *) mtodo(m, + pullup_len - sizeof(struct ng_checksum_vlan_header)); + etype = ntohs(vh->etype); + break; + + default: + goto loopend; + } + } +loopend: +#ifdef INET + if (etype == ETHERTYPE_IP && + (m->m_pkthdr.csum_flags & NG_CHECKSUM_CSUM_IPV4)) { + error = checksum_ipv4(priv, m, pullup_len); + if (error == ENOBUFS) + goto drop; + } else +#endif +#ifdef INET6 + if (etype == ETHERTYPE_IPV6 && + (m->m_pkthdr.csum_flags & NG_CHECKSUM_CSUM_IPV6)) { + error = checksum_ipv6(priv, m, pullup_len); + if (error == ENOBUFS) + goto drop; + } else +#endif + { + m->m_pkthdr.csum_flags &= + ~(NG_CHECKSUM_CSUM_IPV4|NG_CHECKSUM_CSUM_IPV6); + } + + break; + + case DLT_RAW: +#ifdef INET + if (m->m_pkthdr.csum_flags & NG_CHECKSUM_CSUM_IPV4) + { + error = checksum_ipv4(priv, m, pullup_len); + + if (error == 0) + goto bypass; + else if (error == ENOBUFS) + goto drop; + } +#endif +#ifdef INET6 + if (m->m_pkthdr.csum_flags & NG_CHECKSUM_CSUM_IPV6) + { + error = checksum_ipv6(priv, m, pullup_len); + + if (error == 0) + goto bypass; + else if (error == ENOBUFS) + goto drop; + } +#endif + if (error) + m->m_pkthdr.csum_flags &= + ~(NG_CHECKSUM_CSUM_IPV4|NG_CHECKSUM_CSUM_IPV6); + + break; + + default: + ERROUT(EINVAL); + } + } + +#undef PULLUP_CHECK + +bypass: + out = NULL; + + if (hook == priv->in) { + /* return frames on 'in' hook if 'out' not connected */ + out = priv->out ? priv->out : priv->in; + } else if (hook == priv->out && priv->in) { + /* pass frames on 'out' hook if 'in' connected */ + out = priv->in; + } + + if (out == NULL) + ERROUT(0); + + NG_FWD_NEW_DATA(error, item, out, m); + + return (error); + +done: +drop: + NG_FREE_ITEM(item); + NG_FREE_M(m); + + priv->stats.dropped++; + + return (error); +} + +static int +ng_checksum_shutdown(node_p node) +{ + const priv_p priv = NG_NODE_PRIVATE(node); + + NG_NODE_SET_PRIVATE(node, NULL); + NG_NODE_UNREF(node); + + if (priv->conf) + free(priv->conf, M_NETGRAPH); + + free(priv, M_NETGRAPH); + + return (0); +} + +static int +ng_checksum_disconnect(hook_p hook) +{ + priv_p priv; + + priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); + + if (hook == priv->in) + priv->in = NULL; + + if (hook == priv->out) + priv->out = NULL; + + if (NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0 && + NG_NODE_IS_VALID(NG_HOOK_NODE(hook))) /* already shutting down? */ + ng_rmnode_self(NG_HOOK_NODE(hook)); + + return (0); +} Copied: stable/11/sys/netgraph/ng_checksum.h (from r303612, head/sys/netgraph/ng_checksum.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/netgraph/ng_checksum.h Fri Dec 2 05:36:37 2016 (r309385, copy of r303612, head/sys/netgraph/ng_checksum.h) @@ -0,0 +1,88 @@ +/*- + * Copyright (c) 2015 Dmitry Vagin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _NETGRAPH_NG_CHECKSUM_H_ +#define _NETGRAPH_NG_CHECKSUM_H_ + +/* Node type name. */ +#define NG_CHECKSUM_NODE_TYPE "checksum" + +/* Node type cookie. */ +#define NGM_CHECKSUM_COOKIE 439419912 + +/* Hook names */ +#define NG_CHECKSUM_HOOK_IN "in" +#define NG_CHECKSUM_HOOK_OUT "out" + +/* Checksum flags */ +#define NG_CHECKSUM_CSUM_IPV4 (CSUM_IP|CSUM_TCP|CSUM_UDP) +#define NG_CHECKSUM_CSUM_IPV6 (CSUM_TCP_IPV6|CSUM_UDP_IPV6) + +/* Netgraph commands understood by this node type */ +enum { + NGM_CHECKSUM_GETDLT = 1, + NGM_CHECKSUM_SETDLT, + NGM_CHECKSUM_GETCONFIG, + NGM_CHECKSUM_SETCONFIG, + NGM_CHECKSUM_GETCLR_STATS, + NGM_CHECKSUM_GET_STATS, + NGM_CHECKSUM_CLR_STATS, +}; + +/* Parsing declarations */ + +#define NG_CHECKSUM_CONFIG_TYPE { \ + { "csum_flags", &ng_parse_uint64_type }, \ + { "csum_offload", &ng_parse_uint64_type }, \ + { NULL } \ +} + +#define NG_CHECKSUM_STATS_TYPE { \ + { "Received", &ng_parse_uint64_type }, \ + { "Processed", &ng_parse_uint64_type }, \ + { "Dropped", &ng_parse_uint64_type }, \ + { NULL } \ +} + +struct ng_checksum_config { + uint64_t csum_flags; + uint64_t csum_offload; +}; + +struct ng_checksum_stats { + uint64_t received; + uint64_t processed; + uint64_t dropped; +}; + +struct ng_checksum_vlan_header { + u_int16_t tag; + u_int16_t etype; +}; + +#endif /* _NETGRAPH_NG_CHECKSUM_H_ */ From owner-svn-src-all@freebsd.org Fri Dec 2 05:37:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2B30C61CA4; Fri, 2 Dec 2016 05:37:33 +0000 (UTC) (envelope-from julian@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 73892180C; Fri, 2 Dec 2016 05:37:33 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB25bWmG033068; Fri, 2 Dec 2016 05:37:32 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB25bW7W033067; Fri, 2 Dec 2016 05:37:32 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201612020537.uB25bW7W033067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Fri, 2 Dec 2016 05:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309386 - stable/11/share/man/man4 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 05:37:33 -0000 Author: julian Date: Fri Dec 2 05:37:32 2016 New Revision: 309386 URL: https://svnweb.freebsd.org/changeset/base/309386 Log: MFH: r303613 Man page for the new checksum netgraph module. PR: 206186 Submitted by: Dmitry Vagin Added: stable/11/share/man/man4/ng_checksum.4 - copied unchanged from r303613, head/share/man/man4/ng_checksum.4 Modified: Directory Properties: stable/11/ (props changed) Copied: stable/11/share/man/man4/ng_checksum.4 (from r303613, head/share/man/man4/ng_checksum.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/share/man/man4/ng_checksum.4 Fri Dec 2 05:37:32 2016 (r309386, copy of r303613, head/share/man/man4/ng_checksum.4) @@ -0,0 +1,141 @@ +.\" Copyright (c) 2015 Dmitry Vagin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd October 29, 2015 +.Dt NG_CHECKSUM 4 +.Os +.Sh NAME +.Nm ng_checksum +.Nd IP checksum node type +.Sh SYNOPSIS +.In netgraph/ng_checksum.h +.Sh DESCRIPTION +The +.Nm checksum +node can calculate and prepare for calculation in hardware +IPv4 header, TCP, UDP checksum. +.Sh HOOKS +This node type has two hooks: +.Bl -tag -width ".Va out" +.It Va in +Packets received on this hook are processed according to settings specified +in config and then forwarded to +.Ar out +hook, if it exists and connected. Otherwise they are reflected back to the +.Ar in +hook. +.It Va out +Packets received on this hook are forwarded to +.Ar in +hook without any changes. +.El +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_CHECKSUM_SETDLT Pq Ic setdlt +Sets data link type on the +.Va in +hook. Currently, supported types are +.Cm DLT_RAW +(raw IP datagrams) and +.Cm DLT_EN10MB +(Ethernet). DLT_ definitions can be found in +.In net/bpf.h +header. Currently used values are +.Cm DLT_EN10MB += 1 and +.Cm DLT_RAW += 12. +.It Dv NGM_CHECKSUM_GETDLT Pq Ic getdlt +This control message obtains data link type on the +.Va in +hook. +.It Dv NGM_CHECKSUM_SETCONFIG Pq Ic setconfig +Sets node configuration. The following +.Vt "struct ng_checksum_config" +must be supplied as an argument: +.Bd -literal -offset 4n +struct ng_checksum_config { + uint64_t csum_flags; + uint64_t csum_offload; +}; +.Ed +.Pp +The +.Va csum_flags +can be set to any combination of CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 +(other values are ignored) for instructing node need calculate the corresponding checksum. +.Pp +The +.Va csum_offload +can be set to any combination of CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 +(other values are ignored) for instructing node what checksum can calculate in hardware. +.Pp +Also processed any combination of CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 sets before on mbuf. +.It Dv NGM_CHECKSUM_GETCONFIG Pq Ic getconfig +This control message obtains current node configuration, +returned as +.Vt "struct ng_checksum_config" . +.It Dv NGM_CHECKSUM_GET_STATS Pq Ic getstats +Returns node statistics as a +.Vt "struct ng_checksum_stats" . +.It Dv NGM_CHECKSUM_CLR_STATS Pq Ic clrstats +Clear node statistics. +.It Dv NGM_CHECKSUM_GETCLR_STATS Pq Ic getclrstats +This command is identical to +.Dv NGM_CHECKSUM_GET_STATS , +except that the statistics are also atomically cleared. +.El +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh EXAMPLES +.Xr ngctl 8 +script: +.Bd -literal -offset 4n +/usr/sbin/ngctl -f- <<-SEQ + msg checksum-1: "setdlt 1" + ngctl msg checksum-1: "setconfig { csum_flags=0 csum_offload=6 }" +.Ed +.Pp +Set data link type to +.Cm DLT_EN10MB +(Ethernet), not set additional checksum flags, set hardware +can calculate CSUM_IP_UDP|CSUM_IP_TCP. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ng_patch 4 , +.Xr ngctl 8 +.Sh HISTORY +The +.Nm +node type was implemented in +.Fx 10.2 +and first submitted in +.Fx 12.0 . +.Sh AUTHORS +.An "Dmitry Vagin" Aq daemon.hammer@ya.ru . From owner-svn-src-all@freebsd.org Fri Dec 2 05:38:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 376FEC61E45; Fri, 2 Dec 2016 05:38:27 +0000 (UTC) (envelope-from julian@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 F41651A52; Fri, 2 Dec 2016 05:38:26 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB25cQaY033198; Fri, 2 Dec 2016 05:38:26 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB25cQUg033196; Fri, 2 Dec 2016 05:38:26 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201612020538.uB25cQUg033196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Fri, 2 Dec 2016 05:38:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309387 - in stable/10/sys: modules/netgraph/checksum netgraph X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 05:38:27 -0000 Author: julian Date: Fri Dec 2 05:38:25 2016 New Revision: 309387 URL: https://svnweb.freebsd.org/changeset/base/309387 Log: MFH: r303612 netgraph module for reconstructing checksums PR: 206108 Submitted by: Dmitry Vagin daemon.hammer@ya.ru Added: stable/10/sys/modules/netgraph/checksum/ - copied from r303612, head/sys/modules/netgraph/checksum/ stable/10/sys/netgraph/ng_checksum.c - copied unchanged from r303612, head/sys/netgraph/ng_checksum.c stable/10/sys/netgraph/ng_checksum.h - copied unchanged from r303612, head/sys/netgraph/ng_checksum.h Modified: Directory Properties: stable/10/ (props changed) Copied: stable/10/sys/netgraph/ng_checksum.c (from r303612, head/sys/netgraph/ng_checksum.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/netgraph/ng_checksum.c Fri Dec 2 05:38:25 2016 (r309387, copy of r303612, head/sys/netgraph/ng_checksum.c) @@ -0,0 +1,729 @@ +/*- + * Copyright (c) 2015 Dmitry Vagin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_inet.h" +#include "opt_inet6.h" + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +/* private data */ +struct ng_checksum_priv { + hook_p in; + hook_p out; + uint8_t dlt; /* DLT_XXX from bpf.h */ + struct ng_checksum_config *conf; + struct ng_checksum_stats stats; +}; + +typedef struct ng_checksum_priv *priv_p; + +/* Netgraph methods */ +static ng_constructor_t ng_checksum_constructor; +static ng_rcvmsg_t ng_checksum_rcvmsg; +static ng_shutdown_t ng_checksum_shutdown; +static ng_newhook_t ng_checksum_newhook; +static ng_rcvdata_t ng_checksum_rcvdata; +static ng_disconnect_t ng_checksum_disconnect; + +#define ERROUT(x) { error = (x); goto done; } + +static const struct ng_parse_struct_field ng_checksum_config_type_fields[] + = NG_CHECKSUM_CONFIG_TYPE; +static const struct ng_parse_type ng_checksum_config_type = { + &ng_parse_struct_type, + &ng_checksum_config_type_fields +}; + +static const struct ng_parse_struct_field ng_checksum_stats_fields[] + = NG_CHECKSUM_STATS_TYPE; +static const struct ng_parse_type ng_checksum_stats_type = { + &ng_parse_struct_type, + &ng_checksum_stats_fields +}; + +static const struct ng_cmdlist ng_checksum_cmdlist[] = { + { + NGM_CHECKSUM_COOKIE, + NGM_CHECKSUM_GETDLT, + "getdlt", + NULL, + &ng_parse_uint8_type + }, + { + NGM_CHECKSUM_COOKIE, + NGM_CHECKSUM_SETDLT, + "setdlt", + &ng_parse_uint8_type, + NULL + }, + { + NGM_CHECKSUM_COOKIE, + NGM_CHECKSUM_GETCONFIG, + "getconfig", + NULL, + &ng_checksum_config_type + }, + { + NGM_CHECKSUM_COOKIE, + NGM_CHECKSUM_SETCONFIG, + "setconfig", + &ng_checksum_config_type, + NULL + }, + { + NGM_CHECKSUM_COOKIE, + NGM_CHECKSUM_GET_STATS, + "getstats", + NULL, + &ng_checksum_stats_type + }, + { + NGM_CHECKSUM_COOKIE, + NGM_CHECKSUM_CLR_STATS, + "clrstats", + NULL, + NULL + }, + { + NGM_CHECKSUM_COOKIE, + NGM_CHECKSUM_GETCLR_STATS, + "getclrstats", + NULL, + &ng_checksum_stats_type + }, + { 0 } +}; + +static struct ng_type typestruct = { + .version = NG_ABI_VERSION, + .name = NG_CHECKSUM_NODE_TYPE, + .constructor = ng_checksum_constructor, + .rcvmsg = ng_checksum_rcvmsg, + .shutdown = ng_checksum_shutdown, + .newhook = ng_checksum_newhook, + .rcvdata = ng_checksum_rcvdata, + .disconnect = ng_checksum_disconnect, + .cmdlist = ng_checksum_cmdlist, +}; + +NETGRAPH_INIT(checksum, &typestruct); + +static int +ng_checksum_constructor(node_p node) +{ + priv_p priv; + + priv = malloc(sizeof(*priv), M_NETGRAPH, M_WAITOK|M_ZERO); + priv->dlt = DLT_RAW; + + NG_NODE_SET_PRIVATE(node, priv); + + return (0); +} + +static int +ng_checksum_newhook(node_p node, hook_p hook, const char *name) +{ + const priv_p priv = NG_NODE_PRIVATE(node); + + if (strncmp(name, NG_CHECKSUM_HOOK_IN, strlen(NG_CHECKSUM_HOOK_IN)) == 0) { + priv->in = hook; + } else if (strncmp(name, NG_CHECKSUM_HOOK_OUT, strlen(NG_CHECKSUM_HOOK_OUT)) == 0) { + priv->out = hook; + } else + return (EINVAL); + + return (0); +} + +static int +ng_checksum_rcvmsg(node_p node, item_p item, hook_p lasthook) +{ + const priv_p priv = NG_NODE_PRIVATE(node); + struct ng_checksum_config *conf, *newconf; + struct ng_mesg *msg; + struct ng_mesg *resp = NULL; + int error = 0; + + NGI_GET_MSG(item, msg); + + if (msg->header.typecookie != NGM_CHECKSUM_COOKIE) + ERROUT(EINVAL); + + switch (msg->header.cmd) + { + case NGM_CHECKSUM_GETDLT: + NG_MKRESPONSE(resp, msg, sizeof(uint8_t), M_WAITOK); + + if (resp == NULL) + ERROUT(ENOMEM); + + *((uint8_t *) resp->data) = priv->dlt; + + break; + + case NGM_CHECKSUM_SETDLT: + if (msg->header.arglen != sizeof(uint8_t)) + ERROUT(EINVAL); + + switch (*(uint8_t *) msg->data) + { + case DLT_EN10MB: + case DLT_RAW: + priv->dlt = *(uint8_t *) msg->data; + break; + + default: + ERROUT(EINVAL); + } + + break; + + case NGM_CHECKSUM_GETCONFIG: + if (priv->conf == NULL) + ERROUT(0); + + NG_MKRESPONSE(resp, msg, sizeof(struct ng_checksum_config), M_WAITOK); + + if (resp == NULL) + ERROUT(ENOMEM); + + bcopy(priv->conf, resp->data, sizeof(struct ng_checksum_config)); + + break; + + case NGM_CHECKSUM_SETCONFIG: + conf = (struct ng_checksum_config *) msg->data; + + if (msg->header.arglen != sizeof(struct ng_checksum_config)) + ERROUT(EINVAL); + + conf->csum_flags &= NG_CHECKSUM_CSUM_IPV4|NG_CHECKSUM_CSUM_IPV6; + conf->csum_offload &= NG_CHECKSUM_CSUM_IPV4|NG_CHECKSUM_CSUM_IPV6; + + newconf = malloc(sizeof(struct ng_checksum_config), M_NETGRAPH, M_WAITOK|M_ZERO); + + bcopy(conf, newconf, sizeof(struct ng_checksum_config)); + + if (priv->conf) + free(priv->conf, M_NETGRAPH); + + priv->conf = newconf; + + break; + + case NGM_CHECKSUM_GET_STATS: + case NGM_CHECKSUM_CLR_STATS: + case NGM_CHECKSUM_GETCLR_STATS: + if (msg->header.cmd != NGM_CHECKSUM_CLR_STATS) { + NG_MKRESPONSE(resp, msg, sizeof(struct ng_checksum_stats), M_WAITOK); + + if (resp == NULL) + ERROUT(ENOMEM); + + bcopy(&(priv->stats), resp->data, sizeof(struct ng_checksum_stats)); + } + + if (msg->header.cmd != NGM_CHECKSUM_GET_STATS) + bzero(&(priv->stats), sizeof(struct ng_checksum_stats)); + + break; + + default: + ERROUT(EINVAL); + } + +done: + NG_RESPOND_MSG(error, node, item, resp); + NG_FREE_MSG(msg); + + return (error); +} + +#define PULLUP_CHECK(mbuf, length) do { \ + pullup_len += length; \ + if (((mbuf)->m_pkthdr.len < pullup_len) || \ + (pullup_len > MHLEN)) { \ + return (EINVAL); \ + } \ + if ((mbuf)->m_len < pullup_len && \ + (((mbuf) = m_pullup((mbuf), pullup_len)) == NULL)) { \ + return (ENOBUFS); \ + } \ +} while (0) + +#ifdef INET +static int +checksum_ipv4(priv_p priv, struct mbuf *m, int l3_offset) +{ + struct ip *ip4; + int pullup_len; + int hlen, plen; + int processed = 0; + + pullup_len = l3_offset; + + PULLUP_CHECK(m, sizeof(struct ip)); + ip4 = (struct ip *) mtodo(m, l3_offset); + + if (ip4->ip_v != IPVERSION) + return (EOPNOTSUPP); + + hlen = ip4->ip_hl << 2; + plen = ntohs(ip4->ip_len); + + if (hlen < sizeof(struct ip) || m->m_pkthdr.len < l3_offset + plen) + return (EINVAL); + + if (m->m_pkthdr.csum_flags & CSUM_IP) { + ip4->ip_sum = 0; + + if ((priv->conf->csum_offload & CSUM_IP) == 0) { + if (hlen == sizeof(struct ip)) + ip4->ip_sum = in_cksum_hdr(ip4); + else + ip4->ip_sum = in_cksum_skip(m, l3_offset + hlen, l3_offset); + + m->m_pkthdr.csum_flags &= ~CSUM_IP; + } + + processed = 1; + } + + pullup_len = l3_offset + hlen; + + /* We can not calculate a checksum fragmented packets */ + if (ip4->ip_off & htons(IP_MF|IP_OFFMASK)) { + m->m_pkthdr.csum_flags &= ~(CSUM_TCP|CSUM_UDP); + return (0); + } + + switch (ip4->ip_p) + { + case IPPROTO_TCP: + if (m->m_pkthdr.csum_flags & CSUM_TCP) { + struct tcphdr *th; + + PULLUP_CHECK(m, sizeof(struct tcphdr)); + th = (struct tcphdr *) mtodo(m, l3_offset + hlen); + + th->th_sum = in_pseudo(ip4->ip_src.s_addr, + ip4->ip_dst.s_addr, htons(ip4->ip_p + plen - hlen)); + + if ((priv->conf->csum_offload & CSUM_TCP) == 0) { + th->th_sum = in_cksum_skip(m, l3_offset + plen, l3_offset + hlen); + m->m_pkthdr.csum_flags &= ~CSUM_TCP; + } + + processed = 1; + } + + m->m_pkthdr.csum_flags &= ~CSUM_UDP; + break; + + case IPPROTO_UDP: + if (m->m_pkthdr.csum_flags & CSUM_UDP) { + struct udphdr *uh; + + PULLUP_CHECK(m, sizeof(struct udphdr)); + uh = (struct udphdr *) mtodo(m, l3_offset + hlen); + + uh->uh_sum = in_pseudo(ip4->ip_src.s_addr, + ip4->ip_dst.s_addr, htons(ip4->ip_p + plen - hlen)); + + if ((priv->conf->csum_offload & CSUM_UDP) == 0) { + uh->uh_sum = in_cksum_skip(m, + l3_offset + plen, l3_offset + hlen); + + if (uh->uh_sum == 0) + uh->uh_sum = 0xffff; + + m->m_pkthdr.csum_flags &= ~CSUM_UDP; + } + + processed = 1; + } + + m->m_pkthdr.csum_flags &= ~CSUM_TCP; + break; + + default: + m->m_pkthdr.csum_flags &= ~(CSUM_TCP|CSUM_UDP); + break; + } + + m->m_pkthdr.csum_flags &= ~NG_CHECKSUM_CSUM_IPV6; + + if (processed) + priv->stats.processed++; + + return (0); +} +#endif /* INET */ + +#ifdef INET6 +static int +checksum_ipv6(priv_p priv, struct mbuf *m, int l3_offset) +{ + struct ip6_hdr *ip6; + struct ip6_ext *ip6e = NULL; + int pullup_len; + int hlen, plen; + int nxt; + int processed = 0; + + pullup_len = l3_offset; + + PULLUP_CHECK(m, sizeof(struct ip6_hdr)); + ip6 = (struct ip6_hdr *) mtodo(m, l3_offset); + + if ((ip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) + return (EOPNOTSUPP); + + hlen = sizeof(struct ip6_hdr); + plen = ntohs(ip6->ip6_plen) + hlen; + + if (m->m_pkthdr.len < l3_offset + plen) + return (EINVAL); + + nxt = ip6->ip6_nxt; + + for (;;) { + switch (nxt) + { + case IPPROTO_DSTOPTS: + case IPPROTO_HOPOPTS: + case IPPROTO_ROUTING: + PULLUP_CHECK(m, sizeof(struct ip6_ext)); + ip6e = (struct ip6_ext *) mtodo(m, l3_offset + hlen); + nxt = ip6e->ip6e_nxt; + hlen += (ip6e->ip6e_len + 1) << 3; + pullup_len = l3_offset + hlen; + break; + + case IPPROTO_AH: + PULLUP_CHECK(m, sizeof(struct ip6_ext)); + ip6e = (struct ip6_ext *) mtodo(m, l3_offset + hlen); + nxt = ip6e->ip6e_nxt; + hlen += (ip6e->ip6e_len + 2) << 2; + pullup_len = l3_offset + hlen; + break; + + case IPPROTO_FRAGMENT: + /* We can not calculate a checksum fragmented packets */ + m->m_pkthdr.csum_flags &= ~(CSUM_TCP_IPV6|CSUM_UDP_IPV6); + return (0); + + default: + goto loopend; + } + + if (nxt == 0) + return (EINVAL); + } + +loopend: + + switch (nxt) + { + case IPPROTO_TCP: + if (m->m_pkthdr.csum_flags & CSUM_TCP_IPV6) { + struct tcphdr *th; + + PULLUP_CHECK(m, sizeof(struct tcphdr)); + th = (struct tcphdr *) mtodo(m, l3_offset + hlen); + + th->th_sum = in6_cksum_pseudo(ip6, plen - hlen, nxt, 0); + + if ((priv->conf->csum_offload & CSUM_TCP_IPV6) == 0) { + th->th_sum = in_cksum_skip(m, l3_offset + plen, l3_offset + hlen); + m->m_pkthdr.csum_flags &= ~CSUM_TCP_IPV6; + } + + processed = 1; + } + + m->m_pkthdr.csum_flags &= ~CSUM_UDP_IPV6; + break; + + case IPPROTO_UDP: + if (m->m_pkthdr.csum_flags & CSUM_UDP_IPV6) { + struct udphdr *uh; + + PULLUP_CHECK(m, sizeof(struct udphdr)); + uh = (struct udphdr *) mtodo(m, l3_offset + hlen); + + uh->uh_sum = in6_cksum_pseudo(ip6, plen - hlen, nxt, 0); + + if ((priv->conf->csum_offload & CSUM_UDP_IPV6) == 0) { + uh->uh_sum = in_cksum_skip(m, + l3_offset + plen, l3_offset + hlen); + + if (uh->uh_sum == 0) + uh->uh_sum = 0xffff; + + m->m_pkthdr.csum_flags &= ~CSUM_UDP_IPV6; + } + + processed = 1; + } + + m->m_pkthdr.csum_flags &= ~CSUM_TCP_IPV6; + break; + + default: + m->m_pkthdr.csum_flags &= ~(CSUM_TCP_IPV6|CSUM_UDP_IPV6); + break; + } + + m->m_pkthdr.csum_flags &= ~NG_CHECKSUM_CSUM_IPV4; + + if (processed) + priv->stats.processed++; + + return (0); +} +#endif /* INET6 */ + +#undef PULLUP_CHECK + +static int +ng_checksum_rcvdata(hook_p hook, item_p item) +{ + const priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); + struct mbuf *m; + hook_p out; + int error = 0; + + priv->stats.received++; + + NGI_GET_M(item, m); + +#define PULLUP_CHECK(mbuf, length) do { \ + pullup_len += length; \ + if (((mbuf)->m_pkthdr.len < pullup_len) || \ + (pullup_len > MHLEN)) { \ + error = EINVAL; \ + goto bypass; \ + } \ + if ((mbuf)->m_len < pullup_len && \ + (((mbuf) = m_pullup((mbuf), pullup_len)) == NULL)) { \ + error = ENOBUFS; \ + goto drop; \ + } \ +} while (0) + + if (!(priv->conf && hook == priv->in && m && (m->m_flags & M_PKTHDR))) + goto bypass; + + m->m_pkthdr.csum_flags |= priv->conf->csum_flags; + + if (m->m_pkthdr.csum_flags & (NG_CHECKSUM_CSUM_IPV4|NG_CHECKSUM_CSUM_IPV6)) + { + struct ether_header *eh; + struct ng_checksum_vlan_header *vh; + int pullup_len = 0; + uint16_t etype; + + m = m_unshare(m, M_NOWAIT); + + if (m == NULL) + ERROUT(ENOMEM); + + switch (priv->dlt) + { + case DLT_EN10MB: + PULLUP_CHECK(m, sizeof(struct ether_header)); + eh = mtod(m, struct ether_header *); + etype = ntohs(eh->ether_type); + + for (;;) { /* QinQ support */ + switch (etype) + { + case 0x8100: + case 0x88A8: + case 0x9100: + PULLUP_CHECK(m, sizeof(struct ng_checksum_vlan_header)); + vh = (struct ng_checksum_vlan_header *) mtodo(m, + pullup_len - sizeof(struct ng_checksum_vlan_header)); + etype = ntohs(vh->etype); + break; + + default: + goto loopend; + } + } +loopend: +#ifdef INET + if (etype == ETHERTYPE_IP && + (m->m_pkthdr.csum_flags & NG_CHECKSUM_CSUM_IPV4)) { + error = checksum_ipv4(priv, m, pullup_len); + if (error == ENOBUFS) + goto drop; + } else +#endif +#ifdef INET6 + if (etype == ETHERTYPE_IPV6 && + (m->m_pkthdr.csum_flags & NG_CHECKSUM_CSUM_IPV6)) { + error = checksum_ipv6(priv, m, pullup_len); + if (error == ENOBUFS) + goto drop; + } else +#endif + { + m->m_pkthdr.csum_flags &= + ~(NG_CHECKSUM_CSUM_IPV4|NG_CHECKSUM_CSUM_IPV6); + } + + break; + + case DLT_RAW: +#ifdef INET + if (m->m_pkthdr.csum_flags & NG_CHECKSUM_CSUM_IPV4) + { + error = checksum_ipv4(priv, m, pullup_len); + + if (error == 0) + goto bypass; + else if (error == ENOBUFS) + goto drop; + } +#endif +#ifdef INET6 + if (m->m_pkthdr.csum_flags & NG_CHECKSUM_CSUM_IPV6) + { + error = checksum_ipv6(priv, m, pullup_len); + + if (error == 0) + goto bypass; + else if (error == ENOBUFS) + goto drop; + } +#endif + if (error) + m->m_pkthdr.csum_flags &= + ~(NG_CHECKSUM_CSUM_IPV4|NG_CHECKSUM_CSUM_IPV6); + + break; + + default: + ERROUT(EINVAL); + } + } + +#undef PULLUP_CHECK + +bypass: + out = NULL; + + if (hook == priv->in) { + /* return frames on 'in' hook if 'out' not connected */ + out = priv->out ? priv->out : priv->in; + } else if (hook == priv->out && priv->in) { + /* pass frames on 'out' hook if 'in' connected */ + out = priv->in; + } + + if (out == NULL) + ERROUT(0); + + NG_FWD_NEW_DATA(error, item, out, m); + + return (error); + +done: +drop: + NG_FREE_ITEM(item); + NG_FREE_M(m); + + priv->stats.dropped++; + + return (error); +} + +static int +ng_checksum_shutdown(node_p node) +{ + const priv_p priv = NG_NODE_PRIVATE(node); + + NG_NODE_SET_PRIVATE(node, NULL); + NG_NODE_UNREF(node); + + if (priv->conf) + free(priv->conf, M_NETGRAPH); + + free(priv, M_NETGRAPH); + + return (0); +} + +static int +ng_checksum_disconnect(hook_p hook) +{ + priv_p priv; + + priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); + + if (hook == priv->in) + priv->in = NULL; + + if (hook == priv->out) + priv->out = NULL; + + if (NG_NODE_NUMHOOKS(NG_HOOK_NODE(hook)) == 0 && + NG_NODE_IS_VALID(NG_HOOK_NODE(hook))) /* already shutting down? */ + ng_rmnode_self(NG_HOOK_NODE(hook)); + + return (0); +} Copied: stable/10/sys/netgraph/ng_checksum.h (from r303612, head/sys/netgraph/ng_checksum.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/netgraph/ng_checksum.h Fri Dec 2 05:38:25 2016 (r309387, copy of r303612, head/sys/netgraph/ng_checksum.h) @@ -0,0 +1,88 @@ +/*- + * Copyright (c) 2015 Dmitry Vagin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _NETGRAPH_NG_CHECKSUM_H_ +#define _NETGRAPH_NG_CHECKSUM_H_ + +/* Node type name. */ +#define NG_CHECKSUM_NODE_TYPE "checksum" + +/* Node type cookie. */ +#define NGM_CHECKSUM_COOKIE 439419912 + +/* Hook names */ +#define NG_CHECKSUM_HOOK_IN "in" +#define NG_CHECKSUM_HOOK_OUT "out" + +/* Checksum flags */ +#define NG_CHECKSUM_CSUM_IPV4 (CSUM_IP|CSUM_TCP|CSUM_UDP) +#define NG_CHECKSUM_CSUM_IPV6 (CSUM_TCP_IPV6|CSUM_UDP_IPV6) + +/* Netgraph commands understood by this node type */ +enum { + NGM_CHECKSUM_GETDLT = 1, + NGM_CHECKSUM_SETDLT, + NGM_CHECKSUM_GETCONFIG, + NGM_CHECKSUM_SETCONFIG, + NGM_CHECKSUM_GETCLR_STATS, + NGM_CHECKSUM_GET_STATS, + NGM_CHECKSUM_CLR_STATS, +}; + +/* Parsing declarations */ + +#define NG_CHECKSUM_CONFIG_TYPE { \ + { "csum_flags", &ng_parse_uint64_type }, \ + { "csum_offload", &ng_parse_uint64_type }, \ + { NULL } \ +} + +#define NG_CHECKSUM_STATS_TYPE { \ + { "Received", &ng_parse_uint64_type }, \ + { "Processed", &ng_parse_uint64_type }, \ + { "Dropped", &ng_parse_uint64_type }, \ + { NULL } \ +} + +struct ng_checksum_config { + uint64_t csum_flags; + uint64_t csum_offload; +}; + +struct ng_checksum_stats { + uint64_t received; + uint64_t processed; + uint64_t dropped; +}; + +struct ng_checksum_vlan_header { + u_int16_t tag; + u_int16_t etype; +}; + +#endif /* _NETGRAPH_NG_CHECKSUM_H_ */ From owner-svn-src-all@freebsd.org Fri Dec 2 05:39:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9029C61EFB; Fri, 2 Dec 2016 05:39:11 +0000 (UTC) (envelope-from julian@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 A99A61BE6; Fri, 2 Dec 2016 05:39:11 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB25dA7k033316; Fri, 2 Dec 2016 05:39:10 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB25dAKQ033315; Fri, 2 Dec 2016 05:39:10 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201612020539.uB25dAKQ033315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Fri, 2 Dec 2016 05:39:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309388 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 05:39:12 -0000 Author: julian Date: Fri Dec 2 05:39:10 2016 New Revision: 309388 URL: https://svnweb.freebsd.org/changeset/base/309388 Log: MFH: r303613 Man page for the new checksum netgraph module. PR: 206186 Submitted by: Dmitry Vagin Added: stable/10/share/man/man4/ng_checksum.4 - copied unchanged from r303613, head/share/man/man4/ng_checksum.4 Modified: Directory Properties: stable/10/ (props changed) Copied: stable/10/share/man/man4/ng_checksum.4 (from r303613, head/share/man/man4/ng_checksum.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/ng_checksum.4 Fri Dec 2 05:39:10 2016 (r309388, copy of r303613, head/share/man/man4/ng_checksum.4) @@ -0,0 +1,141 @@ +.\" Copyright (c) 2015 Dmitry Vagin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd October 29, 2015 +.Dt NG_CHECKSUM 4 +.Os +.Sh NAME +.Nm ng_checksum +.Nd IP checksum node type +.Sh SYNOPSIS +.In netgraph/ng_checksum.h +.Sh DESCRIPTION +The +.Nm checksum +node can calculate and prepare for calculation in hardware +IPv4 header, TCP, UDP checksum. +.Sh HOOKS +This node type has two hooks: +.Bl -tag -width ".Va out" +.It Va in +Packets received on this hook are processed according to settings specified +in config and then forwarded to +.Ar out +hook, if it exists and connected. Otherwise they are reflected back to the +.Ar in +hook. +.It Va out +Packets received on this hook are forwarded to +.Ar in +hook without any changes. +.El +.Sh CONTROL MESSAGES +This node type supports the generic control messages, plus the following: +.Bl -tag -width foo +.It Dv NGM_CHECKSUM_SETDLT Pq Ic setdlt +Sets data link type on the +.Va in +hook. Currently, supported types are +.Cm DLT_RAW +(raw IP datagrams) and +.Cm DLT_EN10MB +(Ethernet). DLT_ definitions can be found in +.In net/bpf.h +header. Currently used values are +.Cm DLT_EN10MB += 1 and +.Cm DLT_RAW += 12. +.It Dv NGM_CHECKSUM_GETDLT Pq Ic getdlt +This control message obtains data link type on the +.Va in +hook. +.It Dv NGM_CHECKSUM_SETCONFIG Pq Ic setconfig +Sets node configuration. The following +.Vt "struct ng_checksum_config" +must be supplied as an argument: +.Bd -literal -offset 4n +struct ng_checksum_config { + uint64_t csum_flags; + uint64_t csum_offload; +}; +.Ed +.Pp +The +.Va csum_flags +can be set to any combination of CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 +(other values are ignored) for instructing node need calculate the corresponding checksum. +.Pp +The +.Va csum_offload +can be set to any combination of CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 +(other values are ignored) for instructing node what checksum can calculate in hardware. +.Pp +Also processed any combination of CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 sets before on mbuf. +.It Dv NGM_CHECKSUM_GETCONFIG Pq Ic getconfig +This control message obtains current node configuration, +returned as +.Vt "struct ng_checksum_config" . +.It Dv NGM_CHECKSUM_GET_STATS Pq Ic getstats +Returns node statistics as a +.Vt "struct ng_checksum_stats" . +.It Dv NGM_CHECKSUM_CLR_STATS Pq Ic clrstats +Clear node statistics. +.It Dv NGM_CHECKSUM_GETCLR_STATS Pq Ic getclrstats +This command is identical to +.Dv NGM_CHECKSUM_GET_STATS , +except that the statistics are also atomically cleared. +.El +.Sh SHUTDOWN +This node shuts down upon receipt of a +.Dv NGM_SHUTDOWN +control message, or when all hooks have been disconnected. +.Sh EXAMPLES +.Xr ngctl 8 +script: +.Bd -literal -offset 4n +/usr/sbin/ngctl -f- <<-SEQ + msg checksum-1: "setdlt 1" + ngctl msg checksum-1: "setconfig { csum_flags=0 csum_offload=6 }" +.Ed +.Pp +Set data link type to +.Cm DLT_EN10MB +(Ethernet), not set additional checksum flags, set hardware +can calculate CSUM_IP_UDP|CSUM_IP_TCP. +.Sh SEE ALSO +.Xr netgraph 4 , +.Xr ng_patch 4 , +.Xr ngctl 8 +.Sh HISTORY +The +.Nm +node type was implemented in +.Fx 10.2 +and first submitted in +.Fx 12.0 . +.Sh AUTHORS +.An "Dmitry Vagin" Aq daemon.hammer@ya.ru . From owner-svn-src-all@freebsd.org Fri Dec 2 05:42:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29E04C5E2E3; Fri, 2 Dec 2016 05:42:06 +0000 (UTC) (envelope-from julian@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 045E511B0; Fri, 2 Dec 2016 05:42:05 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB25g56b036465; Fri, 2 Dec 2016 05:42:05 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB25g5fk036463; Fri, 2 Dec 2016 05:42:05 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201612020542.uB25g5fk036463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Fri, 2 Dec 2016 05:42:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309389 - stable/10/sys/netgraph X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 05:42:06 -0000 Author: julian Date: Fri Dec 2 05:42:04 2016 New Revision: 309389 URL: https://svnweb.freebsd.org/changeset/base/309389 Log: MFH: r303611 slite style changes. There is an incoming patch that rewrites a lot of this module and I want to get the style and whitespace changes in a separate commit (or maybe more). PR: 206185 Submitted by: Dmitry Vagin Modified: stable/10/sys/netgraph/ng_patch.c stable/10/sys/netgraph/ng_patch.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netgraph/ng_patch.c ============================================================================== --- stable/10/sys/netgraph/ng_patch.c Fri Dec 2 05:39:10 2016 (r309388) +++ stable/10/sys/netgraph/ng_patch.c Fri Dec 2 05:42:04 2016 (r309389) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2010 by Maxim Ignatenko + * Copyright (c) 2010 Maxim Ignatenko * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -50,11 +50,12 @@ static int ng_patch_config_getlen(const struct ng_parse_type *type, const u_char *start, const u_char *buf) { - const struct ng_patch_config *p; + const struct ng_patch_config *conf; - p = (const struct ng_patch_config *)(buf - + conf = (const struct ng_patch_config *)(buf - offsetof(struct ng_patch_config, ops)); - return (p->count); + + return (conf->count); } static const struct ng_parse_struct_field ng_patch_op_type_fields[] @@ -64,13 +65,13 @@ static const struct ng_parse_type ng_pat &ng_patch_op_type_fields }; -static const struct ng_parse_array_info ng_patch_confarr_info = { +static const struct ng_parse_array_info ng_patch_ops_array_info = { &ng_patch_op_type, &ng_patch_config_getlen }; -static const struct ng_parse_type ng_patch_confarr_type = { +static const struct ng_parse_type ng_patch_ops_array_type = { &ng_parse_array_type, - &ng_patch_confarr_info + &ng_patch_ops_array_info }; static const struct ng_parse_struct_field ng_patch_config_type_fields[] @@ -137,6 +138,7 @@ static struct ng_type typestruct = { .disconnect = ng_patch_disconnect, .cmdlist = ng_patch_cmdlist, }; + NETGRAPH_INIT(patch, &typestruct); union patch_val { @@ -146,6 +148,7 @@ union patch_val { uint64_t v8; }; +/* private data */ struct ng_patch_priv { hook_p in; hook_p out; Modified: stable/10/sys/netgraph/ng_patch.h ============================================================================== --- stable/10/sys/netgraph/ng_patch.h Fri Dec 2 05:39:10 2016 (r309388) +++ stable/10/sys/netgraph/ng_patch.h Fri Dec 2 05:42:04 2016 (r309389) @@ -57,7 +57,7 @@ enum { NG_PATCH_MODE_DIV = 5, NG_PATCH_MODE_NEG = 6, NG_PATCH_MODE_AND = 7, - NG_PATCH_MODE_OR = 8, + NG_PATCH_MODE_OR = 8, NG_PATCH_MODE_XOR = 9, NG_PATCH_MODE_SHL = 10, NG_PATCH_MODE_SHR = 11 @@ -66,16 +66,16 @@ enum { struct ng_patch_op { uint64_t value; uint32_t offset; - uint16_t length; /* 1,2,4 or 8 (bytes) */ + uint16_t length; /* 1, 2, 4 or 8 (bytes) */ uint16_t mode; }; -#define NG_PATCH_OP_TYPE_INFO { \ - { "value", &ng_parse_uint64_type }, \ - { "offset", &ng_parse_uint32_type }, \ - { "length", &ng_parse_uint16_type }, \ - { "mode", &ng_parse_uint16_type }, \ - { NULL } \ +#define NG_PATCH_OP_TYPE_INFO { \ + { "value", &ng_parse_uint64_type }, \ + { "offset", &ng_parse_uint32_type }, \ + { "length", &ng_parse_uint16_type }, \ + { "mode", &ng_parse_uint16_type }, \ + { NULL } \ } struct ng_patch_config { @@ -84,11 +84,11 @@ struct ng_patch_config { struct ng_patch_op ops[]; }; -#define NG_PATCH_CONFIG_TYPE_INFO { \ - { "count", &ng_parse_uint32_type }, \ - { "csum_flags", &ng_parse_uint32_type }, \ - { "ops", &ng_patch_confarr_type }, \ - { NULL } \ +#define NG_PATCH_CONFIG_TYPE_INFO { \ + { "count", &ng_parse_uint32_type }, \ + { "csum_flags", &ng_parse_uint64_type }, \ + { "ops", &ng_patch_ops_array_type }, \ + { NULL } \ } struct ng_patch_stats { @@ -97,11 +97,11 @@ struct ng_patch_stats { uint64_t dropped; }; -#define NG_PATCH_STATS_TYPE_INFO { \ - { "received", &ng_parse_uint64_type }, \ - { "patched", &ng_parse_uint64_type }, \ - { "dropped", &ng_parse_uint64_type }, \ - { NULL } \ +#define NG_PATCH_STATS_TYPE_INFO { \ + { "Received", &ng_parse_uint64_type }, \ + { "Patched", &ng_parse_uint64_type }, \ + { "Dropped", &ng_parse_uint64_type }, \ + { NULL } \ } #endif /* _NETGRAPH_NG_PATCH_H_ */ From owner-svn-src-all@freebsd.org Fri Dec 2 05:42:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACA91C5E362; Fri, 2 Dec 2016 05:42:50 +0000 (UTC) (envelope-from julian@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 875A11366; Fri, 2 Dec 2016 05:42:50 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB25gnSC037308; Fri, 2 Dec 2016 05:42:49 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB25gnTc037305; Fri, 2 Dec 2016 05:42:49 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201612020542.uB25gnTc037305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Fri, 2 Dec 2016 05:42:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309390 - stable/11/sys/netgraph X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 05:42:50 -0000 Author: julian Date: Fri Dec 2 05:42:49 2016 New Revision: 309390 URL: https://svnweb.freebsd.org/changeset/base/309390 Log: MFH: r303611 slite style changes. There is an incoming patch that rewrites a lot of this module and I want to get the style and whitespace changes in a separate commit (or maybe more). PR: 206185 Submitted by: Dmitry Vagin Modified: stable/11/sys/netgraph/ng_patch.c stable/11/sys/netgraph/ng_patch.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netgraph/ng_patch.c ============================================================================== --- stable/11/sys/netgraph/ng_patch.c Fri Dec 2 05:42:04 2016 (r309389) +++ stable/11/sys/netgraph/ng_patch.c Fri Dec 2 05:42:49 2016 (r309390) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2010 by Maxim Ignatenko + * Copyright (c) 2010 Maxim Ignatenko * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -50,11 +50,12 @@ static int ng_patch_config_getlen(const struct ng_parse_type *type, const u_char *start, const u_char *buf) { - const struct ng_patch_config *p; + const struct ng_patch_config *conf; - p = (const struct ng_patch_config *)(buf - + conf = (const struct ng_patch_config *)(buf - offsetof(struct ng_patch_config, ops)); - return (p->count); + + return (conf->count); } static const struct ng_parse_struct_field ng_patch_op_type_fields[] @@ -64,13 +65,13 @@ static const struct ng_parse_type ng_pat &ng_patch_op_type_fields }; -static const struct ng_parse_array_info ng_patch_confarr_info = { +static const struct ng_parse_array_info ng_patch_ops_array_info = { &ng_patch_op_type, &ng_patch_config_getlen }; -static const struct ng_parse_type ng_patch_confarr_type = { +static const struct ng_parse_type ng_patch_ops_array_type = { &ng_parse_array_type, - &ng_patch_confarr_info + &ng_patch_ops_array_info }; static const struct ng_parse_struct_field ng_patch_config_type_fields[] @@ -137,6 +138,7 @@ static struct ng_type typestruct = { .disconnect = ng_patch_disconnect, .cmdlist = ng_patch_cmdlist, }; + NETGRAPH_INIT(patch, &typestruct); union patch_val { @@ -146,6 +148,7 @@ union patch_val { uint64_t v8; }; +/* private data */ struct ng_patch_priv { hook_p in; hook_p out; Modified: stable/11/sys/netgraph/ng_patch.h ============================================================================== --- stable/11/sys/netgraph/ng_patch.h Fri Dec 2 05:42:04 2016 (r309389) +++ stable/11/sys/netgraph/ng_patch.h Fri Dec 2 05:42:49 2016 (r309390) @@ -57,7 +57,7 @@ enum { NG_PATCH_MODE_DIV = 5, NG_PATCH_MODE_NEG = 6, NG_PATCH_MODE_AND = 7, - NG_PATCH_MODE_OR = 8, + NG_PATCH_MODE_OR = 8, NG_PATCH_MODE_XOR = 9, NG_PATCH_MODE_SHL = 10, NG_PATCH_MODE_SHR = 11 @@ -66,16 +66,16 @@ enum { struct ng_patch_op { uint64_t value; uint32_t offset; - uint16_t length; /* 1,2,4 or 8 (bytes) */ + uint16_t length; /* 1, 2, 4 or 8 (bytes) */ uint16_t mode; }; -#define NG_PATCH_OP_TYPE_INFO { \ - { "value", &ng_parse_uint64_type }, \ - { "offset", &ng_parse_uint32_type }, \ - { "length", &ng_parse_uint16_type }, \ - { "mode", &ng_parse_uint16_type }, \ - { NULL } \ +#define NG_PATCH_OP_TYPE_INFO { \ + { "value", &ng_parse_uint64_type }, \ + { "offset", &ng_parse_uint32_type }, \ + { "length", &ng_parse_uint16_type }, \ + { "mode", &ng_parse_uint16_type }, \ + { NULL } \ } struct ng_patch_config { @@ -84,11 +84,11 @@ struct ng_patch_config { struct ng_patch_op ops[]; }; -#define NG_PATCH_CONFIG_TYPE_INFO { \ - { "count", &ng_parse_uint32_type }, \ - { "csum_flags", &ng_parse_uint32_type }, \ - { "ops", &ng_patch_confarr_type }, \ - { NULL } \ +#define NG_PATCH_CONFIG_TYPE_INFO { \ + { "count", &ng_parse_uint32_type }, \ + { "csum_flags", &ng_parse_uint64_type }, \ + { "ops", &ng_patch_ops_array_type }, \ + { NULL } \ } struct ng_patch_stats { @@ -97,11 +97,11 @@ struct ng_patch_stats { uint64_t dropped; }; -#define NG_PATCH_STATS_TYPE_INFO { \ - { "received", &ng_parse_uint64_type }, \ - { "patched", &ng_parse_uint64_type }, \ - { "dropped", &ng_parse_uint64_type }, \ - { NULL } \ +#define NG_PATCH_STATS_TYPE_INFO { \ + { "Received", &ng_parse_uint64_type }, \ + { "Patched", &ng_parse_uint64_type }, \ + { "Dropped", &ng_parse_uint64_type }, \ + { NULL } \ } #endif /* _NETGRAPH_NG_PATCH_H_ */ From owner-svn-src-all@freebsd.org Fri Dec 2 05:47:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74FFEC5E569; Fri, 2 Dec 2016 05:47:53 +0000 (UTC) (envelope-from julian@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 4416916FE; Fri, 2 Dec 2016 05:47:53 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB25lq59037574; Fri, 2 Dec 2016 05:47:52 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB25lqEL037573; Fri, 2 Dec 2016 05:47:52 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201612020547.uB25lqEL037573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Fri, 2 Dec 2016 05:47:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309391 - stable/11/sys/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 05:47:53 -0000 Author: julian Date: Fri Dec 2 05:47:52 2016 New Revision: 309391 URL: https://svnweb.freebsd.org/changeset/base/309391 Log: MFH: r303287 Split MAKE_SYSENT into two parts so that the initializer part can be used separately if one wants to embed the sysent into a larger structure. Modified: stable/11/sys/sys/sysent.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/sys/sysent.h ============================================================================== --- stable/11/sys/sys/sysent.h Fri Dec 2 05:42:49 2016 (r309390) +++ stable/11/sys/sys/sysent.h Fri Dec 2 05:47:52 2016 (r309391) @@ -175,13 +175,21 @@ struct syscall_module_data { int flags; /* flags for syscall_register */ }; -#define MAKE_SYSENT(syscallname) \ -static struct sysent syscallname##_sysent = { \ - (sizeof(struct syscallname ## _args ) \ +/* separate initialization vector so it can be used in a substructure */ +#define SYSENT_INIT_VALS(_syscallname) { \ + .sy_narg = (sizeof(struct _syscallname ## _args ) \ / sizeof(register_t)), \ - (sy_call_t *)& sys_##syscallname, \ - SYS_AUE_##syscallname \ -} + .sy_call = (sy_call_t *)&sys_##_syscallname, \ + .sy_auevent = SYS_AUE_##_syscallname, \ + .sy_systrace_args_func = NULL, \ + .sy_entry = 0, \ + .sy_return = 0, \ + .sy_flags = 0, \ + .sy_thrcnt = 0 \ +} + +#define MAKE_SYSENT(syscallname) \ +static struct sysent syscallname##_sysent = SYSENT_INIT_VALS(syscallname); #define MAKE_SYSENT_COMPAT(syscallname) \ static struct sysent syscallname##_sysent = { \ From owner-svn-src-all@freebsd.org Fri Dec 2 05:49:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08E14C5E5FE; Fri, 2 Dec 2016 05:49:24 +0000 (UTC) (envelope-from araujo@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 CC8591887; Fri, 2 Dec 2016 05:49:23 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB25nNUa037702; Fri, 2 Dec 2016 05:49:23 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB25nNs4037701; Fri, 2 Dec 2016 05:49:23 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201612020549.uB25nNs4037701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 2 Dec 2016 05:49:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309392 - head/usr.sbin/ypldap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 05:49:24 -0000 Author: araujo Date: Fri Dec 2 05:49:22 2016 New Revision: 309392 URL: https://svnweb.freebsd.org/changeset/base/309392 Log: String terminators are called NUL, not NULL, also the variable mentioned in the comment is p and not u. Obtained from: OpenBSD (r1.34) Modified: head/usr.sbin/ypldap/aldap.c Modified: head/usr.sbin/ypldap/aldap.c ============================================================================== --- head/usr.sbin/ypldap/aldap.c Fri Dec 2 05:47:52 2016 (r309391) +++ head/usr.sbin/ypldap/aldap.c Fri Dec 2 05:49:22 2016 (r309392) @@ -1206,7 +1206,7 @@ isu8cont(unsigned char c) /* * Parse a LDAP value * notes: - * the argument u should be a NULL terminated sequence of ASCII bytes. + * the argument p should be a NUL-terminated sequence of ASCII bytes. */ char * parseval(char *p, size_t len) From owner-svn-src-all@freebsd.org Fri Dec 2 06:07:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69A76C5EAF5; Fri, 2 Dec 2016 06:07:29 +0000 (UTC) (envelope-from araujo@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 2A669113D; Fri, 2 Dec 2016 06:07:29 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB267SP8045634; Fri, 2 Dec 2016 06:07:28 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB267SI7045630; Fri, 2 Dec 2016 06:07:28 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201612020607.uB267SI7045630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 2 Dec 2016 06:07:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309393 - head/usr.sbin/ypldap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 06:07:29 -0000 Author: araujo Date: Fri Dec 2 06:07:27 2016 New Revision: 309393 URL: https://svnweb.freebsd.org/changeset/base/309393 Log: Use memset(3) instead of bzero(3). Obtained from: OpenBSD (r1.12, r1.20, r1.18 and r1.37) Modified: head/usr.sbin/ypldap/ldapclient.c head/usr.sbin/ypldap/yp.c head/usr.sbin/ypldap/ypldap.c head/usr.sbin/ypldap/ypldap_dns.c Modified: head/usr.sbin/ypldap/ldapclient.c ============================================================================== --- head/usr.sbin/ypldap/ldapclient.c Fri Dec 2 05:49:22 2016 (r309392) +++ head/usr.sbin/ypldap/ldapclient.c Fri Dec 2 06:07:27 2016 (r309393) @@ -363,7 +363,7 @@ ldapclient(int pipe_main2client[2]) return (pid); } - bzero(&env, sizeof(env)); + memset(&env, 0, sizeof(env)); TAILQ_INIT(&env.sc_idms); if ((pw = getpwnam(YPLDAP_USER)) == NULL) @@ -437,7 +437,7 @@ client_build_req(struct idm *idm, struct char **ldap_attrs; int i, k; - bzero(ir, sizeof(*ir)); + memset(ir, 0, sizeof(*ir)); for (i = min_attr; i < max_attr; i++) { if (idm->idm_flags & F_FIXED_ATTR(i)) { if (strlcat(ir->ir_line, idm->idm_attrs[i], @@ -594,7 +594,7 @@ client_try_idm(struct env *env, struct i aldap_freemsg(m); } - bzero(attrs, sizeof(attrs)); + memset(attrs, 0, sizeof(attrs)); for (i = 0, j = 0; i < ATTR_MAX; i++) { if (idm->idm_flags & F_FIXED_ATTR(i)) continue; @@ -611,7 +611,7 @@ client_try_idm(struct env *env, struct i idm->idm_filters[FILTER_USER], 0, ATTR_MAX, IMSG_PW_ENTRY) == -1) goto bad; - bzero(attrs, sizeof(attrs)); + memset(attrs, 0, sizeof(attrs)); for (i = ATTR_GR_MIN, j = 0; i < ATTR_GR_MAX; i++) { if (idm->idm_flags & F_FIXED_ATTR(i)) continue; Modified: head/usr.sbin/ypldap/yp.c ============================================================================== --- head/usr.sbin/ypldap/yp.c Fri Dec 2 05:49:22 2016 (r309392) +++ head/usr.sbin/ypldap/yp.c Fri Dec 2 06:07:27 2016 (r309393) @@ -342,7 +342,7 @@ ypproc_match_2_svc(ypreq_key *arg, struc log_debug("argument too long"); return (NULL); } - bzero(key, sizeof(key)); + memset(key, 0, sizeof(key)); (void)strncpy(key, arg->key.keydat_val, arg->key.keydat_len); if (strcmp(arg->map, "passwd.byname") == 0 || @@ -486,7 +486,7 @@ ypproc_next_2_svc(ypreq_key *arg, struct if (strcmp(arg->map, "passwd.byname") == 0 || strcmp(arg->map, "master.passwd.byname") == 0) { - bzero(key, sizeof(key)); + memset(key, 0, sizeof(key)); (void)strncpy(key, arg->key.keydat_val, arg->key.keydat_len); ukey.ue_line = key; @@ -517,7 +517,7 @@ ypproc_next_2_svc(ypreq_key *arg, struct } else if (strcmp(arg->map, "group.byname") == 0) { - bzero(key, sizeof(key)); + memset(key, 0, sizeof(key)); (void)strncpy(key, arg->key.keydat_val, arg->key.keydat_len); @@ -567,7 +567,7 @@ ypproc_master_2_svc(ypreq_nokey *arg, st static struct ypresp_master res; static char master[YPMAXPEER + 1]; - bzero(&res, sizeof(res)); + memset(&res, 0, sizeof(res)); if (yp_valid_domain(arg->domain, (struct ypresp_val *)&res) == -1) return (&res); @@ -620,7 +620,7 @@ yp_make_val(struct ypresp_val *res, char { static char buf[LINE_WIDTH]; - bzero(buf, sizeof(buf)); + memset(buf, 0, sizeof(buf)); if (replacecolon) line[strlen(line)] = ':'; @@ -640,8 +640,8 @@ yp_make_keyval(struct ypresp_key_val *re static char keybuf[YPMAXRECORD+1]; static char buf[LINE_WIDTH]; - bzero(keybuf, sizeof(keybuf)); - bzero(buf, sizeof(buf)); + memset(keybuf, 0, sizeof(keybuf)); + memset(buf, 0, sizeof(buf)); (void)strlcpy(keybuf, key, sizeof(keybuf)); res->key.keydat_len = strlen(keybuf); Modified: head/usr.sbin/ypldap/ypldap.c ============================================================================== --- head/usr.sbin/ypldap/ypldap.c Fri Dec 2 05:49:22 2016 (r309392) +++ head/usr.sbin/ypldap/ypldap.c Fri Dec 2 06:07:27 2016 (r309393) @@ -609,7 +609,7 @@ main(int argc, char *argv[]) #warning disabling privilege revocation in debug mode #endif - bzero(&tv, sizeof(tv)); + memset(&tv, 0, sizeof(tv)); evtimer_set(&ev_timer, main_init_timer, &env); evtimer_add(&ev_timer, &tv); Modified: head/usr.sbin/ypldap/ypldap_dns.c ============================================================================== --- head/usr.sbin/ypldap/ypldap_dns.c Fri Dec 2 05:49:22 2016 (r309392) +++ head/usr.sbin/ypldap/ypldap_dns.c Fri Dec 2 06:07:27 2016 (r309393) @@ -212,7 +212,7 @@ host_dns(const char *s, struct ypldap_ad struct sockaddr_in6 *sa_in6; struct ypldap_addr *h; - bzero(&hints, sizeof(hints)); + memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_DGRAM; /* DUMMY */ error = getaddrinfo(s, NULL, &hints, &res0); From owner-svn-src-all@freebsd.org Fri Dec 2 06:08:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 669F5C5EB9C; Fri, 2 Dec 2016 06:08:27 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-yw0-x22b.google.com (mail-yw0-x22b.google.com [IPv6:2607:f8b0:4002:c05::22b]) (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 245FD12CD; Fri, 2 Dec 2016 06:08:27 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-yw0-x22b.google.com with SMTP id t125so212315312ywc.1; Thu, 01 Dec 2016 22:08:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc; bh=CHhVi54oOOD0mip0SmfQF1KpVBdHHPseClaZ78YP6Kk=; b=f09ObRzYFX/fq9c9FbINIu4t4zJXq4Su/zgoUO5K638CyIxDPT0KCxoLsbFs3RFDrm ChQwCkuJX/fk9TxImqWoKxyeiONtv1wMCwjjMyB74wXQw3ajPjIJFD8hmkMBK8j+lgkk N5wPvEyZFylCLjwym/J60fbHTnPmMEXZx0f4cTdQPwBPmHogJ3ZKjMcSV2rleUM928Nd xsPniTYgxpyI13Wn4GMYBUxXLVuV8/6Kf+3SG5a8BczVgdBiAsBA53WJZ+t6J/lSJHHG 6UkaCWUGGEhw+wzP9/O/vp9xX+b6xv5+YPmFlmX2gbEfupw03dh8Wy76E4bapOhdUOxg 1khQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=CHhVi54oOOD0mip0SmfQF1KpVBdHHPseClaZ78YP6Kk=; b=dRZbELhwm07Z4otU41IQGwGpUQpcyYL3lT6xZI5q4YFdOAy+nBwFfKwEnjwnZfmb4T I79r43AAlnZzjD9bwMebmSgoSlWz9e78vH5iAZd8rCG7mUA5+8zToTS7HXypdADcRVnk EWlA54AcNuDjpKNN1T2j8/tRI4AkknReS0nRVukpk3a9dBQxg/WzV0r/IZl35hz/EpPy b7TlSo8e2mpioe0q28AELiBeKDWaoZccLdZat7l9D/4YFhYyi5k4EouRm5HUrQwc5LHm 240eAzGalTKCOIRVcVg2OGz5OwcC7kR2jbiGSRh+t0QfZLkbQG9MnFfoJUWJaxaYTnUb t2FQ== X-Gm-Message-State: AKaTC00QeUbfUmJ3pKGwb4Ptq6foykQ4UviUrs5xAuErfwQazbA2QGKdTn+ZW7MioPimik5AzDGQRHjmYCyqCA== X-Received: by 10.13.237.67 with SMTP id w64mr47889444ywe.167.1480658906117; Thu, 01 Dec 2016 22:08:26 -0800 (PST) MIME-Version: 1.0 Received: by 10.13.195.3 with HTTP; Thu, 1 Dec 2016 22:08:25 -0800 (PST) Reply-To: araujo@freebsd.org In-Reply-To: <201612020607.uB267SI7045630@repo.freebsd.org> References: <201612020607.uB267SI7045630@repo.freebsd.org> From: Marcelo Araujo Date: Fri, 2 Dec 2016 14:08:25 +0800 Message-ID: Subject: Re: svn commit: r309393 - head/usr.sbin/ypldap To: Marcelo Araujo Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 06:08:27 -0000 Forgot MFC after two weeks in my last two commits, so noted in my todo list. Br, 2016-12-02 14:07 GMT+08:00 Marcelo Araujo : > Author: araujo > Date: Fri Dec 2 06:07:27 2016 > New Revision: 309393 > URL: https://svnweb.freebsd.org/changeset/base/309393 > > Log: > Use memset(3) instead of bzero(3). > > Obtained from: OpenBSD (r1.12, r1.20, r1.18 and r1.37) > > Modified: > head/usr.sbin/ypldap/ldapclient.c > head/usr.sbin/ypldap/yp.c > head/usr.sbin/ypldap/ypldap.c > head/usr.sbin/ypldap/ypldap_dns.c > > Modified: head/usr.sbin/ypldap/ldapclient.c > ============================================================ > ================== > --- head/usr.sbin/ypldap/ldapclient.c Fri Dec 2 05:49:22 2016 > (r309392) > +++ head/usr.sbin/ypldap/ldapclient.c Fri Dec 2 06:07:27 2016 > (r309393) > @@ -363,7 +363,7 @@ ldapclient(int pipe_main2client[2]) > return (pid); > } > > - bzero(&env, sizeof(env)); > + memset(&env, 0, sizeof(env)); > TAILQ_INIT(&env.sc_idms); > > if ((pw = getpwnam(YPLDAP_USER)) == NULL) > @@ -437,7 +437,7 @@ client_build_req(struct idm *idm, struct > char **ldap_attrs; > int i, k; > > - bzero(ir, sizeof(*ir)); > + memset(ir, 0, sizeof(*ir)); > for (i = min_attr; i < max_attr; i++) { > if (idm->idm_flags & F_FIXED_ATTR(i)) { > if (strlcat(ir->ir_line, idm->idm_attrs[i], > @@ -594,7 +594,7 @@ client_try_idm(struct env *env, struct i > aldap_freemsg(m); > } > > - bzero(attrs, sizeof(attrs)); > + memset(attrs, 0, sizeof(attrs)); > for (i = 0, j = 0; i < ATTR_MAX; i++) { > if (idm->idm_flags & F_FIXED_ATTR(i)) > continue; > @@ -611,7 +611,7 @@ client_try_idm(struct env *env, struct i > idm->idm_filters[FILTER_USER], 0, ATTR_MAX, IMSG_PW_ENTRY) == > -1) > goto bad; > > - bzero(attrs, sizeof(attrs)); > + memset(attrs, 0, sizeof(attrs)); > for (i = ATTR_GR_MIN, j = 0; i < ATTR_GR_MAX; i++) { > if (idm->idm_flags & F_FIXED_ATTR(i)) > continue; > > Modified: head/usr.sbin/ypldap/yp.c > ============================================================ > ================== > --- head/usr.sbin/ypldap/yp.c Fri Dec 2 05:49:22 2016 (r309392) > +++ head/usr.sbin/ypldap/yp.c Fri Dec 2 06:07:27 2016 (r309393) > @@ -342,7 +342,7 @@ ypproc_match_2_svc(ypreq_key *arg, struc > log_debug("argument too long"); > return (NULL); > } > - bzero(key, sizeof(key)); > + memset(key, 0, sizeof(key)); > (void)strncpy(key, arg->key.keydat_val, arg->key.keydat_len); > > if (strcmp(arg->map, "passwd.byname") == 0 || > @@ -486,7 +486,7 @@ ypproc_next_2_svc(ypreq_key *arg, struct > > if (strcmp(arg->map, "passwd.byname") == 0 || > strcmp(arg->map, "master.passwd.byname") == 0) { > - bzero(key, sizeof(key)); > + memset(key, 0, sizeof(key)); > (void)strncpy(key, arg->key.keydat_val, > arg->key.keydat_len); > ukey.ue_line = key; > @@ -517,7 +517,7 @@ ypproc_next_2_svc(ypreq_key *arg, struct > > > } else if (strcmp(arg->map, "group.byname") == 0) { > - bzero(key, sizeof(key)); > + memset(key, 0, sizeof(key)); > (void)strncpy(key, arg->key.keydat_val, > arg->key.keydat_len); > > @@ -567,7 +567,7 @@ ypproc_master_2_svc(ypreq_nokey *arg, st > static struct ypresp_master res; > static char master[YPMAXPEER + 1]; > > - bzero(&res, sizeof(res)); > + memset(&res, 0, sizeof(res)); > if (yp_valid_domain(arg->domain, (struct ypresp_val *)&res) == -1) > return (&res); > > @@ -620,7 +620,7 @@ yp_make_val(struct ypresp_val *res, char > { > static char buf[LINE_WIDTH]; > > - bzero(buf, sizeof(buf)); > + memset(buf, 0, sizeof(buf)); > > if (replacecolon) > line[strlen(line)] = ':'; > @@ -640,8 +640,8 @@ yp_make_keyval(struct ypresp_key_val *re > static char keybuf[YPMAXRECORD+1]; > static char buf[LINE_WIDTH]; > > - bzero(keybuf, sizeof(keybuf)); > - bzero(buf, sizeof(buf)); > + memset(keybuf, 0, sizeof(keybuf)); > + memset(buf, 0, sizeof(buf)); > > (void)strlcpy(keybuf, key, sizeof(keybuf)); > res->key.keydat_len = strlen(keybuf); > > Modified: head/usr.sbin/ypldap/ypldap.c > ============================================================ > ================== > --- head/usr.sbin/ypldap/ypldap.c Fri Dec 2 05:49:22 2016 > (r309392) > +++ head/usr.sbin/ypldap/ypldap.c Fri Dec 2 06:07:27 2016 > (r309393) > @@ -609,7 +609,7 @@ main(int argc, char *argv[]) > #warning disabling privilege revocation in debug mode > #endif > > - bzero(&tv, sizeof(tv)); > + memset(&tv, 0, sizeof(tv)); > evtimer_set(&ev_timer, main_init_timer, &env); > evtimer_add(&ev_timer, &tv); > > > Modified: head/usr.sbin/ypldap/ypldap_dns.c > ============================================================ > ================== > --- head/usr.sbin/ypldap/ypldap_dns.c Fri Dec 2 05:49:22 2016 > (r309392) > +++ head/usr.sbin/ypldap/ypldap_dns.c Fri Dec 2 06:07:27 2016 > (r309393) > @@ -212,7 +212,7 @@ host_dns(const char *s, struct ypldap_ad > struct sockaddr_in6 *sa_in6; > struct ypldap_addr *h; > > - bzero(&hints, sizeof(hints)); > + memset(&hints, 0, sizeof(hints)); > hints.ai_family = PF_UNSPEC; > hints.ai_socktype = SOCK_DGRAM; /* DUMMY */ > error = getaddrinfo(s, NULL, &hints, &res0); > > -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-all@freebsd.org Fri Dec 2 06:16:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7A12C5EF25; Fri, 2 Dec 2016 06:16:00 +0000 (UTC) (envelope-from marcel@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 9736E1873; Fri, 2 Dec 2016 06:16:00 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB26Fxem049432; Fri, 2 Dec 2016 06:15:59 GMT (envelope-from marcel@FreeBSD.org) Received: (from marcel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB26Fxs1049431; Fri, 2 Dec 2016 06:15:59 GMT (envelope-from marcel@FreeBSD.org) Message-Id: <201612020615.uB26Fxs1049431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marcel set sender to marcel@FreeBSD.org using -f From: Marcel Moolenaar Date: Fri, 2 Dec 2016 06:15:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309394 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 06:16:00 -0000 Author: marcel Date: Fri Dec 2 06:15:59 2016 New Revision: 309394 URL: https://svnweb.freebsd.org/changeset/base/309394 Log: Fix use-after-free bugs in pfsync(4) Use after free happens for state that is deleted. The reference count is what prevents the state from being freed. When the state is dequeued, the reference count is dropped and the memory freed. We can't dereference the next pointer or re-queue the state. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D8671 Modified: head/sys/netpfil/pf/if_pfsync.c Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Fri Dec 2 06:07:27 2016 (r309393) +++ head/sys/netpfil/pf/if_pfsync.c Fri Dec 2 06:15:59 2016 (r309394) @@ -1509,7 +1509,7 @@ pfsync_sendout(int schedswi) struct ip *ip; struct pfsync_header *ph; struct pfsync_subheader *subh; - struct pf_state *st; + struct pf_state *st, *st_next; struct pfsync_upd_req_item *ur; int offset; int q, count = 0; @@ -1559,7 +1559,7 @@ pfsync_sendout(int schedswi) offset += sizeof(*subh); count = 0; - TAILQ_FOREACH(st, &sc->sc_qs[q], sync_list) { + TAILQ_FOREACH_SAFE(st, &sc->sc_qs[q], sync_list, st_next) { KASSERT(st->sync_state == q, ("%s: st->sync_state == q", __func__)); @@ -1931,6 +1931,8 @@ pfsync_delete_state(struct pf_state *st) if (sc->sc_len == PFSYNC_MINPKT) callout_reset(&sc->sc_tmo, 1 * hz, pfsync_timeout, V_pfsyncif); + pf_ref_state(st); + switch (st->sync_state) { case PFSYNC_S_INS: /* We never got to tell the world so just forget about it. */ @@ -1950,6 +1952,9 @@ pfsync_delete_state(struct pf_state *st) default: panic("%s: unexpected sync state %d", __func__, st->sync_state); } + + pf_release_state(st); + PFSYNC_UNLOCK(sc); } From owner-svn-src-all@freebsd.org Fri Dec 2 06:27:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A940C6214C; Fri, 2 Dec 2016 06:27:15 +0000 (UTC) (envelope-from julian@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 2ECE91CEC; Fri, 2 Dec 2016 06:27:15 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB26REfw053822; Fri, 2 Dec 2016 06:27:14 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB26REdP053821; Fri, 2 Dec 2016 06:27:14 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201612020627.uB26REdP053821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Fri, 2 Dec 2016 06:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309395 - stable/10/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 06:27:15 -0000 Author: julian Date: Fri Dec 2 06:27:14 2016 New Revision: 309395 URL: https://svnweb.freebsd.org/changeset/base/309395 Log: MFH: r297012 Add a few details that make it easier to use this macro. Sponsored by: Panzura inc Modified: stable/10/share/man/man9/SYSCALL_MODULE.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/SYSCALL_MODULE.9 ============================================================================== --- stable/10/share/man/man9/SYSCALL_MODULE.9 Fri Dec 2 06:15:59 2016 (r309394) +++ stable/10/share/man/man9/SYSCALL_MODULE.9 Fri Dec 2 06:27:14 2016 (r309395) @@ -57,6 +57,8 @@ A pointer to an which saves the offset in .Vt "struct sysent" where the syscall is allocated. +If the location pointed to by offset holds a non 0 number it will be used if possible. +If it holds 0 then one will be assigned. .It Fa new_sysent is a pointer to a structure that specifies the function implementing the syscall and the number of arguments this function needs (see @@ -72,6 +74,17 @@ The argument passed to the callback func .Fa evh event handler when it is called. .El +.Pp +The syscall number assigned to the module can be retrieved using the +.Xr modstat 3 +and +.Xr modfind 3 +library functions in libc. +The MACRO +.Fn SYSCALL_MODULE_HELPER +includes +.Fn SYSCALL_MODULE +and much of its boilerplate code. .Sh EXAMPLES A minimal example for a syscall module can be found in .Pa /usr/share/examples/kld/syscall/module/syscall.c . From owner-svn-src-all@freebsd.org Fri Dec 2 06:27:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55029C62201; Fri, 2 Dec 2016 06:27:55 +0000 (UTC) (envelope-from julian@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 242431E46; Fri, 2 Dec 2016 06:27:55 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB26Rs8K053922; Fri, 2 Dec 2016 06:27:54 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB26RsvF053921; Fri, 2 Dec 2016 06:27:54 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201612020627.uB26RsvF053921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Fri, 2 Dec 2016 06:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309396 - stable/10/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 06:27:55 -0000 Author: julian Date: Fri Dec 2 06:27:54 2016 New Revision: 309396 URL: https://svnweb.freebsd.org/changeset/base/309396 Log: MFH: r297015 Change a little to match what appears to be the right way of specifying an argument (from looking at other man pages) Sponsored by: Panzura inc Modified: stable/10/share/man/man9/SYSCALL_MODULE.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/SYSCALL_MODULE.9 ============================================================================== --- stable/10/share/man/man9/SYSCALL_MODULE.9 Fri Dec 2 06:27:14 2016 (r309395) +++ stable/10/share/man/man9/SYSCALL_MODULE.9 Fri Dec 2 06:27:54 2016 (r309396) @@ -57,7 +57,9 @@ A pointer to an which saves the offset in .Vt "struct sysent" where the syscall is allocated. -If the location pointed to by offset holds a non 0 number it will be used if possible. +If the location pointed to by +.Fa offset +holds a non 0 number it will be used if possible. If it holds 0 then one will be assigned. .It Fa new_sysent is a pointer to a structure that specifies the function implementing From owner-svn-src-all@freebsd.org Fri Dec 2 08:02:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42F0DC61B0A; Fri, 2 Dec 2016 08:02:32 +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 0BC6C16C4; Fri, 2 Dec 2016 08:02:31 +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 uB282VMn092935; Fri, 2 Dec 2016 08:02:31 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB282VAi092934; Fri, 2 Dec 2016 08:02:31 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201612020802.uB282VAi092934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 2 Dec 2016 08:02:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309397 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 08:02:32 -0000 Author: tuexen Date: Fri Dec 2 08:02:31 2016 New Revision: 309397 URL: https://svnweb.freebsd.org/changeset/base/309397 Log: Fix the handling of TCP FIN-segments in the CLOSED state When a TCP segment with the FIN bit set was received in the CLOSED state, a TCP RST-ACK-segment is sent. When computing SEG.ACK for this, the FIN counts as one byte. This accounting was missing and is fixed by this patch. Reviewed by: hiren MFC after: 1 month Sponsored by: Netflix, Inc. Differential Revision: https://svn.freebsd.org/base/head Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Fri Dec 2 06:27:54 2016 (r309396) +++ head/sys/netinet/tcp_input.c Fri Dec 2 08:02:31 2016 (r309397) @@ -3357,6 +3357,8 @@ tcp_dropwithreset(struct mbuf *m, struct } else { if (th->th_flags & TH_SYN) tlen++; + if (th->th_flags & TH_FIN) + tlen++; tcp_respond(tp, mtod(m, void *), th, m, th->th_seq+tlen, (tcp_seq)0, TH_RST|TH_ACK); } From owner-svn-src-all@freebsd.org Fri Dec 2 08:11:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3125C61C07; Fri, 2 Dec 2016 08:11:34 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-ua0-x241.google.com (mail-ua0-x241.google.com [IPv6:2607:f8b0:400c:c08::241]) (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 B47661A59; Fri, 2 Dec 2016 08:11:34 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-ua0-x241.google.com with SMTP id 20so23916331uak.0; Fri, 02 Dec 2016 00:11:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=fgWf/SQqnxAjOmJ95ecsj5sL7V653hdKW12szq2ax6g=; b=00rG8UgUx4z1nLPQdUbg/MNajpA7k9COe3hEyeVSDaVeLJplrNVcyz2FX0iqeenwpt f8oUaUD4Z40cUu4sMgDqpHiGZVcvzgy2p4aHeMAGnY9iSgwII6y383KBWqjFlG+JxknC 1E6+SXe+HoG3nYYrbHF9AKETj/XZ5Fq4UctnwlQnWkeJHu4NhibvIWP9sEfjb+nktgUM F1wDUcdH9B70qYGWX1E4T65j/fAUJ50O7CeCGfO6Dom3yZ5x1Z2kfsQgBBzfN8O4Odg4 dUz5LeuCdZCYLl6V3c2+mAWS/aDi+9UlrJXUUT4DeSwunz0Y/FhjVOoWz1On0dL7h6RN ZC/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=fgWf/SQqnxAjOmJ95ecsj5sL7V653hdKW12szq2ax6g=; b=jdYMKMdekdlKCDMK1M9aLYYSTshgakQuz0/7Xn3sFhwzvKUDoke/cnY4en2VgOYcOm XMUHljd1RTME2wwtsOTEi012o1fo5NeQ18iCeoQtjf9N8B2zDbfz+MIojCDbNz5Q0h4F 2y52E/MmD8ZszoZb08SEmNxEVdEKv0+sCtsSzAerBW8OI5UKNx4SLkoeS25ue7UZfgbl +1Kv0+5nCiJ6xoqUJxE1DjeOG1fiZ2PfSuAVwANpCtDYkdBEUwZsocUUJGVF1TiSLGUo SJ2cexWIYf7wmVVs0iZ4DFHv/pBZEcd59APSYBuLxCHbfBCvzlYQ6kuHcbYZhn6KnwYh U/vQ== X-Gm-Message-State: AKaTC0163zXyi30NU0g8N+0Moaq5mKCQKdG3OmuioanSo/qrL64Ii6fH/o+TJjGp7pAoLj0Z3humUWBjCdKQ3w== X-Received: by 10.159.55.168 with SMTP id q37mr32967920uaq.63.1480666293502; Fri, 02 Dec 2016 00:11:33 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.5.198 with HTTP; Fri, 2 Dec 2016 00:11:32 -0800 (PST) In-Reply-To: <201612012108.uB1L8g19026075@repo.freebsd.org> References: <201612012108.uB1L8g19026075@repo.freebsd.org> From: Sepherosa Ziehau Date: Fri, 2 Dec 2016 16:11:32 +0800 Message-ID: Subject: Re: svn commit: r309372 - head/sys/sys To: Ryan Stone Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 08:11:35 -0000 peek_clear_sc is added to address the issue you mentioned. IMHO, this commit weakens the proper assertion. On Fri, Dec 2, 2016 at 5:08 AM, Ryan Stone wrote: > Author: rstone > Date: Thu Dec 1 21:08:42 2016 > New Revision: 309372 > URL: https://svnweb.freebsd.org/changeset/base/309372 > > Log: > Fix a false positive in a buf_ring assert > > buf_ring contains an assert that checks whether an item being > enqueued already exists on the ring. There is a subtle bug in > this assert. An item can be returned by a peek() function and > freed, and then the consumer thread can be preempted before > calling advance(). If this happens the item appears to still be > on the queue, but another thread may allocate the item from the > free pool and wind up trying to enqueue it again, causing the > assert to trigger incorrectly. > > Fix this by skipping the head of the consumer's portion of the > ring, as this index is what will be returned by peek(). > > Sponsored by: Dell EMC Isilon > MFC After: 1 week > Differential Revision: https://reviews.freebsd.org/D8685 > Reviewed by: hselasky > > Modified: > head/sys/sys/buf_ring.h > > Modified: head/sys/sys/buf_ring.h > ============================================================================== > --- head/sys/sys/buf_ring.h Thu Dec 1 20:36:48 2016 (r309371) > +++ head/sys/sys/buf_ring.h Thu Dec 1 21:08:42 2016 (r309372) > @@ -67,11 +67,13 @@ buf_ring_enqueue(struct buf_ring *br, vo > uint32_t prod_head, prod_next, cons_tail; > #ifdef DEBUG_BUFRING > int i; > - for (i = br->br_cons_head; i != br->br_prod_head; > - i = ((i + 1) & br->br_cons_mask)) > - if(br->br_ring[i] == buf) > - panic("buf=%p already enqueue at %d prod=%d cons=%d", > - buf, i, br->br_prod_tail, br->br_cons_tail); > + if (br->br_cons_head != br->br_prod_head) { > + for (i = (br->br_cons_head + 1) & br->br_cons_mask; i != br->br_prod_head; > + i = ((i + 1) & br->br_cons_mask)) > + if(br->br_ring[i] == buf) > + panic("buf=%p already enqueue at %d prod=%d cons=%d", > + buf, i, br->br_prod_tail, br->br_cons_tail); > + } > #endif > critical_enter(); > do { > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- Tomorrow Will Never Die From owner-svn-src-all@freebsd.org Fri Dec 2 08:12:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2940C61E1A; Fri, 2 Dec 2016 08:12:52 +0000 (UTC) (envelope-from julian@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 C1BB41E10; Fri, 2 Dec 2016 08:12:52 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB28CpZZ097538; Fri, 2 Dec 2016 08:12:51 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB28CpYh097537; Fri, 2 Dec 2016 08:12:51 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201612020812.uB28CpYh097537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Fri, 2 Dec 2016 08:12:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309398 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 08:12:53 -0000 Author: julian Date: Fri Dec 2 08:12:51 2016 New Revision: 309398 URL: https://svnweb.freebsd.org/changeset/base/309398 Log: MFH: r306554 Use accept4 with O_NONBLOCK rather than accept + fcntl Modified: stable/10/usr.sbin/bhyve/dbgport.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/dbgport.c ============================================================================== --- stable/10/usr.sbin/bhyve/dbgport.c Fri Dec 2 08:02:31 2016 (r309397) +++ stable/10/usr.sbin/bhyve/dbgport.c Fri Dec 2 08:12:51 2016 (r309398) @@ -73,10 +73,8 @@ again: printf("Waiting for connection from gdb\r\n"); printonce = 1; } - conn_fd = accept(listen_fd, NULL, NULL); - if (conn_fd >= 0) - fcntl(conn_fd, F_SETFL, O_NONBLOCK); - else if (errno != EINTR) + conn_fd = accept4(listen_fd, NULL, NULL, O_NONBLOCK); + if (conn_fd < 0 && errno != EINTR) perror("accept"); } From owner-svn-src-all@freebsd.org Fri Dec 2 08:15:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC4B7C61F50; Fri, 2 Dec 2016 08:15:53 +0000 (UTC) (envelope-from julian@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 BB7BF1006; Fri, 2 Dec 2016 08:15:53 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB28FqOu097729; Fri, 2 Dec 2016 08:15:52 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB28FqWX097728; Fri, 2 Dec 2016 08:15:52 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201612020815.uB28FqWX097728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Fri, 2 Dec 2016 08:15:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309399 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 08:15:54 -0000 Author: julian Date: Fri Dec 2 08:15:52 2016 New Revision: 309399 URL: https://svnweb.freebsd.org/changeset/base/309399 Log: MFH: r307917 accept4 actually expect SOCK_NONBLOCK and not O_NONBLOCK Reported by: jhb Pointyhat to: bapt Modified: stable/10/usr.sbin/bhyve/dbgport.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/dbgport.c ============================================================================== --- stable/10/usr.sbin/bhyve/dbgport.c Fri Dec 2 08:12:51 2016 (r309398) +++ stable/10/usr.sbin/bhyve/dbgport.c Fri Dec 2 08:15:52 2016 (r309399) @@ -73,7 +73,7 @@ again: printf("Waiting for connection from gdb\r\n"); printonce = 1; } - conn_fd = accept4(listen_fd, NULL, NULL, O_NONBLOCK); + conn_fd = accept4(listen_fd, NULL, NULL, SOCK_NONBLOCK); if (conn_fd < 0 && errno != EINTR) perror("accept"); } From owner-svn-src-all@freebsd.org Fri Dec 2 08:21:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68CD9C62018; Fri, 2 Dec 2016 08:21:09 +0000 (UTC) (envelope-from hselasky@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 43907135A; Fri, 2 Dec 2016 08:21:09 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB28L88f000196; Fri, 2 Dec 2016 08:21:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB28L8s2000195; Fri, 2 Dec 2016 08:21:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201612020821.uB28L8s2000195@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 2 Dec 2016 08:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309400 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 08:21:09 -0000 Author: hselasky Date: Fri Dec 2 08:21:08 2016 New Revision: 309400 URL: https://svnweb.freebsd.org/changeset/base/309400 Log: Fix for endless recursion in the ACPI GPE handler during boot. When handling a GPE ACPI interrupt object the EcSpaceHandler() function can be called which checks the EC_EVENT_SCI bit and then recurse on the EcGpeQueryHandler() function. If there are multiple GPE events pending the EC_EVENT_SCI bit will be set at the next call to EcSpaceHandler() causing it to recurse again via the EcGpeQueryHandler() function. This leads to a slow never ending recursion during boot which prevents proper system startup, because the EC_EVENT_SCI bit never gets cleared in this scenario. The behaviour is reproducible with the ALASKA AMI in combination with a newer Skylake based mainboard in the following way: Enter BIOS and adjust the clock one hour forward. Save and exit the BIOS. System fails to boot due to the above mentioned bug in EcGpeQueryHandler() which was observed recursing multiple times. This patch adds a simple recursion guard to the EcGpeQueryHandler() function and also also adds logic to detect if new GPE events occurred during the execution of EcGpeQueryHandler() and then loop on this function instead of recursing. Reviewed by: jhb MFC after: 2 weeks Modified: head/sys/dev/acpica/acpi_ec.c Modified: head/sys/dev/acpica/acpi_ec.c ============================================================================== --- head/sys/dev/acpica/acpi_ec.c Fri Dec 2 08:15:52 2016 (r309399) +++ head/sys/dev/acpica/acpi_ec.c Fri Dec 2 08:21:08 2016 (r309400) @@ -613,16 +613,14 @@ EcCheckStatus(struct acpi_ec_softc *sc, } static void -EcGpeQueryHandler(void *Context) +EcGpeQueryHandlerSub(struct acpi_ec_softc *sc) { - struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context; UINT8 Data; ACPI_STATUS Status; int retry; char qxx[5]; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); - KASSERT(Context != NULL, ("EcGpeQueryHandler called with NULL")); /* Serialize user access with EcSpaceHandler(). */ Status = EcLock(sc); @@ -647,7 +645,6 @@ EcGpeQueryHandler(void *Context) EC_EVENT_INPUT_BUFFER_EMPTY))) break; } - sc->ec_sci_pend = FALSE; if (ACPI_FAILURE(Status)) { EcUnlock(sc); device_printf(sc->ec_dev, "GPE query failed: %s\n", @@ -678,6 +675,29 @@ EcGpeQueryHandler(void *Context) } } +static void +EcGpeQueryHandler(void *Context) +{ + struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context; + int pending; + + KASSERT(Context != NULL, ("EcGpeQueryHandler called with NULL")); + + do { + /* Read the current pending count */ + pending = atomic_load_acq_int(&sc->ec_sci_pend); + + /* Call GPE handler function */ + EcGpeQueryHandlerSub(sc); + + /* + * Try to reset the pending count to zero. If this fails we + * know another GPE event has occurred while handling the + * current GPE event and need to loop. + */ + } while (!atomic_cmpset_int(&sc->ec_sci_pend, pending, 0)); +} + /* * The GPE handler is called when IBE/OBF or SCI events occur. We are * called from an unknown lock context. @@ -706,13 +726,14 @@ EcGpeHandler(ACPI_HANDLE GpeDevice, UINT * It will run the query and _Qxx method later, under the lock. */ EcStatus = EC_GET_CSR(sc); - if ((EcStatus & EC_EVENT_SCI) && !sc->ec_sci_pend) { + if ((EcStatus & EC_EVENT_SCI) && + atomic_fetchadd_int(&sc->ec_sci_pend, 1) == 0) { CTR0(KTR_ACPI, "ec gpe queueing query handler"); Status = AcpiOsExecute(OSL_GPE_HANDLER, EcGpeQueryHandler, Context); - if (ACPI_SUCCESS(Status)) - sc->ec_sci_pend = TRUE; - else + if (ACPI_FAILURE(Status)) { printf("EcGpeHandler: queuing GPE query handler failed\n"); + atomic_store_rel_int(&sc->ec_sci_pend, 0); + } } return (ACPI_REENABLE_GPE); } @@ -759,7 +780,8 @@ EcSpaceHandler(UINT32 Function, ACPI_PHY * we call it directly here since our thread taskq is not active yet. */ if (cold || rebooting || sc->ec_suspending) { - if ((EC_GET_CSR(sc) & EC_EVENT_SCI)) { + if ((EC_GET_CSR(sc) & EC_EVENT_SCI) && + atomic_fetchadd_int(&sc->ec_sci_pend, 1) == 0) { CTR0(KTR_ACPI, "ec running gpe handler directly"); EcGpeQueryHandler(sc); } From owner-svn-src-all@freebsd.org Fri Dec 2 08:21:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58EDCC62166; Fri, 2 Dec 2016 08:21:26 +0000 (UTC) (envelope-from julian@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 0CD411509; Fri, 2 Dec 2016 08:21:25 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB28LPVY000250; Fri, 2 Dec 2016 08:21:25 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB28LPJk000249; Fri, 2 Dec 2016 08:21:25 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201612020821.uB28LPJk000249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Fri, 2 Dec 2016 08:21:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309401 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 08:21:26 -0000 Author: julian Date: Fri Dec 2 08:21:25 2016 New Revision: 309401 URL: https://svnweb.freebsd.org/changeset/base/309401 Log: MFH: r309295 bhyve: stability and performance improvement for dbgport The TCP server implementation in dbgport does not track clients, so it may try to write to a disconected socket resulting in SIGPIPE. Avoid that by setting SO_NOSIGPIPE socket option. Because dbgport emulates an I/O port to guest, the communication is done byte by byte. Reduce latency of the TCP/IP transfers by using TCP_NODELAY option. In my tests that change improves performance of kgdb commands with lots of output (e.g. info threads) by two orders of magnitude. A general note. Since we have a uart emulation in bhyve, that can be used for the console and gdb access to guests. So, bvmconsole and bvmdebug could be de-orbited now. But there are many existing deployments that still dependend on those. Discussed with: julian, jhb Sponsored by: Panzura Modified: stable/10/usr.sbin/bhyve/dbgport.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/dbgport.c ============================================================================== --- stable/10/usr.sbin/bhyve/dbgport.c Fri Dec 2 08:21:08 2016 (r309400) +++ stable/10/usr.sbin/bhyve/dbgport.c Fri Dec 2 08:21:25 2016 (r309401) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -55,8 +56,9 @@ static int dbg_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, uint32_t *eax, void *arg) { - char ch; int nwritten, nread, printonce; + int on = 1; + char ch; if (bytes == 2 && in) { *eax = BVM_DBG_SIG; @@ -74,8 +76,16 @@ again: printonce = 1; } conn_fd = accept4(listen_fd, NULL, NULL, SOCK_NONBLOCK); - if (conn_fd < 0 && errno != EINTR) + if (conn_fd >= 0) { + /* Avoid EPIPE after the client drops off. */ + (void)setsockopt(conn_fd, SOL_SOCKET, SO_NOSIGPIPE, + &on, sizeof(on)); + /* Improve latency for one byte at a time tranfers. */ + (void)setsockopt(conn_fd, IPPROTO_TCP, TCP_NODELAY, + &on, sizeof(on)); + } else if (errno != EINTR) { perror("accept"); + } } if (in) { From owner-svn-src-all@freebsd.org Fri Dec 2 08:24:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9EF9AC621EA; Fri, 2 Dec 2016 08:24:01 +0000 (UTC) (envelope-from julian@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 543FA1809; Fri, 2 Dec 2016 08:24:01 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB28O0Wr001824; Fri, 2 Dec 2016 08:24:00 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB28O0Qv001823; Fri, 2 Dec 2016 08:24:00 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201612020824.uB28O0Qv001823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Fri, 2 Dec 2016 08:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309402 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 08:24:01 -0000 Author: julian Date: Fri Dec 2 08:24:00 2016 New Revision: 309402 URL: https://svnweb.freebsd.org/changeset/base/309402 Log: MFH: r309295 bhyve: stability and performance improvement for dbgport The TCP server implementation in dbgport does not track clients, so it may try to write to a disconected socket resulting in SIGPIPE. Avoid that by setting SO_NOSIGPIPE socket option. Because dbgport emulates an I/O port to guest, the communication is done byte by byte. Reduce latency of the TCP/IP transfers by using TCP_NODELAY option. In my tests that change improves performance of kgdb commands with lots of output (e.g. info threads) by two orders of magnitude. A general note. Since we have a uart emulation in bhyve, that can be used for the console and gdb access to guests. So, bvmconsole and bvmdebug could be de-orbited now. But there are many existing deployments that still dependend on those. Discussed with: julian, jhb Sponsored by: Panzura Modified: stable/11/usr.sbin/bhyve/dbgport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/dbgport.c ============================================================================== --- stable/11/usr.sbin/bhyve/dbgport.c Fri Dec 2 08:21:25 2016 (r309401) +++ stable/11/usr.sbin/bhyve/dbgport.c Fri Dec 2 08:24:00 2016 (r309402) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -55,8 +56,9 @@ static int dbg_handler(struct vmctx *ctx, int vcpu, int in, int port, int bytes, uint32_t *eax, void *arg) { - char ch; int nwritten, nread, printonce; + int on = 1; + char ch; if (bytes == 2 && in) { *eax = BVM_DBG_SIG; @@ -74,8 +76,16 @@ again: printonce = 1; } conn_fd = accept4(listen_fd, NULL, NULL, SOCK_NONBLOCK); - if (conn_fd < 0 && errno != EINTR) + if (conn_fd >= 0) { + /* Avoid EPIPE after the client drops off. */ + (void)setsockopt(conn_fd, SOL_SOCKET, SO_NOSIGPIPE, + &on, sizeof(on)); + /* Improve latency for one byte at a time tranfers. */ + (void)setsockopt(conn_fd, IPPROTO_TCP, TCP_NODELAY, + &on, sizeof(on)); + } else if (errno != EINTR) { perror("accept"); + } } if (in) { From owner-svn-src-all@freebsd.org Fri Dec 2 09:26:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47EABC5F5F3; Fri, 2 Dec 2016 09:26:53 +0000 (UTC) (envelope-from mm@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 1C7AE1747; Fri, 2 Dec 2016 09:26:53 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB29QqUi030824; Fri, 2 Dec 2016 09:26:52 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB29Qq79030822; Fri, 2 Dec 2016 09:26:52 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201612020926.uB29Qq79030822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 2 Dec 2016 09:26:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r309403 - vendor/libarchive/dist/libarchive X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 09:26:53 -0000 Author: mm Date: Fri Dec 2 09:26:51 2016 New Revision: 309403 URL: https://svnweb.freebsd.org/changeset/base/309403 Log: Update vendor/libarchive to git 53d73345410d69e68171f05facaf4523e38e72bb Vendor bugfixes: Fix for heap-buffer-overflow in archive_le16dec() Fix for heap-buffer-overflow in uudecode_bidder_bid() Reworked fix for compatibility with archives created by Perl Archive::Tar Modified: vendor/libarchive/dist/libarchive/archive_read_support_filter_uu.c vendor/libarchive/dist/libarchive/archive_read_support_format_cab.c vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c Modified: vendor/libarchive/dist/libarchive/archive_read_support_filter_uu.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_filter_uu.c Fri Dec 2 08:24:00 2016 (r309402) +++ vendor/libarchive/dist/libarchive/archive_read_support_filter_uu.c Fri Dec 2 09:26:51 2016 (r309403) @@ -312,6 +312,7 @@ uudecode_bidder_bid(struct archive_read_ avail -= len; if (l == 6) { + /* "begin " */ if (!uuchar[*b]) return (0); /* Get a length of decoded bytes. */ @@ -352,8 +353,8 @@ uudecode_bidder_bid(struct archive_read_ b += nl; if (avail && uuchar[*b]) return (firstline+30); - } - if (l == 13) { + } else if (l == 13) { + /* "begin-base64 " */ while (len-nl > 0) { if (!base64[*b++]) return (0); Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_cab.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_cab.c Fri Dec 2 08:24:00 2016 (r309402) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_cab.c Fri Dec 2 09:26:51 2016 (r309403) @@ -645,12 +645,13 @@ cab_read_header(struct archive_read *a) cab = (struct cab *)(a->format->data); if (cab->found_header == 0 && p[0] == 'M' && p[1] == 'Z') { - /* This is an executable? Must be self-extracting... */ + /* This is an executable? Must be self-extracting... */ err = cab_skip_sfx(a); if (err < ARCHIVE_WARN) return (err); - if ((p = __archive_read_ahead(a, sizeof(*p), NULL)) == NULL) + /* Re-read header after processing the SFX. */ + if ((p = __archive_read_ahead(a, 42, NULL)) == NULL) return (truncated_error(a)); } Modified: vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c ============================================================================== --- vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c Fri Dec 2 08:24:00 2016 (r309402) +++ vendor/libarchive/dist/libarchive/archive_read_support_format_tar.c Fri Dec 2 09:26:51 2016 (r309403) @@ -297,58 +297,50 @@ archive_read_format_tar_cleanup(struct a /* * Validate number field * - * Flags: - * 1 - allow double \0 at field end + * This has to be pretty lenient in order to accomodate the enormous + * variety of tar writers in the world: + * = POSIX ustar requires octal values with leading zeros and + * specific termination on fields + * = Many writers use different termination (in particular, libarchive + * omits terminator bytes to squeeze one or two more digits) + * = Many writers pad with space and omit leading zeros + * = GNU tar and star write base-256 values if numbers are too + * big to be represented in octal + * + * This should tolerate all variants in use. It will reject a field + * where the writer just left garbage after a trailing NUL. */ static int -validate_number_field(const char* p_field, size_t i_size, int flags) +validate_number_field(const char* p_field, size_t i_size) { unsigned char marker = (unsigned char)p_field[0]; - /* octal? */ - if ((marker >= '0' && marker <= '7') || marker == ' ') { + if (marker == 128 || marker == 255 || marker == 0) { + /* Base-256 marker, there's nothing we can check. */ + return 1; + } else { + /* Must be octal */ size_t i = 0; - int octal_found = 0; - for (i = 0; i < i_size; ++i) { - switch (p_field[i]) - { - case ' ': - /* skip any leading spaces and trailing space */ - if (octal_found == 0 || i == i_size - 1) { - continue; - } - break; - case '\0': - /* - * null should be allowed only at the end - * - * Perl Archive::Tar terminates some fields - * with two nulls. We must allow this to stay - * compatible. - */ - if (i != i_size - 1) { - if (((flags & 1) == 0) - || i != i_size - 2) - return 0; - } - break; - /* rest must be octal digits */ - case '0': case '1': case '2': case '3': - case '4': case '5': case '6': case '7': - ++octal_found; - break; + /* Skip any leading spaces */ + while (i < i_size && p_field[i] == ' ') { + ++i; + } + /* Must be at least one octal digit. */ + if (i >= i_size || p_field[i] < '0' || p_field[i] > '7') { + return 0; + } + /* Skip remaining octal digits. */ + while (i < i_size && p_field[i] >= '0' && p_field[i] <= '7') { + ++i; + } + /* Any remaining characters must be space or NUL padding. */ + while (i < i_size) { + if (p_field[i] != ' ' && p_field[i] != 0) { + return 0; } + ++i; } - return octal_found > 0; - } - /* base 256 (i.e. binary number) */ - else if (marker == 128 || marker == 255 || marker == 0) { - /* nothing to check */ return 1; } - /* not a number field */ - else { - return 0; - } } static int @@ -404,26 +396,15 @@ archive_read_format_tar_bid(struct archi /* * Check format of mode/uid/gid/mtime/size/rdevmajor/rdevminor fields. - * These are usually octal numbers but GNU tar encodes "big" values as - * base256 and leading zeroes are sometimes replaced by spaces. - * Even the null terminator is sometimes omitted. Anyway, must be - * checked to avoid false positives. - * - * Perl Archive::Tar does not follow the spec and terminates mode, uid, - * gid, rdevmajor and rdevminor with a double \0. For compatibility - * reasons we allow this deviation. */ if (bid > 0 && ( - validate_number_field(header->mode, sizeof(header->mode), 1) == 0 - || validate_number_field(header->uid, sizeof(header->uid), 1) == 0 - || validate_number_field(header->gid, sizeof(header->gid), 1) == 0 - || validate_number_field(header->mtime, sizeof(header->mtime), - 0) == 0 - || validate_number_field(header->size, sizeof(header->size), 0) == 0 - || validate_number_field(header->rdevmajor, - sizeof(header->rdevmajor), 1) == 0 - || validate_number_field(header->rdevminor, - sizeof(header->rdevminor), 1) == 0)) { + validate_number_field(header->mode, sizeof(header->mode)) == 0 + || validate_number_field(header->uid, sizeof(header->uid)) == 0 + || validate_number_field(header->gid, sizeof(header->gid)) == 0 + || validate_number_field(header->mtime, sizeof(header->mtime)) == 0 + || validate_number_field(header->size, sizeof(header->size)) == 0 + || validate_number_field(header->rdevmajor, sizeof(header->rdevmajor)) == 0 + || validate_number_field(header->rdevminor, sizeof(header->rdevminor)) == 0)) { bid = 0; } From owner-svn-src-all@freebsd.org Fri Dec 2 09:29:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03E12C5F66C; Fri, 2 Dec 2016 09:29:24 +0000 (UTC) (envelope-from hselasky@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 C76D218EB; Fri, 2 Dec 2016 09:29:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB29TM6J030969; Fri, 2 Dec 2016 09:29:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB29TM9v030968; Fri, 2 Dec 2016 09:29:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201612020929.uB29TM9v030968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 2 Dec 2016 09:29:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309404 - head/sys/netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 09:29:24 -0000 Author: hselasky Date: Fri Dec 2 09:29:22 2016 New Revision: 309404 URL: https://svnweb.freebsd.org/changeset/base/309404 Log: Fix return value from ng_uncallout(). callout_stop() recently started returning -1 when the callout is already stopped, which is not handled by the netgraph code. Properly filter the return value. Netgraph callers only want to know if the callout was cancelled and not draining or already stopped. Discussed with: julian, glebius MFC after: 2 weeks Modified: head/sys/netgraph/ng_base.c Modified: head/sys/netgraph/ng_base.c ============================================================================== --- head/sys/netgraph/ng_base.c Fri Dec 2 09:26:51 2016 (r309403) +++ head/sys/netgraph/ng_base.c Fri Dec 2 09:29:22 2016 (r309404) @@ -3825,7 +3825,11 @@ ng_uncallout(struct callout *c, node_p n } c->c_arg = NULL; - return (rval); + /* + * Callers only want to know if the callout was cancelled and + * not draining or stopped. + */ + return (rval > 0); } /* From owner-svn-src-all@freebsd.org Fri Dec 2 09:30:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECCECC5F70A; Fri, 2 Dec 2016 09:30:14 +0000 (UTC) (envelope-from mm@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 C79971A7C; Fri, 2 Dec 2016 09:30:14 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB29UD7H031067; Fri, 2 Dec 2016 09:30:13 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB29UDQR031063; Fri, 2 Dec 2016 09:30:13 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201612020930.uB29UDQR031063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 2 Dec 2016 09:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309405 - head/contrib/libarchive/libarchive X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 09:30:15 -0000 Author: mm Date: Fri Dec 2 09:30:13 2016 New Revision: 309405 URL: https://svnweb.freebsd.org/changeset/base/309405 Log: MFV r309403: Sync libarchive with vendor. Vendor bugfixes: Fix for heap-buffer-overflow in archive_le16dec() Fix for heap-buffer-overflow in uudecode_bidder_bid() Reworked fix for compatibility with archives created by Perl Archive::Tar MFC after: 1 week Modified: head/contrib/libarchive/libarchive/archive_read_support_filter_uu.c head/contrib/libarchive/libarchive/archive_read_support_format_cab.c head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Directory Properties: head/contrib/libarchive/ (props changed) Modified: head/contrib/libarchive/libarchive/archive_read_support_filter_uu.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_filter_uu.c Fri Dec 2 09:29:22 2016 (r309404) +++ head/contrib/libarchive/libarchive/archive_read_support_filter_uu.c Fri Dec 2 09:30:13 2016 (r309405) @@ -312,6 +312,7 @@ uudecode_bidder_bid(struct archive_read_ avail -= len; if (l == 6) { + /* "begin " */ if (!uuchar[*b]) return (0); /* Get a length of decoded bytes. */ @@ -352,8 +353,8 @@ uudecode_bidder_bid(struct archive_read_ b += nl; if (avail && uuchar[*b]) return (firstline+30); - } - if (l == 13) { + } else if (l == 13) { + /* "begin-base64 " */ while (len-nl > 0) { if (!base64[*b++]) return (0); Modified: head/contrib/libarchive/libarchive/archive_read_support_format_cab.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_cab.c Fri Dec 2 09:29:22 2016 (r309404) +++ head/contrib/libarchive/libarchive/archive_read_support_format_cab.c Fri Dec 2 09:30:13 2016 (r309405) @@ -645,12 +645,13 @@ cab_read_header(struct archive_read *a) cab = (struct cab *)(a->format->data); if (cab->found_header == 0 && p[0] == 'M' && p[1] == 'Z') { - /* This is an executable? Must be self-extracting... */ + /* This is an executable? Must be self-extracting... */ err = cab_skip_sfx(a); if (err < ARCHIVE_WARN) return (err); - if ((p = __archive_read_ahead(a, sizeof(*p), NULL)) == NULL) + /* Re-read header after processing the SFX. */ + if ((p = __archive_read_ahead(a, 42, NULL)) == NULL) return (truncated_error(a)); } Modified: head/contrib/libarchive/libarchive/archive_read_support_format_tar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Fri Dec 2 09:29:22 2016 (r309404) +++ head/contrib/libarchive/libarchive/archive_read_support_format_tar.c Fri Dec 2 09:30:13 2016 (r309405) @@ -297,58 +297,50 @@ archive_read_format_tar_cleanup(struct a /* * Validate number field * - * Flags: - * 1 - allow double \0 at field end + * This has to be pretty lenient in order to accomodate the enormous + * variety of tar writers in the world: + * = POSIX ustar requires octal values with leading zeros and + * specific termination on fields + * = Many writers use different termination (in particular, libarchive + * omits terminator bytes to squeeze one or two more digits) + * = Many writers pad with space and omit leading zeros + * = GNU tar and star write base-256 values if numbers are too + * big to be represented in octal + * + * This should tolerate all variants in use. It will reject a field + * where the writer just left garbage after a trailing NUL. */ static int -validate_number_field(const char* p_field, size_t i_size, int flags) +validate_number_field(const char* p_field, size_t i_size) { unsigned char marker = (unsigned char)p_field[0]; - /* octal? */ - if ((marker >= '0' && marker <= '7') || marker == ' ') { + if (marker == 128 || marker == 255 || marker == 0) { + /* Base-256 marker, there's nothing we can check. */ + return 1; + } else { + /* Must be octal */ size_t i = 0; - int octal_found = 0; - for (i = 0; i < i_size; ++i) { - switch (p_field[i]) - { - case ' ': - /* skip any leading spaces and trailing space */ - if (octal_found == 0 || i == i_size - 1) { - continue; - } - break; - case '\0': - /* - * null should be allowed only at the end - * - * Perl Archive::Tar terminates some fields - * with two nulls. We must allow this to stay - * compatible. - */ - if (i != i_size - 1) { - if (((flags & 1) == 0) - || i != i_size - 2) - return 0; - } - break; - /* rest must be octal digits */ - case '0': case '1': case '2': case '3': - case '4': case '5': case '6': case '7': - ++octal_found; - break; + /* Skip any leading spaces */ + while (i < i_size && p_field[i] == ' ') { + ++i; + } + /* Must be at least one octal digit. */ + if (i >= i_size || p_field[i] < '0' || p_field[i] > '7') { + return 0; + } + /* Skip remaining octal digits. */ + while (i < i_size && p_field[i] >= '0' && p_field[i] <= '7') { + ++i; + } + /* Any remaining characters must be space or NUL padding. */ + while (i < i_size) { + if (p_field[i] != ' ' && p_field[i] != 0) { + return 0; } + ++i; } - return octal_found > 0; - } - /* base 256 (i.e. binary number) */ - else if (marker == 128 || marker == 255 || marker == 0) { - /* nothing to check */ return 1; } - /* not a number field */ - else { - return 0; - } } static int @@ -404,26 +396,15 @@ archive_read_format_tar_bid(struct archi /* * Check format of mode/uid/gid/mtime/size/rdevmajor/rdevminor fields. - * These are usually octal numbers but GNU tar encodes "big" values as - * base256 and leading zeroes are sometimes replaced by spaces. - * Even the null terminator is sometimes omitted. Anyway, must be - * checked to avoid false positives. - * - * Perl Archive::Tar does not follow the spec and terminates mode, uid, - * gid, rdevmajor and rdevminor with a double \0. For compatibility - * reasons we allow this deviation. */ if (bid > 0 && ( - validate_number_field(header->mode, sizeof(header->mode), 1) == 0 - || validate_number_field(header->uid, sizeof(header->uid), 1) == 0 - || validate_number_field(header->gid, sizeof(header->gid), 1) == 0 - || validate_number_field(header->mtime, sizeof(header->mtime), - 0) == 0 - || validate_number_field(header->size, sizeof(header->size), 0) == 0 - || validate_number_field(header->rdevmajor, - sizeof(header->rdevmajor), 1) == 0 - || validate_number_field(header->rdevminor, - sizeof(header->rdevminor), 1) == 0)) { + validate_number_field(header->mode, sizeof(header->mode)) == 0 + || validate_number_field(header->uid, sizeof(header->uid)) == 0 + || validate_number_field(header->gid, sizeof(header->gid)) == 0 + || validate_number_field(header->mtime, sizeof(header->mtime)) == 0 + || validate_number_field(header->size, sizeof(header->size)) == 0 + || validate_number_field(header->rdevmajor, sizeof(header->rdevmajor)) == 0 + || validate_number_field(header->rdevminor, sizeof(header->rdevminor)) == 0)) { bid = 0; } From owner-svn-src-all@freebsd.org Fri Dec 2 09:41:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43481C5FCAD; Fri, 2 Dec 2016 09:41:56 +0000 (UTC) (envelope-from hselasky@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 1E10D12A6; Fri, 2 Dec 2016 09:41:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB29ftLA037891; Fri, 2 Dec 2016 09:41:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB29ftOi037889; Fri, 2 Dec 2016 09:41:55 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201612020941.uB29ftOi037889@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 2 Dec 2016 09:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309406 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 09:41:56 -0000 Author: hselasky Date: Fri Dec 2 09:41:54 2016 New Revision: 309406 URL: https://svnweb.freebsd.org/changeset/base/309406 Log: Remove useless NULL checks. NULL is not returned when allocating memory passing the M_WAITOK flag. Submitted by: trasz @ Differential Revision: https://reviews.freebsd.org/D5772 Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Fri Dec 2 09:30:13 2016 (r309405) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_flow_table.c Fri Dec 2 09:41:54 2016 (r309406) @@ -854,8 +854,6 @@ mlx5e_create_main_flow_table(struct mlx5 u8 *dmac; g = malloc(9 * sizeof(*g), M_MLX5EN, M_WAITOK | M_ZERO); - if (g == NULL) - return (-ENOMEM); g[0].log_sz = 2; g[0].match_criteria_enable = MLX5_MATCH_OUTER_HEADERS; @@ -939,8 +937,6 @@ mlx5e_create_vlan_flow_table(struct mlx5 struct mlx5_flow_table_group *g; g = malloc(2 * sizeof(*g), M_MLX5EN, M_WAITOK | M_ZERO); - if (g == NULL) - return (-ENOMEM); g[0].log_sz = 12; g[0].match_criteria_enable = MLX5_MATCH_OUTER_HEADERS; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Dec 2 09:30:13 2016 (r309405) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Dec 2 09:41:54 2016 (r309406) @@ -656,10 +656,6 @@ mlx5e_create_rq(struct mlx5e_channel *c, goto err_rq_wq_destroy; rq->mbuf = malloc(wq_sz * sizeof(rq->mbuf[0]), M_MLX5EN, M_WAITOK | M_ZERO); - if (rq->mbuf == NULL) { - err = -ENOMEM; - goto err_lro_init; - } for (i = 0; i != wq_sz; i++) { struct mlx5e_rx_wqe *wqe = mlx5_wq_ll_get_wqe(&rq->wq, i); uint32_t byte_count = rq->wqe_sz - MLX5E_NET_IP_ALIGN; @@ -686,7 +682,6 @@ mlx5e_create_rq(struct mlx5e_channel *c, err_rq_mbuf_free: free(rq->mbuf, M_MLX5EN); -err_lro_init: tcp_lro_free(&rq->lro); err_rq_wq_destroy: mlx5_wq_destroy(&rq->wq_ctrl); @@ -897,8 +892,6 @@ mlx5e_alloc_sq_db(struct mlx5e_sq *sq) int x; sq->mbuf = malloc(wq_sz * sizeof(sq->mbuf[0]), M_MLX5EN, M_WAITOK | M_ZERO); - if (sq->mbuf == NULL) - return (-ENOMEM); /* Create DMA descriptor MAPs */ for (x = 0; x != wq_sz; x++) { @@ -1486,9 +1479,6 @@ mlx5e_open_channel(struct mlx5e_priv *pr int err; c = malloc(sizeof(*c), M_MLX5EN, M_WAITOK | M_ZERO); - if (c == NULL) - return (-ENOMEM); - c->priv = priv; c->ix = ix; c->cpu = 0; @@ -1699,8 +1689,6 @@ mlx5e_open_channels(struct mlx5e_priv *p priv->channel = malloc(priv->params.num_channels * sizeof(struct mlx5e_channel *), M_MLX5EN, M_WAITOK | M_ZERO); - if (priv->channel == NULL) - return (-ENOMEM); mlx5e_build_channel_param(priv, &cparam); for (i = 0; i < priv->params.num_channels; i++) { @@ -2879,10 +2867,6 @@ mlx5e_create_ifp(struct mlx5_core_dev *m return (NULL); } priv = malloc(sizeof(*priv), M_MLX5EN, M_WAITOK | M_ZERO); - if (priv == NULL) { - mlx5_core_err(mdev, "malloc() failed\n"); - return (NULL); - } mlx5e_priv_mtx_init(priv); ifp = priv->ifp = if_alloc(IFT_ETHER); From owner-svn-src-all@freebsd.org Fri Dec 2 09:51:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4045C5FE6D; Fri, 2 Dec 2016 09:51:13 +0000 (UTC) (envelope-from julian@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 7E9E316BA; Fri, 2 Dec 2016 09:51:13 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB29pCRw042578; Fri, 2 Dec 2016 09:51:12 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB29pCMc042577; Fri, 2 Dec 2016 09:51:12 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201612020951.uB29pCMc042577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Fri, 2 Dec 2016 09:51:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309407 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 09:51:13 -0000 Author: julian Date: Fri Dec 2 09:51:12 2016 New Revision: 309407 URL: https://svnweb.freebsd.org/changeset/base/309407 Log: A little light wordsmithing only. Sponsored by: FreeBSD Modified: head/share/man/man4/ng_checksum.4 Modified: head/share/man/man4/ng_checksum.4 ============================================================================== --- head/share/man/man4/ng_checksum.4 Fri Dec 2 09:41:54 2016 (r309406) +++ head/share/man/man4/ng_checksum.4 Fri Dec 2 09:51:12 2016 (r309407) @@ -29,26 +29,26 @@ .Os .Sh NAME .Nm ng_checksum -.Nd IP checksum node type +.Nd reconstructing IP checksums node type .Sh SYNOPSIS .In netgraph/ng_checksum.h .Sh DESCRIPTION The .Nm checksum -node can calculate and prepare for calculation in hardware -IPv4 header, TCP, UDP checksum. +node can calculate, or prepare for calculation in hardware, +IPv4 header, TCP and UDP checksums. .Sh HOOKS This node type has two hooks: .Bl -tag -width ".Va out" .It Va in Packets received on this hook are processed according to settings specified -in config and then forwarded to +in config and then forwarded to the .Ar out -hook, if it exists and connected. Otherwise they are reflected back to the +hook, if it exists and is connected. Otherwise they are reflected back to the .Ar in hook. .It Va out -Packets received on this hook are forwarded to +Packets received on this hook are forwarded to the .Ar in hook without any changes. .El @@ -56,13 +56,13 @@ hook without any changes. This node type supports the generic control messages, plus the following: .Bl -tag -width foo .It Dv NGM_CHECKSUM_SETDLT Pq Ic setdlt -Sets data link type on the +Sets the data link type on the .Va in hook. Currently, supported types are .Cm DLT_RAW (raw IP datagrams) and .Cm DLT_EN10MB -(Ethernet). DLT_ definitions can be found in +(Ethernet). DLT_ definitions can be found in the .In net/bpf.h header. Currently used values are .Cm DLT_EN10MB @@ -70,11 +70,11 @@ header. Currently used values are .Cm DLT_RAW = 12. .It Dv NGM_CHECKSUM_GETDLT Pq Ic getdlt -This control message obtains data link type on the +This control message obtains the data link type on the .Va in hook. .It Dv NGM_CHECKSUM_SETCONFIG Pq Ic setconfig -Sets node configuration. The following +Sets the node configuration. The following .Vt "struct ng_checksum_config" must be supplied as an argument: .Bd -literal -offset 4n @@ -87,23 +87,24 @@ struct ng_checksum_config { The .Va csum_flags can be set to any combination of CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 -(other values are ignored) for instructing node need calculate the corresponding checksum. +(other values are ignored) for instructing the node to calculate the corresponding checksum. .Pp The .Va csum_offload -can be set to any combination of CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 -(other values are ignored) for instructing node what checksum can calculate in hardware. +value can be set to any combination of CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 +(other values are ignored) for instructing the node what checksums should be requested from the hardware. .Pp -Also processed any combination of CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 sets before on mbuf. +The node also takes into account any combination of +CSUM_IP, CSUM_TCP, CSUM_UDP, CSUM_TCP_IPV6 and CSUM_UDP_IPV6 already +flagged on the mbuf. .It Dv NGM_CHECKSUM_GETCONFIG Pq Ic getconfig -This control message obtains current node configuration, -returned as +This control message obtains the current node configuration returned as a .Vt "struct ng_checksum_config" . .It Dv NGM_CHECKSUM_GET_STATS Pq Ic getstats Returns node statistics as a .Vt "struct ng_checksum_stats" . .It Dv NGM_CHECKSUM_CLR_STATS Pq Ic clrstats -Clear node statistics. +Clear the node statistics. .It Dv NGM_CHECKSUM_GETCLR_STATS Pq Ic getclrstats This command is identical to .Dv NGM_CHECKSUM_GET_STATS , @@ -118,14 +119,15 @@ control message, or when all hooks have script: .Bd -literal -offset 4n /usr/sbin/ngctl -f- <<-SEQ - msg checksum-1: "setdlt 1" - ngctl msg checksum-1: "setconfig { csum_flags=0 csum_offload=6 }" + msg checksum-1: setdlt 1 + msg checksum-1: setconfig { csum_flags=0 csum_offload=6 } +SEQ .Ed .Pp -Set data link type to +Set the data link type to .Cm DLT_EN10MB -(Ethernet), not set additional checksum flags, set hardware -can calculate CSUM_IP_UDP|CSUM_IP_TCP. +(Ethernet), do not set additional checksum flags +and request that the hardware calculate CSUM_IP_UDP|CSUM_IP_TCP. .Sh SEE ALSO .Xr netgraph 4 , .Xr ng_patch 4 , From owner-svn-src-all@freebsd.org Fri Dec 2 10:47:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72946C610CD; Fri, 2 Dec 2016 10:47:11 +0000 (UTC) (envelope-from julian@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 414AE1543; Fri, 2 Dec 2016 10:47:11 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2AlAT5063532; Fri, 2 Dec 2016 10:47:10 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2AlAIV063529; Fri, 2 Dec 2016 10:47:10 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201612021047.uB2AlAIV063529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Fri, 2 Dec 2016 10:47:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309408 - in head: share/man/man4 sys/netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 10:47:11 -0000 Author: julian Date: Fri Dec 2 10:47:10 2016 New Revision: 309408 URL: https://svnweb.freebsd.org/changeset/base/309408 Log: Changes to allow the patching of packets with an offset (and other changes.. see man page) PR: 206185 Submitted by: Dmitry Vagin MFC after: 1 week Relnotes: yes (also ng_checksum node) Modified: head/share/man/man4/ng_patch.4 head/sys/netgraph/ng_patch.c head/sys/netgraph/ng_patch.h Modified: head/share/man/man4/ng_patch.4 ============================================================================== --- head/share/man/man4/ng_patch.4 Fri Dec 2 09:51:12 2016 (r309407) +++ head/share/man/man4/ng_patch.4 Fri Dec 2 10:47:10 2016 (r309408) @@ -1,5 +1,6 @@ .\" Copyright (c) 2010 Maxim Ignatenko .\" Copyright (c) 2010 Vadim Goncharov +.\" Copyright (c) 2015 Dmitry Vagin .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -25,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 5, 2012 +.Dd November 17, 2015 .Dt NG_PATCH 4 .Os .Sh NAME @@ -47,33 +48,52 @@ A negation operation is the one exceptio and second operand (the .Va value ) is not used. -There may be several modification operations, they are all applied -to a packet sequentially in order they were specified by user. -Data payload of packet is viewed as array of bytes, with zero offset -corresponding to the very first byte of packet headers, and +If there is more than one modification operation, they are applied +to packets sequentially in the order they were specified by the user. +The data payload of a packet is viewed as an array of bytes, with a zero offset +corresponding to the very first byte of packet headers, and the .Va length bytes beginning from .Va offset -are taken as a single integer in network byte order. +as a single integer in network byte order. An additional offset can be optionally +requested at configuration time to account for packet type. .Sh HOOKS This node type has two hooks: .Bl -tag -width ".Va out" .It Va in Packets received on this hook are modified according to rules specified -in config and then forwarded to +in the configuration and then forwarded to the .Ar out -hook, if it exists and connected. +hook, if it exists. Otherwise they are reflected back to the .Ar in hook. .It Va out -Packets received on this hook are forwarded to +Packets received on this hook are forwarded to the .Ar in hook without any changes. .El .Sh CONTROL MESSAGES This node type supports the generic control messages, plus the following: .Bl -tag -width foo +.It Dv NGM_PATCH_SETDLT Pq Ic setdlt +Sets the data link type on the +.Va in +hook (to help calculate relative offset). Currently, supported types are +.Cm DLT_RAW +(raw IP datagrams , no offset applied, the default) and +.Cm DLT_EN10MB +(Ethernet). DLT_ definitions can be found in +.In net/bpf.h . +If you want to work on the link layer header you must use no additional offset by specifying +.Cm DLT_RAW . +If +.Cm EN10MB +is specified, then the optional additional offset will take into account the Ethernet header and a QinQ header if present. +.It Dv NGM_PATCH_GETDLT Pq Ic getdlt +This control message returns the data link type of the +.Va in +hook. .It Dv NGM_PATCH_SETCONFIG Pq Ic setconfig This command sets the sequence of modify operations that will be applied to incoming data on a hook. @@ -82,10 +102,10 @@ The following must be supplied as an argument: .Bd -literal -offset 4n struct ng_patch_op { - uint64_t value; uint32_t offset; uint16_t length; /* 1,2,4 or 8 bytes */ uint16_t mode; + uint64_t value; }; /* Patching modes */ #define NG_PATCH_MODE_SET 1 @@ -103,6 +123,7 @@ struct ng_patch_op { struct ng_patch_config { uint32_t count; uint32_t csum_flags; + uint32_t relative_offset; struct ng_patch_op ops[]; }; .Ed @@ -116,14 +137,14 @@ The .Nm node does not do any checksum correction by itself. .It Dv NGM_PATCH_GETCONFIG Pq Ic getconfig -This control message obtains current set of modify operations, -returned as +This control message returns the current set of modify operations, +in the form of a .Vt "struct ng_patch_config" . .It Dv NGM_PATCH_GET_STATS Pq Ic getstats -Returns node statistics as a +Returns the node's statistics as a .Vt "struct ng_patch_stats" . .It Dv NGM_PATCH_CLR_STATS Pq Ic clrstats -Clear node statistics. +Clears the node's statistics. .It Dv NGM_PATCH_GETCLR_STATS Pq Ic getclrstats This command is identical to .Dv NGM_PATCH_GET_STATS , @@ -134,19 +155,20 @@ This node shuts down upon receipt of a .Dv NGM_SHUTDOWN control message, or when all hooks have been disconnected. .Sh EXAMPLES -The +This .Nm -node allows to modify TTL and TOS/DSCP fields in IP packets. -Suppose you have two adjacent simplex links to remote network +node was designed to modify TTL and TOS/DSCP fields in IP packets. +As an example, +suppose you have two adjacent simplex links to a remote network (e.g.\& satellite), so that the packets expiring in between will generate unwanted ICMP-replies which have to go forth, not back. Thus you need to raise TTL of every packet entering link by 2 to ensure the TTL will not reach zero there. -So you setup +To achieve this you can set an .Xr ipfw 8 -rule with +rule to use the .Cm netgraph -action to inject packets going to other end of simplex link by the +action to inject packets which are going to the simplex link into the patch node, by using the following .Xr ngctl 8 script: @@ -160,11 +182,11 @@ SEQ /sbin/ipfw add 150 netgraph 200 ip from any to simplex.remote.net .Ed .Pp -Here +Here the .Dq Li ttl_add node of type .Nm -configured to add (mode +is configured to add (mode .Dv NG_PATCH_MODE_ADD ) a .Va value @@ -218,13 +240,15 @@ The node type was implemented in .Fx 8.1 . .Sh AUTHORS -.An Maxim Ignatenko Aq Mt gelraen.ua@gmail.com +.An "Maxim Ignatenko" Aq gelraen.ua@gmail.com . +.Pp +Relative offset code by +.An "DMitry Vagin" .Pp -.An -nosplit This manual page was written by -.An Vadim Goncharov Aq Mt vadimnuclight@tpu.ru . +.An "Vadim Goncharov" Aq vadimnuclight@tpu.ru . .Sh BUGS -Node blindly tries to apply every patching operation to each packet +The node blindly tries to apply every patching operation to each packet (except those which offset if greater than length of the packet), so be sure that you supply only the right packets to it (e.g. changing bytes in the ARP packets meant to be in IP header could corrupt @@ -232,6 +256,6 @@ them and make your machine unreachable f .Pp .Em !!! WARNING !!! .Pp -Output path of the IP stack assumes correct fields and lengths in the -packets - changing them by mistake to incorrect values can cause +The output path of the IP stack assumes correct fields and lengths in the +packets - changing them by to incorrect values can cause unpredictable results including kernel panics. Modified: head/sys/netgraph/ng_patch.c ============================================================================== --- head/sys/netgraph/ng_patch.c Fri Dec 2 09:51:12 2016 (r309407) +++ head/sys/netgraph/ng_patch.c Fri Dec 2 10:47:10 2016 (r309408) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2010 Maxim Ignatenko + * Copyright (c) 2010 Maxim Ignatenko + * Copyright (c) 2015 Dmitry Vagin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,11 +35,28 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#include +#include + #include #include -#include #include +#include + +/* private data */ +struct ng_patch_priv { + hook_p in; + hook_p out; + uint8_t dlt; /* DLT_XXX from bpf.h */ + struct ng_patch_stats stats; + struct ng_patch_config *conf; +}; + +typedef struct ng_patch_priv *priv_p; + +/* Netgraph methods */ static ng_constructor_t ng_patch_constructor; static ng_rcvmsg_t ng_patch_rcvmsg; static ng_shutdown_t ng_patch_shutdown; @@ -46,6 +64,8 @@ static ng_newhook_t ng_patch_newhook; static ng_rcvdata_t ng_patch_rcvdata; static ng_disconnect_t ng_patch_disconnect; +#define ERROUT(x) { error = (x); goto done; } + static int ng_patch_config_getlen(const struct ng_parse_type *type, const u_char *start, const u_char *buf) @@ -59,7 +79,7 @@ ng_patch_config_getlen(const struct ng_p } static const struct ng_parse_struct_field ng_patch_op_type_fields[] - = NG_PATCH_OP_TYPE_INFO; + = NG_PATCH_OP_TYPE; static const struct ng_parse_type ng_patch_op_type = { &ng_parse_struct_type, &ng_patch_op_type_fields @@ -75,14 +95,14 @@ static const struct ng_parse_type ng_pat }; static const struct ng_parse_struct_field ng_patch_config_type_fields[] - = NG_PATCH_CONFIG_TYPE_INFO; + = NG_PATCH_CONFIG_TYPE; static const struct ng_parse_type ng_patch_config_type = { &ng_parse_struct_type, &ng_patch_config_type_fields }; static const struct ng_parse_struct_field ng_patch_stats_fields[] - = NG_PATCH_STATS_TYPE_INFO; + = NG_PATCH_STATS_TYPE; static const struct ng_parse_type ng_patch_stats_type = { &ng_parse_struct_type, &ng_patch_stats_fields @@ -91,6 +111,20 @@ static const struct ng_parse_type ng_pat static const struct ng_cmdlist ng_patch_cmdlist[] = { { NGM_PATCH_COOKIE, + NGM_PATCH_GETDLT, + "getdlt", + NULL, + &ng_parse_uint8_type + }, + { + NGM_PATCH_COOKIE, + NGM_PATCH_SETDLT, + "setdlt", + &ng_parse_uint8_type, + NULL + }, + { + NGM_PATCH_COOKIE, NGM_PATCH_GETCONFIG, "getconfig", NULL, @@ -141,38 +175,16 @@ static struct ng_type typestruct = { NETGRAPH_INIT(patch, &typestruct); -union patch_val { - uint8_t v1; - uint16_t v2; - uint32_t v4; - uint64_t v8; -}; - -/* private data */ -struct ng_patch_priv { - hook_p in; - hook_p out; - struct ng_patch_config *config; - union patch_val *val; - struct ng_patch_stats stats; -}; -typedef struct ng_patch_priv *priv_p; - -#define NG_PATCH_CONF_SIZE(count) (sizeof(struct ng_patch_config) + \ - (count) * sizeof(struct ng_patch_op)) - -static void do_patch(priv_p conf, struct mbuf *m); - static int ng_patch_constructor(node_p node) { priv_p privdata; privdata = malloc(sizeof(*privdata), M_NETGRAPH, M_WAITOK | M_ZERO); + privdata->dlt = DLT_RAW; + NG_NODE_SET_PRIVATE(node, privdata); - privdata->in = NULL; - privdata->out = NULL; - privdata->config = NULL; + return (0); } @@ -188,7 +200,8 @@ ng_patch_newhook(node_p node, hook_p hoo privp->out = hook; } else return (EINVAL); - return(0); + + return (0); } static int @@ -196,308 +209,341 @@ ng_patch_rcvmsg(node_p node, item_p item { const priv_p privp = NG_NODE_PRIVATE(node); struct ng_patch_config *conf, *newconf; - union patch_val *newval; struct ng_mesg *msg; - struct ng_mesg *resp; - int i, clear, error; + struct ng_mesg *resp = NULL; + int i, error = 0; - clear = error = 0; - resp = NULL; NGI_GET_MSG(item, msg); - switch (msg->header.typecookie) { - case NGM_PATCH_COOKIE: - switch (msg->header.cmd) { + + if (msg->header.typecookie != NGM_PATCH_COOKIE) + ERROUT(EINVAL); + + switch (msg->header.cmd) + { case NGM_PATCH_GETCONFIG: - if (privp->config == NULL) - break; + if (privp->conf == NULL) + ERROUT(0); + NG_MKRESPONSE(resp, msg, - NG_PATCH_CONF_SIZE(privp->config->count), - M_WAITOK); - bcopy(privp->config, resp->data, - NG_PATCH_CONF_SIZE(privp->config->count)); - break; - case NGM_PATCH_SETCONFIG: - { - if (msg->header.arglen < - sizeof(struct ng_patch_config)) { - error = EINVAL; - break; - } + NG_PATCH_CONF_SIZE(privp->conf->count), M_WAITOK); - conf = (struct ng_patch_config *)msg->data; - if (msg->header.arglen < - NG_PATCH_CONF_SIZE(conf->count)) { - error = EINVAL; - break; - } + if (resp == NULL) + ERROUT(ENOMEM); - for(i = 0; i < conf->count; i++) { - switch(conf->ops[i].length) { - case 1: - case 2: - case 4: - case 8: - break; - default: - error = EINVAL; - break; + bcopy(privp->conf, resp->data, + NG_PATCH_CONF_SIZE(privp->conf->count)); + + conf = (struct ng_patch_config *) resp->data; + + for (i = 0; i < conf->count; i++) { + switch (conf->ops[i].length) + { + case 1: + conf->ops[i].val.v8 = conf->ops[i].val.v1; + break; + case 2: + conf->ops[i].val.v8 = conf->ops[i].val.v2; + break; + case 4: + conf->ops[i].val.v8 = conf->ops[i].val.v4; + break; + case 8: + break; } - if (error != 0) - break; } - conf->csum_flags &= CSUM_IP | CSUM_TCP | CSUM_UDP | - CSUM_SCTP; + break; + + case NGM_PATCH_SETCONFIG: + conf = (struct ng_patch_config *) msg->data; - if (error == 0) { - newconf = malloc( - NG_PATCH_CONF_SIZE(conf->count), - M_NETGRAPH, M_WAITOK); - newval = malloc(conf->count * - sizeof(union patch_val), M_NETGRAPH, - M_WAITOK); - for(i = 0; i < conf->count; i++) { - switch (conf->ops[i].length) { + if (msg->header.arglen < sizeof(struct ng_patch_config) || + msg->header.arglen < NG_PATCH_CONF_SIZE(conf->count)) + ERROUT(EINVAL); + + for (i = 0; i < conf->count; i++) { + switch (conf->ops[i].length) + { case 1: - newval[i].v1 = - conf->ops[i].value; + conf->ops[i].val.v1 = (uint8_t) conf->ops[i].val.v8; break; case 2: - newval[i].v2 = - conf->ops[i].value; + conf->ops[i].val.v2 = (uint16_t) conf->ops[i].val.v8; break; case 4: - newval[i].v4 = - conf->ops[i].value; + conf->ops[i].val.v4 = (uint32_t) conf->ops[i].val.v8; break; case 8: - newval[i].v8 = - conf->ops[i].value; break; - } + default: + ERROUT(EINVAL); } - bcopy(conf, newconf, - NG_PATCH_CONF_SIZE(conf->count)); - if (privp->val != NULL) - free(privp->val, M_NETGRAPH); - privp->val = newval; - if (privp->config != NULL) - free(privp->config, M_NETGRAPH); - privp->config = newconf; } + + conf->csum_flags &= NG_PATCH_CSUM_IPV4|NG_PATCH_CSUM_IPV6; + conf->relative_offset = !!conf->relative_offset; + + newconf = malloc(NG_PATCH_CONF_SIZE(conf->count), M_NETGRAPH, M_WAITOK | M_ZERO); + + bcopy(conf, newconf, NG_PATCH_CONF_SIZE(conf->count)); + + if (privp->conf) + free(privp->conf, M_NETGRAPH); + + privp->conf = newconf; + break; - } - case NGM_PATCH_GETCLR_STATS: - clear = 1; - /* FALLTHROUGH */ + case NGM_PATCH_GET_STATS: - NG_MKRESPONSE(resp, msg, sizeof(struct ng_patch_stats), - M_WAITOK); - bcopy(&(privp->stats), resp->data, - sizeof(struct ng_patch_stats)); - if (clear == 0) - break; - /* else FALLTHROUGH */ case NGM_PATCH_CLR_STATS: - bzero(&(privp->stats), sizeof(struct ng_patch_stats)); + case NGM_PATCH_GETCLR_STATS: + if (msg->header.cmd != NGM_PATCH_CLR_STATS) { + NG_MKRESPONSE(resp, msg, sizeof(struct ng_patch_stats), M_WAITOK); + + if (resp == NULL) + ERROUT(ENOMEM); + + bcopy(&(privp->stats), resp->data, sizeof(struct ng_patch_stats)); + } + + if (msg->header.cmd != NGM_PATCH_GET_STATS) + bzero(&(privp->stats), sizeof(struct ng_patch_stats)); + break; - default: - error = EINVAL; + + case NGM_PATCH_GETDLT: + NG_MKRESPONSE(resp, msg, sizeof(uint8_t), M_WAITOK); + + if (resp == NULL) + ERROUT(ENOMEM); + + *((uint8_t *) resp->data) = privp->dlt; + break; - } - break; - default: - error = EINVAL; - break; + + case NGM_PATCH_SETDLT: + if (msg->header.arglen != sizeof(uint8_t)) + ERROUT(EINVAL); + + switch (*(uint8_t *) msg->data) + { + case DLT_EN10MB: + case DLT_RAW: + privp->dlt = *(uint8_t *) msg->data; + break; + + default: + ERROUT(EINVAL); + } + + break; + + default: + ERROUT(EINVAL); } +done: NG_RESPOND_MSG(error, node, item, resp); NG_FREE_MSG(msg); - return(error); + + return (error); } static void -do_patch(priv_p privp, struct mbuf *m) +do_patch(priv_p privp, struct mbuf *m, int global_offset) { - struct ng_patch_config *conf; - uint64_t buf; - int i, patched; + int i, offset, patched = 0; + union ng_patch_op_val val; + + for (i = 0; i < privp->conf->count; i++) { + offset = global_offset + privp->conf->ops[i].offset; - conf = privp->config; - patched = 0; - for(i = 0; i < conf->count; i++) { - if (conf->ops[i].offset + conf->ops[i].length > - m->m_pkthdr.len) + if (offset + privp->conf->ops[i].length > m->m_pkthdr.len) continue; /* for "=" operation we don't need to copy data from mbuf */ - if (conf->ops[i].mode != NG_PATCH_MODE_SET) { - m_copydata(m, conf->ops[i].offset, - conf->ops[i].length, (caddr_t)&buf); - } + if (privp->conf->ops[i].mode != NG_PATCH_MODE_SET) + m_copydata(m, offset, privp->conf->ops[i].length, (caddr_t) &val); - switch (conf->ops[i].length) { - case 1: - switch (conf->ops[i].mode) { - case NG_PATCH_MODE_SET: - *((uint8_t *)&buf) = privp->val[i].v1; - break; - case NG_PATCH_MODE_ADD: - *((uint8_t *)&buf) += privp->val[i].v1; - break; - case NG_PATCH_MODE_SUB: - *((uint8_t *)&buf) -= privp->val[i].v1; - break; - case NG_PATCH_MODE_MUL: - *((uint8_t *)&buf) *= privp->val[i].v1; - break; - case NG_PATCH_MODE_DIV: - *((uint8_t *)&buf) /= privp->val[i].v1; - break; - case NG_PATCH_MODE_NEG: - *((int8_t *)&buf) = - *((int8_t *)&buf); - break; - case NG_PATCH_MODE_AND: - *((uint8_t *)&buf) &= privp->val[i].v1; - break; - case NG_PATCH_MODE_OR: - *((uint8_t *)&buf) |= privp->val[i].v1; - break; - case NG_PATCH_MODE_XOR: - *((uint8_t *)&buf) ^= privp->val[i].v1; - break; - case NG_PATCH_MODE_SHL: - *((uint8_t *)&buf) <<= privp->val[i].v1; - break; - case NG_PATCH_MODE_SHR: - *((uint8_t *)&buf) >>= privp->val[i].v1; - break; - } - break; - case 2: - *((int16_t *)&buf) = ntohs(*((int16_t *)&buf)); - switch (conf->ops[i].mode) { - case NG_PATCH_MODE_SET: - *((uint16_t *)&buf) = privp->val[i].v2; - break; - case NG_PATCH_MODE_ADD: - *((uint16_t *)&buf) += privp->val[i].v2; - break; - case NG_PATCH_MODE_SUB: - *((uint16_t *)&buf) -= privp->val[i].v2; - break; - case NG_PATCH_MODE_MUL: - *((uint16_t *)&buf) *= privp->val[i].v2; - break; - case NG_PATCH_MODE_DIV: - *((uint16_t *)&buf) /= privp->val[i].v2; - break; - case NG_PATCH_MODE_NEG: - *((int16_t *)&buf) = - *((int16_t *)&buf); - break; - case NG_PATCH_MODE_AND: - *((uint16_t *)&buf) &= privp->val[i].v2; - break; - case NG_PATCH_MODE_OR: - *((uint16_t *)&buf) |= privp->val[i].v2; - break; - case NG_PATCH_MODE_XOR: - *((uint16_t *)&buf) ^= privp->val[i].v2; - break; - case NG_PATCH_MODE_SHL: - *((uint16_t *)&buf) <<= privp->val[i].v2; - break; - case NG_PATCH_MODE_SHR: - *((uint16_t *)&buf) >>= privp->val[i].v2; - break; - } - *((int16_t *)&buf) = htons(*((int16_t *)&buf)); - break; - case 4: - *((int32_t *)&buf) = ntohl(*((int32_t *)&buf)); - switch (conf->ops[i].mode) { - case NG_PATCH_MODE_SET: - *((uint32_t *)&buf) = privp->val[i].v4; - break; - case NG_PATCH_MODE_ADD: - *((uint32_t *)&buf) += privp->val[i].v4; - break; - case NG_PATCH_MODE_SUB: - *((uint32_t *)&buf) -= privp->val[i].v4; - break; - case NG_PATCH_MODE_MUL: - *((uint32_t *)&buf) *= privp->val[i].v4; - break; - case NG_PATCH_MODE_DIV: - *((uint32_t *)&buf) /= privp->val[i].v4; - break; - case NG_PATCH_MODE_NEG: - *((int32_t *)&buf) = - *((int32_t *)&buf); - break; - case NG_PATCH_MODE_AND: - *((uint32_t *)&buf) &= privp->val[i].v4; - break; - case NG_PATCH_MODE_OR: - *((uint32_t *)&buf) |= privp->val[i].v4; - break; - case NG_PATCH_MODE_XOR: - *((uint32_t *)&buf) ^= privp->val[i].v4; - break; - case NG_PATCH_MODE_SHL: - *((uint32_t *)&buf) <<= privp->val[i].v4; - break; - case NG_PATCH_MODE_SHR: - *((uint32_t *)&buf) >>= privp->val[i].v4; - break; - } - *((int32_t *)&buf) = htonl(*((int32_t *)&buf)); - break; - case 8: - *((int64_t *)&buf) = be64toh(*((int64_t *)&buf)); - switch (conf->ops[i].mode) { - case NG_PATCH_MODE_SET: - *((uint64_t *)&buf) = privp->val[i].v8; - break; - case NG_PATCH_MODE_ADD: - *((uint64_t *)&buf) += privp->val[i].v8; - break; - case NG_PATCH_MODE_SUB: - *((uint64_t *)&buf) -= privp->val[i].v8; - break; - case NG_PATCH_MODE_MUL: - *((uint64_t *)&buf) *= privp->val[i].v8; - break; - case NG_PATCH_MODE_DIV: - *((uint64_t *)&buf) /= privp->val[i].v8; - break; - case NG_PATCH_MODE_NEG: - *((int64_t *)&buf) = - *((int64_t *)&buf); - break; - case NG_PATCH_MODE_AND: - *((uint64_t *)&buf) &= privp->val[i].v8; - break; - case NG_PATCH_MODE_OR: - *((uint64_t *)&buf) |= privp->val[i].v8; + switch (privp->conf->ops[i].length) + { + case 1: + switch (privp->conf->ops[i].mode) + { + case NG_PATCH_MODE_SET: + val.v1 = privp->conf->ops[i].val.v1; + break; + case NG_PATCH_MODE_ADD: + val.v1 += privp->conf->ops[i].val.v1; + break; + case NG_PATCH_MODE_SUB: + val.v1 -= privp->conf->ops[i].val.v1; + break; + case NG_PATCH_MODE_MUL: + val.v1 *= privp->conf->ops[i].val.v1; + break; + case NG_PATCH_MODE_DIV: + val.v1 /= privp->conf->ops[i].val.v1; + break; + case NG_PATCH_MODE_NEG: + *((int8_t *) &val) = - *((int8_t *) &val); + break; + case NG_PATCH_MODE_AND: + val.v1 &= privp->conf->ops[i].val.v1; + break; + case NG_PATCH_MODE_OR: + val.v1 |= privp->conf->ops[i].val.v1; + break; + case NG_PATCH_MODE_XOR: + val.v1 ^= privp->conf->ops[i].val.v1; + break; + case NG_PATCH_MODE_SHL: + val.v1 <<= privp->conf->ops[i].val.v1; + break; + case NG_PATCH_MODE_SHR: + val.v1 >>= privp->conf->ops[i].val.v1; + break; + } break; - case NG_PATCH_MODE_XOR: - *((uint64_t *)&buf) ^= privp->val[i].v8; + + case 2: + val.v2 = ntohs(val.v2); + + switch (privp->conf->ops[i].mode) + { + case NG_PATCH_MODE_SET: + val.v2 = privp->conf->ops[i].val.v2; + break; + case NG_PATCH_MODE_ADD: + val.v2 += privp->conf->ops[i].val.v2; + break; + case NG_PATCH_MODE_SUB: + val.v2 -= privp->conf->ops[i].val.v2; + break; + case NG_PATCH_MODE_MUL: + val.v2 *= privp->conf->ops[i].val.v2; + break; + case NG_PATCH_MODE_DIV: + val.v2 /= privp->conf->ops[i].val.v2; + break; + case NG_PATCH_MODE_NEG: + *((int16_t *) &val) = - *((int16_t *) &val); + break; + case NG_PATCH_MODE_AND: + val.v2 &= privp->conf->ops[i].val.v2; + break; + case NG_PATCH_MODE_OR: + val.v2 |= privp->conf->ops[i].val.v2; + break; + case NG_PATCH_MODE_XOR: + val.v2 ^= privp->conf->ops[i].val.v2; + break; + case NG_PATCH_MODE_SHL: + val.v2 <<= privp->conf->ops[i].val.v2; + break; + case NG_PATCH_MODE_SHR: + val.v2 >>= privp->conf->ops[i].val.v2; + break; + } + + val.v2 = htons(val.v2); + break; - case NG_PATCH_MODE_SHL: - *((uint64_t *)&buf) <<= privp->val[i].v8; + + case 4: + val.v4 = ntohl(val.v4); + + switch (privp->conf->ops[i].mode) + { + case NG_PATCH_MODE_SET: + val.v4 = privp->conf->ops[i].val.v4; + break; + case NG_PATCH_MODE_ADD: + val.v4 += privp->conf->ops[i].val.v4; + break; + case NG_PATCH_MODE_SUB: + val.v4 -= privp->conf->ops[i].val.v4; + break; + case NG_PATCH_MODE_MUL: + val.v4 *= privp->conf->ops[i].val.v4; + break; + case NG_PATCH_MODE_DIV: + val.v4 /= privp->conf->ops[i].val.v4; + break; + case NG_PATCH_MODE_NEG: + *((int32_t *) &val) = - *((int32_t *) &val); + break; + case NG_PATCH_MODE_AND: + val.v4 &= privp->conf->ops[i].val.v4; + break; + case NG_PATCH_MODE_OR: + val.v4 |= privp->conf->ops[i].val.v4; + break; + case NG_PATCH_MODE_XOR: + val.v4 ^= privp->conf->ops[i].val.v4; + break; + case NG_PATCH_MODE_SHL: + val.v4 <<= privp->conf->ops[i].val.v4; + break; + case NG_PATCH_MODE_SHR: + val.v4 >>= privp->conf->ops[i].val.v4; + break; + } + + val.v4 = htonl(val.v4); + break; - case NG_PATCH_MODE_SHR: - *((uint64_t *)&buf) >>= privp->val[i].v8; + + case 8: + val.v8 = be64toh(val.v8); + + switch (privp->conf->ops[i].mode) + { + case NG_PATCH_MODE_SET: + val.v8 = privp->conf->ops[i].val.v8; + break; + case NG_PATCH_MODE_ADD: + val.v8 += privp->conf->ops[i].val.v8; + break; + case NG_PATCH_MODE_SUB: + val.v8 -= privp->conf->ops[i].val.v8; + break; + case NG_PATCH_MODE_MUL: + val.v8 *= privp->conf->ops[i].val.v8; + break; + case NG_PATCH_MODE_DIV: + val.v8 /= privp->conf->ops[i].val.v8; + break; + case NG_PATCH_MODE_NEG: + *((int64_t *) &val) = - *((int64_t *) &val); + break; + case NG_PATCH_MODE_AND: + val.v8 &= privp->conf->ops[i].val.v8; + break; + case NG_PATCH_MODE_OR: + val.v8 |= privp->conf->ops[i].val.v8; + break; + case NG_PATCH_MODE_XOR: + val.v8 ^= privp->conf->ops[i].val.v8; + break; + case NG_PATCH_MODE_SHL: + val.v8 <<= privp->conf->ops[i].val.v8; + break; + case NG_PATCH_MODE_SHR: + val.v8 >>= privp->conf->ops[i].val.v8; + break; + } + + val.v8 = htobe64(val.v8); + break; - } - *((int64_t *)&buf) = htobe64(*((int64_t *)&buf)); - break; } - m_copyback(m, conf->ops[i].offset, conf->ops[i].length, - (caddr_t)&buf); + m_copyback(m, offset, privp->conf->ops[i].length, (caddr_t) &val); patched = 1; } - if (patched > 0) + + if (patched) privp->stats.patched++; } @@ -506,41 +552,107 @@ ng_patch_rcvdata(hook_p hook, item_p ite { const priv_p priv = NG_NODE_PRIVATE(NG_HOOK_NODE(hook)); struct mbuf *m; - hook_p target; - int error; + hook_p out; + int pullup_len = 0; + int error = 0; priv->stats.received++; + NGI_GET_M(item, m); - if (priv->config != NULL && hook == priv->in && - (m->m_flags & M_PKTHDR) != 0) { - m = m_unshare(m,M_NOWAIT); - if (m == NULL) { - priv->stats.dropped++; - NG_FREE_ITEM(item); - return (ENOMEM); + +#define PULLUP_CHECK(mbuf, length) do { \ + pullup_len += length; \ + if (((mbuf)->m_pkthdr.len < pullup_len) || \ + (pullup_len > MHLEN)) { \ + error = EINVAL; \ + goto bypass; \ + } \ + if ((mbuf)->m_len < pullup_len && \ + (((mbuf) = m_pullup((mbuf), pullup_len)) == NULL)) { \ + error = ENOBUFS; \ + goto drop; \ + } \ +} while (0) + + if (priv->conf && hook == priv->in && + m && (m->m_flags & M_PKTHDR)) { + + m = m_unshare(m, M_NOWAIT); + + if (m == NULL) + ERROUT(ENOMEM); + + if (priv->conf->relative_offset) { + struct ether_header *eh; + struct ng_patch_vlan_header *vh; + uint16_t etype; + + switch (priv->dlt) + { + case DLT_EN10MB: + PULLUP_CHECK(m, sizeof(struct ether_header)); + eh = mtod(m, struct ether_header *); + etype = ntohs(eh->ether_type); + + for (;;) { /* QinQ support */ + switch (etype) + { + case 0x8100: + case 0x88A8: + case 0x9100: + PULLUP_CHECK(m, sizeof(struct ng_patch_vlan_header)); + vh = (struct ng_patch_vlan_header *) mtodo(m, + pullup_len - sizeof(struct ng_patch_vlan_header)); + etype = ntohs(vh->etype); + break; + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Dec 2 11:30:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93E40C61D7F; Fri, 2 Dec 2016 11:30:22 +0000 (UTC) (envelope-from n_hibma@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 638001A0E; Fri, 2 Dec 2016 11:30:22 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2BULRR079897; Fri, 2 Dec 2016 11:30:21 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2BULRo079896; Fri, 2 Dec 2016 11:30:21 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <201612021130.uB2BULRo079896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: n_hibma set sender to n_hibma@FreeBSD.org using -f From: Nick Hibma Date: Fri, 2 Dec 2016 11:30:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309409 - head/usr.sbin/i2c X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 11:30:22 -0000 Author: n_hibma Date: Fri Dec 2 11:30:21 2016 New Revision: 309409 URL: https://svnweb.freebsd.org/changeset/base/309409 Log: More typos in strings. Submitted by: bde MFC after: 3 days Modified: head/usr.sbin/i2c/i2c.c Modified: head/usr.sbin/i2c/i2c.c ============================================================================== --- head/usr.sbin/i2c/i2c.c Fri Dec 2 10:47:10 2016 (r309408) +++ head/usr.sbin/i2c/i2c.c Fri Dec 2 11:30:21 2016 (r309409) @@ -413,7 +413,7 @@ err1: cmd.slave = i2c_opt.addr; error = ioctl(fd, I2CSTOP, &cmd); if (error == -1) - fprintf(stderr, "error sending stop condtion\n"); + fprintf(stderr, "error sending stop condition\n"); err2: if (err_msg) fprintf(stderr, "%s\n", err_msg); @@ -466,7 +466,7 @@ i2c_read(char *dev, struct options i2c_o cmd.slave = i2c_opt.addr; error = ioctl(fd, I2CSTOP, &cmd); if (error == -1) { - err_msg = "error sending stop condtion"; + err_msg = "error sending stop condition"; goto err2; } } @@ -491,7 +491,7 @@ i2c_read(char *dev, struct options i2c_o } error = ioctl(fd, I2CSTOP, &cmd); if (error == -1) { - err_msg = "error sending stop condtion"; + err_msg = "error sending stop condition"; goto err2; } @@ -510,7 +510,7 @@ err1: cmd.slave = i2c_opt.addr; error = ioctl(fd, I2CSTOP, &cmd); if (error == -1) - fprintf(stderr, "error sending stop condtion\n"); + fprintf(stderr, "error sending stop condition\n"); err2: if (err_msg) fprintf(stderr, "%s\n", err_msg); From owner-svn-src-all@freebsd.org Fri Dec 2 11:32:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB92DC61E27; Fri, 2 Dec 2016 11:32:12 +0000 (UTC) (envelope-from n_hibma@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 7AC0F1DB8; Fri, 2 Dec 2016 11:32:12 +0000 (UTC) (envelope-from n_hibma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2BWBpX083451; Fri, 2 Dec 2016 11:32:11 GMT (envelope-from n_hibma@FreeBSD.org) Received: (from n_hibma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2BWBZv083450; Fri, 2 Dec 2016 11:32:11 GMT (envelope-from n_hibma@FreeBSD.org) Message-Id: <201612021132.uB2BWBZv083450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: n_hibma set sender to n_hibma@FreeBSD.org using -f From: Nick Hibma Date: Fri, 2 Dec 2016 11:32:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309410 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 11:32:12 -0000 Author: n_hibma Date: Fri Dec 2 11:32:11 2016 New Revision: 309410 URL: https://svnweb.freebsd.org/changeset/base/309410 Log: Fix man page: - It should say 'read' in the I2CREAD section. - last in the struct indicates the last command in a sequence, not the reverse. Reviewed by: imp MFC after: 3 days Modified: head/share/man/man4/iic.4 Modified: head/share/man/man4/iic.4 ============================================================================== --- head/share/man/man4/iic.4 Fri Dec 2 11:30:21 2016 (r309409) +++ head/share/man/man4/iic.4 Fri Dec 2 11:32:11 2016 (r309410) @@ -104,7 +104,8 @@ element is the number of bytes to write. The .Va last element is a boolean flag. -It is non-zero when additional write commands will follow. +It must be zero when additional read commands will follow, or non-zero if this +is the last command. The .Va buf element is a pointer to the data to write to the bus. @@ -120,11 +121,12 @@ The element is ignored. The .Va count -element is the number of bytes to write. +element is the number of bytes to read. The .Va last element is a boolean flag. -It is non-zero when additional write commands will follow. +It must be zero when additional read commands will follow, or non-zero if this +is the last command. The .Va buf element is a pointer to where to store the data read from the bus. From owner-svn-src-all@freebsd.org Fri Dec 2 14:23:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88AA6C62098; Fri, 2 Dec 2016 14:23:28 +0000 (UTC) (envelope-from emaste@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 4967314A8; Fri, 2 Dec 2016 14:23:28 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2ENR3o054181; Fri, 2 Dec 2016 14:23:27 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2ENRwi054177; Fri, 2 Dec 2016 14:23:27 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201612021423.uB2ENRwi054177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 2 Dec 2016 14:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309411 - in head/libexec/rtld-elf: . aarch64 riscv sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 14:23:28 -0000 Author: emaste Date: Fri Dec 2 14:23:26 2016 New Revision: 309411 URL: https://svnweb.freebsd.org/changeset/base/309411 Log: Retire long-broken/unused static rtld support rtld-elf has some vestigial support for building as a static executable. r45501 introduced a partial implementation with a prescient note that it "might never be enabled." r153515 introduced ELF symbol versioning support, and removed part of the unused build infrastructure for static rtld. GNU ld populates rela relocation addends and GOT entries with the same values, and rtld's run-time dynamic executable check relied on this. Alternate toolchains may not populate the GOT entries, which caused RTLD_IS_DYNAMIC to return false. Simplify rtld by just removing the unused check. If we want to restore static rtld support later on we ought to introduce a build-time #ifdef flag. PR: 214972 Reviewed by: kan MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D8687 Modified: head/libexec/rtld-elf/aarch64/rtld_machdep.h head/libexec/rtld-elf/riscv/rtld_machdep.h head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/sparc64/rtld_machdep.h Modified: head/libexec/rtld-elf/aarch64/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/aarch64/rtld_machdep.h Fri Dec 2 11:32:11 2016 (r309410) +++ head/libexec/rtld-elf/aarch64/rtld_machdep.h Fri Dec 2 14:23:26 2016 (r309411) @@ -45,7 +45,6 @@ struct Struct_Obj_Entry; asm volatile("adr %0, _DYNAMIC" : "=&r"(_dynamic_addr)); \ (const Elf_Dyn *)_dynamic_addr; \ }) -#define RTLD_IS_DYNAMIC() (1) Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const struct Struct_Obj_Entry *defobj, Modified: head/libexec/rtld-elf/riscv/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/riscv/rtld_machdep.h Fri Dec 2 11:32:11 2016 (r309410) +++ head/libexec/rtld-elf/riscv/rtld_machdep.h Fri Dec 2 14:23:26 2016 (r309411) @@ -52,7 +52,6 @@ uint64_t set_gp(struct Struct_Obj_Entry __asm __volatile("lla %0, _DYNAMIC" : "=r"(_dynamic_addr)); \ (const Elf_Dyn *)_dynamic_addr; \ }) -#define RTLD_IS_DYNAMIC() (1) Elf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target, const struct Struct_Obj_Entry *defobj, Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Fri Dec 2 11:32:11 2016 (r309410) +++ head/libexec/rtld-elf/rtld.c Fri Dec 2 14:23:26 2016 (r309411) @@ -200,9 +200,6 @@ Elf_Sym sym_zero; /* For resolving unde extern Elf_Dyn _DYNAMIC; #pragma weak _DYNAMIC -#ifndef RTLD_IS_DYNAMIC -#define RTLD_IS_DYNAMIC() (&_DYNAMIC != NULL) -#endif int dlclose(void *) __exported; char *dlerror(void) __exported; @@ -1920,22 +1917,20 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo * #ifdef PIC objtmp.relocbase = mapbase; #endif - if (RTLD_IS_DYNAMIC()) { - objtmp.dynamic = rtld_dynamic(&objtmp); - digest_dynamic1(&objtmp, 1, &dyn_rpath, &dyn_soname, &dyn_runpath); - assert(objtmp.needed == NULL); + + objtmp.dynamic = rtld_dynamic(&objtmp); + digest_dynamic1(&objtmp, 1, &dyn_rpath, &dyn_soname, &dyn_runpath); + assert(objtmp.needed == NULL); #if !defined(__mips__) - /* MIPS has a bogus DT_TEXTREL. */ - assert(!objtmp.textrel); + /* MIPS has a bogus DT_TEXTREL. */ + assert(!objtmp.textrel); #endif + /* + * Temporarily put the dynamic linker entry into the object list, so + * that symbols can be found. + */ + relocate_objects(&objtmp, true, &objtmp, 0, NULL); - /* - * Temporarily put the dynamic linker entry into the object list, so - * that symbols can be found. - */ - - relocate_objects(&objtmp, true, &objtmp, 0, NULL); - } ehdr = (Elf_Ehdr *)mapbase; objtmp.phdr = (Elf_Phdr *)((char *)mapbase + ehdr->e_phoff); objtmp.phsize = ehdr->e_phnum * sizeof(objtmp.phdr[0]); Modified: head/libexec/rtld-elf/sparc64/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/sparc64/rtld_machdep.h Fri Dec 2 11:32:11 2016 (r309410) +++ head/libexec/rtld-elf/sparc64/rtld_machdep.h Fri Dec 2 14:23:26 2016 (r309411) @@ -37,7 +37,6 @@ struct Struct_Obj_Entry; /* Return the address of the .dynamic section in the dynamic linker. */ Elf_Dyn *rtld_dynamic_addr(void); #define rtld_dynamic(obj) rtld_dynamic_addr() -#define RTLD_IS_DYNAMIC() (rtld_dynamic_addr() != NULL) Elf_Addr reloc_jmpslot(Elf_Addr *, Elf_Addr, const struct Struct_Obj_Entry *, From owner-svn-src-all@freebsd.org Fri Dec 2 14:44:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0801CC62857; Fri, 2 Dec 2016 14:44:41 +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 D00F61F36; Fri, 2 Dec 2016 14:44:40 +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 uB2EieRU062067; Fri, 2 Dec 2016 14:44:40 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2Eicfr062056; Fri, 2 Dec 2016 14:44:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201612021444.uB2Eicfr062056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 2 Dec 2016 14:44:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309412 - in head: . sys/boot sys/boot/efi/boot1 sys/boot/i386/boot2 sys/boot/i386/pxeldr sys/boot/i386/zfsboot sys/boot/pc98/boot0.5 sys/boot/pc98/boot2 sys/boot/pc98/pc98boot sys/boot... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 14:44:41 -0000 Author: imp Date: Fri Dec 2 14:44:38 2016 New Revision: 309412 URL: https://svnweb.freebsd.org/changeset/base/309412 Log: dd is currently a bootstrap tool. It really doesn't have any business being a bootstrap tool. However, for reproducible build output, FreeBSD added dd status=none because it was otherwise difficult to suppress the status information, but retain any errors that might happen. There's no real reason that dd has to be a build tool, other than we use status=none unconditional. Remove dd from a bootstrap tool entirely by only using status=none when available. This may also help efforts to build the system on non-FreeBSD hosts as well. Differential Revision: https://reviews.freebsd.org/D8605 Modified: head/Makefile.inc1 head/sys/boot/Makefile.inc head/sys/boot/efi/boot1/Makefile head/sys/boot/i386/boot2/Makefile head/sys/boot/i386/pxeldr/Makefile head/sys/boot/i386/zfsboot/Makefile head/sys/boot/pc98/boot0.5/Makefile head/sys/boot/pc98/boot2/Makefile head/sys/boot/pc98/pc98boot/Makefile head/sys/boot/powerpc/boot1.chrp/Makefile head/sys/boot/sparc64/boot1/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Dec 2 14:23:26 2016 (r309411) +++ head/Makefile.inc1 Fri Dec 2 14:44:38 2016 (r309412) @@ -1631,11 +1631,6 @@ ${_bt}-usr.sbin/nmtree: ${_bt}-lib/libne _cat= bin/cat .endif -# r264059 support for status= -.if ${BOOTSTRAPPING} < 1100017 -_dd= bin/dd -.endif - # r277259 crunchide: Correct 64-bit section header offset # r281674 crunchide: always include both 32- and 64-bit ELF support .if ${BOOTSTRAPPING} < 1100078 @@ -1718,7 +1713,6 @@ bootstrap-tools: .PHONY ${_groff} \ ${_dtc} \ ${_cat} \ - ${_dd} \ ${_kbdcontrol} \ usr.bin/lorder \ ${_libopenbsd} \ Modified: head/sys/boot/Makefile.inc ============================================================================== --- head/sys/boot/Makefile.inc Fri Dec 2 14:23:26 2016 (r309411) +++ head/sys/boot/Makefile.inc Fri Dec 2 14:44:38 2016 (r309412) @@ -15,3 +15,10 @@ CFLAGS.clang+= -mno-movt .endif CFLAGS.clang+= -mfpu=none .endif + +# The boot loader build uses dd status=none, where possible, for reproducible +# build output (since performance varies from run to run). Trouble is that +# option was recently (10.3) added to FreeBSD and is non-standard. Only use it +# when this test succeeds rather than require dd to be a bootstrap tool. +DD_NOSTATUS!=(dd status=none count=0 2> /dev/null && echo status=none) || true +DD=dd ${DD_NOSTATUS} Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Fri Dec 2 14:23:26 2016 (r309411) +++ head/sys/boot/efi/boot1/Makefile Fri Dec 2 14:44:38 2016 (r309412) @@ -124,8 +124,7 @@ boot1.efifat: boot1.efi uudecode ${.CURDIR}/fat-${MACHINE}.tmpl.bz2.uu mv fat-${MACHINE}.tmpl.bz2 ${.TARGET}.bz2 bzip2 -f -d ${.TARGET}.bz2 - dd if=boot1.efi of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc \ - status=none + ${DD} if=boot1.efi of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc CLEANFILES= boot1.efi boot1.efifat Modified: head/sys/boot/i386/boot2/Makefile ============================================================================== --- head/sys/boot/i386/boot2/Makefile Fri Dec 2 14:23:26 2016 (r309411) +++ head/sys/boot/i386/boot2/Makefile Fri Dec 2 14:44:38 2016 (r309412) @@ -72,14 +72,14 @@ CLEANFILES+= boot2 boot2.ld boot2.ldr bo boot2: boot2.ld @set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 - dd if=boot2.ld of=${.TARGET} obs=7680 conv=osync status=none + ${DD} if=boot2.ld of=${.TARGET} obs=7680 conv=osync boot2.ld: boot2.ldr boot2.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \ -o ${.TARGET} -P 1 boot2.bin boot2.ldr: - dd if=/dev/zero of=${.TARGET} bs=512 count=1 status=none + ${DD} if=/dev/zero of=${.TARGET} bs=512 count=1 boot2.bin: boot2.out ${OBJCOPY} -S -O binary boot2.out ${.TARGET} Modified: head/sys/boot/i386/pxeldr/Makefile ============================================================================== --- head/sys/boot/i386/pxeldr/Makefile Fri Dec 2 14:23:26 2016 (r309411) +++ head/sys/boot/i386/pxeldr/Makefile Fri Dec 2 14:44:38 2016 (r309412) @@ -31,7 +31,7 @@ CLEANFILES+= ${BOOT}.tmp ${BOOT}: ${LDR} ${LOADER} cat ${LDR} ${LOADER} > ${.TARGET}.tmp - dd if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync status=none + ${DD} if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync rm ${.TARGET}.tmp LDFLAGS+=${LDFLAGS_BIN} Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Fri Dec 2 14:23:26 2016 (r309411) +++ head/sys/boot/i386/zfsboot/Makefile Fri Dec 2 14:44:38 2016 (r309412) @@ -70,7 +70,7 @@ BOOT2SIZE= 131072 zfsboot2: zfsboot.ld @set -- `ls -l zfsboot.ld`; x=$$((${BOOT2SIZE}-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 - dd if=zfsboot.ld of=${.TARGET} obs=${BOOT2SIZE} conv=osync status=none + ${DD} if=zfsboot.ld of=${.TARGET} obs=${BOOT2SIZE} conv=osync zfsboot.ld: zfsboot.ldr zfsboot.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l zfsboot.ldr \ Modified: head/sys/boot/pc98/boot0.5/Makefile ============================================================================== --- head/sys/boot/pc98/boot0.5/Makefile Fri Dec 2 14:23:26 2016 (r309411) +++ head/sys/boot/pc98/boot0.5/Makefile Fri Dec 2 14:44:38 2016 (r309412) @@ -18,7 +18,7 @@ LDFLAGS=-e start -Ttext ${BOOT_BOOT0_ORG # The size of boot0.5 must be 7168 bytes ${BOOT}: ${BOOT}.bin - cat ${BOOT}.bin /dev/zero | dd of=${BOOT} bs=1 count=7168 + cat ${BOOT}.bin /dev/zero | ${DD} of=${BOOT} bs=1 count=7168 ${BOOT}.bin: ${BOOT}.out ${OBJCOPY} -S -O binary ${BOOT}.out ${.TARGET} Modified: head/sys/boot/pc98/boot2/Makefile ============================================================================== --- head/sys/boot/pc98/boot2/Makefile Fri Dec 2 14:23:26 2016 (r309411) +++ head/sys/boot/pc98/boot2/Makefile Fri Dec 2 14:44:38 2016 (r309412) @@ -78,14 +78,14 @@ CLEANFILES+= boot2 boot2.ld boot2.ldr bo boot2: boot2.ld @set -- `ls -l boot2.ld`; x=$$((7680-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 - dd if=boot2.ld of=${.TARGET} obs=7680 conv=osync + ${DD} if=boot2.ld of=${.TARGET} obs=7680 conv=osync boot2.ld: boot2.ldr boot2.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \ -o ${.TARGET} -P 1 boot2.bin boot2.ldr: - dd if=/dev/zero of=${.TARGET} bs=276 count=1 + ${DD} if=/dev/zero of=${.TARGET} bs=276 count=1 boot2.bin: boot2.out ${OBJCOPY} -S -O binary boot2.out ${.TARGET} Modified: head/sys/boot/pc98/pc98boot/Makefile ============================================================================== --- head/sys/boot/pc98/pc98boot/Makefile Fri Dec 2 14:23:26 2016 (r309411) +++ head/sys/boot/pc98/pc98boot/Makefile Fri Dec 2 14:44:38 2016 (r309412) @@ -20,6 +20,6 @@ ${BOOT}: ${BOOT0} ${BOOT05} ${BOOT}.part cat ${BOOT0} ${BOOT}.part ${BOOT05} > ${.TARGET} ${BOOT}.part: - dd if=/dev/zero of=${.TARGET} bs=512 count=1 + ${DD} if=/dev/zero of=${.TARGET} bs=512 count=1 .include Modified: head/sys/boot/powerpc/boot1.chrp/Makefile ============================================================================== --- head/sys/boot/powerpc/boot1.chrp/Makefile Fri Dec 2 14:23:26 2016 (r309411) +++ head/sys/boot/powerpc/boot1.chrp/Makefile Fri Dec 2 14:44:38 2016 (r309412) @@ -30,8 +30,8 @@ boot1.hfs: boot1.elf bootinfo.txt uudecode ${.CURDIR}/hfs.tmpl.bz2.uu mv hfs.tmpl.bz2 ${.TARGET}.bz2 bzip2 -f -d ${.TARGET}.bz2 - dd if=boot1.elf of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc - dd if=${.CURDIR}/bootinfo.txt of=${.TARGET} seek=${BOOTINFO_OFFSET} \ + ${DD} if=boot1.elf of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc + ${DD} if=${.CURDIR}/bootinfo.txt of=${.TARGET} seek=${BOOTINFO_OFFSET} \ conv=notrunc CLEANFILES= boot1.hfs Modified: head/sys/boot/sparc64/boot1/Makefile ============================================================================== --- head/sys/boot/sparc64/boot1/Makefile Fri Dec 2 14:23:26 2016 (r309411) +++ head/sys/boot/sparc64/boot1/Makefile Fri Dec 2 14:44:38 2016 (r309412) @@ -19,8 +19,8 @@ LDFLAGS=-Ttext ${BOOTBLOCKBASE} -Wl,-N ${FILES}: boot1.aout @set -- `ls -l boot1.aout`; x=$$((7680-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 - dd if=/dev/zero of=${.TARGET} bs=512 count=16 - dd if=boot1.aout of=${.TARGET} bs=512 oseek=1 conv=notrunc + ${DD} if=/dev/zero of=${.TARGET} bs=512 count=16 + ${DD} if=boot1.aout of=${.TARGET} bs=512 oseek=1 conv=notrunc boot1.aout: boot1.elf elf2aout -o ${.TARGET} ${.ALLSRC} From owner-svn-src-all@freebsd.org Fri Dec 2 14:44:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97968C628B6; Fri, 2 Dec 2016 14:44:46 +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 59EA11F7A; Fri, 2 Dec 2016 14:44:46 +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 uB2EijDc062121; Fri, 2 Dec 2016 14:44:45 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2EijxT062120; Fri, 2 Dec 2016 14:44:45 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201612021444.uB2EijxT062120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 2 Dec 2016 14:44:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309413 - head/sbin/nvmecontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 14:44:46 -0000 Author: imp Date: Fri Dec 2 14:44:45 2016 New Revision: 309413 URL: https://svnweb.freebsd.org/changeset/base/309413 Log: Flag the vendor specific pages as such. This allows different decoding for the same page number as different vendors encode vendor specific pages differently. Modified: head/sbin/nvmecontrol/logpage.c Modified: head/sbin/nvmecontrol/logpage.c ============================================================================== --- head/sbin/nvmecontrol/logpage.c Fri Dec 2 14:44:38 2016 (r309412) +++ head/sbin/nvmecontrol/logpage.c Fri Dec 2 14:44:45 2016 (r309413) @@ -793,23 +793,23 @@ print_hgst_info_log(void *buf, uint32_t */ static struct logpage_function { uint8_t log_page; + const char *vendor; print_fn_t print_fn; size_t size; } logfuncs[] = { - {NVME_LOG_ERROR, print_log_error, + {NVME_LOG_ERROR, NULL, print_log_error, 0}, - {NVME_LOG_HEALTH_INFORMATION, print_log_health, + {NVME_LOG_HEALTH_INFORMATION, NULL, print_log_health, sizeof(struct nvme_health_information_page)}, - {NVME_LOG_FIRMWARE_SLOT, print_log_firmware, + {NVME_LOG_FIRMWARE_SLOT, NULL, print_log_firmware, sizeof(struct nvme_firmware_page)}, - {INTEL_LOG_TEMP_STATS, print_intel_temp_stats, + {INTEL_LOG_TEMP_STATS, "intel", print_intel_temp_stats, sizeof(struct intel_log_temp_stats)}, - {INTEL_LOG_ADD_SMART, print_intel_add_smart, + {INTEL_LOG_ADD_SMART, "intel", print_intel_add_smart, DEFAULT_SIZE}, - {HGST_INFO_LOG, print_hgst_info_log, + {HGST_INFO_LOG, "hgst", print_hgst_info_log, DEFAULT_SIZE}, - {0, NULL, - 0}, + {0, NULL, NULL, 0}, }; static void @@ -830,11 +830,12 @@ logpage(int argc, char *argv[]) char cname[64]; uint32_t size; void *buf; + const char *vendor = NULL; struct logpage_function *f; struct nvme_controller_data cdata; print_fn_t print_fn; - while ((ch = getopt(argc, argv, "p:x")) != -1) { + while ((ch = getopt(argc, argv, "p:xv:")) != -1) { switch (ch) { case 'p': /* TODO: Add human-readable ASCII page IDs */ @@ -850,6 +851,9 @@ logpage(int argc, char *argv[]) case 'x': hexflag = true; break; + case 'v': + vendor = optarg; + break; } } @@ -893,18 +897,21 @@ logpage(int argc, char *argv[]) size = DEFAULT_SIZE; if (!hexflag) { /* - * See if there is a pretty print function for the - * specified log page. If one isn't found, we - * just revert to the default (print_hex). + * See if there is a pretty print function for the specified log + * page. If one isn't found, we just revert to the default + * (print_hex). If there was a vendor specified bt the user, and + * the page is vendor specific, don't match the print function + * unless the vendors match. */ - f = logfuncs; - while (f->log_page > 0) { - if (log_page == f->log_page) { - print_fn = f->print_fn; - size = f->size; - break; - } - f++; + for (f = logfuncs; f->log_page > 0; f++) { + if (f->vendor != NULL && vendor != NULL && + strcmp(f->vendor, vendor) != 0) + continue; + if (log_page != f->log_page) + continue; + print_fn = f->print_fn; + size = f->size; + break; } } From owner-svn-src-all@freebsd.org Fri Dec 2 15:38:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD9DCC63872; Fri, 2 Dec 2016 15:38:35 +0000 (UTC) (envelope-from rstone@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 8D631129D; Fri, 2 Dec 2016 15:38:35 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2FcYma083893; Fri, 2 Dec 2016 15:38:34 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2FcYRM083892; Fri, 2 Dec 2016 15:38:34 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201612021538.uB2FcYRM083892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Fri, 2 Dec 2016 15:38:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309414 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 15:38:35 -0000 Author: rstone Date: Fri Dec 2 15:38:34 2016 New Revision: 309414 URL: https://svnweb.freebsd.org/changeset/base/309414 Log: Revert r309372 The bug intended to be fixed by r309372 was already addressed by r296178, so revert my change. Reported by: seph Modified: head/sys/sys/buf_ring.h Modified: head/sys/sys/buf_ring.h ============================================================================== --- head/sys/sys/buf_ring.h Fri Dec 2 14:44:45 2016 (r309413) +++ head/sys/sys/buf_ring.h Fri Dec 2 15:38:34 2016 (r309414) @@ -67,13 +67,11 @@ buf_ring_enqueue(struct buf_ring *br, vo uint32_t prod_head, prod_next, cons_tail; #ifdef DEBUG_BUFRING int i; - if (br->br_cons_head != br->br_prod_head) { - for (i = (br->br_cons_head + 1) & br->br_cons_mask; i != br->br_prod_head; - i = ((i + 1) & br->br_cons_mask)) - if(br->br_ring[i] == buf) - panic("buf=%p already enqueue at %d prod=%d cons=%d", - buf, i, br->br_prod_tail, br->br_cons_tail); - } + for (i = br->br_cons_head; i != br->br_prod_head; + i = ((i + 1) & br->br_cons_mask)) + if(br->br_ring[i] == buf) + panic("buf=%p already enqueue at %d prod=%d cons=%d", + buf, i, br->br_prod_tail, br->br_cons_tail); #endif critical_enter(); do { From owner-svn-src-all@freebsd.org Fri Dec 2 16:00:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5BEAC63D8D; Fri, 2 Dec 2016 16:00:14 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 731941CF2; Fri, 2 Dec 2016 16:00:14 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (ppp121-45-230-194.lns20.per1.internode.on.net [121.45.230.194]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id uB2G07m9072144 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 2 Dec 2016 08:00:10 -0800 (PST) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r309035 - in head/lib/libpathconv: . tests To: Jilles Tjoelker References: <201611230757.uAN7vqmC008888@repo.freebsd.org> <20161127204305.GA58954@stack.nl> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Julian Elischer Message-ID: <4de52b2a-fef9-f043-2409-c77bafc599fe@freebsd.org> Date: Sat, 3 Dec 2016 00:00:01 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 MIME-Version: 1.0 In-Reply-To: <20161127204305.GA58954@stack.nl> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 16:00:14 -0000 On 28/11/2016 4:43 AM, Jilles Tjoelker wrote: > On Wed, Nov 23, 2016 at 07:57:52AM +0000, Julian Elischer wrote: >> Author: julian >> Date: Wed Nov 23 07:57:52 2016 >> New Revision: 309035 >> URL: https://svnweb.freebsd.org/changeset/base/309035 >> Log: >> This little BSD licensed library has been kicking around for years. >> It allows one to trivially convert an absolute path to a relative path >> and the reverse. The test programs themselves are very useful in scripts >> but the real use comes shortly with the -r and -a arguments to ln. >> These are sometimes known as the --relative and --absolute flags and >> can force a symlink to be relative when you only have an absolue path. >> Another place these are sometimes used is to add -a and -r args to 'realpath'. >> Incredibly useful in Makefiles. >> I was going to just add the files in with 'ln' but a library makes more sense. >> The test programs may come out in their own right some day for scripting. >> released under a BSD 2-clause: >> * Copyright (c) 1997 Shigio Yamaguchi. All rights reserved. >> * Copyright (c) 1999 Tama Communications Corporation. All rights reserved. >> The test directry does not conform to any framework. >> Not connected to build. >> doc people may want to play with the manual pages. >> Obtained from: https://www.tamacom.com/pathconvert.html Shigio Yamaguchi. >> MFC after: 1 month >> Relnotes: yes >> Sponsored by: Panzura, Tama Communications Corporation > Consider making this a static-only library or a part of an existing > library such as libc or libutil, since the overhead of a shared object > is rather big compared to the amount of code here. yeah I was thinking of making it part of libc but libc is already such a kitchen sink and there are only two planned users. ln and realpath. A static library is one idea for sure. (or even just a .o). The actual real target for this is the build itself. Currently we are making lots of symlinks that should be relative but we only really have absolute information. This allows symlink -sr to dynamically generate the correct relative symlink, given absolute args. e.g. /usr/lib/libm.so -> /lib/libm.so.5 should really be ../../lib/libm.so.5 so that when it is read from outside a jail it still refers to the right place. I'm waiting for a gap in my work schedule to get ln and realpath changes in place. > > Thanks for not linking this to the build right away. > From owner-svn-src-all@freebsd.org Fri Dec 2 16:18:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 642BAC62523; Fri, 2 Dec 2016 16:18:38 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (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 364FF1B2B; Fri, 2 Dec 2016 16:18:37 +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 5DF5C10A74C; Fri, 2 Dec 2016 11:18:36 -0500 (EST) From: John Baldwin To: Warner Losh Cc: hiren panchasara , Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r309351 - head/etc/defaults Date: Fri, 02 Dec 2016 08:18:13 -0800 Message-ID: <3180246.4fqia12Gik@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-PRERELEASE; KDE/4.14.10; amd64; ; ) In-Reply-To: References: <201612010435.uB14Zh21020050@repo.freebsd.org> <20161201164807.GE27291@strugglingcoder.info> 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); Fri, 02 Dec 2016 11:18:36 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 16:18:38 -0000 On Thursday, December 01, 2016 02:41:41 PM Warner Losh wrote: > On Thu, Dec 1, 2016 at 9:48 AM, hiren panchasara > wrote: > > On 12/01/16 at 04:35P, Warner Losh wrote: > >> Author: imp > >> Date: Thu Dec 1 04:35:43 2016 > >> New Revision: 309351 > >> URL: https://svnweb.freebsd.org/changeset/base/309351 > >> > >> Log: > >> Revert the 'performance' setting to 'NONE' from C2. > > > > Just a note that this commit reverts r282110. > > Yea, it's good for laptops, bad for servers. At least there's some > Intel CPUs that this causes corruption with USB. That's being sorted > out, but until that's done we need to fail more safe for our primary > market. It's also good for some servers as you need some cores in C-states to get the maximum Turbo Boost on other cores (though that may have been more true for earlier generations of i7 CPUs than more recent generations). -- John Baldwin From owner-svn-src-all@freebsd.org Fri Dec 2 16:28:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FCD5C62A28; Fri, 2 Dec 2016 16:28:20 +0000 (UTC) (envelope-from pfg@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 D3A4112EF; Fri, 2 Dec 2016 16:28:19 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2GSJ1G004893; Fri, 2 Dec 2016 16:28:19 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2GSJVP004892; Fri, 2 Dec 2016 16:28:19 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612021628.uB2GSJVP004892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 2 Dec 2016 16:28:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309415 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 16:28:20 -0000 Author: pfg Date: Fri Dec 2 16:28:18 2016 New Revision: 309415 URL: https://svnweb.freebsd.org/changeset/base/309415 Log: indent(1): Optimize parser stack usage. When special else-if processing is enabled (-ei), we can assume "else if" and "if" to be equivalent for indentation purposes. This reduction saves a lot of stack space in case of a long "if-else-if ... else-if" sequence; with this change, Postgres/src/bin/psql/tab-complete.c as of 9.6beta3 requires minimum of the stack length to be 31 instead of 444. Submitted by: Piotr Sephaniak Modified: head/usr.bin/indent/parse.c Modified: head/usr.bin/indent/parse.c ============================================================================== --- head/usr.bin/indent/parse.c Fri Dec 2 15:38:34 2016 (r309414) +++ head/usr.bin/indent/parse.c Fri Dec 2 16:28:18 2016 (r309415) @@ -94,7 +94,13 @@ parse(int tk) /* tk: the code for the co case ifstmt: /* scanned if (...) */ if (ps.p_stack[ps.tos] == elsehead && ps.else_if) /* "else if ..." */ - ps.i_l_follow = ps.il[ps.tos]; + /* + * Note that the stack pointer here is decremented, effectively + * reducing "else if" to "if". This saves a lot of stack space + * in case of a long "if-else-if ... else-if" sequence. + */ + ps.i_l_follow = ps.il[ps.tos--]; + /* the rest is the same as for dolit and forstmt */ case dolit: /* 'do' */ case forstmt: /* for (...) */ From owner-svn-src-all@freebsd.org Fri Dec 2 16:29:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9ADFCC62AFC; Fri, 2 Dec 2016 16:29:31 +0000 (UTC) (envelope-from alc@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 6AB201519; Fri, 2 Dec 2016 16:29:31 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2GTUIN004977; Fri, 2 Dec 2016 16:29:30 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2GTUCZ004976; Fri, 2 Dec 2016 16:29:30 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201612021629.uB2GTUCZ004976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 2 Dec 2016 16:29:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309416 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 16:29:31 -0000 Author: alc Date: Fri Dec 2 16:29:30 2016 New Revision: 309416 URL: https://svnweb.freebsd.org/changeset/base/309416 Log: Eliminate a stale comment; vm_radix_prealloc() was replaced in r254141. MFC after: 3 days Modified: head/sys/vm/vm_radix.c Modified: head/sys/vm/vm_radix.c ============================================================================== --- head/sys/vm/vm_radix.c Fri Dec 2 16:28:18 2016 (r309415) +++ head/sys/vm/vm_radix.c Fri Dec 2 16:29:30 2016 (r309416) @@ -308,8 +308,6 @@ SYSINIT(vm_radix_reserve_kva, SI_SUB_KME /* * Initialize the UMA slab zone. - * Until vm_radix_prealloc() is called, the zone will be served by the - * UMA boot-time pre-allocated pool of pages. */ void vm_radix_init(void) From owner-svn-src-all@freebsd.org Fri Dec 2 16:32:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE809C62CEF; Fri, 2 Dec 2016 16:32:15 +0000 (UTC) (envelope-from pfg@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 BE39A1935; Fri, 2 Dec 2016 16:32:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2GWESk008616; Fri, 2 Dec 2016 16:32:14 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2GWEIV008615; Fri, 2 Dec 2016 16:32:14 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612021632.uB2GWEIV008615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 2 Dec 2016 16:32:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309417 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 16:32:16 -0000 Author: pfg Date: Fri Dec 2 16:32:14 2016 New Revision: 309417 URL: https://svnweb.freebsd.org/changeset/base/309417 Log: indent(1): Remove an extra newline added in a previous commit. It doesn't math the remaining of the case statement. Modified: head/usr.bin/indent/parse.c Modified: head/usr.bin/indent/parse.c ============================================================================== --- head/usr.bin/indent/parse.c Fri Dec 2 16:29:30 2016 (r309416) +++ head/usr.bin/indent/parse.c Fri Dec 2 16:32:14 2016 (r309417) @@ -100,7 +100,6 @@ parse(int tk) /* tk: the code for the co * in case of a long "if-else-if ... else-if" sequence. */ ps.i_l_follow = ps.il[ps.tos--]; - /* the rest is the same as for dolit and forstmt */ case dolit: /* 'do' */ case forstmt: /* for (...) */ From owner-svn-src-all@freebsd.org Fri Dec 2 16:41:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D6E7C62F1A; Fri, 2 Dec 2016 16:41:09 +0000 (UTC) (envelope-from pfg@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 2D3071CBF; Fri, 2 Dec 2016 16:41:09 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2Gf8m7011762; Fri, 2 Dec 2016 16:41:08 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2Gf8YK011761; Fri, 2 Dec 2016 16:41:08 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612021641.uB2Gf8YK011761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 2 Dec 2016 16:41:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309418 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 16:41:09 -0000 Author: pfg Date: Fri Dec 2 16:41:08 2016 New Revision: 309418 URL: https://svnweb.freebsd.org/changeset/base/309418 Log: indent(1): Avoid out-of-bound accesses of arrays. ps.paren_indents: When ps.paren_level was 0, this was accessing paren_indents[-1]. in_buffer: This fragment checks if "*/" was read, but there's no guarantee that there is more than one byte in the array (actually, this happens frequently for the "{" in things like "int main(void) {"). Submitted by: Piotr Stefaniak Modified: head/usr.bin/indent/io.c Modified: head/usr.bin/indent/io.c ============================================================================== --- head/usr.bin/indent/io.c Fri Dec 2 16:32:14 2016 (r309417) +++ head/usr.bin/indent/io.c Fri Dec 2 16:41:08 2016 (r309418) @@ -278,7 +278,8 @@ inhibit_newline: *(e_com = s_com = combuf + 1) = '\0'; ps.ind_level = ps.i_l_follow; ps.paren_level = ps.p_l_follow; - paren_target = -ps.paren_indents[ps.paren_level - 1]; + if (ps.paren_level > 0) + paren_target = -ps.paren_indents[ps.paren_level - 1]; not_first_line = 1; } @@ -371,7 +372,7 @@ fill_buffer(void) } buf_ptr = in_buffer; buf_end = p; - if (p[-2] == '/' && p[-3] == '*') { + if (p - in_buffer > 2 && p[-2] == '/' && p[-3] == '*') { if (in_buffer[3] == 'I' && strncmp(in_buffer, "/**INDENT**", 11) == 0) fill_buffer(); /* flush indent error message */ else { From owner-svn-src-all@freebsd.org Fri Dec 2 16:42:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C163CC63087; Fri, 2 Dec 2016 16:42:46 +0000 (UTC) (envelope-from pfg@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 913AA104F; Fri, 2 Dec 2016 16:42:46 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2GgjkC012705; Fri, 2 Dec 2016 16:42:45 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2Ggj1Q012704; Fri, 2 Dec 2016 16:42:45 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612021642.uB2Ggj1Q012704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 2 Dec 2016 16:42:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309419 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 16:42:46 -0000 Author: pfg Date: Fri Dec 2 16:42:45 2016 New Revision: 309419 URL: https://svnweb.freebsd.org/changeset/base/309419 Log: indent(1): Avoid out-of-bound accesses of array ps.p_stack. Submitted by: Piotr Stefaniak Modified: head/usr.bin/indent/parse.c Modified: head/usr.bin/indent/parse.c ============================================================================== --- head/usr.bin/indent/parse.c Fri Dec 2 16:41:08 2016 (r309418) +++ head/usr.bin/indent/parse.c Fri Dec 2 16:42:45 2016 (r309419) @@ -172,7 +172,7 @@ parse(int tk) /* tk: the code for the co case rbrace: /* scanned a } */ /* stack should have or */ - if (ps.p_stack[ps.tos - 1] == lbrace) { + if (ps.tos > 0 && ps.p_stack[ps.tos - 1] == lbrace) { ps.ind_level = ps.i_l_follow = ps.il[--ps.tos]; ps.p_stack[ps.tos] = stmt; } From owner-svn-src-all@freebsd.org Fri Dec 2 17:15:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDB15C63E9A for ; Fri, 2 Dec 2016 17:15:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22b.google.com (mail-io0-x22b.google.com [IPv6:2607:f8b0:4001:c06::22b]) (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 7AC52322 for ; Fri, 2 Dec 2016 17:15:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22b.google.com with SMTP id a124so492511414ioe.2 for ; Fri, 02 Dec 2016 09:15:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=nOxnbYDUZ2tSSrnvXkah79znpHH2W8gWCBOKXu8xtwM=; b=gKPxSLXGafZkCnLSh/hLr7emuM7t9GG5lKGNUu4YpRAkAVWLo882ZaDeSjYOJak0t0 5CM+Dq5LAFVeSJu4ou8uvxJ9HdmZM7xVs5i9rhYMoLgGq2jgrXRWzcbjLm/yW85/W2AU ahOofg+L0ozy/Jssf12tFC7i1t9et9eohvyieHHbVZC19pSjjHXXGI9m7e1AoNBKz1Ew afKAlYFWajkNfgfUaJPA8k3ZM0VRpjlpqJherZaY3tIXFxgdV1s06+h1BSgUujm4JOsm OfZUrB984PrlaElpGWzs6QqtLMFJjfyRbLRTIdVplfLXXteu3O/st5fBjb7BZV1wg/b7 vLVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=nOxnbYDUZ2tSSrnvXkah79znpHH2W8gWCBOKXu8xtwM=; b=ZlxXkdbAhwevA/zDwHLuiRRQ8dgZJacz0qTCjbxGf/x4ViRqEQBPDP9dZt19bd9EAd G8RmiSQYo/36HLihB8xb/JB5SA7o0ESCFpGjjm8avlKeF2x+IqX6Ped5/SFyREoJ8hxR prRGUDmuVRLR2NT0ETCnZSbMtAKJk6Goj4l75qZK3SBIerGPgyxNdd3kt3Xypm5THttz rTVZ6e6yUodgKistUaFoN+W4RIVavajrwYft7VSHbsJh68zplp1BFWQ7KjBfE2PdaVJG 22vSz5O1X3zgsOky2LhfLb5q3FZJ7bQMVyUYSnCnmzjIIfcJMu6kiWGKzMcYSat9L4Yw 2vKQ== X-Gm-Message-State: AKaTC03PAGw1Uv8mkbjJ6uB5PNZmSsKOU5C8OAo0FXDqwyJ8D9CjwAdguxf9McwAWJQOCw2GcJXTax7yqViJxw== X-Received: by 10.36.200.68 with SMTP id w65mr3583771itf.85.1480698916574; Fri, 02 Dec 2016 09:15:16 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.31.199 with HTTP; Fri, 2 Dec 2016 09:15:15 -0800 (PST) X-Originating-IP: [69.53.245.200] In-Reply-To: <3180246.4fqia12Gik@ralph.baldwin.cx> References: <201612010435.uB14Zh21020050@repo.freebsd.org> <20161201164807.GE27291@strugglingcoder.info> <3180246.4fqia12Gik@ralph.baldwin.cx> From: Warner Losh Date: Fri, 2 Dec 2016 10:15:15 -0700 X-Google-Sender-Auth: Z1PQwPRAM0rbKrujnX68vLdAYgM Message-ID: Subject: Re: svn commit: r309351 - head/etc/defaults To: John Baldwin Cc: hiren panchasara , Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 17:15:17 -0000 On Fri, Dec 2, 2016 at 9:18 AM, John Baldwin wrote: > On Thursday, December 01, 2016 02:41:41 PM Warner Losh wrote: >> On Thu, Dec 1, 2016 at 9:48 AM, hiren panchasara >> wrote: >> > On 12/01/16 at 04:35P, Warner Losh wrote: >> >> Author: imp >> >> Date: Thu Dec 1 04:35:43 2016 >> >> New Revision: 309351 >> >> URL: https://svnweb.freebsd.org/changeset/base/309351 >> >> >> >> Log: >> >> Revert the 'performance' setting to 'NONE' from C2. >> > >> > Just a note that this commit reverts r282110. >> >> Yea, it's good for laptops, bad for servers. At least there's some >> Intel CPUs that this causes corruption with USB. That's being sorted >> out, but until that's done we need to fail more safe for our primary >> market. > > It's also good for some servers as you need some cores in C-states > to get the maximum Turbo Boost on other cores (though that may have > been more true for earlier generations of i7 CPUs than more recent > generations). Once the corruption issues are solved, we can and should put this back. Adrian is working on that. Warner From owner-svn-src-all@freebsd.org Fri Dec 2 17:18:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F42BC63F7D; Fri, 2 Dec 2016 17:18:57 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::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 C3E94813; Fri, 2 Dec 2016 17:18:56 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id uB2HIlla070541 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 2 Dec 2016 19:18:47 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua uB2HIlla070541 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id uB2HIlgW070540; Fri, 2 Dec 2016 19:18:47 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 2 Dec 2016 19:18:46 +0200 From: Konstantin Belousov To: Julian Elischer Cc: Jilles Tjoelker , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r309035 - in head/lib/libpathconv: . tests Message-ID: <20161202171846.GF54029@kib.kiev.ua> References: <201611230757.uAN7vqmC008888@repo.freebsd.org> <20161127204305.GA58954@stack.nl> <4de52b2a-fef9-f043-2409-c77bafc599fe@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4de52b2a-fef9-f043-2409-c77bafc599fe@freebsd.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 17:18:57 -0000 On Sat, Dec 03, 2016 at 12:00:01AM +0800, Julian Elischer wrote: > On 28/11/2016 4:43 AM, Jilles Tjoelker wrote: > > On Wed, Nov 23, 2016 at 07:57:52AM +0000, Julian Elischer wrote: > >> Author: julian > >> Date: Wed Nov 23 07:57:52 2016 > >> New Revision: 309035 > >> URL: https://svnweb.freebsd.org/changeset/base/309035 > >> Log: > >> This little BSD licensed library has been kicking around for years. > >> It allows one to trivially convert an absolute path to a relative path > >> and the reverse. The test programs themselves are very useful in scripts > >> but the real use comes shortly with the -r and -a arguments to ln. > >> These are sometimes known as the --relative and --absolute flags and > >> can force a symlink to be relative when you only have an absolue path. > >> Another place these are sometimes used is to add -a and -r args to 'realpath'. > >> Incredibly useful in Makefiles. > >> I was going to just add the files in with 'ln' but a library makes more sense. > >> The test programs may come out in their own right some day for scripting. > >> released under a BSD 2-clause: > >> * Copyright (c) 1997 Shigio Yamaguchi. All rights reserved. > >> * Copyright (c) 1999 Tama Communications Corporation. All rights reserved. > >> The test directry does not conform to any framework. > >> Not connected to build. > >> doc people may want to play with the manual pages. > >> Obtained from: https://www.tamacom.com/pathconvert.html Shigio Yamaguchi. > >> MFC after: 1 month > >> Relnotes: yes > >> Sponsored by: Panzura, Tama Communications Corporation > > Consider making this a static-only library or a part of an existing > > library such as libc or libutil, since the overhead of a shared object > > is rather big compared to the amount of code here. > > yeah I was thinking of making it part of libc but libc is already > such a kitchen sink and there are only two planned users. > ln and realpath. > A static library is one idea for sure. (or even just a .o). Note that libutil was mentioned, which is the kitchen sink both by design and by purpose. > > The actual real target for this is the build itself. Currently we are > making > lots of symlinks that should be relative but we only really have > absolute information. > This allows symlink -sr to dynamically generate the correct relative > symlink, > given absolute args. > e.g. /usr/lib/libm.so -> /lib/libm.so.5 should really be > ../../lib/libm.so.5 > so that when it is read from outside a jail it still refers to the > right place. > > I'm waiting for a gap in my work schedule to get ln and realpath > changes in place. > > > > > > > Thanks for not linking this to the build right away. > > > From owner-svn-src-all@freebsd.org Fri Dec 2 18:03:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07E15C6302E; Fri, 2 Dec 2016 18:03:17 +0000 (UTC) (envelope-from mjg@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 B29D31EA; Fri, 2 Dec 2016 18:03:16 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2I3FSj046713; Fri, 2 Dec 2016 18:03:15 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2I3Fmt046712; Fri, 2 Dec 2016 18:03:15 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201612021803.uB2I3Fmt046712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Fri, 2 Dec 2016 18:03:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309425 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 18:03:17 -0000 Author: mjg Date: Fri Dec 2 18:03:15 2016 New Revision: 309425 URL: https://svnweb.freebsd.org/changeset/base/309425 Log: vfs: provide fake locking primitives for the crossmp vnode Since the vnode is only expected to be shared locked, we can save a little overhead by only pretending we are locking in the first place. Reviewed by: kib Tested by: pho Modified: head/sys/kern/vfs_lookup.c Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Fri Dec 2 17:08:27 2016 (r309424) +++ head/sys/kern/vfs_lookup.c Fri Dec 2 18:03:15 2016 (r309425) @@ -79,6 +79,64 @@ uma_zone_t namei_zone; /* Placeholder vnode for mp traversal. */ static struct vnode *vp_crossmp; +static int +crossmp_vop_islocked(struct vop_islocked_args *ap) +{ + + return (LK_SHARED); +} + +static int +crossmp_vop_lock1(struct vop_lock1_args *ap) +{ + struct vnode *vp; + struct lock *lk; + const char *file; + int flags, line; + + vp = ap->a_vp; + lk = vp->v_vnlock; + flags = ap->a_flags; + file = ap->a_file; + line = ap->a_line; + + if ((flags & LK_SHARED) == 0) + panic("invalid lock request for crossmp"); + + WITNESS_CHECKORDER(&lk->lock_object, LOP_NEWORDER, file, line, + flags & LK_INTERLOCK ? &VI_MTX(vp)->lock_object : NULL); + WITNESS_LOCK(&lk->lock_object, 0, file, line); + if ((flags & LK_INTERLOCK) != 0) + VI_UNLOCK(vp); + LOCK_LOG_LOCK("SLOCK", &lk->lock_object, 0, 0, ap->a_file, line); + return (0); +} + +static int +crossmp_vop_unlock(struct vop_unlock_args *ap) +{ + struct vnode *vp; + struct lock *lk; + int flags; + + vp = ap->a_vp; + lk = vp->v_vnlock; + flags = ap->a_flags; + + if ((flags & LK_INTERLOCK) != 0) + VI_UNLOCK(vp); + WITNESS_UNLOCK(&lk->lock_object, 0, LOCK_FILE, LOCK_LINE); + LOCK_LOG_LOCK("SUNLOCK", &lk->lock_object, 0, 0, LOCK_FILE, + LOCK_LINE); + return (0); +} + +static struct vop_vector crossmp_vnodeops = { + .vop_islocked = crossmp_vop_islocked, + .vop_lock1 = crossmp_vop_lock1, + .vop_unlock = crossmp_vop_unlock, +}; + struct nameicap_tracker { struct vnode *dp; TAILQ_ENTRY(nameicap_tracker) nm_link; @@ -95,10 +153,7 @@ nameiinit(void *dummy __unused) UMA_ALIGN_PTR, 0); nt_zone = uma_zcreate("rentr", sizeof(struct nameicap_tracker), NULL, NULL, NULL, NULL, sizeof(void *), 0); - getnewvnode("crossmp", NULL, &dead_vnodeops, &vp_crossmp); - vn_lock(vp_crossmp, LK_EXCLUSIVE); - VN_LOCK_ASHARE(vp_crossmp); - VOP_UNLOCK(vp_crossmp, 0); + getnewvnode("crossmp", NULL, &crossmp_vnodeops, &vp_crossmp); } SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_SECOND, nameiinit, NULL); From owner-svn-src-all@freebsd.org Fri Dec 2 19:02:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F056C63ECC; Fri, 2 Dec 2016 19:02:14 +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 13F601F36; Fri, 2 Dec 2016 19:02:14 +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 uB2J2D8s070361; Fri, 2 Dec 2016 19:02:13 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2J2CIo070357; Fri, 2 Dec 2016 19:02:12 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612021902.uB2J2CIo070357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 2 Dec 2016 19:02:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309426 - in stable: 10/sys/amd64/amd64 10/sys/amd64/include 10/sys/i386/i386 10/sys/i386/include 11/sys/amd64/amd64 11/sys/i386/i386 11/sys/x86/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 19:02:14 -0000 Author: jhb Date: Fri Dec 2 19:02:12 2016 New Revision: 309426 URL: https://svnweb.freebsd.org/changeset/base/309426 Log: MFC 303753,308004: Add bounds checking on addresses used with /dev/mem. 303753: Don't permit mappings of invalid physical addresses on amd64 via /dev/mem. 308004: MFamd64: Add bounds checks on addresses used with /dev/mem. Reject attempts to read from or memory map offsets in /dev/mem that are beyond the maximum-supported physical address of the current CPU. Modified: stable/10/sys/amd64/amd64/mem.c stable/10/sys/amd64/include/md_var.h stable/10/sys/i386/i386/mem.c stable/10/sys/i386/include/md_var.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/amd64/amd64/mem.c stable/11/sys/i386/i386/mem.c stable/11/sys/x86/include/x86_var.h Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/amd64/amd64/mem.c ============================================================================== --- stable/10/sys/amd64/amd64/mem.c Fri Dec 2 18:03:15 2016 (r309425) +++ stable/10/sys/amd64/amd64/mem.c Fri Dec 2 19:02:12 2016 (r309426) @@ -140,7 +140,7 @@ memrw(struct cdev *dev, struct uio *uio, error = uiomove((void *)vd, c, uio); break; } - if (v >= (1ULL << cpu_maxphyaddr)) { + if (v > cpu_getmaxphyaddr()) { error = EFAULT; break; } @@ -168,9 +168,11 @@ int memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int prot __unused, vm_memattr_t *memattr __unused) { - if (dev2unit(dev) == CDEV_MINOR_MEM) + if (dev2unit(dev) == CDEV_MINOR_MEM) { + if (offset > cpu_getmaxphyaddr()) + return (-1); *paddr = offset; - else if (dev2unit(dev) == CDEV_MINOR_KMEM) + } else if (dev2unit(dev) == CDEV_MINOR_KMEM) *paddr = vtophys(offset); /* else panic! */ return (0); Modified: stable/10/sys/amd64/include/md_var.h ============================================================================== --- stable/10/sys/amd64/include/md_var.h Fri Dec 2 18:03:15 2016 (r309425) +++ stable/10/sys/amd64/include/md_var.h Fri Dec 2 19:02:12 2016 (r309426) @@ -89,6 +89,16 @@ struct fpreg; struct dbreg; struct dumperinfo; +/* + * Returns the maximum physical address that can be used with the + * current system. + */ +static __inline vm_paddr_t +cpu_getmaxphyaddr(void) +{ + return ((1ULL << cpu_maxphyaddr) - 1); +} + void *alloc_fpusave(int flags); void amd64_syscall(struct thread *td, int traced); void busdma_swi(void); Modified: stable/10/sys/i386/i386/mem.c ============================================================================== --- stable/10/sys/i386/i386/mem.c Fri Dec 2 18:03:15 2016 (r309425) +++ stable/10/sys/i386/i386/mem.c Fri Dec 2 19:02:12 2016 (r309426) @@ -108,8 +108,11 @@ memrw(struct cdev *dev, struct uio *uio, continue; } if (dev2unit(dev) == CDEV_MINOR_MEM) { - pa = uio->uio_offset; - pa &= ~PAGE_MASK; + if (uio->uio_offset > cpu_getmaxphyaddr()) { + error = EFAULT; + break; + } + pa = trunc_page(uio->uio_offset); } else { /* * Extract the physical page since the mapping may @@ -161,9 +164,11 @@ int memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int prot __unused, vm_memattr_t *memattr __unused) { - if (dev2unit(dev) == CDEV_MINOR_MEM) + if (dev2unit(dev) == CDEV_MINOR_MEM) { + if (offset > cpu_getmaxphyaddr()) + return (-1); *paddr = offset; - else if (dev2unit(dev) == CDEV_MINOR_KMEM) + } else if (dev2unit(dev) == CDEV_MINOR_KMEM) *paddr = vtophys(offset); /* else panic! */ return (0); Modified: stable/10/sys/i386/include/md_var.h ============================================================================== --- stable/10/sys/i386/include/md_var.h Fri Dec 2 18:03:15 2016 (r309425) +++ stable/10/sys/i386/include/md_var.h Fri Dec 2 19:02:12 2016 (r309426) @@ -96,6 +96,20 @@ struct dbreg; struct dumperinfo; struct segment_descriptor; +/* + * Returns the maximum physical address that can be used with the + * current system. + */ +static __inline vm_paddr_t +cpu_getmaxphyaddr(void) +{ +#if !defined(PAE) + return (0xffffffff); +#else + return ((1ULL << cpu_maxphyaddr) - 1); +#endif +} + void *alloc_fpusave(int flags); void bcopyb(const void *from, void *to, size_t len); void busdma_swi(void); From owner-svn-src-all@freebsd.org Fri Dec 2 19:02:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B001EC63ED0; Fri, 2 Dec 2016 19:02:14 +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 7D57C1F38; Fri, 2 Dec 2016 19:02:14 +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 uB2J2DWO070369; Fri, 2 Dec 2016 19:02:13 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2J2Dn0070366; Fri, 2 Dec 2016 19:02:13 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612021902.uB2J2Dn0070366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 2 Dec 2016 19:02:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309426 - in stable: 10/sys/amd64/amd64 10/sys/amd64/include 10/sys/i386/i386 10/sys/i386/include 11/sys/amd64/amd64 11/sys/i386/i386 11/sys/x86/include X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 19:02:14 -0000 Author: jhb Date: Fri Dec 2 19:02:12 2016 New Revision: 309426 URL: https://svnweb.freebsd.org/changeset/base/309426 Log: MFC 303753,308004: Add bounds checking on addresses used with /dev/mem. 303753: Don't permit mappings of invalid physical addresses on amd64 via /dev/mem. 308004: MFamd64: Add bounds checks on addresses used with /dev/mem. Reject attempts to read from or memory map offsets in /dev/mem that are beyond the maximum-supported physical address of the current CPU. Modified: stable/11/sys/amd64/amd64/mem.c stable/11/sys/i386/i386/mem.c stable/11/sys/x86/include/x86_var.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/amd64/amd64/mem.c stable/10/sys/amd64/include/md_var.h stable/10/sys/i386/i386/mem.c stable/10/sys/i386/include/md_var.h Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/amd64/amd64/mem.c ============================================================================== --- stable/11/sys/amd64/amd64/mem.c Fri Dec 2 18:03:15 2016 (r309425) +++ stable/11/sys/amd64/amd64/mem.c Fri Dec 2 19:02:12 2016 (r309426) @@ -140,7 +140,7 @@ memrw(struct cdev *dev, struct uio *uio, error = uiomove((void *)vd, c, uio); break; } - if (v >= (1ULL << cpu_maxphyaddr)) { + if (v > cpu_getmaxphyaddr()) { error = EFAULT; break; } @@ -168,9 +168,11 @@ int memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int prot __unused, vm_memattr_t *memattr __unused) { - if (dev2unit(dev) == CDEV_MINOR_MEM) + if (dev2unit(dev) == CDEV_MINOR_MEM) { + if (offset > cpu_getmaxphyaddr()) + return (-1); *paddr = offset; - else if (dev2unit(dev) == CDEV_MINOR_KMEM) + } else if (dev2unit(dev) == CDEV_MINOR_KMEM) *paddr = vtophys(offset); /* else panic! */ return (0); Modified: stable/11/sys/i386/i386/mem.c ============================================================================== --- stable/11/sys/i386/i386/mem.c Fri Dec 2 18:03:15 2016 (r309425) +++ stable/11/sys/i386/i386/mem.c Fri Dec 2 19:02:12 2016 (r309426) @@ -108,8 +108,11 @@ memrw(struct cdev *dev, struct uio *uio, continue; } if (dev2unit(dev) == CDEV_MINOR_MEM) { - pa = uio->uio_offset; - pa &= ~PAGE_MASK; + if (uio->uio_offset > cpu_getmaxphyaddr()) { + error = EFAULT; + break; + } + pa = trunc_page(uio->uio_offset); } else { /* * Extract the physical page since the mapping may @@ -161,9 +164,11 @@ int memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int prot __unused, vm_memattr_t *memattr __unused) { - if (dev2unit(dev) == CDEV_MINOR_MEM) + if (dev2unit(dev) == CDEV_MINOR_MEM) { + if (offset > cpu_getmaxphyaddr()) + return (-1); *paddr = offset; - else if (dev2unit(dev) == CDEV_MINOR_KMEM) + } else if (dev2unit(dev) == CDEV_MINOR_KMEM) *paddr = vtophys(offset); /* else panic! */ return (0); Modified: stable/11/sys/x86/include/x86_var.h ============================================================================== --- stable/11/sys/x86/include/x86_var.h Fri Dec 2 18:03:15 2016 (r309425) +++ stable/11/sys/x86/include/x86_var.h Fri Dec 2 19:02:12 2016 (r309426) @@ -94,6 +94,20 @@ struct trapframe; */ typedef void alias_for_inthand_t(void); +/* + * Returns the maximum physical address that can be used with the + * current system. + */ +static __inline vm_paddr_t +cpu_getmaxphyaddr(void) +{ +#if defined(__i386__) && !defined(PAE) + return (0xffffffff); +#else + return ((1ULL << cpu_maxphyaddr) - 1); +#endif +} + void *alloc_fpusave(int flags); void busdma_swi(void); bool cpu_mwait_usable(void); From owner-svn-src-all@freebsd.org Fri Dec 2 19:20:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 810CDC63227; Fri, 2 Dec 2016 19:20:12 +0000 (UTC) (envelope-from dim@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 37760975; Fri, 2 Dec 2016 19:20:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2JKBjf074788; Fri, 2 Dec 2016 19:20:11 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2JKA5r074776; Fri, 2 Dec 2016 19:20:10 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612021920.uB2JKA5r074776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 2 Dec 2016 19:20:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r309427 - in vendor/llvm/dist: include/llvm/Support lib/CodeGen/SelectionDAG lib/Target/AMDGPU lib/Transforms/InstCombine lib/Transforms/Utils test/CodeGen/AMDGPU test/CodeGen/X86 test/... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 19:20:12 -0000 Author: dim Date: Fri Dec 2 19:20:10 2016 New Revision: 309427 URL: https://svnweb.freebsd.org/changeset/base/309427 Log: Vendor import of llvm release_39 branch r288513: https://llvm.org/svn/llvm-project/llvm/branches/release_39@288513 Added: vendor/llvm/dist/test/CodeGen/AMDGPU/mubuf-shader-vgpr.ll vendor/llvm/dist/test/CodeGen/X86/mul-i1024.ll vendor/llvm/dist/test/CodeGen/X86/mul-i512.ll vendor/llvm/dist/test/Transforms/SimplifyCFG/PR29163.ll Modified: vendor/llvm/dist/include/llvm/Support/Threading.h vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIInstrInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIInstructions.td vendor/llvm/dist/lib/Target/AMDGPU/SIWholeQuadMode.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCompares.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp vendor/llvm/dist/lib/Transforms/Utils/SimplifyCFG.cpp vendor/llvm/dist/test/CodeGen/AMDGPU/wqm.ll vendor/llvm/dist/test/CodeGen/X86/mul-i256.ll vendor/llvm/dist/test/LTO/X86/type-mapping-bug.ll vendor/llvm/dist/test/Transforms/InstCombine/indexed-gep-compares.ll vendor/llvm/dist/test/Transforms/InstCombine/unpack-fca.ll Modified: vendor/llvm/dist/include/llvm/Support/Threading.h ============================================================================== --- vendor/llvm/dist/include/llvm/Support/Threading.h Fri Dec 2 19:02:12 2016 (r309426) +++ vendor/llvm/dist/include/llvm/Support/Threading.h Fri Dec 2 19:20:10 2016 (r309427) @@ -20,11 +20,11 @@ #include // So we can check the C++ standard lib macros. #include -// We use std::call_once on all Unix platforms except for NetBSD with -// libstdc++. That platform has a bug they are working to fix, and they'll -// remove the NetBSD checks once fixed. -#if defined(LLVM_ON_UNIX) && \ - !(defined(__NetBSD__) && !defined(_LIBCPP_VERSION)) && !defined(__ppc__) +// std::call_once from libc++ is used on all Unix platforms. Other +// implementations like libstdc++ are known to have problems on NetBSD, +// OpenBSD and PowerPC. +#if defined(LLVM_ON_UNIX) && (defined(_LIBCPP_VERSION) || \ + !(defined(__NetBSD__) || defined(__OpenBSD__) || defined(__ppc__))) #define LLVM_THREADING_USE_STD_CALL_ONCE 1 #else #define LLVM_THREADING_USE_STD_CALL_ONCE 0 Modified: vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp ============================================================================== --- vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Fri Dec 2 19:02:12 2016 (r309426) +++ vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp Fri Dec 2 19:20:10 2016 (r309427) @@ -2185,24 +2185,29 @@ void DAGTypeLegalizer::ExpandIntRes_MUL( // options. This is a trivially-generalized version of the code from // Hacker's Delight (itself derived from Knuth's Algorithm M from section // 4.3.1). - SDValue Mask = - DAG.getConstant(APInt::getLowBitsSet(NVT.getSizeInBits(), - NVT.getSizeInBits() >> 1), dl, NVT); + unsigned Bits = NVT.getSizeInBits(); + unsigned HalfBits = Bits >> 1; + SDValue Mask = DAG.getConstant(APInt::getLowBitsSet(Bits, HalfBits), dl, + NVT); SDValue LLL = DAG.getNode(ISD::AND, dl, NVT, LL, Mask); SDValue RLL = DAG.getNode(ISD::AND, dl, NVT, RL, Mask); SDValue T = DAG.getNode(ISD::MUL, dl, NVT, LLL, RLL); SDValue TL = DAG.getNode(ISD::AND, dl, NVT, T, Mask); - SDValue Shift = - DAG.getConstant(NVT.getSizeInBits() >> 1, dl, - TLI.getShiftAmountTy(NVT, DAG.getDataLayout())); + EVT ShiftAmtTy = TLI.getShiftAmountTy(NVT, DAG.getDataLayout()); + if (APInt::getMaxValue(ShiftAmtTy.getSizeInBits()).ult(HalfBits)) { + // The type from TLI is too small to fit the shift amount we want. + // Override it with i32. The shift will have to be legalized. + ShiftAmtTy = MVT::i32; + } + SDValue Shift = DAG.getConstant(HalfBits, dl, ShiftAmtTy); SDValue TH = DAG.getNode(ISD::SRL, dl, NVT, T, Shift); SDValue LLH = DAG.getNode(ISD::SRL, dl, NVT, LL, Shift); SDValue RLH = DAG.getNode(ISD::SRL, dl, NVT, RL, Shift); SDValue U = DAG.getNode(ISD::ADD, dl, NVT, - DAG.getNode(ISD::MUL, dl, NVT, LLH, RLL), TL); + DAG.getNode(ISD::MUL, dl, NVT, LLH, RLL), TH); SDValue UL = DAG.getNode(ISD::AND, dl, NVT, U, Mask); SDValue UH = DAG.getNode(ISD::SRL, dl, NVT, U, Shift); @@ -2211,14 +2216,14 @@ void DAGTypeLegalizer::ExpandIntRes_MUL( SDValue VH = DAG.getNode(ISD::SRL, dl, NVT, V, Shift); SDValue W = DAG.getNode(ISD::ADD, dl, NVT, - DAG.getNode(ISD::MUL, dl, NVT, LL, RL), + DAG.getNode(ISD::MUL, dl, NVT, LLH, RLH), DAG.getNode(ISD::ADD, dl, NVT, UH, VH)); - Lo = DAG.getNode(ISD::ADD, dl, NVT, TH, + Lo = DAG.getNode(ISD::ADD, dl, NVT, TL, DAG.getNode(ISD::SHL, dl, NVT, V, Shift)); Hi = DAG.getNode(ISD::ADD, dl, NVT, W, DAG.getNode(ISD::ADD, dl, NVT, - DAG.getNode(ISD::MUL, dl, NVT, RH, LL), + DAG.getNode(ISD::MUL, dl, NVT, RH, LL), DAG.getNode(ISD::MUL, dl, NVT, RL, LH))); return; } Modified: vendor/llvm/dist/lib/Target/AMDGPU/SIInstrInfo.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/AMDGPU/SIInstrInfo.cpp Fri Dec 2 19:02:12 2016 (r309426) +++ vendor/llvm/dist/lib/Target/AMDGPU/SIInstrInfo.cpp Fri Dec 2 19:20:10 2016 (r309427) @@ -2203,7 +2203,8 @@ void SIInstrInfo::legalizeOperandsSMRD(M } void SIInstrInfo::legalizeOperands(MachineInstr &MI) const { - MachineRegisterInfo &MRI = MI.getParent()->getParent()->getRegInfo(); + MachineFunction &MF = *MI.getParent()->getParent(); + MachineRegisterInfo &MRI = MF.getRegInfo(); // Legalize VOP2 if (isVOP2(MI) || isVOPC(MI)) { @@ -2321,8 +2322,14 @@ void SIInstrInfo::legalizeOperands(Machi return; } - // Legalize MIMG - if (isMIMG(MI)) { + // Legalize MIMG and MUBUF/MTBUF for shaders. + // + // Shaders only generate MUBUF/MTBUF instructions via intrinsics or via + // scratch memory access. In both cases, the legalization never involves + // conversion to the addr64 form. + if (isMIMG(MI) || + (AMDGPU::isShader(MF.getFunction()->getCallingConv()) && + (isMUBUF(MI) || isMTBUF(MI)))) { MachineOperand *SRsrc = getNamedOperand(MI, AMDGPU::OpName::srsrc); if (SRsrc && !RI.isSGPRClass(MRI.getRegClass(SRsrc->getReg()))) { unsigned SGPR = readlaneVGPRToSGPR(SRsrc->getReg(), MI, MRI); @@ -2337,9 +2344,10 @@ void SIInstrInfo::legalizeOperands(Machi return; } - // Legalize MUBUF* instructions + // Legalize MUBUF* instructions by converting to addr64 form. // FIXME: If we start using the non-addr64 instructions for compute, we - // may need to legalize them here. + // may need to legalize them as above. This especially applies to the + // buffer_load_format_* variants and variants with idxen (or bothen). int SRsrcIdx = AMDGPU::getNamedOperandIdx(MI.getOpcode(), AMDGPU::OpName::srsrc); if (SRsrcIdx != -1) { Modified: vendor/llvm/dist/lib/Target/AMDGPU/SIInstructions.td ============================================================================== --- vendor/llvm/dist/lib/Target/AMDGPU/SIInstructions.td Fri Dec 2 19:02:12 2016 (r309426) +++ vendor/llvm/dist/lib/Target/AMDGPU/SIInstructions.td Fri Dec 2 19:20:10 2016 (r309427) @@ -2029,6 +2029,7 @@ def SI_RETURN : PseudoInstSI < let hasSideEffects = 1; let SALU = 1; let hasNoSchedulingInfo = 1; + let DisableWQM = 1; } let Uses = [EXEC], Defs = [EXEC, VCC, M0], Modified: vendor/llvm/dist/lib/Target/AMDGPU/SIWholeQuadMode.cpp ============================================================================== --- vendor/llvm/dist/lib/Target/AMDGPU/SIWholeQuadMode.cpp Fri Dec 2 19:02:12 2016 (r309426) +++ vendor/llvm/dist/lib/Target/AMDGPU/SIWholeQuadMode.cpp Fri Dec 2 19:20:10 2016 (r309427) @@ -219,13 +219,6 @@ char SIWholeQuadMode::scanInstructions(M markInstruction(MI, Flags, Worklist); GlobalFlags |= Flags; } - - if (WQMOutputs && MBB.succ_empty()) { - // This is a prolog shader. Make sure we go back to exact mode at the end. - Blocks[&MBB].OutNeeds = StateExact; - Worklist.push_back(&MBB); - GlobalFlags |= StateExact; - } } return GlobalFlags; Modified: vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCompares.cpp ============================================================================== --- vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCompares.cpp Fri Dec 2 19:02:12 2016 (r309426) +++ vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCompares.cpp Fri Dec 2 19:20:10 2016 (r309427) @@ -634,7 +634,7 @@ static bool canRewriteGEPAsOffset(Value } if (!isa(V) && !isa(V) && - !isa(V) && !isa(V)) + !isa(V) && !isa(V)) // We've found some value that we can't explore which is different from // the base. Therefore we can't do this transformation. return false; Modified: vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp ============================================================================== --- vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp Fri Dec 2 19:02:12 2016 (r309426) +++ vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp Fri Dec 2 19:20:10 2016 (r309427) @@ -579,6 +579,13 @@ static Instruction *unpackLoadToAggregat UndefValue::get(T), NewLoad, 0, Name)); } + // Bail out if the array is too large. Ideally we would like to optimize + // arrays of arbitrary size but this has a terrible impact on compile time. + // The threshold here is chosen arbitrarily, maybe needs a little bit of + // tuning. + if (NumElements > 1024) + return nullptr; + const DataLayout &DL = IC.getDataLayout(); auto EltSize = DL.getTypeAllocSize(ET); auto Align = LI.getAlignment(); @@ -1081,6 +1088,13 @@ static bool unpackStoreToAggregate(InstC return true; } + // Bail out if the array is too large. Ideally we would like to optimize + // arrays of arbitrary size but this has a terrible impact on compile time. + // The threshold here is chosen arbitrarily, maybe needs a little bit of + // tuning. + if (NumElements > 1024) + return false; + const DataLayout &DL = IC.getDataLayout(); auto EltSize = DL.getTypeAllocSize(AT->getElementType()); auto Align = SI.getAlignment(); Modified: vendor/llvm/dist/lib/Transforms/Utils/SimplifyCFG.cpp ============================================================================== --- vendor/llvm/dist/lib/Transforms/Utils/SimplifyCFG.cpp Fri Dec 2 19:02:12 2016 (r309426) +++ vendor/llvm/dist/lib/Transforms/Utils/SimplifyCFG.cpp Fri Dec 2 19:20:10 2016 (r309427) @@ -2024,14 +2024,20 @@ static bool FoldTwoEntryPHINode(PHINode // Move all 'aggressive' instructions, which are defined in the // conditional parts of the if's up to the dominating block. - if (IfBlock1) + if (IfBlock1) { + for (auto &I : *IfBlock1) + I.dropUnknownNonDebugMetadata(); DomBlock->getInstList().splice(InsertPt->getIterator(), IfBlock1->getInstList(), IfBlock1->begin(), IfBlock1->getTerminator()->getIterator()); - if (IfBlock2) + } + if (IfBlock2) { + for (auto &I : *IfBlock2) + I.dropUnknownNonDebugMetadata(); DomBlock->getInstList().splice(InsertPt->getIterator(), IfBlock2->getInstList(), IfBlock2->begin(), IfBlock2->getTerminator()->getIterator()); + } while (PHINode *PN = dyn_cast(BB->begin())) { // Change the PHI node into a select instruction. Added: vendor/llvm/dist/test/CodeGen/AMDGPU/mubuf-shader-vgpr.ll ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/test/CodeGen/AMDGPU/mubuf-shader-vgpr.ll Fri Dec 2 19:20:10 2016 (r309427) @@ -0,0 +1,49 @@ +;RUN: llc < %s -march=amdgcn -mcpu=verde -verify-machineinstrs | FileCheck %s -check-prefix=CHECK +;RUN: llc < %s -march=amdgcn -mcpu=tonga -verify-machineinstrs | FileCheck %s -check-prefix=CHECK + +; Test that buffer_load_format with VGPR resource descriptor is properly +; legalized. + +; CHECK-LABEL: {{^}}test_none: +; CHECK: buffer_load_format_x v0, off, {{s\[[0-9]+:[0-9]+\]}}, 0{{$}} +define amdgpu_vs float @test_none(<4 x i32> addrspace(2)* inreg %base, i32 %i) { +main_body: + %ptr = getelementptr <4 x i32>, <4 x i32> addrspace(2)* %base, i32 %i + %tmp2 = load <4 x i32>, <4 x i32> addrspace(2)* %ptr, align 32 + %tmp7 = call float @llvm.amdgcn.buffer.load.format.f32(<4 x i32> %tmp2, i32 0, i32 0, i1 0, i1 0) + ret float %tmp7 +} + +; CHECK-LABEL: {{^}}test_idxen: +; CHECK: buffer_load_format_x v0, {{v[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, 0 idxen{{$}} +define amdgpu_vs float @test_idxen(<4 x i32> addrspace(2)* inreg %base, i32 %i) { +main_body: + %ptr = getelementptr <4 x i32>, <4 x i32> addrspace(2)* %base, i32 %i + %tmp2 = load <4 x i32>, <4 x i32> addrspace(2)* %ptr, align 32 + %tmp7 = call float @llvm.amdgcn.buffer.load.format.f32(<4 x i32> %tmp2, i32 undef, i32 0, i1 0, i1 0) + ret float %tmp7 +} + +; CHECK-LABEL: {{^}}test_offen: +; CHECK: buffer_load_format_x v0, {{v[0-9]+}}, {{s\[[0-9]+:[0-9]+\]}}, 0 offen{{$}} +define amdgpu_vs float @test_offen(<4 x i32> addrspace(2)* inreg %base, i32 %i) { +main_body: + %ptr = getelementptr <4 x i32>, <4 x i32> addrspace(2)* %base, i32 %i + %tmp2 = load <4 x i32>, <4 x i32> addrspace(2)* %ptr, align 32 + %tmp7 = call float @llvm.amdgcn.buffer.load.format.f32(<4 x i32> %tmp2, i32 0, i32 undef, i1 0, i1 0) + ret float %tmp7 +} + +; CHECK-LABEL: {{^}}test_both: +; CHECK: buffer_load_format_x v0, {{v\[[0-9]+:[0-9]+\]}}, {{s\[[0-9]+:[0-9]+\]}}, 0 idxen offen{{$}} +define amdgpu_vs float @test_both(<4 x i32> addrspace(2)* inreg %base, i32 %i) { +main_body: + %ptr = getelementptr <4 x i32>, <4 x i32> addrspace(2)* %base, i32 %i + %tmp2 = load <4 x i32>, <4 x i32> addrspace(2)* %ptr, align 32 + %tmp7 = call float @llvm.amdgcn.buffer.load.format.f32(<4 x i32> %tmp2, i32 undef, i32 undef, i1 0, i1 0) + ret float %tmp7 +} + +declare float @llvm.amdgcn.buffer.load.format.f32(<4 x i32>, i32, i32, i1, i1) nounwind readonly + +attributes #0 = { nounwind readnone } Modified: vendor/llvm/dist/test/CodeGen/AMDGPU/wqm.ll ============================================================================== --- vendor/llvm/dist/test/CodeGen/AMDGPU/wqm.ll Fri Dec 2 19:02:12 2016 (r309426) +++ vendor/llvm/dist/test/CodeGen/AMDGPU/wqm.ll Fri Dec 2 19:20:10 2016 (r309427) @@ -17,17 +17,18 @@ main_body: ;CHECK-LABEL: {{^}}test2: ;CHECK-NEXT: ; %main_body ;CHECK-NEXT: s_wqm_b64 exec, exec -;CHECK: image_sample ;CHECK-NOT: exec -;CHECK: _load_dword v0, -define amdgpu_ps float @test2(<8 x i32> inreg %rsrc, <4 x i32> inreg %sampler, float addrspace(1)* inreg %ptr, <4 x i32> %c) { +define amdgpu_ps void @test2(<8 x i32> inreg %rsrc, <4 x i32> inreg %sampler, float addrspace(1)* inreg %ptr, <4 x i32> %c) { main_body: %c.1 = call <4 x float> @llvm.SI.image.sample.v4i32(<4 x i32> %c, <8 x i32> %rsrc, <4 x i32> %sampler, i32 15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0) %c.2 = bitcast <4 x float> %c.1 to <4 x i32> %c.3 = extractelement <4 x i32> %c.2, i32 0 %gep = getelementptr float, float addrspace(1)* %ptr, i32 %c.3 %data = load float, float addrspace(1)* %gep - ret float %data + + call void @llvm.SI.export(i32 15, i32 1, i32 1, i32 0, i32 1, float %data, float undef, float undef, float undef) + + ret void } ; ... but disabled for stores (and, in this simple case, not re-enabled). @@ -414,6 +415,46 @@ entry: ret void } +; Must return to exact at the end of a non-void returning shader, +; otherwise the EXEC mask exported by the epilog will be wrong. This is true +; even if the shader has no kills, because a kill could have happened in a +; previous shader fragment. +; +; CHECK-LABEL: {{^}}test_nonvoid_return: +; CHECK: s_mov_b64 [[LIVE:s\[[0-9]+:[0-9]+\]]], exec +; CHECK: s_wqm_b64 exec, exec +; +; CHECK: s_and_b64 exec, exec, [[LIVE]] +; CHECK-NOT: exec +define amdgpu_ps <4 x float> @test_nonvoid_return() nounwind { + %tex = call <4 x float> @llvm.SI.image.sample.v4i32(<4 x i32> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0) + %tex.i = bitcast <4 x float> %tex to <4 x i32> + %dtex = call <4 x float> @llvm.SI.image.sample.v4i32(<4 x i32> %tex.i, <8 x i32> undef, <4 x i32> undef, i32 15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0) + ret <4 x float> %dtex +} + +; CHECK-LABEL: {{^}}test_nonvoid_return_unreachable: +; CHECK: s_mov_b64 [[LIVE:s\[[0-9]+:[0-9]+\]]], exec +; CHECK: s_wqm_b64 exec, exec +; +; CHECK: s_and_b64 exec, exec, [[LIVE]] +; CHECK-NOT: exec +define amdgpu_ps <4 x float> @test_nonvoid_return_unreachable(i32 inreg %c) nounwind { +entry: + %tex = call <4 x float> @llvm.SI.image.sample.v4i32(<4 x i32> undef, <8 x i32> undef, <4 x i32> undef, i32 15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0) + %tex.i = bitcast <4 x float> %tex to <4 x i32> + %dtex = call <4 x float> @llvm.SI.image.sample.v4i32(<4 x i32> %tex.i, <8 x i32> undef, <4 x i32> undef, i32 15, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0) + + %cc = icmp sgt i32 %c, 0 + br i1 %cc, label %if, label %else + +if: + store volatile <4 x float> %dtex, <4 x float>* undef + unreachable + +else: + ret <4 x float> %dtex +} declare void @llvm.amdgcn.image.store.v4i32(<4 x float>, <4 x i32>, <8 x i32>, i32, i1, i1, i1, i1) #1 declare void @llvm.amdgcn.buffer.store.f32(float, <4 x i32>, i32, i32, i1, i1) #1 Added: vendor/llvm/dist/test/CodeGen/X86/mul-i1024.ll ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/llvm/dist/test/CodeGen/X86/mul-i1024.ll Fri Dec 2 19:20:10 2016 (r309427) @@ -0,0 +1,5938 @@ +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py +; RUN: llc < %s -mtriple=i386-unknown | FileCheck %s --check-prefix=X32 +; RUN: llc < %s -mtriple=x86_64-unknown | FileCheck %s --check-prefix=X64 + +define void @test_1024(i1024* %a, i1024* %b, i1024* %out) nounwind { +; X32-LABEL: test_1024: +; X32: # BB#0: +; X32-NEXT: pushl %ebp +; X32-NEXT: movl %esp, %ebp +; X32-NEXT: pushl %ebx +; X32-NEXT: pushl %edi +; X32-NEXT: pushl %esi +; X32-NEXT: andl $-8, %esp +; X32-NEXT: subl $2640, %esp # imm = 0xA50 +; X32-NEXT: movl 8(%ebp), %eax +; X32-NEXT: movl 64(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 68(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 72(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 76(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 80(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 84(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 88(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 92(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 96(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 100(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 104(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 108(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 112(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 116(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 120(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 124(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl (%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 4(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 8(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 12(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 16(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 20(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 24(%eax), %ecx +; X32-NEXT: movl %ecx, (%esp) # 4-byte Spill +; X32-NEXT: movl 28(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 32(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 36(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 40(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 44(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 48(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 52(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 56(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 60(%eax), %ebx +; X32-NEXT: movl %ebx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 12(%ebp), %eax +; X32-NEXT: movl 48(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 52(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 56(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 60(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 32(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 36(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 40(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 44(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 16(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 20(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 24(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 28(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 8(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 12(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 112(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 116(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 120(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 124(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 96(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 100(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 104(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 108(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 80(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 84(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 88(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 92(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 64(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 68(%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 72(%eax), %edi +; X32-NEXT: movl 76(%eax), %esi +; X32-NEXT: movl (%eax), %ecx +; X32-NEXT: movl %ecx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: movl 4(%eax), %edx +; X32-NEXT: movl %edx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl %edx +; X32-NEXT: pushl %ecx +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl %ebx +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %esi +; X32-NEXT: movl %esi, %ebx +; X32-NEXT: movl %ebx, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: pushl %edi +; X32-NEXT: movl %edi, {{[0-9]+}}(%esp) # 4-byte Spill +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: movl {{[0-9]+}}(%esp), %esi # 4-byte Reload +; X32-NEXT: pushl %esi +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl %ebx +; X32-NEXT: pushl %edi +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %esi +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl %ebx +; X32-NEXT: pushl %edi +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: movl {{[0-9]+}}(%esp), %esi # 4-byte Reload +; X32-NEXT: pushl %esi +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: movl {{[0-9]+}}(%esp), %edi # 4-byte Reload +; X32-NEXT: pushl %edi +; X32-NEXT: movl {{[0-9]+}}(%esp), %ebx # 4-byte Reload +; X32-NEXT: pushl %ebx +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl %esi +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl %edi +; X32-NEXT: pushl %ebx +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: movl {{[0-9]+}}(%esp), %edi # 4-byte Reload +; X32-NEXT: pushl %edi +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: movl {{[0-9]+}}(%esp), %esi # 4-byte Reload +; X32-NEXT: pushl %esi +; X32-NEXT: movl {{[0-9]+}}(%esp), %ebx # 4-byte Reload +; X32-NEXT: pushl %ebx +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %edi +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl %esi +; X32-NEXT: pushl %ebx +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %edi +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: movl {{[0-9]+}}(%esp), %esi # 4-byte Reload +; X32-NEXT: pushl %esi +; X32-NEXT: movl {{[0-9]+}}(%esp), %edi # 4-byte Reload +; X32-NEXT: pushl %edi +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: movl {{[0-9]+}}(%esp), %ebx # 4-byte Reload +; X32-NEXT: pushl %ebx +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl %esi +; X32-NEXT: pushl %edi +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %ebx +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: movl {{[0-9]+}}(%esp), %esi # 4-byte Reload +; X32-NEXT: pushl %esi +; X32-NEXT: movl {{[0-9]+}}(%esp), %edi # 4-byte Reload +; X32-NEXT: pushl %edi +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl %esi +; X32-NEXT: pushl %edi +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: movl {{[0-9]+}}(%esp), %esi # 4-byte Reload +; X32-NEXT: pushl %esi +; X32-NEXT: movl {{[0-9]+}}(%esp), %edi # 4-byte Reload +; X32-NEXT: pushl %edi +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: movl {{[0-9]+}}(%esp), %ebx # 4-byte Reload +; X32-NEXT: pushl %ebx +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl %esi +; X32-NEXT: pushl %edi +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl %ebx +; X32-NEXT: movl {{[0-9]+}}(%esp), %esi # 4-byte Reload +; X32-NEXT: pushl %esi +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: movl {{[0-9]+}}(%esp), %ebx # 4-byte Reload +; X32-NEXT: pushl %ebx +; X32-NEXT: movl {{[0-9]+}}(%esp), %edi # 4-byte Reload +; X32-NEXT: pushl %edi +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl %ebx +; X32-NEXT: pushl %edi +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: movl {{[0-9]+}}(%esp), %ebx # 4-byte Reload +; X32-NEXT: pushl %ebx +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: movl {{[0-9]+}}(%esp), %edi # 4-byte Reload +; X32-NEXT: pushl %edi +; X32-NEXT: pushl %esi +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %ebx +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl %edi +; X32-NEXT: pushl %esi +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: movl {{[0-9]+}}(%esp), %edi # 4-byte Reload +; X32-NEXT: pushl %edi +; X32-NEXT: movl {{[0-9]+}}(%esp), %esi # 4-byte Reload +; X32-NEXT: pushl %esi +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl %edi +; X32-NEXT: pushl %esi +; X32-NEXT: movl {{[0-9]+}}(%esp), %ebx # 4-byte Reload +; X32-NEXT: pushl %ebx +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: movl {{[0-9]+}}(%esp), %edi # 4-byte Reload +; X32-NEXT: pushl %edi +; X32-NEXT: movl {{[0-9]+}}(%esp), %esi # 4-byte Reload +; X32-NEXT: pushl %esi +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl %edi +; X32-NEXT: pushl %esi +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl %ebx +; X32-NEXT: movl {{[0-9]+}}(%esp), %esi # 4-byte Reload +; X32-NEXT: pushl %esi +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: movl {{[0-9]+}}(%esp), %edi # 4-byte Reload +; X32-NEXT: pushl %edi +; X32-NEXT: movl {{[0-9]+}}(%esp), %ebx # 4-byte Reload +; X32-NEXT: pushl %ebx +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %esi +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl %edi +; X32-NEXT: pushl %ebx +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: movl {{[0-9]+}}(%esp), %ebx # 4-byte Reload +; X32-NEXT: pushl %ebx +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: movl {{[0-9]+}}(%esp), %esi # 4-byte Reload +; X32-NEXT: pushl %esi +; X32-NEXT: movl {{[0-9]+}}(%esp), %edi # 4-byte Reload +; X32-NEXT: pushl %edi +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %ebx +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl %esi +; X32-NEXT: pushl %edi +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: movl {{[0-9]+}}(%esp), %edi # 4-byte Reload +; X32-NEXT: pushl %edi +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: movl {{[0-9]+}}(%esp), %esi # 4-byte Reload +; X32-NEXT: pushl %esi +; X32-NEXT: movl {{[0-9]+}}(%esp), %ebx # 4-byte Reload +; X32-NEXT: pushl %ebx +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %edi +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl %esi +; X32-NEXT: pushl %ebx +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: movl {{[0-9]+}}(%esp), %edi # 4-byte Reload +; X32-NEXT: pushl %edi +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: movl {{[0-9]+}}(%esp), %esi # 4-byte Reload +; X32-NEXT: pushl %esi +; X32-NEXT: movl {{[0-9]+}}(%esp), %ebx # 4-byte Reload +; X32-NEXT: pushl %ebx +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl %edi +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl %esi +; X32-NEXT: pushl %ebx +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl %edi +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: movl {{[0-9]+}}(%esp), %ebx # 4-byte Reload +; X32-NEXT: pushl %ebx +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: movl {{[0-9]+}}(%esp), %edi # 4-byte Reload +; X32-NEXT: pushl %edi +; X32-NEXT: movl {{[0-9]+}}(%esp), %esi # 4-byte Reload +; X32-NEXT: pushl %esi +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %ebx +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl %edi +; X32-NEXT: pushl %esi +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: movl {{[0-9]+}}(%esp), %edi # 4-byte Reload +; X32-NEXT: pushl %edi +; X32-NEXT: movl {{[0-9]+}}(%esp), %esi # 4-byte Reload +; X32-NEXT: pushl %esi +; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx # 4-byte Reload +; X32-NEXT: pushl %ecx +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: movl {{[0-9]+}}(%esp), %ebx # 4-byte Reload +; X32-NEXT: pushl %ebx +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl {{[0-9]+}}(%esp) # 4-byte Folded Reload +; X32-NEXT: pushl %eax +; X32-NEXT: calll __multi3 +; X32-NEXT: addl $32, %esp +; X32-NEXT: leal {{[0-9]+}}(%esp), %eax +; X32-NEXT: pushl $0 +; X32-NEXT: pushl $0 +; X32-NEXT: pushl %edi +; X32-NEXT: pushl %esi +; X32-NEXT: pushl $0 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Dec 2 19:20:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55AC6C6322E; Fri, 2 Dec 2016 19:20:15 +0000 (UTC) (envelope-from dim@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 0B9BA977; Fri, 2 Dec 2016 19:20:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2JKEjj074834; Fri, 2 Dec 2016 19:20:14 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2JKEZc074833; Fri, 2 Dec 2016 19:20:14 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612021920.uB2JKEZc074833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 2 Dec 2016 19:20:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r309428 - vendor/llvm/llvm-release_39-r288513 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 19:20:15 -0000 Author: dim Date: Fri Dec 2 19:20:14 2016 New Revision: 309428 URL: https://svnweb.freebsd.org/changeset/base/309428 Log: Tag llvm release_39 branch r288513. Added: vendor/llvm/llvm-release_39-r288513/ - copied from r309427, vendor/llvm/dist/ From owner-svn-src-all@freebsd.org Fri Dec 2 19:20:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9574C6328A; Fri, 2 Dec 2016 19:20:23 +0000 (UTC) (envelope-from dim@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 962409C0; Fri, 2 Dec 2016 19:20:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2JKKLX074892; Fri, 2 Dec 2016 19:20:20 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2JKKsT074883; Fri, 2 Dec 2016 19:20:20 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612021920.uB2JKKsT074883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 2 Dec 2016 19:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r309429 - in vendor/clang/dist: include/clang/Basic include/clang/Sema lib/Basic lib/CodeGen lib/Headers lib/Sema test/CodeGen test/OpenMP test/SemaCXX X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 19:20:23 -0000 Author: dim Date: Fri Dec 2 19:20:19 2016 New Revision: 309429 URL: https://svnweb.freebsd.org/changeset/base/309429 Log: Vendor import of clang release_39 branch r288513: https://llvm.org/svn/llvm-project/cfe/branches/release_39@288513 Added: vendor/clang/dist/lib/Headers/msa.h (contents, props changed) vendor/clang/dist/test/CodeGen/builtins-mips-msa-error.c (contents, props changed) Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td vendor/clang/dist/include/clang/Sema/Sema.h vendor/clang/dist/lib/Basic/Targets.cpp vendor/clang/dist/lib/CodeGen/CGStmtOpenMP.cpp vendor/clang/dist/lib/CodeGen/CodeGenFunction.h vendor/clang/dist/lib/Headers/CMakeLists.txt vendor/clang/dist/lib/Sema/SemaChecking.cpp vendor/clang/dist/lib/Sema/SemaExprCXX.cpp vendor/clang/dist/test/CodeGen/builtins-mips-msa.c vendor/clang/dist/test/OpenMP/cancel_codegen.cpp vendor/clang/dist/test/SemaCXX/cxx11-crashes.cpp Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Fri Dec 2 19:20:14 2016 (r309428) +++ vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Fri Dec 2 19:20:19 2016 (r309429) @@ -7621,6 +7621,8 @@ def err_invalid_neon_type_code : Error< "incompatible constant for this __builtin_neon function">; def err_argument_invalid_range : Error< "argument should be a value from %0 to %1">; +def err_argument_not_multiple : Error< + "argument should be a multiple of %0">; def warn_neon_vector_initializer_non_portable : Warning< "vector initializers are not compatible with NEON intrinsics in big endian " "mode">, InGroup>; Modified: vendor/clang/dist/include/clang/Sema/Sema.h ============================================================================== --- vendor/clang/dist/include/clang/Sema/Sema.h Fri Dec 2 19:20:14 2016 (r309428) +++ vendor/clang/dist/include/clang/Sema/Sema.h Fri Dec 2 19:20:19 2016 (r309429) @@ -9417,6 +9417,8 @@ private: llvm::APSInt &Result); bool SemaBuiltinConstantArgRange(CallExpr *TheCall, int ArgNum, int Low, int High); + bool SemaBuiltinConstantArgMultiple(CallExpr *TheCall, int ArgNum, + unsigned Multiple); bool SemaBuiltinARMSpecialReg(unsigned BuiltinID, CallExpr *TheCall, int ArgNum, unsigned ExpectedFieldNum, bool AllowName); Modified: vendor/clang/dist/lib/Basic/Targets.cpp ============================================================================== --- vendor/clang/dist/lib/Basic/Targets.cpp Fri Dec 2 19:20:14 2016 (r309428) +++ vendor/clang/dist/lib/Basic/Targets.cpp Fri Dec 2 19:20:19 2016 (r309429) @@ -2081,21 +2081,23 @@ public: static GPUKind parseAMDGCNName(StringRef Name) { return llvm::StringSwitch(Name) - .Case("tahiti", GK_SOUTHERN_ISLANDS) - .Case("pitcairn", GK_SOUTHERN_ISLANDS) - .Case("verde", GK_SOUTHERN_ISLANDS) - .Case("oland", GK_SOUTHERN_ISLANDS) - .Case("hainan", GK_SOUTHERN_ISLANDS) - .Case("bonaire", GK_SEA_ISLANDS) - .Case("kabini", GK_SEA_ISLANDS) - .Case("kaveri", GK_SEA_ISLANDS) - .Case("hawaii", GK_SEA_ISLANDS) - .Case("mullins", GK_SEA_ISLANDS) - .Case("tonga", GK_VOLCANIC_ISLANDS) - .Case("iceland", GK_VOLCANIC_ISLANDS) - .Case("carrizo", GK_VOLCANIC_ISLANDS) - .Case("fiji", GK_VOLCANIC_ISLANDS) - .Case("stoney", GK_VOLCANIC_ISLANDS) + .Case("tahiti", GK_SOUTHERN_ISLANDS) + .Case("pitcairn", GK_SOUTHERN_ISLANDS) + .Case("verde", GK_SOUTHERN_ISLANDS) + .Case("oland", GK_SOUTHERN_ISLANDS) + .Case("hainan", GK_SOUTHERN_ISLANDS) + .Case("bonaire", GK_SEA_ISLANDS) + .Case("kabini", GK_SEA_ISLANDS) + .Case("kaveri", GK_SEA_ISLANDS) + .Case("hawaii", GK_SEA_ISLANDS) + .Case("mullins", GK_SEA_ISLANDS) + .Case("tonga", GK_VOLCANIC_ISLANDS) + .Case("iceland", GK_VOLCANIC_ISLANDS) + .Case("carrizo", GK_VOLCANIC_ISLANDS) + .Case("fiji", GK_VOLCANIC_ISLANDS) + .Case("stoney", GK_VOLCANIC_ISLANDS) + .Case("polaris10", GK_VOLCANIC_ISLANDS) + .Case("polaris11", GK_VOLCANIC_ISLANDS) .Default(GK_NONE); } Modified: vendor/clang/dist/lib/CodeGen/CGStmtOpenMP.cpp ============================================================================== --- vendor/clang/dist/lib/CodeGen/CGStmtOpenMP.cpp Fri Dec 2 19:20:14 2016 (r309428) +++ vendor/clang/dist/lib/CodeGen/CGStmtOpenMP.cpp Fri Dec 2 19:20:19 2016 (r309429) @@ -1767,17 +1767,11 @@ void CodeGenFunction::EmitOMPOuterLoop(b EmitBlock(LoopExit.getBlock()); // Tell the runtime we are done. - SourceLocation ELoc = S.getLocEnd(); - auto &&CodeGen = [DynamicOrOrdered, ELoc](CodeGenFunction &CGF) { + auto &&CodeGen = [DynamicOrOrdered, &S](CodeGenFunction &CGF) { if (!DynamicOrOrdered) - CGF.CGM.getOpenMPRuntime().emitForStaticFinish(CGF, ELoc); + CGF.CGM.getOpenMPRuntime().emitForStaticFinish(CGF, S.getLocEnd()); }; - CodeGen(*this); - - OpenMPDirectiveKind DKind = S.getDirectiveKind(); - if (DKind == OMPD_for || DKind == OMPD_parallel_for || - DKind == OMPD_distribute_parallel_for) - OMPCancelStack.back().CodeGen = CodeGen; + OMPCancelStack.emitExit(*this, S.getDirectiveKind(), CodeGen); } void CodeGenFunction::EmitOMPForOuterLoop( @@ -1889,11 +1883,12 @@ void CodeGenFunction::EmitOMPDistributeO void CodeGenFunction::EmitOMPDistributeParallelForDirective( const OMPDistributeParallelForDirective &S) { OMPLexicalScope Scope(*this, S, /*AsInlined=*/true); - OMPCancelStackRAII CancelRegion(*this); CGM.getOpenMPRuntime().emitInlinedDirective( *this, OMPD_distribute_parallel_for, [&S](CodeGenFunction &CGF, PrePostActionTy &) { OMPLoopScope PreInitScope(CGF, S); + OMPCancelStackRAII CancelRegion(CGF, OMPD_distribute_parallel_for, + /*HasCancel=*/false); CGF.EmitStmt( cast(S.getAssociatedStmt())->getCapturedStmt()); }); @@ -2082,15 +2077,10 @@ bool CodeGenFunction::EmitOMPWorksharing [](CodeGenFunction &) {}); EmitBlock(LoopExit.getBlock()); // Tell the runtime we are done. - SourceLocation ELoc = S.getLocEnd(); - auto &&CodeGen = [ELoc](CodeGenFunction &CGF) { - CGF.CGM.getOpenMPRuntime().emitForStaticFinish(CGF, ELoc); + auto &&CodeGen = [&S](CodeGenFunction &CGF) { + CGF.CGM.getOpenMPRuntime().emitForStaticFinish(CGF, S.getLocEnd()); }; - CodeGen(*this); - OpenMPDirectiveKind DKind = S.getDirectiveKind(); - if (DKind == OMPD_for || DKind == OMPD_parallel_for || - DKind == OMPD_distribute_parallel_for) - OMPCancelStack.back().CodeGen = CodeGen; + OMPCancelStack.emitExit(*this, S.getDirectiveKind(), CodeGen); } else { const bool IsMonotonic = Ordered || ScheduleKind.Schedule == OMPC_SCHEDULE_static || @@ -2140,11 +2130,11 @@ void CodeGenFunction::EmitOMPForDirectiv bool HasLastprivates = false; auto &&CodeGen = [&S, &HasLastprivates](CodeGenFunction &CGF, PrePostActionTy &) { + OMPCancelStackRAII CancelRegion(CGF, OMPD_for, S.hasCancel()); HasLastprivates = CGF.EmitOMPWorksharingLoop(S); }; { OMPLexicalScope Scope(*this, S, /*AsInlined=*/true); - OMPCancelStackRAII CancelRegion(*this); CGM.getOpenMPRuntime().emitInlinedDirective(*this, OMPD_for, CodeGen, S.hasCancel()); } @@ -2187,7 +2177,6 @@ void CodeGenFunction::EmitSections(const bool HasLastprivates = false; auto &&CodeGen = [&S, Stmt, CS, &HasLastprivates](CodeGenFunction &CGF, PrePostActionTy &) { - OMPCancelStackRAII CancelRegion(CGF); auto &C = CGF.CGM.getContext(); auto KmpInt32Ty = C.getIntTypeForBitwidth(/*DestWidth=*/32, /*Signed=*/1); // Emit helper vars inits. @@ -2282,12 +2271,10 @@ void CodeGenFunction::EmitSections(const CGF.EmitOMPInnerLoop(S, /*RequiresCleanup=*/false, &Cond, &Inc, BodyGen, [](CodeGenFunction &) {}); // Tell the runtime we are done. - SourceLocation ELoc = S.getLocEnd(); - auto &&FinalCodeGen = [ELoc](CodeGenFunction &CGF) { - CGF.CGM.getOpenMPRuntime().emitForStaticFinish(CGF, ELoc); + auto &&CodeGen = [&S](CodeGenFunction &CGF) { + CGF.CGM.getOpenMPRuntime().emitForStaticFinish(CGF, S.getLocEnd()); }; - FinalCodeGen(CGF); - CGF.OMPCancelStack.back().CodeGen = FinalCodeGen; + CGF.OMPCancelStack.emitExit(CGF, S.getDirectiveKind(), CodeGen); CGF.EmitOMPReductionClauseFinal(S); // Emit post-update of the reduction variables if IsLastIter != 0. emitPostUpdateForReductionClause( @@ -2309,6 +2296,7 @@ void CodeGenFunction::EmitSections(const HasCancel = OSD->hasCancel(); else if (auto *OPSD = dyn_cast(&S)) HasCancel = OPSD->hasCancel(); + OMPCancelStackRAII CancelRegion(*this, S.getDirectiveKind(), HasCancel); CGM.getOpenMPRuntime().emitInlinedDirective(*this, OMPD_sections, CodeGen, HasCancel); // Emit barrier for lastprivates only if 'sections' directive has 'nowait' @@ -2412,7 +2400,7 @@ void CodeGenFunction::EmitOMPParallelFor // Emit directive as a combined directive that consists of two implicit // directives: 'parallel' with 'for' directive. auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &) { - OMPCancelStackRAII CancelRegion(CGF); + OMPCancelStackRAII CancelRegion(CGF, OMPD_parallel_for, S.hasCancel()); CGF.EmitOMPWorksharingLoop(S); }; emitCommonOMPParallelDirective(*this, S, OMPD_for, CodeGen); @@ -3412,14 +3400,14 @@ void CodeGenFunction::EmitOMPCancelDirec CodeGenFunction::JumpDest CodeGenFunction::getOMPCancelDestination(OpenMPDirectiveKind Kind) { - if (Kind == OMPD_parallel || Kind == OMPD_task) + if (Kind == OMPD_parallel || Kind == OMPD_task || + Kind == OMPD_target_parallel) return ReturnBlock; assert(Kind == OMPD_for || Kind == OMPD_section || Kind == OMPD_sections || Kind == OMPD_parallel_sections || Kind == OMPD_parallel_for || - Kind == OMPD_distribute_parallel_for); - if (!OMPCancelStack.back().ExitBlock.isValid()) - OMPCancelStack.back().ExitBlock = getJumpDestInCurrentScope("cancel.exit"); - return OMPCancelStack.back().ExitBlock; + Kind == OMPD_distribute_parallel_for || + Kind == OMPD_target_parallel_for); + return OMPCancelStack.getExitBlock(); } // Generate the instructions for '#pragma omp target data' directive. Modified: vendor/clang/dist/lib/CodeGen/CodeGenFunction.h ============================================================================== --- vendor/clang/dist/lib/CodeGen/CodeGenFunction.h Fri Dec 2 19:20:14 2016 (r309428) +++ vendor/clang/dist/lib/CodeGen/CodeGenFunction.h Fri Dec 2 19:20:19 2016 (r309429) @@ -965,33 +965,92 @@ private: }; SmallVector BreakContinueStack; - /// Data for exit block for proper support of OpenMP cancellation constructs. - struct OMPCancel { - JumpDest ExitBlock; - llvm::function_ref CodeGen; - OMPCancel() : CodeGen([](CodeGenFunction &CGF) {}) {} + /// Handles cancellation exit points in OpenMP-related constructs. + class OpenMPCancelExitStack { + /// Tracks cancellation exit point and join point for cancel-related exit + /// and normal exit. + struct CancelExit { + CancelExit() = default; + CancelExit(OpenMPDirectiveKind Kind, JumpDest ExitBlock, + JumpDest ContBlock) + : Kind(Kind), ExitBlock(ExitBlock), ContBlock(ContBlock) {} + OpenMPDirectiveKind Kind = OMPD_unknown; + /// true if the exit block has been emitted already by the special + /// emitExit() call, false if the default codegen is used. + bool HasBeenEmitted = false; + JumpDest ExitBlock; + JumpDest ContBlock; + }; + + SmallVector Stack; + + public: + OpenMPCancelExitStack() : Stack(1) {} + ~OpenMPCancelExitStack() = default; + /// Fetches the exit block for the current OpenMP construct. + JumpDest getExitBlock() const { return Stack.back().ExitBlock; } + /// Emits exit block with special codegen procedure specific for the related + /// OpenMP construct + emits code for normal construct cleanup. + void emitExit(CodeGenFunction &CGF, OpenMPDirectiveKind Kind, + const llvm::function_ref &CodeGen) { + if (Stack.back().Kind == Kind && getExitBlock().isValid()) { + assert(CGF.getOMPCancelDestination(Kind).isValid()); + assert(CGF.HaveInsertPoint()); + assert(!Stack.back().HasBeenEmitted); + auto IP = CGF.Builder.saveAndClearIP(); + CGF.EmitBlock(Stack.back().ExitBlock.getBlock()); + CodeGen(CGF); + CGF.EmitBranchThroughCleanup(Stack.back().ContBlock); + CGF.Builder.restoreIP(IP); + Stack.back().HasBeenEmitted = true; + } + CodeGen(CGF); + } + /// Enter the cancel supporting \a Kind construct. + /// \param Kind OpenMP directive that supports cancel constructs. + /// \param HasCancel true, if the construct has inner cancel directive, + /// false otherwise. + void enter(CodeGenFunction &CGF, OpenMPDirectiveKind Kind, bool HasCancel) { + Stack.push_back({Kind, + HasCancel ? CGF.getJumpDestInCurrentScope("cancel.exit") + : JumpDest(), + HasCancel ? CGF.getJumpDestInCurrentScope("cancel.cont") + : JumpDest()}); + } + /// Emits default exit point for the cancel construct (if the special one + /// has not be used) + join point for cancel/normal exits. + void exit(CodeGenFunction &CGF) { + if (getExitBlock().isValid()) { + assert(CGF.getOMPCancelDestination(Stack.back().Kind).isValid()); + bool HaveIP = CGF.HaveInsertPoint(); + if (!Stack.back().HasBeenEmitted) { + if (HaveIP) + CGF.EmitBranchThroughCleanup(Stack.back().ContBlock); + CGF.EmitBlock(Stack.back().ExitBlock.getBlock()); + CGF.EmitBranchThroughCleanup(Stack.back().ContBlock); + } + CGF.EmitBlock(Stack.back().ContBlock.getBlock()); + if (!HaveIP) { + CGF.Builder.CreateUnreachable(); + CGF.Builder.ClearInsertionPoint(); + } + } + Stack.pop_back(); + } }; - SmallVector OMPCancelStack; + OpenMPCancelExitStack OMPCancelStack; /// Controls insertion of cancellation exit blocks in worksharing constructs. class OMPCancelStackRAII { CodeGenFunction &CGF; public: - OMPCancelStackRAII(CodeGenFunction &CGF) : CGF(CGF) { - CGF.OMPCancelStack.push_back({}); - } - ~OMPCancelStackRAII() { - if (CGF.HaveInsertPoint() && - CGF.OMPCancelStack.back().ExitBlock.isValid()) { - auto CJD = CGF.getJumpDestInCurrentScope("cancel.cont"); - CGF.EmitBranchThroughCleanup(CJD); - CGF.EmitBlock(CGF.OMPCancelStack.back().ExitBlock.getBlock()); - CGF.OMPCancelStack.back().CodeGen(CGF); - CGF.EmitBranchThroughCleanup(CJD); - CGF.EmitBlock(CJD.getBlock()); - } + OMPCancelStackRAII(CodeGenFunction &CGF, OpenMPDirectiveKind Kind, + bool HasCancel) + : CGF(CGF) { + CGF.OMPCancelStack.enter(CGF, Kind, HasCancel); } + ~OMPCancelStackRAII() { CGF.OMPCancelStack.exit(CGF); } }; CodeGenPGO PGO; Modified: vendor/clang/dist/lib/Headers/CMakeLists.txt ============================================================================== --- vendor/clang/dist/lib/Headers/CMakeLists.txt Fri Dec 2 19:20:14 2016 (r309428) +++ vendor/clang/dist/lib/Headers/CMakeLists.txt Fri Dec 2 19:20:19 2016 (r309429) @@ -47,6 +47,7 @@ set(files mmintrin.h mm_malloc.h module.modulemap + msa.h mwaitxintrin.h nmmintrin.h opencl-c.h Added: vendor/clang/dist/lib/Headers/msa.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/clang/dist/lib/Headers/msa.h Fri Dec 2 19:20:19 2016 (r309429) @@ -0,0 +1,583 @@ +/*===---- msa.h - MIPS MSA intrinsics --------------------------------------=== + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + *===-----------------------------------------------------------------------=== + */ + +#ifndef _MSA_H +#define _MSA_H 1 + +#if defined(__mips_msa) +typedef signed char v16i8 __attribute__((vector_size(16), aligned(16))); +typedef signed char v16i8_b __attribute__((vector_size(16), aligned(1))); +typedef unsigned char v16u8 __attribute__((vector_size(16), aligned(16))); +typedef unsigned char v16u8_b __attribute__((vector_size(16), aligned(1))); +typedef short v8i16 __attribute__((vector_size(16), aligned(16))); +typedef short v8i16_h __attribute__((vector_size(16), aligned(2))); +typedef unsigned short v8u16 __attribute__((vector_size(16), aligned(16))); +typedef unsigned short v8u16_h __attribute__((vector_size(16), aligned(2))); +typedef int v4i32 __attribute__((vector_size(16), aligned(16))); +typedef int v4i32_w __attribute__((vector_size(16), aligned(4))); +typedef unsigned int v4u32 __attribute__((vector_size(16), aligned(16))); +typedef unsigned int v4u32_w __attribute__((vector_size(16), aligned(4))); +typedef long long v2i64 __attribute__((vector_size(16), aligned(16))); +typedef long long v2i64_d __attribute__((vector_size(16), aligned(8))); +typedef unsigned long long v2u64 __attribute__((vector_size(16), aligned(16))); +typedef unsigned long long v2u64_d __attribute__((vector_size(16), aligned(8))); +typedef float v4f32 __attribute__((vector_size(16), aligned(16))); +typedef float v4f32_w __attribute__((vector_size(16), aligned(4))); +typedef double v2f64 __attribute__ ((vector_size(16), aligned(16))); +typedef double v2f64_d __attribute__ ((vector_size(16), aligned(8))); + +#define __msa_sll_b __builtin_msa_sll_b +#define __msa_sll_h __builtin_msa_sll_h +#define __msa_sll_w __builtin_msa_sll_w +#define __msa_sll_d __builtin_msa_sll_d +#define __msa_slli_b __builtin_msa_slli_b +#define __msa_slli_h __builtin_msa_slli_h +#define __msa_slli_w __builtin_msa_slli_w +#define __msa_slli_d __builtin_msa_slli_d +#define __msa_sra_b __builtin_msa_sra_b +#define __msa_sra_h __builtin_msa_sra_h +#define __msa_sra_w __builtin_msa_sra_w +#define __msa_sra_d __builtin_msa_sra_d +#define __msa_srai_b __builtin_msa_srai_b +#define __msa_srai_h __builtin_msa_srai_h +#define __msa_srai_w __builtin_msa_srai_w +#define __msa_srai_d __builtin_msa_srai_d +#define __msa_srar_b __builtin_msa_srar_b +#define __msa_srar_h __builtin_msa_srar_h +#define __msa_srar_w __builtin_msa_srar_w +#define __msa_srar_d __builtin_msa_srar_d +#define __msa_srari_b __builtin_msa_srari_b +#define __msa_srari_h __builtin_msa_srari_h +#define __msa_srari_w __builtin_msa_srari_w +#define __msa_srari_d __builtin_msa_srari_d +#define __msa_srl_b __builtin_msa_srl_b +#define __msa_srl_h __builtin_msa_srl_h +#define __msa_srl_w __builtin_msa_srl_w +#define __msa_srl_d __builtin_msa_srl_d +#define __msa_srli_b __builtin_msa_srli_b +#define __msa_srli_h __builtin_msa_srli_h +#define __msa_srli_w __builtin_msa_srli_w +#define __msa_srli_d __builtin_msa_srli_d +#define __msa_srlr_b __builtin_msa_srlr_b +#define __msa_srlr_h __builtin_msa_srlr_h +#define __msa_srlr_w __builtin_msa_srlr_w +#define __msa_srlr_d __builtin_msa_srlr_d +#define __msa_srlri_b __builtin_msa_srlri_b +#define __msa_srlri_h __builtin_msa_srlri_h +#define __msa_srlri_w __builtin_msa_srlri_w +#define __msa_srlri_d __builtin_msa_srlri_d +#define __msa_bclr_b __builtin_msa_bclr_b +#define __msa_bclr_h __builtin_msa_bclr_h +#define __msa_bclr_w __builtin_msa_bclr_w +#define __msa_bclr_d __builtin_msa_bclr_d +#define __msa_bclri_b __builtin_msa_bclri_b +#define __msa_bclri_h __builtin_msa_bclri_h +#define __msa_bclri_w __builtin_msa_bclri_w +#define __msa_bclri_d __builtin_msa_bclri_d +#define __msa_bset_b __builtin_msa_bset_b +#define __msa_bset_h __builtin_msa_bset_h +#define __msa_bset_w __builtin_msa_bset_w +#define __msa_bset_d __builtin_msa_bset_d +#define __msa_bseti_b __builtin_msa_bseti_b +#define __msa_bseti_h __builtin_msa_bseti_h +#define __msa_bseti_w __builtin_msa_bseti_w +#define __msa_bseti_d __builtin_msa_bseti_d +#define __msa_bneg_b __builtin_msa_bneg_b +#define __msa_bneg_h __builtin_msa_bneg_h +#define __msa_bneg_w __builtin_msa_bneg_w +#define __msa_bneg_d __builtin_msa_bneg_d +#define __msa_bnegi_b __builtin_msa_bnegi_b +#define __msa_bnegi_h __builtin_msa_bnegi_h +#define __msa_bnegi_w __builtin_msa_bnegi_w +#define __msa_bnegi_d __builtin_msa_bnegi_d +#define __msa_binsl_b __builtin_msa_binsl_b +#define __msa_binsl_h __builtin_msa_binsl_h +#define __msa_binsl_w __builtin_msa_binsl_w +#define __msa_binsl_d __builtin_msa_binsl_d +#define __msa_binsli_b __builtin_msa_binsli_b +#define __msa_binsli_h __builtin_msa_binsli_h +#define __msa_binsli_w __builtin_msa_binsli_w +#define __msa_binsli_d __builtin_msa_binsli_d +#define __msa_binsr_b __builtin_msa_binsr_b +#define __msa_binsr_h __builtin_msa_binsr_h +#define __msa_binsr_w __builtin_msa_binsr_w +#define __msa_binsr_d __builtin_msa_binsr_d +#define __msa_binsri_b __builtin_msa_binsri_b +#define __msa_binsri_h __builtin_msa_binsri_h +#define __msa_binsri_w __builtin_msa_binsri_w +#define __msa_binsri_d __builtin_msa_binsri_d +#define __msa_addv_b __builtin_msa_addv_b +#define __msa_addv_h __builtin_msa_addv_h +#define __msa_addv_w __builtin_msa_addv_w +#define __msa_addv_d __builtin_msa_addv_d +#define __msa_addvi_b __builtin_msa_addvi_b +#define __msa_addvi_h __builtin_msa_addvi_h +#define __msa_addvi_w __builtin_msa_addvi_w +#define __msa_addvi_d __builtin_msa_addvi_d +#define __msa_subv_b __builtin_msa_subv_b +#define __msa_subv_h __builtin_msa_subv_h +#define __msa_subv_w __builtin_msa_subv_w +#define __msa_subv_d __builtin_msa_subv_d +#define __msa_subvi_b __builtin_msa_subvi_b +#define __msa_subvi_h __builtin_msa_subvi_h +#define __msa_subvi_w __builtin_msa_subvi_w +#define __msa_subvi_d __builtin_msa_subvi_d +#define __msa_max_s_b __builtin_msa_max_s_b +#define __msa_max_s_h __builtin_msa_max_s_h +#define __msa_max_s_w __builtin_msa_max_s_w +#define __msa_max_s_d __builtin_msa_max_s_d +#define __msa_maxi_s_b __builtin_msa_maxi_s_b +#define __msa_maxi_s_h __builtin_msa_maxi_s_h +#define __msa_maxi_s_w __builtin_msa_maxi_s_w +#define __msa_maxi_s_d __builtin_msa_maxi_s_d +#define __msa_max_u_b __builtin_msa_max_u_b +#define __msa_max_u_h __builtin_msa_max_u_h +#define __msa_max_u_w __builtin_msa_max_u_w +#define __msa_max_u_d __builtin_msa_max_u_d +#define __msa_maxi_u_b __builtin_msa_maxi_u_b +#define __msa_maxi_u_h __builtin_msa_maxi_u_h +#define __msa_maxi_u_w __builtin_msa_maxi_u_w +#define __msa_maxi_u_d __builtin_msa_maxi_u_d +#define __msa_min_s_b __builtin_msa_min_s_b +#define __msa_min_s_h __builtin_msa_min_s_h +#define __msa_min_s_w __builtin_msa_min_s_w +#define __msa_min_s_d __builtin_msa_min_s_d +#define __msa_mini_s_b __builtin_msa_mini_s_b +#define __msa_mini_s_h __builtin_msa_mini_s_h +#define __msa_mini_s_w __builtin_msa_mini_s_w +#define __msa_mini_s_d __builtin_msa_mini_s_d +#define __msa_min_u_b __builtin_msa_min_u_b +#define __msa_min_u_h __builtin_msa_min_u_h +#define __msa_min_u_w __builtin_msa_min_u_w +#define __msa_min_u_d __builtin_msa_min_u_d +#define __msa_mini_u_b __builtin_msa_mini_u_b +#define __msa_mini_u_h __builtin_msa_mini_u_h +#define __msa_mini_u_w __builtin_msa_mini_u_w +#define __msa_mini_u_d __builtin_msa_mini_u_d +#define __msa_max_a_b __builtin_msa_max_a_b +#define __msa_max_a_h __builtin_msa_max_a_h +#define __msa_max_a_w __builtin_msa_max_a_w +#define __msa_max_a_d __builtin_msa_max_a_d +#define __msa_min_a_b __builtin_msa_min_a_b +#define __msa_min_a_h __builtin_msa_min_a_h +#define __msa_min_a_w __builtin_msa_min_a_w +#define __msa_min_a_d __builtin_msa_min_a_d +#define __msa_ceq_b __builtin_msa_ceq_b +#define __msa_ceq_h __builtin_msa_ceq_h +#define __msa_ceq_w __builtin_msa_ceq_w +#define __msa_ceq_d __builtin_msa_ceq_d +#define __msa_ceqi_b __builtin_msa_ceqi_b +#define __msa_ceqi_h __builtin_msa_ceqi_h +#define __msa_ceqi_w __builtin_msa_ceqi_w +#define __msa_ceqi_d __builtin_msa_ceqi_d +#define __msa_clt_s_b __builtin_msa_clt_s_b +#define __msa_clt_s_h __builtin_msa_clt_s_h +#define __msa_clt_s_w __builtin_msa_clt_s_w +#define __msa_clt_s_d __builtin_msa_clt_s_d +#define __msa_clti_s_b __builtin_msa_clti_s_b +#define __msa_clti_s_h __builtin_msa_clti_s_h +#define __msa_clti_s_w __builtin_msa_clti_s_w +#define __msa_clti_s_d __builtin_msa_clti_s_d +#define __msa_clt_u_b __builtin_msa_clt_u_b +#define __msa_clt_u_h __builtin_msa_clt_u_h +#define __msa_clt_u_w __builtin_msa_clt_u_w +#define __msa_clt_u_d __builtin_msa_clt_u_d +#define __msa_clti_u_b __builtin_msa_clti_u_b +#define __msa_clti_u_h __builtin_msa_clti_u_h +#define __msa_clti_u_w __builtin_msa_clti_u_w +#define __msa_clti_u_d __builtin_msa_clti_u_d +#define __msa_cle_s_b __builtin_msa_cle_s_b +#define __msa_cle_s_h __builtin_msa_cle_s_h +#define __msa_cle_s_w __builtin_msa_cle_s_w +#define __msa_cle_s_d __builtin_msa_cle_s_d +#define __msa_clei_s_b __builtin_msa_clei_s_b +#define __msa_clei_s_h __builtin_msa_clei_s_h +#define __msa_clei_s_w __builtin_msa_clei_s_w +#define __msa_clei_s_d __builtin_msa_clei_s_d +#define __msa_cle_u_b __builtin_msa_cle_u_b +#define __msa_cle_u_h __builtin_msa_cle_u_h +#define __msa_cle_u_w __builtin_msa_cle_u_w +#define __msa_cle_u_d __builtin_msa_cle_u_d +#define __msa_clei_u_b __builtin_msa_clei_u_b +#define __msa_clei_u_h __builtin_msa_clei_u_h +#define __msa_clei_u_w __builtin_msa_clei_u_w +#define __msa_clei_u_d __builtin_msa_clei_u_d +#define __msa_ld_b __builtin_msa_ld_b +#define __msa_ld_h __builtin_msa_ld_h +#define __msa_ld_w __builtin_msa_ld_w +#define __msa_ld_d __builtin_msa_ld_d +#define __msa_st_b __builtin_msa_st_b +#define __msa_st_h __builtin_msa_st_h +#define __msa_st_w __builtin_msa_st_w +#define __msa_st_d __builtin_msa_st_d +#define __msa_sat_s_b __builtin_msa_sat_s_b +#define __msa_sat_s_h __builtin_msa_sat_s_h +#define __msa_sat_s_w __builtin_msa_sat_s_w +#define __msa_sat_s_d __builtin_msa_sat_s_d +#define __msa_sat_u_b __builtin_msa_sat_u_b +#define __msa_sat_u_h __builtin_msa_sat_u_h +#define __msa_sat_u_w __builtin_msa_sat_u_w +#define __msa_sat_u_d __builtin_msa_sat_u_d +#define __msa_add_a_b __builtin_msa_add_a_b +#define __msa_add_a_h __builtin_msa_add_a_h +#define __msa_add_a_w __builtin_msa_add_a_w +#define __msa_add_a_d __builtin_msa_add_a_d +#define __msa_adds_a_b __builtin_msa_adds_a_b +#define __msa_adds_a_h __builtin_msa_adds_a_h +#define __msa_adds_a_w __builtin_msa_adds_a_w +#define __msa_adds_a_d __builtin_msa_adds_a_d +#define __msa_adds_s_b __builtin_msa_adds_s_b +#define __msa_adds_s_h __builtin_msa_adds_s_h +#define __msa_adds_s_w __builtin_msa_adds_s_w +#define __msa_adds_s_d __builtin_msa_adds_s_d +#define __msa_adds_u_b __builtin_msa_adds_u_b +#define __msa_adds_u_h __builtin_msa_adds_u_h +#define __msa_adds_u_w __builtin_msa_adds_u_w +#define __msa_adds_u_d __builtin_msa_adds_u_d +#define __msa_ave_s_b __builtin_msa_ave_s_b +#define __msa_ave_s_h __builtin_msa_ave_s_h +#define __msa_ave_s_w __builtin_msa_ave_s_w +#define __msa_ave_s_d __builtin_msa_ave_s_d +#define __msa_ave_u_b __builtin_msa_ave_u_b +#define __msa_ave_u_h __builtin_msa_ave_u_h +#define __msa_ave_u_w __builtin_msa_ave_u_w +#define __msa_ave_u_d __builtin_msa_ave_u_d +#define __msa_aver_s_b __builtin_msa_aver_s_b +#define __msa_aver_s_h __builtin_msa_aver_s_h +#define __msa_aver_s_w __builtin_msa_aver_s_w +#define __msa_aver_s_d __builtin_msa_aver_s_d +#define __msa_aver_u_b __builtin_msa_aver_u_b +#define __msa_aver_u_h __builtin_msa_aver_u_h +#define __msa_aver_u_w __builtin_msa_aver_u_w +#define __msa_aver_u_d __builtin_msa_aver_u_d +#define __msa_subs_s_b __builtin_msa_subs_s_b +#define __msa_subs_s_h __builtin_msa_subs_s_h +#define __msa_subs_s_w __builtin_msa_subs_s_w +#define __msa_subs_s_d __builtin_msa_subs_s_d +#define __msa_subs_u_b __builtin_msa_subs_u_b +#define __msa_subs_u_h __builtin_msa_subs_u_h +#define __msa_subs_u_w __builtin_msa_subs_u_w +#define __msa_subs_u_d __builtin_msa_subs_u_d +#define __msa_subsuu_s_b __builtin_msa_subsuu_s_b +#define __msa_subsuu_s_h __builtin_msa_subsuu_s_h +#define __msa_subsuu_s_w __builtin_msa_subsuu_s_w +#define __msa_subsuu_s_d __builtin_msa_subsuu_s_d +#define __msa_subsus_u_b __builtin_msa_subsus_u_b +#define __msa_subsus_u_h __builtin_msa_subsus_u_h +#define __msa_subsus_u_w __builtin_msa_subsus_u_w +#define __msa_subsus_u_d __builtin_msa_subsus_u_d +#define __msa_asub_s_b __builtin_msa_asub_s_b +#define __msa_asub_s_h __builtin_msa_asub_s_h +#define __msa_asub_s_w __builtin_msa_asub_s_w +#define __msa_asub_s_d __builtin_msa_asub_s_d +#define __msa_asub_u_b __builtin_msa_asub_u_b +#define __msa_asub_u_h __builtin_msa_asub_u_h +#define __msa_asub_u_w __builtin_msa_asub_u_w +#define __msa_asub_u_d __builtin_msa_asub_u_d +#define __msa_mulv_b __builtin_msa_mulv_b +#define __msa_mulv_h __builtin_msa_mulv_h +#define __msa_mulv_w __builtin_msa_mulv_w +#define __msa_mulv_d __builtin_msa_mulv_d +#define __msa_maddv_b __builtin_msa_maddv_b +#define __msa_maddv_h __builtin_msa_maddv_h +#define __msa_maddv_w __builtin_msa_maddv_w +#define __msa_maddv_d __builtin_msa_maddv_d +#define __msa_msubv_b __builtin_msa_msubv_b +#define __msa_msubv_h __builtin_msa_msubv_h +#define __msa_msubv_w __builtin_msa_msubv_w +#define __msa_msubv_d __builtin_msa_msubv_d +#define __msa_div_s_b __builtin_msa_div_s_b +#define __msa_div_s_h __builtin_msa_div_s_h +#define __msa_div_s_w __builtin_msa_div_s_w +#define __msa_div_s_d __builtin_msa_div_s_d +#define __msa_div_u_b __builtin_msa_div_u_b +#define __msa_div_u_h __builtin_msa_div_u_h +#define __msa_div_u_w __builtin_msa_div_u_w +#define __msa_div_u_d __builtin_msa_div_u_d +#define __msa_hadd_s_h __builtin_msa_hadd_s_h +#define __msa_hadd_s_w __builtin_msa_hadd_s_w +#define __msa_hadd_s_d __builtin_msa_hadd_s_d +#define __msa_hadd_u_h __builtin_msa_hadd_u_h +#define __msa_hadd_u_w __builtin_msa_hadd_u_w +#define __msa_hadd_u_d __builtin_msa_hadd_u_d +#define __msa_hsub_s_h __builtin_msa_hsub_s_h +#define __msa_hsub_s_w __builtin_msa_hsub_s_w +#define __msa_hsub_s_d __builtin_msa_hsub_s_d +#define __msa_hsub_u_h __builtin_msa_hsub_u_h +#define __msa_hsub_u_w __builtin_msa_hsub_u_w +#define __msa_hsub_u_d __builtin_msa_hsub_u_d +#define __msa_mod_s_b __builtin_msa_mod_s_b +#define __msa_mod_s_h __builtin_msa_mod_s_h +#define __msa_mod_s_w __builtin_msa_mod_s_w +#define __msa_mod_s_d __builtin_msa_mod_s_d +#define __msa_mod_u_b __builtin_msa_mod_u_b +#define __msa_mod_u_h __builtin_msa_mod_u_h +#define __msa_mod_u_w __builtin_msa_mod_u_w +#define __msa_mod_u_d __builtin_msa_mod_u_d +#define __msa_dotp_s_h __builtin_msa_dotp_s_h +#define __msa_dotp_s_w __builtin_msa_dotp_s_w +#define __msa_dotp_s_d __builtin_msa_dotp_s_d +#define __msa_dotp_u_h __builtin_msa_dotp_u_h +#define __msa_dotp_u_w __builtin_msa_dotp_u_w +#define __msa_dotp_u_d __builtin_msa_dotp_u_d +#define __msa_dpadd_s_h __builtin_msa_dpadd_s_h +#define __msa_dpadd_s_w __builtin_msa_dpadd_s_w +#define __msa_dpadd_s_d __builtin_msa_dpadd_s_d +#define __msa_dpadd_u_h __builtin_msa_dpadd_u_h +#define __msa_dpadd_u_w __builtin_msa_dpadd_u_w +#define __msa_dpadd_u_d __builtin_msa_dpadd_u_d +#define __msa_dpsub_s_h __builtin_msa_dpsub_s_h +#define __msa_dpsub_s_w __builtin_msa_dpsub_s_w +#define __msa_dpsub_s_d __builtin_msa_dpsub_s_d +#define __msa_dpsub_u_h __builtin_msa_dpsub_u_h +#define __msa_dpsub_u_w __builtin_msa_dpsub_u_w +#define __msa_dpsub_u_d __builtin_msa_dpsub_u_d +#define __msa_sld_b __builtin_msa_sld_b +#define __msa_sld_h __builtin_msa_sld_h +#define __msa_sld_w __builtin_msa_sld_w +#define __msa_sld_d __builtin_msa_sld_d +#define __msa_sldi_b __builtin_msa_sldi_b +#define __msa_sldi_h __builtin_msa_sldi_h +#define __msa_sldi_w __builtin_msa_sldi_w +#define __msa_sldi_d __builtin_msa_sldi_d +#define __msa_splat_b __builtin_msa_splat_b +#define __msa_splat_h __builtin_msa_splat_h +#define __msa_splat_w __builtin_msa_splat_w +#define __msa_splat_d __builtin_msa_splat_d +#define __msa_splati_b __builtin_msa_splati_b +#define __msa_splati_h __builtin_msa_splati_h +#define __msa_splati_w __builtin_msa_splati_w +#define __msa_splati_d __builtin_msa_splati_d +#define __msa_pckev_b __builtin_msa_pckev_b +#define __msa_pckev_h __builtin_msa_pckev_h +#define __msa_pckev_w __builtin_msa_pckev_w +#define __msa_pckev_d __builtin_msa_pckev_d +#define __msa_pckod_b __builtin_msa_pckod_b +#define __msa_pckod_h __builtin_msa_pckod_h +#define __msa_pckod_w __builtin_msa_pckod_w +#define __msa_pckod_d __builtin_msa_pckod_d +#define __msa_ilvl_b __builtin_msa_ilvl_b +#define __msa_ilvl_h __builtin_msa_ilvl_h +#define __msa_ilvl_w __builtin_msa_ilvl_w +#define __msa_ilvl_d __builtin_msa_ilvl_d +#define __msa_ilvr_b __builtin_msa_ilvr_b +#define __msa_ilvr_h __builtin_msa_ilvr_h +#define __msa_ilvr_w __builtin_msa_ilvr_w +#define __msa_ilvr_d __builtin_msa_ilvr_d +#define __msa_ilvev_b __builtin_msa_ilvev_b +#define __msa_ilvev_h __builtin_msa_ilvev_h +#define __msa_ilvev_w __builtin_msa_ilvev_w +#define __msa_ilvev_d __builtin_msa_ilvev_d +#define __msa_ilvod_b __builtin_msa_ilvod_b +#define __msa_ilvod_h __builtin_msa_ilvod_h +#define __msa_ilvod_w __builtin_msa_ilvod_w +#define __msa_ilvod_d __builtin_msa_ilvod_d +#define __msa_vshf_b __builtin_msa_vshf_b +#define __msa_vshf_h __builtin_msa_vshf_h +#define __msa_vshf_w __builtin_msa_vshf_w +#define __msa_vshf_d __builtin_msa_vshf_d +#define __msa_and_v __builtin_msa_and_v +#define __msa_andi_b __builtin_msa_andi_b +#define __msa_or_v __builtin_msa_or_v +#define __msa_ori_b __builtin_msa_ori_b +#define __msa_nor_v __builtin_msa_nor_v +#define __msa_nori_b __builtin_msa_nori_b +#define __msa_xor_v __builtin_msa_xor_v +#define __msa_xori_b __builtin_msa_xori_b +#define __msa_bmnz_v __builtin_msa_bmnz_v +#define __msa_bmnzi_b __builtin_msa_bmnzi_b +#define __msa_bmz_v __builtin_msa_bmz_v +#define __msa_bmzi_b __builtin_msa_bmzi_b +#define __msa_bsel_v __builtin_msa_bsel_v +#define __msa_bseli_b __builtin_msa_bseli_b +#define __msa_shf_b __builtin_msa_shf_b +#define __msa_shf_h __builtin_msa_shf_h +#define __msa_shf_w __builtin_msa_shf_w +#define __msa_test_bnz_v __builtin_msa_bnz_v +#define __msa_test_bz_v __builtin_msa_bz_v +#define __msa_fill_b __builtin_msa_fill_b +#define __msa_fill_h __builtin_msa_fill_h +#define __msa_fill_w __builtin_msa_fill_w +#define __msa_fill_d __builtin_msa_fill_d +#define __msa_pcnt_b __builtin_msa_pcnt_b +#define __msa_pcnt_h __builtin_msa_pcnt_h +#define __msa_pcnt_w __builtin_msa_pcnt_w +#define __msa_pcnt_d __builtin_msa_pcnt_d +#define __msa_nloc_b __builtin_msa_nloc_b +#define __msa_nloc_h __builtin_msa_nloc_h +#define __msa_nloc_w __builtin_msa_nloc_w +#define __msa_nloc_d __builtin_msa_nloc_d +#define __msa_nlzc_b __builtin_msa_nlzc_b +#define __msa_nlzc_h __builtin_msa_nlzc_h +#define __msa_nlzc_w __builtin_msa_nlzc_w +#define __msa_nlzc_d __builtin_msa_nlzc_d +#define __msa_copy_s_b __builtin_msa_copy_s_b +#define __msa_copy_s_h __builtin_msa_copy_s_h +#define __msa_copy_s_w __builtin_msa_copy_s_w +#define __msa_copy_s_d __builtin_msa_copy_s_d +#define __msa_copy_u_b __builtin_msa_copy_u_b +#define __msa_copy_u_h __builtin_msa_copy_u_h +#define __msa_copy_u_w __builtin_msa_copy_u_w +#define __msa_copy_u_d __builtin_msa_copy_u_d +#define __msa_insert_b __builtin_msa_insert_b +#define __msa_insert_h __builtin_msa_insert_h +#define __msa_insert_w __builtin_msa_insert_w +#define __msa_insert_d __builtin_msa_insert_d +#define __msa_insve_b __builtin_msa_insve_b +#define __msa_insve_h __builtin_msa_insve_h +#define __msa_insve_w __builtin_msa_insve_w +#define __msa_insve_d __builtin_msa_insve_d +#define __msa_test_bnz_b __builtin_msa_bnz_b +#define __msa_test_bnz_h __builtin_msa_bnz_h +#define __msa_test_bnz_w __builtin_msa_bnz_w +#define __msa_test_bnz_d __builtin_msa_bnz_d +#define __msa_test_bz_b __builtin_msa_bz_b +#define __msa_test_bz_h __builtin_msa_bz_h +#define __msa_test_bz_w __builtin_msa_bz_w +#define __msa_test_bz_d __builtin_msa_bz_d +#define __msa_ldi_b __builtin_msa_ldi_b +#define __msa_ldi_h __builtin_msa_ldi_h +#define __msa_ldi_w __builtin_msa_ldi_w +#define __msa_ldi_d __builtin_msa_ldi_d +#define __msa_fcaf_w __builtin_msa_fcaf_w +#define __msa_fcaf_d __builtin_msa_fcaf_d +#define __msa_fcor_w __builtin_msa_fcor_w +#define __msa_fcor_d __builtin_msa_fcor_d +#define __msa_fcun_w __builtin_msa_fcun_w +#define __msa_fcun_d __builtin_msa_fcun_d +#define __msa_fcune_w __builtin_msa_fcune_w +#define __msa_fcune_d __builtin_msa_fcune_d +#define __msa_fcueq_w __builtin_msa_fcueq_w +#define __msa_fcueq_d __builtin_msa_fcueq_d +#define __msa_fceq_w __builtin_msa_fceq_w +#define __msa_fceq_d __builtin_msa_fceq_d +#define __msa_fcne_w __builtin_msa_fcne_w +#define __msa_fcne_d __builtin_msa_fcne_d +#define __msa_fclt_w __builtin_msa_fclt_w +#define __msa_fclt_d __builtin_msa_fclt_d +#define __msa_fcult_w __builtin_msa_fcult_w +#define __msa_fcult_d __builtin_msa_fcult_d +#define __msa_fcle_w __builtin_msa_fcle_w +#define __msa_fcle_d __builtin_msa_fcle_d +#define __msa_fcule_w __builtin_msa_fcule_w +#define __msa_fcule_d __builtin_msa_fcule_d +#define __msa_fsaf_w __builtin_msa_fsaf_w +#define __msa_fsaf_d __builtin_msa_fsaf_d +#define __msa_fsor_w __builtin_msa_fsor_w +#define __msa_fsor_d __builtin_msa_fsor_d +#define __msa_fsun_w __builtin_msa_fsun_w +#define __msa_fsun_d __builtin_msa_fsun_d +#define __msa_fsune_w __builtin_msa_fsune_w +#define __msa_fsune_d __builtin_msa_fsune_d +#define __msa_fsueq_w __builtin_msa_fsueq_w +#define __msa_fsueq_d __builtin_msa_fsueq_d +#define __msa_fseq_w __builtin_msa_fseq_w +#define __msa_fseq_d __builtin_msa_fseq_d +#define __msa_fsne_w __builtin_msa_fsne_w +#define __msa_fsne_d __builtin_msa_fsne_d +#define __msa_fslt_w __builtin_msa_fslt_w +#define __msa_fslt_d __builtin_msa_fslt_d +#define __msa_fsult_w __builtin_msa_fsult_w +#define __msa_fsult_d __builtin_msa_fsult_d +#define __msa_fsle_w __builtin_msa_fsle_w +#define __msa_fsle_d __builtin_msa_fsle_d +#define __msa_fsule_w __builtin_msa_fsule_w +#define __msa_fsule_d __builtin_msa_fsule_d +#define __msa_fadd_w __builtin_msa_fadd_w +#define __msa_fadd_d __builtin_msa_fadd_d +#define __msa_fsub_w __builtin_msa_fsub_w +#define __msa_fsub_d __builtin_msa_fsub_d +#define __msa_fmul_w __builtin_msa_fmul_w +#define __msa_fmul_d __builtin_msa_fmul_d +#define __msa_fdiv_w __builtin_msa_fdiv_w +#define __msa_fdiv_d __builtin_msa_fdiv_d +#define __msa_fmadd_w __builtin_msa_fmadd_w +#define __msa_fmadd_d __builtin_msa_fmadd_d +#define __msa_fmsub_w __builtin_msa_fmsub_w +#define __msa_fmsub_d __builtin_msa_fmsub_d +#define __msa_fexp2_w __builtin_msa_fexp2_w +#define __msa_fexp2_d __builtin_msa_fexp2_d +#define __msa_fexdo_h __builtin_msa_fexdo_h +#define __msa_fexdo_w __builtin_msa_fexdo_w +#define __msa_ftq_h __builtin_msa_ftq_h +#define __msa_ftq_w __builtin_msa_ftq_w +#define __msa_fmin_w __builtin_msa_fmin_w +#define __msa_fmin_d __builtin_msa_fmin_d +#define __msa_fmin_a_w __builtin_msa_fmin_a_w +#define __msa_fmin_a_d __builtin_msa_fmin_a_d +#define __msa_fmax_w __builtin_msa_fmax_w +#define __msa_fmax_d __builtin_msa_fmax_d +#define __msa_fmax_a_w __builtin_msa_fmax_a_w +#define __msa_fmax_a_d __builtin_msa_fmax_a_d +#define __msa_mul_q_h __builtin_msa_mul_q_h +#define __msa_mul_q_w __builtin_msa_mul_q_w +#define __msa_mulr_q_h __builtin_msa_mulr_q_h +#define __msa_mulr_q_w __builtin_msa_mulr_q_w +#define __msa_madd_q_h __builtin_msa_madd_q_h +#define __msa_madd_q_w __builtin_msa_madd_q_w +#define __msa_maddr_q_h __builtin_msa_maddr_q_h +#define __msa_maddr_q_w __builtin_msa_maddr_q_w +#define __msa_msub_q_h __builtin_msa_msub_q_h +#define __msa_msub_q_w __builtin_msa_msub_q_w +#define __msa_msubr_q_h __builtin_msa_msubr_q_h +#define __msa_msubr_q_w __builtin_msa_msubr_q_w +#define __msa_fclass_w __builtin_msa_fclass_w +#define __msa_fclass_d __builtin_msa_fclass_d +#define __msa_fsqrt_w __builtin_msa_fsqrt_w +#define __msa_fsqrt_d __builtin_msa_fsqrt_d +#define __msa_frcp_w __builtin_msa_frcp_w +#define __msa_frcp_d __builtin_msa_frcp_d +#define __msa_frint_w __builtin_msa_frint_w +#define __msa_frint_d __builtin_msa_frint_d +#define __msa_frsqrt_w __builtin_msa_frsqrt_w +#define __msa_frsqrt_d __builtin_msa_frsqrt_d +#define __msa_flog2_w __builtin_msa_flog2_w +#define __msa_flog2_d __builtin_msa_flog2_d +#define __msa_fexupl_w __builtin_msa_fexupl_w +#define __msa_fexupl_d __builtin_msa_fexupl_d +#define __msa_fexupr_w __builtin_msa_fexupr_w +#define __msa_fexupr_d __builtin_msa_fexupr_d +#define __msa_ffql_w __builtin_msa_ffql_w +#define __msa_ffql_d __builtin_msa_ffql_d +#define __msa_ffqr_w __builtin_msa_ffqr_w +#define __msa_ffqr_d __builtin_msa_ffqr_d +#define __msa_ftint_s_w __builtin_msa_ftint_s_w +#define __msa_ftint_s_d __builtin_msa_ftint_s_d +#define __msa_ftint_u_w __builtin_msa_ftint_u_w +#define __msa_ftint_u_d __builtin_msa_ftint_u_d +#define __msa_ftrunc_s_w __builtin_msa_ftrunc_s_w +#define __msa_ftrunc_s_d __builtin_msa_ftrunc_s_d +#define __msa_ftrunc_u_w __builtin_msa_ftrunc_u_w +#define __msa_ftrunc_u_d __builtin_msa_ftrunc_u_d +#define __msa_ffint_s_w __builtin_msa_ffint_s_w +#define __msa_ffint_s_d __builtin_msa_ffint_s_d +#define __msa_ffint_u_w __builtin_msa_ffint_u_w +#define __msa_ffint_u_d __builtin_msa_ffint_u_d +#define __msa_cfcmsa __builtin_msa_cfcmsa +#define __msa_move_v __builtin_msa_move_v +#define __msa_cast_to_vector_float __builtin_msa_cast_to_vector_float +#define __msa_cast_to_vector_double __builtin_msa_cast_to_vector_double +#define __msa_cast_to_scalar_float __builtin_msa_cast_to_scalar_float +#define __msa_cast_to_scalar_double __builtin_msa_cast_to_scalar_double +#endif /* defined(__mips_msa) */ +#endif /* _MSA_H */ Modified: vendor/clang/dist/lib/Sema/SemaChecking.cpp ============================================================================== --- vendor/clang/dist/lib/Sema/SemaChecking.cpp Fri Dec 2 19:20:14 2016 (r309428) +++ vendor/clang/dist/lib/Sema/SemaChecking.cpp Fri Dec 2 19:20:19 2016 (r309429) @@ -1454,8 +1454,17 @@ bool Sema::CheckAArch64BuiltinFunctionCa return SemaBuiltinConstantArgRange(TheCall, i, l, u + l); } +// CheckMipsBuiltinFunctionCall - Checks the constant value passed to the +// intrinsic is correct. The switch statement is ordered by DSP, MSA. The +// ordering for DSP is unspecified. MSA is ordered by the data format used +// by the underlying instruction i.e., df/m, df/n and then by size. +// +// FIXME: The size tests here should instead be tablegen'd along with the +// definitions from include/clang/Basic/BuiltinsMips.def. +// FIXME: GCC is strict on signedness for some of these intrinsics, we should +// be too. bool Sema::CheckMipsBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) { - unsigned i = 0, l = 0, u = 0; + unsigned i = 0, l = 0, u = 0, m = 0; switch (BuiltinID) { default: return false; case Mips::BI__builtin_mips_wrdsp: i = 1; l = 0; u = 63; break; @@ -1465,9 +1474,168 @@ bool Sema::CheckMipsBuiltinFunctionCall( case Mips::BI__builtin_mips_precr_sra_ph_w: i = 2; l = 0; u = 31; break; case Mips::BI__builtin_mips_precr_sra_r_ph_w: i = 2; l = 0; u = 31; break; case Mips::BI__builtin_mips_prepend: i = 2; l = 0; u = 31; break; + // MSA instrinsics. Instructions (which the intrinsics maps to) which use the + // df/m field. + // These intrinsics take an unsigned 3 bit immediate. + case Mips::BI__builtin_msa_bclri_b: + case Mips::BI__builtin_msa_bnegi_b: + case Mips::BI__builtin_msa_bseti_b: + case Mips::BI__builtin_msa_sat_s_b: + case Mips::BI__builtin_msa_sat_u_b: + case Mips::BI__builtin_msa_slli_b: + case Mips::BI__builtin_msa_srai_b: + case Mips::BI__builtin_msa_srari_b: + case Mips::BI__builtin_msa_srli_b: + case Mips::BI__builtin_msa_srlri_b: i = 1; l = 0; u = 7; break; + case Mips::BI__builtin_msa_binsli_b: + case Mips::BI__builtin_msa_binsri_b: i = 2; l = 0; u = 7; break; + // These intrinsics take an unsigned 4 bit immediate. + case Mips::BI__builtin_msa_bclri_h: + case Mips::BI__builtin_msa_bnegi_h: + case Mips::BI__builtin_msa_bseti_h: + case Mips::BI__builtin_msa_sat_s_h: + case Mips::BI__builtin_msa_sat_u_h: + case Mips::BI__builtin_msa_slli_h: + case Mips::BI__builtin_msa_srai_h: + case Mips::BI__builtin_msa_srari_h: + case Mips::BI__builtin_msa_srli_h: + case Mips::BI__builtin_msa_srlri_h: i = 1; l = 0; u = 15; break; + case Mips::BI__builtin_msa_binsli_h: + case Mips::BI__builtin_msa_binsri_h: i = 2; l = 0; u = 15; break; + // These intrinsics take an unsigned 5 bit immedate. + // The first block of intrinsics actually have an unsigned 5 bit field, + // not a df/n field. + case Mips::BI__builtin_msa_clei_u_b: + case Mips::BI__builtin_msa_clei_u_h: + case Mips::BI__builtin_msa_clei_u_w: + case Mips::BI__builtin_msa_clei_u_d: + case Mips::BI__builtin_msa_clti_u_b: + case Mips::BI__builtin_msa_clti_u_h: + case Mips::BI__builtin_msa_clti_u_w: + case Mips::BI__builtin_msa_clti_u_d: + case Mips::BI__builtin_msa_maxi_u_b: + case Mips::BI__builtin_msa_maxi_u_h: + case Mips::BI__builtin_msa_maxi_u_w: + case Mips::BI__builtin_msa_maxi_u_d: + case Mips::BI__builtin_msa_mini_u_b: + case Mips::BI__builtin_msa_mini_u_h: + case Mips::BI__builtin_msa_mini_u_w: + case Mips::BI__builtin_msa_mini_u_d: + case Mips::BI__builtin_msa_addvi_b: + case Mips::BI__builtin_msa_addvi_h: + case Mips::BI__builtin_msa_addvi_w: + case Mips::BI__builtin_msa_addvi_d: + case Mips::BI__builtin_msa_bclri_w: + case Mips::BI__builtin_msa_bnegi_w: + case Mips::BI__builtin_msa_bseti_w: + case Mips::BI__builtin_msa_sat_s_w: + case Mips::BI__builtin_msa_sat_u_w: + case Mips::BI__builtin_msa_slli_w: + case Mips::BI__builtin_msa_srai_w: + case Mips::BI__builtin_msa_srari_w: + case Mips::BI__builtin_msa_srli_w: + case Mips::BI__builtin_msa_srlri_w: + case Mips::BI__builtin_msa_subvi_b: + case Mips::BI__builtin_msa_subvi_h: + case Mips::BI__builtin_msa_subvi_w: + case Mips::BI__builtin_msa_subvi_d: i = 1; l = 0; u = 31; break; + case Mips::BI__builtin_msa_binsli_w: + case Mips::BI__builtin_msa_binsri_w: i = 2; l = 0; u = 31; break; + // These intrinsics take an unsigned 6 bit immediate. + case Mips::BI__builtin_msa_bclri_d: + case Mips::BI__builtin_msa_bnegi_d: + case Mips::BI__builtin_msa_bseti_d: + case Mips::BI__builtin_msa_sat_s_d: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Dec 2 19:20:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6D1DC632BC; Fri, 2 Dec 2016 19:20:30 +0000 (UTC) (envelope-from dim@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 42E32A62; Fri, 2 Dec 2016 19:20:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2JKTxq075036; Fri, 2 Dec 2016 19:20:29 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2JKTGe075035; Fri, 2 Dec 2016 19:20:29 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612021920.uB2JKTGe075035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 2 Dec 2016 19:20:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r309432 - vendor/compiler-rt/compiler-rt-release_39-r288513 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 19:20:31 -0000 Author: dim Date: Fri Dec 2 19:20:29 2016 New Revision: 309432 URL: https://svnweb.freebsd.org/changeset/base/309432 Log: Tag compiler-rt release_39 branch r288513. Added: vendor/compiler-rt/compiler-rt-release_39-r288513/ - copied from r309431, vendor/compiler-rt/dist/ From owner-svn-src-all@freebsd.org Fri Dec 2 19:20:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAD6AC63291; Fri, 2 Dec 2016 19:20:24 +0000 (UTC) (envelope-from dim@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 5CB6E9E0; Fri, 2 Dec 2016 19:20:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2JKNCb074940; Fri, 2 Dec 2016 19:20:23 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2JKN3L074939; Fri, 2 Dec 2016 19:20:23 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612021920.uB2JKN3L074939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 2 Dec 2016 19:20:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r309430 - vendor/clang/clang-release_39-r288513 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 19:20:24 -0000 Author: dim Date: Fri Dec 2 19:20:23 2016 New Revision: 309430 URL: https://svnweb.freebsd.org/changeset/base/309430 Log: Tag clang release_39 branch r288513. Added: vendor/clang/clang-release_39-r288513/ - copied from r309429, vendor/clang/dist/ From owner-svn-src-all@freebsd.org Fri Dec 2 19:20:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0930DC6329A; Fri, 2 Dec 2016 19:20:28 +0000 (UTC) (envelope-from dim@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 A2F9AA22; Fri, 2 Dec 2016 19:20:27 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2JKQnE074989; Fri, 2 Dec 2016 19:20:26 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2JKQZY074988; Fri, 2 Dec 2016 19:20:26 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612021920.uB2JKQZY074988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 2 Dec 2016 19:20:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r309431 - vendor/compiler-rt/dist/test/sanitizer_common/TestCases/Linux X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 19:20:28 -0000 Author: dim Date: Fri Dec 2 19:20:26 2016 New Revision: 309431 URL: https://svnweb.freebsd.org/changeset/base/309431 Log: Vendor import of compiler-rt release_39 branch r288513: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_39@288513 Modified: vendor/compiler-rt/dist/test/sanitizer_common/TestCases/Linux/sem_init_glibc.cc Modified: vendor/compiler-rt/dist/test/sanitizer_common/TestCases/Linux/sem_init_glibc.cc ============================================================================== --- vendor/compiler-rt/dist/test/sanitizer_common/TestCases/Linux/sem_init_glibc.cc Fri Dec 2 19:20:23 2016 (r309430) +++ vendor/compiler-rt/dist/test/sanitizer_common/TestCases/Linux/sem_init_glibc.cc Fri Dec 2 19:20:26 2016 (r309431) @@ -17,6 +17,21 @@ typedef uint64_t semval_t; typedef unsigned semval_t; #endif +// glibc 2.21 has introduced some changes in the way the semaphore value is +// handled for 32-bit platforms, but since these changes are not ABI-breaking +// they are not versioned. On newer platforms such as ARM, there is only one +// version of the symbol, so it's enough to check the glibc version. However, +// for old platforms such as i386, glibc contains two or even three versions of +// the sem_init symbol, and the sanitizers always pick the oldest one. +// Therefore, it is not enough to rely on the __GLIBC_PREREQ macro - we should +// instead check the platform as well to make sure we only expect the new +// behavior on platforms where the older symbols do not exist. +#if defined(__arm__) && __GLIBC_PREREQ(2, 21) +#define GET_SEM_VALUE(V) ((V) >> 1) +#else +#define GET_SEM_VALUE(V) (V) +#endif + void my_sem_init(bool priv, int value, semval_t *a, unsigned char *b) { sem_t sem; memset(&sem, 0xAB, sizeof(sem)); @@ -34,10 +49,10 @@ int main() { unsigned char b; my_sem_init(false, 42, &a, &b); - assert(a == 42); + assert(GET_SEM_VALUE(a) == 42); assert(b != 0xAB); my_sem_init(true, 43, &a, &b); - assert(a == 43); + assert(GET_SEM_VALUE(a) == 43); assert(b != 0xAB); } From owner-svn-src-all@freebsd.org Fri Dec 2 19:23:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E65F4C63527; Fri, 2 Dec 2016 19:23:10 +0000 (UTC) (envelope-from dim@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 9C2C1149E; Fri, 2 Dec 2016 19:23:10 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2JN9tU078967; Fri, 2 Dec 2016 19:23:09 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2JN9Bi078966; Fri, 2 Dec 2016 19:23:09 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612021923.uB2JN9Bi078966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 2 Dec 2016 19:23:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r309433 - vendor/libc++/libc++-release_39-r288513 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 19:23:11 -0000 Author: dim Date: Fri Dec 2 19:23:09 2016 New Revision: 309433 URL: https://svnweb.freebsd.org/changeset/base/309433 Log: Tag libc++ release_39 branch r288513. Added: vendor/libc++/libc++-release_39-r288513/ - copied from r309432, vendor/libc++/dist/ From owner-svn-src-all@freebsd.org Fri Dec 2 19:23:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85B10C6353D; Fri, 2 Dec 2016 19:23:13 +0000 (UTC) (envelope-from dim@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 5570114A1; Fri, 2 Dec 2016 19:23:13 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2JNCa5079014; Fri, 2 Dec 2016 19:23:12 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2JNC4b079013; Fri, 2 Dec 2016 19:23:12 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612021923.uB2JNC4b079013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 2 Dec 2016 19:23:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r309434 - vendor/lld/dist/COFF X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 19:23:13 -0000 Author: dim Date: Fri Dec 2 19:23:12 2016 New Revision: 309434 URL: https://svnweb.freebsd.org/changeset/base/309434 Log: Vendor import of lld release_39 branch r288513: https://llvm.org/svn/llvm-project/lld/branches/release_39@288513 Modified: vendor/lld/dist/COFF/CMakeLists.txt Modified: vendor/lld/dist/COFF/CMakeLists.txt ============================================================================== --- vendor/lld/dist/COFF/CMakeLists.txt Fri Dec 2 19:23:09 2016 (r309433) +++ vendor/lld/dist/COFF/CMakeLists.txt Fri Dec 2 19:23:12 2016 (r309434) @@ -33,4 +33,4 @@ add_lld_library(lldCOFF LINK_LIBS ${PTHREAD_LIB} ) -add_dependencies(lldCOFF COFFOptionsTableGen) +add_dependencies(lldCOFF COFFOptionsTableGen intrinsics_gen) From owner-svn-src-all@freebsd.org Fri Dec 2 19:23:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C902C63584; Fri, 2 Dec 2016 19:23:18 +0000 (UTC) (envelope-from dim@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 6F64514CE; Fri, 2 Dec 2016 19:23:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2JNG4k079063; Fri, 2 Dec 2016 19:23:16 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2JNG29079062; Fri, 2 Dec 2016 19:23:16 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612021923.uB2JNG29079062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 2 Dec 2016 19:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r309435 - vendor/lld/lld-release_39-r288513 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 19:23:18 -0000 Author: dim Date: Fri Dec 2 19:23:16 2016 New Revision: 309435 URL: https://svnweb.freebsd.org/changeset/base/309435 Log: Tag lld release_39 branch r288513. Added: vendor/lld/lld-release_39-r288513/ - copied from r309434, vendor/lld/dist/ From owner-svn-src-all@freebsd.org Fri Dec 2 19:23:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C2DAC635B1; Fri, 2 Dec 2016 19:23:21 +0000 (UTC) (envelope-from dim@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 3867B152D; Fri, 2 Dec 2016 19:23:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2JNKPJ079109; Fri, 2 Dec 2016 19:23:20 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2JNKgu079108; Fri, 2 Dec 2016 19:23:20 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201612021923.uB2JNKgu079108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 2 Dec 2016 19:23:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r309436 - vendor/lldb/lldb-release_39-r288513 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 19:23:21 -0000 Author: dim Date: Fri Dec 2 19:23:20 2016 New Revision: 309436 URL: https://svnweb.freebsd.org/changeset/base/309436 Log: Tag lldb release_39 branch r288513. Added: vendor/lldb/lldb-release_39-r288513/ - copied from r309435, vendor/lldb/dist/ From owner-svn-src-all@freebsd.org Fri Dec 2 19:47:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE269C63D23; Fri, 2 Dec 2016 19:47:25 +0000 (UTC) (envelope-from pfg@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 B85C49EE; Fri, 2 Dec 2016 19:47:25 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB2JlOHk087894; Fri, 2 Dec 2016 19:47:24 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2JlN6o087881; Fri, 2 Dec 2016 19:47:23 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612021947.uB2JlN6o087881@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 2 Dec 2016 19:47:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309439 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 19:47:26 -0000 Author: pfg Date: Fri Dec 2 19:47:23 2016 New Revision: 309439 URL: https://svnweb.freebsd.org/changeset/base/309439 Log: ext2fs: renumber the license clauses to avoid skipping #3. This is to keep consistency with other files, and help license-checking utilities determine the number of clauses that apply. No functional change. Modified: head/sys/fs/ext2fs/ext2_alloc.c head/sys/fs/ext2fs/ext2_balloc.c head/sys/fs/ext2fs/ext2_bmap.c head/sys/fs/ext2fs/ext2_extern.h head/sys/fs/ext2fs/ext2_inode.c head/sys/fs/ext2fs/ext2_lookup.c head/sys/fs/ext2fs/ext2_mount.h head/sys/fs/ext2fs/ext2_subr.c head/sys/fs/ext2fs/ext2_vfsops.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/ext2fs/fs.h head/sys/fs/ext2fs/inode.h Modified: head/sys/fs/ext2fs/ext2_alloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_alloc.c Fri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/ext2_alloc.c Fri Dec 2 19:47:23 2016 (r309439) @@ -16,7 +16,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/fs/ext2fs/ext2_balloc.c ============================================================================== --- head/sys/fs/ext2fs/ext2_balloc.c Fri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/ext2_balloc.c Fri Dec 2 19:47:23 2016 (r309439) @@ -16,7 +16,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/fs/ext2fs/ext2_bmap.c ============================================================================== --- head/sys/fs/ext2fs/ext2_bmap.c Fri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/ext2_bmap.c Fri Dec 2 19:47:23 2016 (r309439) @@ -15,7 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/fs/ext2fs/ext2_extern.h ============================================================================== --- head/sys/fs/ext2fs/ext2_extern.h Fri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/ext2_extern.h Fri Dec 2 19:47:23 2016 (r309439) @@ -16,7 +16,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode.c Fri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/ext2_inode.c Fri Dec 2 19:47:23 2016 (r309439) @@ -16,7 +16,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- head/sys/fs/ext2fs/ext2_lookup.c Fri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/ext2_lookup.c Fri Dec 2 19:47:23 2016 (r309439) @@ -21,7 +21,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/fs/ext2fs/ext2_mount.h ============================================================================== --- head/sys/fs/ext2fs/ext2_mount.h Fri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/ext2_mount.h Fri Dec 2 19:47:23 2016 (r309439) @@ -10,7 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/fs/ext2fs/ext2_subr.c ============================================================================== --- head/sys/fs/ext2fs/ext2_subr.c Fri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/ext2_subr.c Fri Dec 2 19:47:23 2016 (r309439) @@ -16,7 +16,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Fri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/ext2_vfsops.c Fri Dec 2 19:47:23 2016 (r309439) @@ -16,7 +16,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Fri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/ext2_vnops.c Fri Dec 2 19:47:23 2016 (r309439) @@ -21,7 +21,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/fs/ext2fs/fs.h ============================================================================== --- head/sys/fs/ext2fs/fs.h Fri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/fs.h Fri Dec 2 19:47:23 2016 (r309439) @@ -16,7 +16,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/fs/ext2fs/inode.h ============================================================================== --- head/sys/fs/ext2fs/inode.h Fri Dec 2 19:40:00 2016 (r309438) +++ head/sys/fs/ext2fs/inode.h Fri Dec 2 19:47:23 2016 (r309439) @@ -15,7 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * From owner-svn-src-all@freebsd.org Fri Dec 2 20:16:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E96A7C621AB; Fri, 2 Dec 2016 20:16:53 +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 B80EA160E; Fri, 2 Dec 2016 20:16:53 +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 uB2KGrrL099805; Fri, 2 Dec 2016 20:16:53 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2KGq3B099798; Fri, 2 Dec 2016 20:16:52 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612022016.uB2KGq3B099798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 2 Dec 2016 20:16:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309440 - in stable/10/sys/dev/cxgbe: . tom X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 20:16:54 -0000 Author: jhb Date: Fri Dec 2 20:16:52 2016 New Revision: 309440 URL: https://svnweb.freebsd.org/changeset/base/309440 Log: MFC 292736: cxgbe(4): Updates to the base NIC driver and t4_tom to support the iSCSI offload driver. These changes come from projects/cxl_iscsi. Note that these changes make use of the mbufq API from 11.0, but that API is not present in 10.x in the same form. Borrow an implementation from the CAM CTL ha code that uses m_nextpkt to implement mbufq for use in 10. Modified: stable/10/sys/dev/cxgbe/adapter.h stable/10/sys/dev/cxgbe/offload.h stable/10/sys/dev/cxgbe/t4_main.c stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c stable/10/sys/dev/cxgbe/tom/t4_ddp.c stable/10/sys/dev/cxgbe/tom/t4_tom.c stable/10/sys/dev/cxgbe/tom/t4_tom.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/10/sys/dev/cxgbe/adapter.h Fri Dec 2 19:47:23 2016 (r309439) +++ stable/10/sys/dev/cxgbe/adapter.h Fri Dec 2 20:16:52 2016 (r309440) @@ -784,7 +784,7 @@ struct adapter { void *tom_softc; /* (struct tom_data *) */ struct tom_tunables tt; void *iwarp_softc; /* (struct c4iw_dev *) */ - void *iscsi_softc; + void *iscsi_ulp_softc; /* (struct cxgbei_data *) */ struct l2t_data *l2t; /* L2 table */ struct tid_info tids; Modified: stable/10/sys/dev/cxgbe/offload.h ============================================================================== --- stable/10/sys/dev/cxgbe/offload.h Fri Dec 2 19:47:23 2016 (r309439) +++ stable/10/sys/dev/cxgbe/offload.h Fri Dec 2 20:16:52 2016 (r309440) @@ -156,7 +156,7 @@ int t4_register_uld(struct uld_info *); int t4_unregister_uld(struct uld_info *); int t4_activate_uld(struct adapter *, int); int t4_deactivate_uld(struct adapter *, int); -void t4_iscsi_init(struct ifnet *, unsigned int, const unsigned int *); +void t4_iscsi_init(struct adapter *, u_int, const u_int *); int uld_active(struct adapter *, int); #endif #endif Modified: stable/10/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_main.c Fri Dec 2 19:47:23 2016 (r309439) +++ stable/10/sys/dev/cxgbe/t4_main.c Fri Dec 2 20:16:52 2016 (r309440) @@ -8882,11 +8882,8 @@ t4_db_dropped(struct adapter *sc) #ifdef TCP_OFFLOAD void -t4_iscsi_init(struct ifnet *ifp, unsigned int tag_mask, - const unsigned int *pgsz_order) +t4_iscsi_init(struct adapter *sc, u_int tag_mask, const u_int *pgsz_order) { - struct vi_info *vi = ifp->if_softc; - struct adapter *sc = vi->pi->adapter; t4_write_reg(sc, A_ULP_RX_ISCSI_TAGMASK, tag_mask); t4_write_reg(sc, A_ULP_RX_ISCSI_PSZ, V_HPZ0(pgsz_order[0]) | Modified: stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Dec 2 19:47:23 2016 (r309439) +++ stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Dec 2 20:16:52 2016 (r309440) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Chelsio Communications, Inc. + * Copyright (c) 2012, 2015 Chelsio Communications, Inc. * All rights reserved. * Written by: Navdeep Parhar * @@ -71,31 +71,38 @@ VNET_DECLARE(int, tcp_autorcvbuf_inc); VNET_DECLARE(int, tcp_autorcvbuf_max); #define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) -/* - * For ULP connections HW may add headers, e.g., for digests, that aren't part - * of the messages sent by the host but that are part of the TCP payload and - * therefore consume TCP sequence space. Tx connection parameters that - * operate in TCP sequence space are affected by the HW additions and need to - * compensate for them to accurately track TCP sequence numbers. This array - * contains the compensating extra lengths for ULP packets. It is indexed by - * a packet's ULP submode. - */ -const unsigned int t4_ulp_extra_len[] = {0, 4, 4, 8}; +static inline struct mbuf * +mbufq_dequeue(struct mbufq *q) +{ + struct mbuf *m; -/* - * Return the length of any HW additions that will be made to a Tx packet. - * Such additions can happen for some types of ULP packets. - */ -static inline unsigned int -ulp_extra_len(struct mbuf *m, int *ulp_mode) + m = q->head; + if (m) { + if (q->tail == m) + q->tail = NULL; + q->head = m->m_nextpkt; + m->m_nextpkt = NULL; + } + return (m); +} + +static inline void +mbufq_enqueue(struct mbufq *q, struct mbuf *m) { - struct m_tag *mtag; - if ((mtag = m_tag_find(m, CXGBE_ISCSI_MBUF_TAG, NULL)) == NULL) - return (0); - *ulp_mode = *((int *)(mtag + 1)); + m->m_nextpkt = NULL; + if (q->tail) + q->tail->m_nextpkt = m; + else + q->head = m; + q->tail = m; +} + +static inline struct mbuf * +mbufq_first(const struct mbufq *q) +{ - return (t4_ulp_extra_len[*ulp_mode & 3]); + return (q->head); } void @@ -386,13 +393,9 @@ t4_rcvd(struct toedev *tod, struct tcpcb KASSERT(toep->sb_cc >= sb->sb_cc, ("%s: sb %p has more data (%d) than last time (%d).", __func__, sb, sb->sb_cc, toep->sb_cc)); - if (toep->ulp_mode == ULP_MODE_ISCSI) { - toep->rx_credits += toep->sb_cc; - toep->sb_cc = 0; - } else { - toep->rx_credits += toep->sb_cc - sb->sb_cc; - toep->sb_cc = sb->sb_cc; - } + toep->rx_credits += toep->sb_cc - sb->sb_cc; + toep->sb_cc = sb->sb_cc; + if (toep->rx_credits > 0 && (tp->rcv_wnd <= 32 * 1024 || toep->rx_credits >= 64 * 1024 || (toep->rx_credits >= 16 * 1024 && tp->rcv_wnd <= 128 * 1024) || @@ -492,25 +495,16 @@ max_dsgl_nsegs(int tx_credits) static inline void write_tx_wr(void *dst, struct toepcb *toep, unsigned int immdlen, - unsigned int plen, uint8_t credits, int shove, int ulp_mode, int txalign) + unsigned int plen, uint8_t credits, int shove, int ulp_submode, int txalign) { struct fw_ofld_tx_data_wr *txwr = dst; - unsigned int wr_ulp_mode; txwr->op_to_immdlen = htobe32(V_WR_OP(FW_OFLD_TX_DATA_WR) | V_FW_WR_IMMDLEN(immdlen)); txwr->flowid_len16 = htobe32(V_FW_WR_FLOWID(toep->tid) | V_FW_WR_LEN16(credits)); - - /* for iscsi, the mode & submode setting is per-packet */ - if (toep->ulp_mode == ULP_MODE_ISCSI) - wr_ulp_mode = V_TX_ULP_MODE(ulp_mode >> 4) | - V_TX_ULP_SUBMODE(ulp_mode & 3); - else - wr_ulp_mode = V_TX_ULP_MODE(toep->ulp_mode); - - txwr->lsodisable_to_flags = htobe32(wr_ulp_mode | V_TX_URG(0) | /*XXX*/ - V_TX_SHOVE(shove)); + txwr->lsodisable_to_flags = htobe32(V_TX_ULP_MODE(toep->ulp_mode) | + V_TX_ULP_SUBMODE(ulp_submode) | V_TX_URG(0) | V_TX_SHOVE(shove)); txwr->plen = htobe32(plen); if (txalign > 0) { @@ -618,6 +612,9 @@ t4_push_frames(struct adapter *sc, struc toep->ulp_mode == ULP_MODE_RDMA, ("%s: ulp_mode %u for toep %p", __func__, toep->ulp_mode, toep)); + if (__predict_false(toep->flags & TPF_ABORT_SHUTDOWN)) + return; + /* * This function doesn't resume by itself. Someone else must clear the * flag and call this function. @@ -802,56 +799,70 @@ t4_push_frames(struct adapter *sc, struc close_conn(sc, toep); } -/* Send ULP data over TOE using TX_DATA_WR. We send whole mbuf at once */ +static inline void +rqdrop_locked(struct mbufq *q, int plen) +{ + struct mbuf *m; + + while (plen > 0) { + m = mbufq_dequeue(q); + + /* Too many credits. */ + MPASS(m != NULL); + M_ASSERTPKTHDR(m); + + /* Partial credits. */ + MPASS(plen >= m->m_pkthdr.len); + + plen -= m->m_pkthdr.len; + m_freem(m); + } +} + void -t4_ulp_push_frames(struct adapter *sc, struct toepcb *toep, int drop) +t4_push_pdus(struct adapter *sc, struct toepcb *toep, int drop) { - struct mbuf *sndptr, *m = NULL; + struct mbuf *sndptr, *m; struct fw_ofld_tx_data_wr *txwr; struct wrqe *wr; - unsigned int plen, nsegs, credits, max_imm, max_nsegs, max_nsegs_1mbuf; + u_int plen, nsegs, credits, max_imm, max_nsegs, max_nsegs_1mbuf; + u_int adjusted_plen, ulp_submode; struct inpcb *inp = toep->inp; - struct tcpcb *tp; - struct socket *so; - struct sockbuf *sb; - int tx_credits, ulp_len = 0, ulp_mode = 0, qlen = 0; - int shove, compl; - struct ofld_tx_sdesc *txsd; + struct tcpcb *tp = intotcpcb(inp); + int tx_credits, shove; + struct ofld_tx_sdesc *txsd = &toep->txsd[toep->txsd_pidx]; + struct mbufq *pduq = &toep->ulp_pduq; + static const u_int ulp_extra_len[] = {0, 4, 4, 8}; INP_WLOCK_ASSERT(inp); - if (toep->flags & TPF_ABORT_SHUTDOWN) - return; - - tp = intotcpcb(inp); - so = inp->inp_socket; - sb = &so->so_snd; - txsd = &toep->txsd[toep->txsd_pidx]; - KASSERT(toep->flags & TPF_FLOWC_WR_SENT, ("%s: flowc_wr not sent for tid %u.", __func__, toep->tid)); + KASSERT(toep->ulp_mode == ULP_MODE_ISCSI, + ("%s: ulp_mode %u for toep %p", __func__, toep->ulp_mode, toep)); + + if (__predict_false(toep->flags & TPF_ABORT_SHUTDOWN)) + return; /* * This function doesn't resume by itself. Someone else must clear the * flag and call this function. */ - if (__predict_false(toep->flags & TPF_TX_SUSPENDED)) + if (__predict_false(toep->flags & TPF_TX_SUSPENDED)) { + KASSERT(drop == 0, + ("%s: drop (%d) != 0 but tx is suspended", __func__, drop)); return; + } - sndptr = t4_queue_iscsi_callback(so, toep, 1, &qlen); - if (!qlen) - return; + if (drop) + rqdrop_locked(&toep->ulp_pdu_reclaimq, drop); + + while ((sndptr = mbufq_first(pduq)) != NULL) { + M_ASSERTPKTHDR(sndptr); - do { tx_credits = min(toep->tx_credits, MAX_OFLD_TX_CREDITS); max_imm = max_imm_payload(tx_credits); max_nsegs = max_dsgl_nsegs(tx_credits); - if (drop) { - t4_cpl_iscsi_callback(toep->td, toep, &drop, - CPL_FW4_ACK); - drop = 0; - } - plen = 0; nsegs = 0; max_nsegs_1mbuf = 0; /* max # of SGL segments in any one mbuf */ @@ -861,7 +872,10 @@ t4_ulp_push_frames(struct adapter *sc, s nsegs += n; plen += m->m_len; - /* This mbuf sent us _over_ the nsegs limit, return */ + /* + * This mbuf would send us _over_ the nsegs limit. + * Suspend tx because the PDU can't be sent out. + */ if (plen > max_imm && nsegs > max_nsegs) { toep->flags |= TPF_TX_SUSPENDED; return; @@ -869,30 +883,35 @@ t4_ulp_push_frames(struct adapter *sc, s if (max_nsegs_1mbuf < n) max_nsegs_1mbuf = n; - - /* This mbuf put us right at the max_nsegs limit */ - if (plen > max_imm && nsegs == max_nsegs) { - toep->flags |= TPF_TX_SUSPENDED; - return; - } - } - - shove = m == NULL && !(tp->t_flags & TF_MORETOCOME); - /* nothing to send */ - if (plen == 0) { - KASSERT(m == NULL, - ("%s: nothing to send, but m != NULL", __func__)); - break; } if (__predict_false(toep->flags & TPF_FIN_SENT)) panic("%s: excess tx.", __func__); - ulp_len = plen + ulp_extra_len(sndptr, &ulp_mode); + /* + * We have a PDU to send. All of it goes out in one WR so 'm' + * is NULL. A PDU's length is always a multiple of 4. + */ + MPASS(m == NULL); + MPASS((plen & 3) == 0); + MPASS(sndptr->m_pkthdr.len == plen); + + shove = !(tp->t_flags & TF_MORETOCOME); + ulp_submode = mbuf_ulp_submode(sndptr); + MPASS(ulp_submode < nitems(ulp_extra_len)); + + /* + * plen doesn't include header and data digests, which are + * generated and inserted in the right places by the TOE, but + * they do occupy TCP sequence space and need to be accounted + * for. + */ + adjusted_plen = plen + ulp_extra_len[ulp_submode]; if (plen <= max_imm) { /* Immediate data tx */ - wr = alloc_wrqe(roundup(sizeof(*txwr) + plen, 16), + + wr = alloc_wrqe(roundup2(sizeof(*txwr) + plen, 16), toep->ofld_txq); if (wr == NULL) { /* XXX: how will we recover from this? */ @@ -901,16 +920,17 @@ t4_ulp_push_frames(struct adapter *sc, s } txwr = wrtod(wr); credits = howmany(wr->wr_len, 16); - write_tx_wr(txwr, toep, plen, ulp_len, credits, shove, - ulp_mode, 0); + write_tx_wr(txwr, toep, plen, adjusted_plen, credits, + shove, ulp_submode, sc->tt.tx_align); m_copydata(sndptr, 0, plen, (void *)(txwr + 1)); + nsegs = 0; } else { int wr_len; /* DSGL tx */ wr_len = sizeof(*txwr) + sizeof(struct ulptx_sgl) + ((3 * (nsegs - 1)) / 2 + ((nsegs - 1) & 1)) * 8; - wr = alloc_wrqe(roundup(wr_len, 16), toep->ofld_txq); + wr = alloc_wrqe(roundup2(wr_len, 16), toep->ofld_txq); if (wr == NULL) { /* XXX: how will we recover from this? */ toep->flags |= TPF_TX_SUSPENDED; @@ -918,8 +938,8 @@ t4_ulp_push_frames(struct adapter *sc, s } txwr = wrtod(wr); credits = howmany(wr_len, 16); - write_tx_wr(txwr, toep, 0, ulp_len, credits, shove, - ulp_mode, 0); + write_tx_wr(txwr, toep, 0, adjusted_plen, credits, + shove, ulp_submode, sc->tt.tx_align); write_tx_sgl(txwr + 1, sndptr, m, nsegs, max_nsegs_1mbuf); if (wr_len & 0xf) { @@ -932,28 +952,26 @@ t4_ulp_push_frames(struct adapter *sc, s KASSERT(toep->tx_credits >= credits, ("%s: not enough credits", __func__)); + m = mbufq_dequeue(pduq); + MPASS(m == sndptr); + mbufq_enqueue(&toep->ulp_pdu_reclaimq, m); + toep->tx_credits -= credits; toep->tx_nocompl += credits; toep->plen_nocompl += plen; if (toep->tx_credits <= toep->tx_total * 3 / 8 && - toep->tx_nocompl >= toep->tx_total / 4) - compl = 1; - - if (compl) { + toep->tx_nocompl >= toep->tx_total / 4) { txwr->op_to_immdlen |= htobe32(F_FW_WR_COMPL); toep->tx_nocompl = 0; toep->plen_nocompl = 0; } - tp->snd_nxt += ulp_len; - tp->snd_max += ulp_len; - /* goto next mbuf */ - sndptr = m = t4_queue_iscsi_callback(so, toep, 2, &qlen); + tp->snd_nxt += adjusted_plen; + tp->snd_max += adjusted_plen; toep->flags |= TPF_TX_DATA_SENT; - if (toep->tx_credits < MIN_OFLD_TX_CREDITS) { + if (toep->tx_credits < MIN_OFLD_TX_CREDITS) toep->flags |= TPF_TX_SUSPENDED; - } KASSERT(toep->txsd_avail > 0, ("%s: no txsd", __func__)); txsd->plen = plen; @@ -966,10 +984,10 @@ t4_ulp_push_frames(struct adapter *sc, s toep->txsd_avail--; t4_l2t_send(sc, wr, toep->l2te); - } while (m != NULL); + } - /* Send a FIN if requested, but only if there's no more data to send */ - if (m == NULL && toep->flags & TPF_SEND_FIN) + /* Send a FIN if requested, but only if there are no more PDUs to send */ + if (mbufq_first(pduq) == NULL && toep->flags & TPF_SEND_FIN) close_conn(sc, toep); } @@ -987,7 +1005,10 @@ t4_tod_output(struct toedev *tod, struct ("%s: inp %p dropped.", __func__, inp)); KASSERT(toep != NULL, ("%s: toep is NULL", __func__)); - t4_push_frames(sc, toep, 0); + if (toep->ulp_mode == ULP_MODE_ISCSI) + t4_push_pdus(sc, toep, 0); + else + t4_push_frames(sc, toep, 0); return (0); } @@ -1009,7 +1030,7 @@ t4_send_fin(struct toedev *tod, struct t toep->flags |= TPF_SEND_FIN; if (tp->t_state >= TCPS_ESTABLISHED) { if (toep->ulp_mode == ULP_MODE_ISCSI) - t4_ulp_push_frames(sc, toep, 0); + t4_push_pdus(sc, toep, 0); else t4_push_frames(sc, toep, 0); } @@ -1250,91 +1271,6 @@ abort_status_to_errno(struct tcpcb *tp, } } -int -cpl_not_handled(struct sge_iq *, const struct rss_header *, struct mbuf *); -/* - * tom_cpl_iscsi_callback - - * iscsi and tom would share the following cpl messages, so when any of these - * message is received, after tom is done with processing it, the messages - * needs to be forwarded to iscsi for further processing: - * - CPL_SET_TCB_RPL - * - CPL_RX_DATA_DDP - */ -void (*tom_cpl_iscsi_callback)(struct tom_data *, struct socket *, void *, - unsigned int); - -struct mbuf *(*tom_queue_iscsi_callback)(struct socket *, unsigned int, int *); -/* - * Check if the handler function is set for a given CPL - * return 0 if the function is NULL or cpl_not_handled, 1 otherwise. - */ -int -t4tom_cpl_handler_registered(struct adapter *sc, unsigned int opcode) -{ - - MPASS(opcode < nitems(sc->cpl_handler)); - - return (sc->cpl_handler[opcode] && - sc->cpl_handler[opcode] != cpl_not_handled); -} - -/* - * set the tom_cpl_iscsi_callback function, this function should be used - * whenever both toe and iscsi need to process the same cpl msg. - */ -void -t4tom_register_cpl_iscsi_callback(void (*fp)(struct tom_data *, struct socket *, - void *, unsigned int)) -{ - - tom_cpl_iscsi_callback = fp; -} - -void -t4tom_register_queue_iscsi_callback(struct mbuf *(*fp)(struct socket *, - unsigned int, int *qlen)) -{ - - tom_queue_iscsi_callback = fp; -} - -int -t4_cpl_iscsi_callback(struct tom_data *td, struct toepcb *toep, void *m, - unsigned int opcode) -{ - struct socket *so; - - if (opcode == CPL_FW4_ACK) - so = toep->inp->inp_socket; - else { - INP_WLOCK(toep->inp); - so = toep->inp->inp_socket; - INP_WUNLOCK(toep->inp); - } - - if (tom_cpl_iscsi_callback && so) { - if (toep->ulp_mode == ULP_MODE_ISCSI) { - tom_cpl_iscsi_callback(td, so, m, opcode); - return (0); - } - } - - return (1); -} - -struct mbuf * -t4_queue_iscsi_callback(struct socket *so, struct toepcb *toep, - unsigned int cmd, int *qlen) -{ - - if (tom_queue_iscsi_callback && so) { - if (toep->ulp_mode == ULP_MODE_ISCSI) - return (tom_queue_iscsi_callback(so, cmd, qlen)); - } - - return (NULL); -} - /* * TCP RST from the peer, timeout, or some other such critical error. */ @@ -1739,21 +1675,34 @@ do_fw4_ack(struct sge_iq *iq, const stru toep->tx_credits >= toep->tx_total / 4) { toep->flags &= ~TPF_TX_SUSPENDED; if (toep->ulp_mode == ULP_MODE_ISCSI) - t4_ulp_push_frames(sc, toep, plen); + t4_push_pdus(sc, toep, plen); else t4_push_frames(sc, toep, plen); } else if (plen > 0) { struct sockbuf *sb = &so->so_snd; + int sbu; - if (toep->ulp_mode == ULP_MODE_ISCSI) - t4_cpl_iscsi_callback(toep->td, toep, &plen, - CPL_FW4_ACK); - else { - SOCKBUF_LOCK(sb); + SOCKBUF_LOCK(sb); + sbu = sb->sb_cc; + if (toep->ulp_mode == ULP_MODE_ISCSI) { + + if (__predict_false(sbu > 0)) { + /* + * The data trasmitted before the tid's ULP mode + * changed to ISCSI is still in so_snd. + * Incoming credits should account for so_snd + * first. + */ + sbdrop_locked(sb, min(sbu, plen)); + plen -= min(sbu, plen); + } + sowwakeup_locked(so); /* unlocks so_snd */ + rqdrop_locked(&toep->ulp_pdu_reclaimq, plen); + } else { sbdrop_locked(sb, plen); - sowwakeup_locked(so); - SOCKBUF_UNLOCK_ASSERT(sb); + sowwakeup_locked(so); /* unlocks so_snd */ } + SOCKBUF_UNLOCK_ASSERT(sb); } INP_WUNLOCK(inp); @@ -1777,14 +1726,21 @@ do_set_tcb_rpl(struct sge_iq *iq, const if (is_ftid(sc, tid)) return (t4_filter_rpl(iq, rss, m)); /* TCB is a filter */ - else { - struct toepcb *toep = lookup_tid(sc, tid); - t4_cpl_iscsi_callback(toep->td, toep, m, CPL_SET_TCB_RPL); - return (0); - } + /* + * TOM and/or other ULPs don't request replies for CPL_SET_TCB or + * CPL_SET_TCB_FIELD requests. This can easily change and when it does + * the dispatch code will go here. + */ +#ifdef INVARIANTS + panic("%s: Unexpected CPL_SET_TCB_RPL for tid %u on iq %p", __func__, + tid, iq); +#else + log(LOG_ERR, "%s: Unexpected CPL_SET_TCB_RPL for tid %u on iq %p\n", + __func__, tid, iq); +#endif - CXGBE_UNIMPLEMENTED(__func__); + return (0); } void Modified: stable/10/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_ddp.c Fri Dec 2 19:47:23 2016 (r309439) +++ stable/10/sys/dev/cxgbe/tom/t4_ddp.c Fri Dec 2 20:16:52 2016 (r309440) @@ -488,7 +488,6 @@ do_rx_data_ddp(struct sge_iq *iq, const unsigned int tid = GET_TID(cpl); uint32_t vld; struct toepcb *toep = lookup_tid(sc, tid); - struct tom_data *td = toep->td; KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); KASSERT(toep->tid == tid, ("%s: toep tid/atid mismatch", __func__)); @@ -500,16 +499,11 @@ do_rx_data_ddp(struct sge_iq *iq, const panic("%s: DDP error 0x%x (tid %d, toep %p)", __func__, vld, tid, toep); } + if (toep->ulp_mode == ULP_MODE_ISCSI) { - m = m_get(M_NOWAIT, MT_DATA); - if (m == NULL) - CXGBE_UNIMPLEMENTED("mbuf alloc failure"); - memcpy(mtod(m, unsigned char *), cpl, - sizeof(struct cpl_rx_data_ddp)); - if (!t4_cpl_iscsi_callback(td, toep, m, CPL_RX_DATA_DDP)) - return (0); - m_freem(m); - } + sc->cpl_handler[CPL_RX_ISCSI_DDP](iq, rss, m); + return (0); + } handle_ddp_data(toep, cpl->u.ddp_report, cpl->seq, be16toh(cpl->len)); Modified: stable/10/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_tom.c Fri Dec 2 19:47:23 2016 (r309439) +++ stable/10/sys/dev/cxgbe/tom/t4_tom.c Fri Dec 2 20:16:52 2016 (r309440) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -103,6 +104,37 @@ static int in6_ifaddr_gen; static eventhandler_tag ifaddr_evhandler; static struct timeout_task clip_task; +static void +mbufq_init(struct mbufq *q, int limit) +{ + + q->head = q->tail = NULL; +} + +static void +mbufq_drain(struct mbufq *q) +{ + struct mbuf *m; + + while ((m = q->head) != NULL) { + q->head = m->m_nextpkt; + m_freem(m); + } + q->tail = NULL; +} + +static inline int +mbufq_len(const struct mbufq *q) +{ + struct mbuf *m; + int len; + + len = 0; + for (m = q->head; m != NULL; m = m->m_nextpkt) + len++; + return (len); +} + struct toepcb * alloc_toepcb(struct vi_info *vi, int txqid, int rxqid, int flags) { @@ -155,6 +187,8 @@ alloc_toepcb(struct vi_info *vi, int txq toep->ofld_txq = &sc->sge.ofld_txq[txqid]; toep->ofld_rxq = &sc->sge.ofld_rxq[rxqid]; toep->ctrlq = &sc->sge.ctrlq[pi->port_id]; + mbufq_init(&toep->ulp_pduq, INT_MAX); + mbufq_init(&toep->ulp_pdu_reclaimq, INT_MAX); toep->txsd_total = txsd_total; toep->txsd_avail = txsd_total; toep->txsd_pidx = 0; @@ -270,6 +304,14 @@ release_offload_resources(struct toepcb CTR5(KTR_CXGBE, "%s: toep %p (tid %d, l2te %p, ce %p)", __func__, toep, tid, toep->l2te, toep->ce); + /* + * These queues should have been emptied at approximately the same time + * that a normal connection's socket's so_snd would have been purged or + * drained. Do _not_ clean up here. + */ + MPASS(mbufq_len(&toep->ulp_pduq) == 0); + MPASS(mbufq_len(&toep->ulp_pdu_reclaimq) == 0); + if (toep->ulp_mode == ULP_MODE_TCPDDP) release_ddp_resources(toep); @@ -377,6 +419,7 @@ final_cpl_received(struct toepcb *toep) toep->inp = NULL; toep->flags &= ~TPF_CPL_PENDING; + mbufq_drain(&toep->ulp_pdu_reclaimq); if (!(toep->flags & TPF_ATTACHED)) release_offload_resources(toep); Modified: stable/10/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_tom.h Fri Dec 2 19:47:23 2016 (r309439) +++ stable/10/sys/dev/cxgbe/tom/t4_tom.h Fri Dec 2 20:16:52 2016 (r309440) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 Chelsio Communications, Inc. + * Copyright (c) 2012, 2015 Chelsio Communications, Inc. * All rights reserved. * Written by: Navdeep Parhar * @@ -32,6 +32,15 @@ #define __T4_TOM_H__ #include +/* + * Inline version of mbufq for use on 10.x. Borrowed from + * sys/cam/ctl/ctl_ha.c. + */ +struct mbufq { + struct mbuf *head; + struct mbuf *tail; +}; + #define LISTEN_HASH_SIZE 32 /* @@ -115,6 +124,10 @@ struct toepcb { int rx_credits; /* rx credits (in bytes) to be returned to hw */ u_int ulp_mode; /* ULP mode */ + void *ulpcb; + void *ulpcb2; + struct mbufq ulp_pduq; /* PDUs waiting to be sent out. */ + struct mbufq ulp_pdu_reclaimq; u_int ddp_flags; struct ddp_buffer *db[2]; @@ -220,6 +233,28 @@ td_adapter(struct tom_data *td) return (td->tod.tod_softc); } +/* + * XXX: Don't define these for the iWARP driver on 10 due to differences + * in LinuxKPI. + */ +#ifndef _LINUX_TYPES_H_ +static inline void +set_mbuf_ulp_submode(struct mbuf *m, uint8_t ulp_submode) +{ + + M_ASSERTPKTHDR(m); + m->m_pkthdr.PH_per.eigth[0] = ulp_submode; +} + +static inline uint8_t +mbuf_ulp_submode(struct mbuf *m) +{ + + M_ASSERTPKTHDR(m); + return (m->m_pkthdr.PH_per.eigth[0]); +} +#endif + /* t4_tom.c */ struct toepcb *alloc_toepcb(struct vi_info *, int, int, int); void free_toepcb(struct toepcb *); @@ -275,6 +310,7 @@ int t4_send_rst(struct toedev *, struct void t4_set_tcb_field(struct adapter *, struct toepcb *, int, uint16_t, uint64_t, uint64_t); void t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop); +void t4_push_pdus(struct adapter *sc, struct toepcb *toep, int drop); /* t4_ddp.c */ void t4_init_ddp(struct adapter *, struct tom_data *); @@ -287,19 +323,4 @@ void handle_ddp_close(struct toepcb *, s uint32_t); void insert_ddp_data(struct toepcb *, uint32_t); -/* ULP related */ -#define CXGBE_ISCSI_MBUF_TAG 50 -int t4tom_cpl_handler_registered(struct adapter *, unsigned int); -void t4tom_register_cpl_iscsi_callback(void (*fp)(struct tom_data *, - struct socket *, void *, unsigned int)); -void t4tom_register_queue_iscsi_callback(struct mbuf *(*fp)(struct socket *, - unsigned int, int *)); -void t4_ulp_push_frames(struct adapter *sc, struct toepcb *toep, int); -int t4_cpl_iscsi_callback(struct tom_data *, struct toepcb *, void *, uint32_t); -struct mbuf *t4_queue_iscsi_callback(struct socket *, struct toepcb *, uint32_t, - int *); -extern void (*tom_cpl_iscsi_callback)(struct tom_data *, struct socket *, - void *, unsigned int); -extern struct mbuf *(*tom_queue_iscsi_callback)(struct socket*, unsigned int, - int *); #endif From owner-svn-src-all@freebsd.org Fri Dec 2 21:29:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FC98C634A8; Fri, 2 Dec 2016 21:29:55 +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 EC7E91719; Fri, 2 Dec 2016 21:29:54 +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 uB2LTstb028214; Fri, 2 Dec 2016 21:29:54 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2LTq35028199; Fri, 2 Dec 2016 21:29:52 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612022129.uB2LTq35028199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 2 Dec 2016 21:29:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309442 - in stable/10/sys/dev/cxgbe: . iw_cxgbe tom X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 21:29:55 -0000 Author: jhb Date: Fri Dec 2 21:29:52 2016 New Revision: 309442 URL: https://svnweb.freebsd.org/changeset/base/309442 Log: MFC 302339: cxgbe(4): Changes to the CPL-handler registration mechanism and code related to "shared" CPLs. a) Combine t4_set_tcb_field and t4_set_tcb_field_rpl into a single function. Allow callers to direct the response to any iq. Tidy up set_ulp_mode_iscsi while there to use names from t4_tcb.h instead of magic constants. b) Remove all CPL handler tables from struct adapter. This reduces its size by around 2KB. All handlers are now registered at MOD_LOAD instead of attach or some kind of initialization/activation. The registration functions do not need an adapter parameter any more. c) Add per-iq handlers to deal with CPLs whose destination cannot be determined solely from the opcode. There are 2 such CPLs in use right now: SET_TCB_RPL and L2T_WRITE_RPL. The base driver continues to send filter and L2T_WRITEs over the mgmtq and solicits the reply on fwq. t4_tom (including the DDP code) now uses the port's ctrlq to send L2T_WRITEs and SET_TCB_FIELDs and solicits the reply on an ofld_rxq. fwq and ofld_rxq have different handlers that know what kind of tid to expect in the reply. Update t4_write_l2e and callers to to support any wrq/iq combination. Sponsored by: Chelsio Communications Modified: stable/10/sys/dev/cxgbe/adapter.h stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c stable/10/sys/dev/cxgbe/iw_cxgbe/device.c stable/10/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h stable/10/sys/dev/cxgbe/t4_l2t.c stable/10/sys/dev/cxgbe/t4_l2t.h stable/10/sys/dev/cxgbe/t4_main.c stable/10/sys/dev/cxgbe/t4_sge.c stable/10/sys/dev/cxgbe/tom/t4_connect.c stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c stable/10/sys/dev/cxgbe/tom/t4_ddp.c stable/10/sys/dev/cxgbe/tom/t4_listen.c stable/10/sys/dev/cxgbe/tom/t4_tom.c stable/10/sys/dev/cxgbe/tom/t4_tom.h stable/10/sys/dev/cxgbe/tom/t4_tom_l2t.c stable/10/sys/dev/cxgbe/tom/t4_tom_l2t.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/10/sys/dev/cxgbe/adapter.h Fri Dec 2 20:17:41 2016 (r309441) +++ stable/10/sys/dev/cxgbe/adapter.h Fri Dec 2 21:29:52 2016 (r309442) @@ -365,6 +365,13 @@ enum { NM_BUSY = 2, }; +struct sge_iq; +struct rss_header; +typedef int (*cpl_handler_t)(struct sge_iq *, const struct rss_header *, + struct mbuf *); +typedef int (*an_handler_t)(struct sge_iq *, const struct rsp_ctrl *); +typedef int (*fw_msg_handler_t)(struct adapter *, const __be64 *); + /* * Ingress Queue: T4 is producer, driver is consumer. */ @@ -372,6 +379,8 @@ struct sge_iq { uint32_t flags; volatile int state; struct adapter *adapter; + cpl_handler_t set_tcb_rpl; + cpl_handler_t l2t_write_rpl; struct iq_desc *desc; /* KVA of descriptor ring */ int8_t intr_pktc_idx; /* packet count threshold index */ uint8_t gen; /* generation bit */ @@ -732,12 +741,6 @@ struct sge { struct hw_buf_info hw_buf_info[SGE_FLBUF_SIZES]; }; -struct rss_header; -typedef int (*cpl_handler_t)(struct sge_iq *, const struct rss_header *, - struct mbuf *); -typedef int (*an_handler_t)(struct sge_iq *, const struct rsp_ctrl *); -typedef int (*fw_msg_handler_t)(struct adapter *, const __be64 *); - struct adapter { SLIST_ENTRY(adapter) link; device_t dev; @@ -776,6 +779,7 @@ struct adapter { struct sge sge; int lro_timeout; + int sc_do_rxcopy; struct taskqueue *tq[MAX_NCHAN]; /* General purpose taskqueues */ struct port_info *port[MAX_NPORTS]; @@ -835,15 +839,9 @@ struct adapter { struct memwin memwin[NUM_MEMWIN]; /* memory windows */ - an_handler_t an_handler __aligned(CACHE_LINE_SIZE); - fw_msg_handler_t fw_msg_handler[7]; /* NUM_FW6_TYPES */ - cpl_handler_t cpl_handler[0xef]; /* NUM_CPL_CMDS */ - const char *last_op; const void *last_op_thr; int last_op_flags; - - int sc_do_rxcopy; }; #define ADAPTER_LOCK(sc) mtx_lock(&(sc)->sc_lock) @@ -1073,9 +1071,6 @@ int t4_os_pci_restore_state(struct adapt void t4_os_portmod_changed(const struct adapter *, int); void t4_os_link_changed(struct adapter *, int, int, int); void t4_iterate(void (*)(struct adapter *, void *), void *); -int t4_register_cpl_handler(struct adapter *, int, cpl_handler_t); -int t4_register_an_handler(struct adapter *, an_handler_t); -int t4_register_fw_msg_handler(struct adapter *, int, fw_msg_handler_t); int t4_filter_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *); int begin_synchronized_op(struct adapter *, struct vi_info *, int, char *); void doom_vi(struct adapter *, struct vi_info *); @@ -1100,7 +1095,6 @@ void t4_nm_intr(void *); void t4_sge_modload(void); void t4_sge_modunload(void); uint64_t t4_sge_extfree_refs(void); -void t4_init_sge_cpl_handlers(struct adapter *); void t4_tweak_chip_settings(struct adapter *); int t4_read_chip_settings(struct adapter *); int t4_create_dma_tag(struct adapter *); @@ -1122,6 +1116,9 @@ int parse_pkt(struct mbuf **); void *start_wrq_wr(struct sge_wrq *, int, struct wrq_cookie *); void commit_wrq_wr(struct sge_wrq *, void *, struct wrq_cookie *); int tnl_cong(struct port_info *, int); +int t4_register_an_handler(an_handler_t); +int t4_register_fw_msg_handler(int, fw_msg_handler_t); +int t4_register_cpl_handler(int, cpl_handler_t); /* t4_tracer.c */ struct t4_tracer; Modified: stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c Fri Dec 2 20:17:41 2016 (r309441) +++ stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c Fri Dec 2 21:29:52 2016 (r309442) @@ -2479,28 +2479,14 @@ static int terminate(struct sge_iq *iq, return 0; } - void -c4iw_cm_init_cpl(struct adapter *sc) -{ - - t4_register_cpl_handler(sc, CPL_RDMA_TERMINATE, terminate); - t4_register_fw_msg_handler(sc, FW6_TYPE_WR_RPL, fw6_wr_rpl); - t4_register_fw_msg_handler(sc, FW6_TYPE_CQE, fw6_cqe_handler); - t4_register_an_handler(sc, c4iw_ev_handler); -} - - void -c4iw_cm_term_cpl(struct adapter *sc) -{ - - t4_register_cpl_handler(sc, CPL_RDMA_TERMINATE, NULL); - t4_register_fw_msg_handler(sc, FW6_TYPE_WR_RPL, NULL); - t4_register_fw_msg_handler(sc, FW6_TYPE_CQE, NULL); -} - int __init c4iw_cm_init(void) { + t4_register_cpl_handler(CPL_RDMA_TERMINATE, terminate); + t4_register_fw_msg_handler(FW6_TYPE_WR_RPL, fw6_wr_rpl); + t4_register_fw_msg_handler(FW6_TYPE_CQE, fw6_cqe_handler); + t4_register_an_handler(c4iw_ev_handler); + TAILQ_INIT(&req_list); spin_lock_init(&req_lock); INIT_LIST_HEAD(&timeout_list); @@ -2512,7 +2498,6 @@ int __init c4iw_cm_init(void) if (!c4iw_taskq) return -ENOMEM; - return 0; } @@ -2522,5 +2507,10 @@ void __exit c4iw_cm_term(void) WARN_ON(!list_empty(&timeout_list)); flush_workqueue(c4iw_taskq); destroy_workqueue(c4iw_taskq); + + t4_register_cpl_handler(CPL_RDMA_TERMINATE, NULL); + t4_register_fw_msg_handler(FW6_TYPE_WR_RPL, NULL); + t4_register_fw_msg_handler(FW6_TYPE_CQE, NULL); + t4_register_an_handler(NULL); } #endif Modified: stable/10/sys/dev/cxgbe/iw_cxgbe/device.c ============================================================================== --- stable/10/sys/dev/cxgbe/iw_cxgbe/device.c Fri Dec 2 20:17:41 2016 (r309441) +++ stable/10/sys/dev/cxgbe/iw_cxgbe/device.c Fri Dec 2 21:29:52 2016 (r309442) @@ -227,7 +227,6 @@ c4iw_activate(struct adapter *sc) } sc->iwarp_softc = iwsc; - c4iw_cm_init_cpl(sc); rc = -c4iw_register_device(iwsc); if (rc) { Modified: stable/10/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h ============================================================================== --- stable/10/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Fri Dec 2 20:17:41 2016 (r309441) +++ stable/10/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Fri Dec 2 21:29:52 2016 (r309442) @@ -974,9 +974,6 @@ int idr_for_each(struct idr *idp, return error; } -void c4iw_cm_init_cpl(struct adapter *); -void c4iw_cm_term_cpl(struct adapter *); - void your_reg_device(struct c4iw_dev *dev); #define SGE_CTRLQ_NUM 0 Modified: stable/10/sys/dev/cxgbe/t4_l2t.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_l2t.c Fri Dec 2 20:17:41 2016 (r309441) +++ stable/10/sys/dev/cxgbe/t4_l2t.c Fri Dec 2 21:29:52 2016 (r309442) @@ -110,27 +110,34 @@ found: * The write may be synchronous or asynchronous. */ int -t4_write_l2e(struct adapter *sc, struct l2t_entry *e, int sync) +t4_write_l2e(struct l2t_entry *e, int sync) { + struct sge_wrq *wrq; + struct adapter *sc; struct wrq_cookie cookie; struct cpl_l2t_write_req *req; - int idx = e->idx + sc->vres.l2t.start; + int idx; mtx_assert(&e->lock, MA_OWNED); + MPASS(e->wrq != NULL); - req = start_wrq_wr(&sc->sge.mgmtq, howmany(sizeof(*req), 16), &cookie); + wrq = e->wrq; + sc = wrq->adapter; + + req = start_wrq_wr(wrq, howmany(sizeof(*req), 16), &cookie); if (req == NULL) return (ENOMEM); + idx = e->idx + sc->vres.l2t.start; INIT_TP_WR(req, 0); OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_L2T_WRITE_REQ, idx | - V_SYNC_WR(sync) | V_TID_QID(sc->sge.fwq.abs_id))); + V_SYNC_WR(sync) | V_TID_QID(e->iqid))); req->params = htons(V_L2T_W_PORT(e->lport) | V_L2T_W_NOREPLY(!sync)); req->l2t_idx = htons(idx); req->vlan = htons(e->vlan); memcpy(req->dst_mac, e->dmac, sizeof(req->dst_mac)); - commit_wrq_wr(&sc->sge.mgmtq, req, &cookie); + commit_wrq_wr(wrq, req, &cookie); if (sync && e->state != L2T_STATE_SWITCHING) e->state = L2T_STATE_SYNC_WRITE; @@ -172,9 +179,11 @@ t4_l2t_set_switching(struct adapter *sc, e->vlan = vlan; e->lport = port; + e->wrq = &sc->sge.mgmtq; + e->iqid = sc->sge.fwq.abs_id; memcpy(e->dmac, eth_addr, ETHER_ADDR_LEN); mtx_lock(&e->lock); - rc = t4_write_l2e(sc, e, 0); + rc = t4_write_l2e(e, 0); mtx_unlock(&e->lock); return (rc); } @@ -210,7 +219,6 @@ t4_init_l2t(struct adapter *sc, int flag } sc->l2t = d; - t4_register_cpl_handler(sc, CPL_L2T_WRITE_RPL, do_l2t_write_rpl); return (0); } Modified: stable/10/sys/dev/cxgbe/t4_l2t.h ============================================================================== --- stable/10/sys/dev/cxgbe/t4_l2t.h Fri Dec 2 20:17:41 2016 (r309441) +++ stable/10/sys/dev/cxgbe/t4_l2t.h Fri Dec 2 21:29:52 2016 (r309442) @@ -61,6 +61,8 @@ struct l2t_entry { uint16_t state; /* entry state */ uint16_t idx; /* entry index */ uint32_t addr[4]; /* next hop IP or IPv6 address */ + uint32_t iqid; /* iqid for reply to write_l2e */ + struct sge_wrq *wrq; /* queue to use for write_l2e */ struct ifnet *ifp; /* outgoing interface */ uint16_t smt_idx; /* SMT index */ uint16_t vlan; /* VLAN TCI (id: 0-11, prio: 13-15) */ @@ -90,7 +92,7 @@ struct l2t_entry *t4_alloc_l2e(struct l2 struct l2t_entry *t4_l2t_alloc_switching(struct l2t_data *); int t4_l2t_set_switching(struct adapter *, struct l2t_entry *, uint16_t, uint8_t, uint8_t *); -int t4_write_l2e(struct adapter *, struct l2t_entry *, int); +int t4_write_l2e(struct l2t_entry *, int); int do_l2t_write_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *); static inline void Modified: stable/10/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_main.c Fri Dec 2 20:17:41 2016 (r309441) +++ stable/10/sys/dev/cxgbe/t4_main.c Fri Dec 2 21:29:52 2016 (r309442) @@ -459,10 +459,6 @@ static void vi_refresh_stats(struct adap static void cxgbe_refresh_stats(struct adapter *, struct port_info *); static void cxgbe_tick(void *); static void cxgbe_vlan_config(void *, struct ifnet *, uint16_t); -static int cpl_not_handled(struct sge_iq *, const struct rss_header *, - struct mbuf *); -static int an_not_handled(struct sge_iq *, const struct rsp_ctrl *); -static int fw_msg_not_handled(struct adapter *, const __be64 *); static void t4_sysctls(struct adapter *); static void cxgbe_sysctls(struct port_info *); static int sysctl_int_array(SYSCTL_HANDLER_ARGS); @@ -526,6 +522,8 @@ static int del_filter(struct adapter *, static void clear_filter(struct filter_entry *); static int set_filter_wr(struct adapter *, int); static int del_filter_wr(struct adapter *, int); +static int set_tcb_rpl(struct sge_iq *, const struct rss_header *, + struct mbuf *); static int get_sge_context(struct adapter *, struct t4_sge_context *); static int load_fw(struct adapter *, struct t4_data *); static int read_card_mem(struct adapter *, int, struct t4_mem_range *); @@ -590,11 +588,6 @@ struct { CTASSERT(offsetof(struct sge_ofld_rxq, iq) == offsetof(struct sge_rxq, iq)); CTASSERT(offsetof(struct sge_ofld_rxq, fl) == offsetof(struct sge_rxq, fl)); #endif - -/* No easy way to include t4_msg.h before adapter.h so we check this way */ -CTASSERT(nitems(((struct adapter *)0)->cpl_handler) == NUM_CPL_CMDS); -CTASSERT(nitems(((struct adapter *)0)->fw_msg_handler) == NUM_FW6_TYPES); - CTASSERT(sizeof(struct cluster_metadata) <= CL_METADATA_SIZE); static int @@ -740,15 +733,6 @@ t4_attach(device_t dev) sc->mbox = sc->pf; memset(sc->chan_map, 0xff, sizeof(sc->chan_map)); - sc->an_handler = an_not_handled; - for (i = 0; i < nitems(sc->cpl_handler); i++) - sc->cpl_handler[i] = cpl_not_handled; - for (i = 0; i < nitems(sc->fw_msg_handler); i++) - sc->fw_msg_handler[i] = fw_msg_not_handled; - t4_register_cpl_handler(sc, CPL_SET_TCB_RPL, t4_filter_rpl); - t4_register_cpl_handler(sc, CPL_TRACE_PKT, t4_trace_pkt); - t4_register_cpl_handler(sc, CPL_T5_TRACE_PKT, t5_trace_pkt); - t4_init_sge_cpl_handlers(sc); /* Prepare the adapter for operation. */ buf = malloc(PAGE_SIZE, M_CXGBE, M_ZERO | M_WAITOK); @@ -4424,98 +4408,6 @@ cxgbe_vlan_config(void *arg, struct ifne VLAN_SETCOOKIE(vlan, ifp); } -static int -cpl_not_handled(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) -{ - -#ifdef INVARIANTS - panic("%s: opcode 0x%02x on iq %p with payload %p", - __func__, rss->opcode, iq, m); -#else - log(LOG_ERR, "%s: opcode 0x%02x on iq %p with payload %p\n", - __func__, rss->opcode, iq, m); - m_freem(m); -#endif - return (EDOOFUS); -} - -int -t4_register_cpl_handler(struct adapter *sc, int opcode, cpl_handler_t h) -{ - uintptr_t *loc, new; - - if (opcode >= nitems(sc->cpl_handler)) - return (EINVAL); - - new = h ? (uintptr_t)h : (uintptr_t)cpl_not_handled; - loc = (uintptr_t *) &sc->cpl_handler[opcode]; - atomic_store_rel_ptr(loc, new); - - return (0); -} - -static int -an_not_handled(struct sge_iq *iq, const struct rsp_ctrl *ctrl) -{ - -#ifdef INVARIANTS - panic("%s: async notification on iq %p (ctrl %p)", __func__, iq, ctrl); -#else - log(LOG_ERR, "%s: async notification on iq %p (ctrl %p)\n", - __func__, iq, ctrl); -#endif - return (EDOOFUS); -} - -int -t4_register_an_handler(struct adapter *sc, an_handler_t h) -{ - uintptr_t *loc, new; - - new = h ? (uintptr_t)h : (uintptr_t)an_not_handled; - loc = (uintptr_t *) &sc->an_handler; - atomic_store_rel_ptr(loc, new); - - return (0); -} - -static int -fw_msg_not_handled(struct adapter *sc, const __be64 *rpl) -{ - const struct cpl_fw6_msg *cpl = - __containerof(rpl, struct cpl_fw6_msg, data[0]); - -#ifdef INVARIANTS - panic("%s: fw_msg type %d", __func__, cpl->type); -#else - log(LOG_ERR, "%s: fw_msg type %d\n", __func__, cpl->type); -#endif - return (EDOOFUS); -} - -int -t4_register_fw_msg_handler(struct adapter *sc, int type, fw_msg_handler_t h) -{ - uintptr_t *loc, new; - - if (type >= nitems(sc->fw_msg_handler)) - return (EINVAL); - - /* - * These are dispatched by the handler for FW{4|6}_CPL_MSG using the CPL - * handler dispatch table. Reject any attempt to install a handler for - * this subtype. - */ - if (type == FW_TYPE_RSSCPL || type == FW6_TYPE_RSSCPL) - return (EINVAL); - - new = h ? (uintptr_t)h : (uintptr_t)fw_msg_not_handled; - loc = (uintptr_t *) &sc->fw_msg_handler[type]; - atomic_store_rel_ptr(loc, new); - - return (0); -} - /* * Should match fw_caps_config_ enums in t4fw_interface.h */ @@ -8196,39 +8088,54 @@ t4_filter_rpl(struct sge_iq *iq, const s KASSERT(m == NULL, ("%s: payload with opcode %02x", __func__, rss->opcode)); + MPASS(iq == &sc->sge.fwq); + MPASS(is_ftid(sc, idx)); - if (is_ftid(sc, idx)) { - - idx -= sc->tids.ftid_base; - f = &sc->tids.ftid_tab[idx]; - rc = G_COOKIE(rpl->cookie); - - mtx_lock(&sc->tids.ftid_lock); - if (rc == FW_FILTER_WR_FLT_ADDED) { - KASSERT(f->pending, ("%s: filter[%u] isn't pending.", - __func__, idx)); - f->smtidx = (be64toh(rpl->oldval) >> 24) & 0xff; - f->pending = 0; /* asynchronous setup completed */ - f->valid = 1; - } else { - if (rc != FW_FILTER_WR_FLT_DELETED) { - /* Add or delete failed, display an error */ - log(LOG_ERR, - "filter %u setup failed with error %u\n", - idx, rc); - } - - clear_filter(f); - sc->tids.ftids_in_use--; + idx -= sc->tids.ftid_base; + f = &sc->tids.ftid_tab[idx]; + rc = G_COOKIE(rpl->cookie); + + mtx_lock(&sc->tids.ftid_lock); + if (rc == FW_FILTER_WR_FLT_ADDED) { + KASSERT(f->pending, ("%s: filter[%u] isn't pending.", + __func__, idx)); + f->smtidx = (be64toh(rpl->oldval) >> 24) & 0xff; + f->pending = 0; /* asynchronous setup completed */ + f->valid = 1; + } else { + if (rc != FW_FILTER_WR_FLT_DELETED) { + /* Add or delete failed, display an error */ + log(LOG_ERR, + "filter %u setup failed with error %u\n", + idx, rc); } - wakeup(&sc->tids.ftid_tab); - mtx_unlock(&sc->tids.ftid_lock); + + clear_filter(f); + sc->tids.ftids_in_use--; } + wakeup(&sc->tids.ftid_tab); + mtx_unlock(&sc->tids.ftid_lock); return (0); } static int +set_tcb_rpl(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) +{ + + MPASS(iq->set_tcb_rpl != NULL); + return (iq->set_tcb_rpl(iq, rss, m)); +} + +static int +l2t_write_rpl(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) +{ + + MPASS(iq->l2t_write_rpl != NULL); + return (iq->l2t_write_rpl(iq, rss, m)); +} + +static int get_sge_context(struct adapter *sc, struct t4_sge_context *cntxt) { int rc; @@ -9403,6 +9310,10 @@ mod_event(module_t mod, int cmd, void *a sx_xlock(&mlu); if (loaded++ == 0) { t4_sge_modload(); + t4_register_cpl_handler(CPL_SET_TCB_RPL, set_tcb_rpl); + t4_register_cpl_handler(CPL_L2T_WRITE_RPL, l2t_write_rpl); + t4_register_cpl_handler(CPL_TRACE_PKT, t4_trace_pkt); + t4_register_cpl_handler(CPL_T5_TRACE_PKT, t5_trace_pkt); sx_init(&t4_list_lock, "T4/T5 adapters"); SLIST_INIT(&t4_list); #ifdef TCP_OFFLOAD Modified: stable/10/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_sge.c Fri Dec 2 20:17:41 2016 (r309441) +++ stable/10/sys/dev/cxgbe/t4_sge.c Fri Dec 2 21:29:52 2016 (r309442) @@ -67,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include "common/t4_regs.h" #include "common/t4_regs_values.h" #include "common/t4_msg.h" +#include "t4_l2t.h" #include "t4_mp_ring.h" #ifdef T4_PKT_TIMESTAMP @@ -252,12 +253,110 @@ static int sysctl_tc(SYSCTL_HANDLER_ARGS static counter_u64_t extfree_refs; static counter_u64_t extfree_rels; +an_handler_t t4_an_handler; +fw_msg_handler_t t4_fw_msg_handler[NUM_FW6_TYPES]; +cpl_handler_t t4_cpl_handler[NUM_CPL_CMDS]; + + +static int +an_not_handled(struct sge_iq *iq, const struct rsp_ctrl *ctrl) +{ + +#ifdef INVARIANTS + panic("%s: async notification on iq %p (ctrl %p)", __func__, iq, ctrl); +#else + log(LOG_ERR, "%s: async notification on iq %p (ctrl %p)\n", + __func__, iq, ctrl); +#endif + return (EDOOFUS); +} + +int +t4_register_an_handler(an_handler_t h) +{ + uintptr_t *loc, new; + + new = h ? (uintptr_t)h : (uintptr_t)an_not_handled; + loc = (uintptr_t *) &t4_an_handler; + atomic_store_rel_ptr(loc, new); + + return (0); +} + +static int +fw_msg_not_handled(struct adapter *sc, const __be64 *rpl) +{ + const struct cpl_fw6_msg *cpl = + __containerof(rpl, struct cpl_fw6_msg, data[0]); + +#ifdef INVARIANTS + panic("%s: fw_msg type %d", __func__, cpl->type); +#else + log(LOG_ERR, "%s: fw_msg type %d\n", __func__, cpl->type); +#endif + return (EDOOFUS); +} + +int +t4_register_fw_msg_handler(int type, fw_msg_handler_t h) +{ + uintptr_t *loc, new; + + if (type >= nitems(t4_fw_msg_handler)) + return (EINVAL); + + /* + * These are dispatched by the handler for FW{4|6}_CPL_MSG using the CPL + * handler dispatch table. Reject any attempt to install a handler for + * this subtype. + */ + if (type == FW_TYPE_RSSCPL || type == FW6_TYPE_RSSCPL) + return (EINVAL); + + new = h ? (uintptr_t)h : (uintptr_t)fw_msg_not_handled; + loc = (uintptr_t *) &t4_fw_msg_handler[type]; + atomic_store_rel_ptr(loc, new); + + return (0); +} + +static int +cpl_not_handled(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) +{ + +#ifdef INVARIANTS + panic("%s: opcode 0x%02x on iq %p with payload %p", + __func__, rss->opcode, iq, m); +#else + log(LOG_ERR, "%s: opcode 0x%02x on iq %p with payload %p\n", + __func__, rss->opcode, iq, m); + m_freem(m); +#endif + return (EDOOFUS); +} + +int +t4_register_cpl_handler(int opcode, cpl_handler_t h) +{ + uintptr_t *loc, new; + + if (opcode >= nitems(t4_cpl_handler)) + return (EINVAL); + + new = h ? (uintptr_t)h : (uintptr_t)cpl_not_handled; + loc = (uintptr_t *) &t4_cpl_handler[opcode]; + atomic_store_rel_ptr(loc, new); + + return (0); +} + /* * Called on MOD_LOAD. Validates and calculates the SGE tunables. */ void t4_sge_modload(void) { + int i; if (fl_pktshift < 0 || fl_pktshift > 7) { printf("Invalid hw.cxgbe.fl_pktshift value (%d)," @@ -290,6 +389,18 @@ t4_sge_modload(void) extfree_rels = counter_u64_alloc(M_WAITOK); counter_u64_zero(extfree_refs); counter_u64_zero(extfree_rels); + + t4_an_handler = an_not_handled; + for (i = 0; i < nitems(t4_fw_msg_handler); i++) + t4_fw_msg_handler[i] = fw_msg_not_handled; + for (i = 0; i < nitems(t4_cpl_handler); i++) + t4_cpl_handler[i] = cpl_not_handled; + + t4_register_cpl_handler(CPL_FW4_MSG, handle_fw_msg); + t4_register_cpl_handler(CPL_FW6_MSG, handle_fw_msg); + t4_register_cpl_handler(CPL_SGE_EGR_UPDATE, handle_sge_egr_update); + t4_register_cpl_handler(CPL_RX_PKT, t4_eth_rx); + t4_register_fw_msg_handler(FW6_TYPE_CMD_RPL, t4_handle_fw_rpl); } void @@ -311,17 +422,6 @@ t4_sge_extfree_refs(void) return (refs - rels); } -void -t4_init_sge_cpl_handlers(struct adapter *sc) -{ - - t4_register_cpl_handler(sc, CPL_FW4_MSG, handle_fw_msg); - t4_register_cpl_handler(sc, CPL_FW6_MSG, handle_fw_msg); - t4_register_cpl_handler(sc, CPL_SGE_EGR_UPDATE, handle_sge_egr_update); - t4_register_cpl_handler(sc, CPL_RX_PKT, t4_eth_rx); - t4_register_fw_msg_handler(sc, FW6_TYPE_CMD_RPL, t4_handle_fw_rpl); -} - static inline void setup_pad_and_pack_boundaries(struct adapter *sc) { @@ -1315,7 +1415,7 @@ service_iq(struct sge_iq *iq, int budget KASSERT(d->rss.opcode < NUM_CPL_CMDS, ("%s: bad opcode %02x.", __func__, d->rss.opcode)); - sc->cpl_handler[d->rss.opcode](iq, &d->rss, m0); + t4_cpl_handler[d->rss.opcode](iq, &d->rss, m0); break; case X_RSPD_TYPE_INTR: @@ -1337,7 +1437,7 @@ service_iq(struct sge_iq *iq, int budget * iWARP async notification. */ if (lq >= 1024) { - sc->an_handler(iq, &d->rsp); + t4_an_handler(iq, &d->rsp); break; } @@ -2789,6 +2889,8 @@ alloc_fwq(struct adapter *sc) init_iq(fwq, sc, 0, 0, FW_IQ_QSIZE); fwq->flags |= IQ_INTR; /* always */ intr_idx = sc->intr_count > 1 ? 1 : 0; + fwq->set_tcb_rpl = t4_filter_rpl; + fwq->l2t_write_rpl = do_l2t_write_rpl; rc = alloc_iq_fl(&sc->port[0]->vi[0], fwq, NULL, intr_idx, -1); if (rc != 0) { device_printf(sc->dev, @@ -4674,10 +4776,10 @@ handle_fw_msg(struct sge_iq *iq, const s const struct rss_header *rss2; rss2 = (const struct rss_header *)&cpl->data[0]; - return (sc->cpl_handler[rss2->opcode](iq, rss2, m)); + return (t4_cpl_handler[rss2->opcode](iq, rss2, m)); } - return (sc->fw_msg_handler[cpl->type](sc, &cpl->data[0])); + return (t4_fw_msg_handler[cpl->type](sc, &cpl->data[0])); } static int Modified: stable/10/sys/dev/cxgbe/tom/t4_connect.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_connect.c Fri Dec 2 20:17:41 2016 (r309441) +++ stable/10/sys/dev/cxgbe/tom/t4_connect.c Fri Dec 2 21:29:52 2016 (r309442) @@ -261,11 +261,11 @@ calc_opt2a(struct socket *so, struct toe } void -t4_init_connect_cpl_handlers(struct adapter *sc) +t4_init_connect_cpl_handlers(void) { - t4_register_cpl_handler(sc, CPL_ACT_ESTABLISH, do_act_establish); - t4_register_cpl_handler(sc, CPL_ACT_OPEN_RPL, do_act_open_rpl); + t4_register_cpl_handler(CPL_ACT_ESTABLISH, do_act_establish); + t4_register_cpl_handler(CPL_ACT_OPEN_RPL, do_act_open_rpl); } #define DONT_OFFLOAD_ACTIVE_OPEN(x) do { \ Modified: stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Dec 2 20:17:41 2016 (r309441) +++ stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Dec 2 21:29:52 2016 (r309442) @@ -1710,7 +1710,7 @@ do_fw4_ack(struct sge_iq *iq, const stru return (0); } -static int +int do_set_tcb_rpl(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) { struct adapter *sc = iq->adapter; @@ -1723,9 +1723,7 @@ do_set_tcb_rpl(struct sge_iq *iq, const KASSERT(opcode == CPL_SET_TCB_RPL, ("%s: unexpected opcode 0x%x", __func__, opcode)); KASSERT(m == NULL, ("%s: wasn't expecting payload", __func__)); - - if (is_ftid(sc, tid)) - return (t4_filter_rpl(iq, rss, m)); /* TCB is a filter */ + MPASS(iq != &sc->sge.fwq); /* * TOM and/or other ULPs don't request replies for CPL_SET_TCB or @@ -1744,23 +1742,27 @@ do_set_tcb_rpl(struct sge_iq *iq, const } void -t4_set_tcb_field(struct adapter *sc, struct toepcb *toep, int ctrl, - uint16_t word, uint64_t mask, uint64_t val) +t4_set_tcb_field(struct adapter *sc, struct sge_wrq *wrq, int tid, + uint16_t word, uint64_t mask, uint64_t val, int reply, int cookie, int iqid) { struct wrqe *wr; struct cpl_set_tcb_field *req; - wr = alloc_wrqe(sizeof(*req), ctrl ? toep->ctrlq : toep->ofld_txq); + MPASS((cookie & ~M_COOKIE) == 0); + MPASS((iqid & ~M_QUEUENO) == 0); + + wr = alloc_wrqe(sizeof(*req), wrq); if (wr == NULL) { /* XXX */ panic("%s: allocation failure.", __func__); } req = wrtod(wr); - INIT_TP_WR_MIT_CPL(req, CPL_SET_TCB_FIELD, toep->tid); - req->reply_ctrl = htobe16(V_NO_REPLY(1) | - V_QUEUENO(toep->ofld_rxq->iq.abs_id)); - req->word_cookie = htobe16(V_WORD(word) | V_COOKIE(0)); + INIT_TP_WR_MIT_CPL(req, CPL_SET_TCB_FIELD, tid); + req->reply_ctrl = htobe16(V_QUEUENO(iqid)); + if (reply == 0) + req->reply_ctrl |= htobe16(F_NO_REPLY); + req->word_cookie = htobe16(V_WORD(word) | V_COOKIE(cookie)); req->mask = htobe64(mask); req->val = htobe64(val); @@ -1768,22 +1770,26 @@ t4_set_tcb_field(struct adapter *sc, str } void -t4_init_cpl_io_handlers(struct adapter *sc) +t4_init_cpl_io_handlers(void) { - t4_register_cpl_handler(sc, CPL_PEER_CLOSE, do_peer_close); - t4_register_cpl_handler(sc, CPL_CLOSE_CON_RPL, do_close_con_rpl); - t4_register_cpl_handler(sc, CPL_ABORT_REQ_RSS, do_abort_req); - t4_register_cpl_handler(sc, CPL_ABORT_RPL_RSS, do_abort_rpl); - t4_register_cpl_handler(sc, CPL_RX_DATA, do_rx_data); - t4_register_cpl_handler(sc, CPL_FW4_ACK, do_fw4_ack); - t4_register_cpl_handler(sc, CPL_SET_TCB_RPL, do_set_tcb_rpl); + t4_register_cpl_handler(CPL_PEER_CLOSE, do_peer_close); + t4_register_cpl_handler(CPL_CLOSE_CON_RPL, do_close_con_rpl); + t4_register_cpl_handler(CPL_ABORT_REQ_RSS, do_abort_req); + t4_register_cpl_handler(CPL_ABORT_RPL_RSS, do_abort_rpl); + t4_register_cpl_handler(CPL_RX_DATA, do_rx_data); + t4_register_cpl_handler(CPL_FW4_ACK, do_fw4_ack); } void -t4_uninit_cpl_io_handlers(struct adapter *sc) +t4_uninit_cpl_io_handlers(void) { - t4_register_cpl_handler(sc, CPL_SET_TCB_RPL, t4_filter_rpl); + t4_register_cpl_handler(CPL_PEER_CLOSE, do_peer_close); + t4_register_cpl_handler(CPL_CLOSE_CON_RPL, do_close_con_rpl); + t4_register_cpl_handler(CPL_ABORT_REQ_RSS, do_abort_req); + t4_register_cpl_handler(CPL_ABORT_RPL_RSS, do_abort_rpl); + t4_register_cpl_handler(CPL_RX_DATA, do_rx_data); + t4_register_cpl_handler(CPL_FW4_ACK, do_fw4_ack); } #endif Modified: stable/10/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_ddp.c Fri Dec 2 20:17:41 2016 (r309441) +++ stable/10/sys/dev/cxgbe/tom/t4_ddp.c Fri Dec 2 21:29:52 2016 (r309442) @@ -480,6 +480,8 @@ handle_ddp_close(struct toepcb *toep, st F_DDP_INVALID_TAG | F_DDP_COLOR_ERR | F_DDP_TID_MISMATCH |\ F_DDP_INVALID_PPOD | F_DDP_HDRCRC_ERR | F_DDP_DATACRC_ERR) +extern cpl_handler_t t4_cpl_handler[]; + static int do_rx_data_ddp(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) { @@ -501,7 +503,7 @@ do_rx_data_ddp(struct sge_iq *iq, const } if (toep->ulp_mode == ULP_MODE_ISCSI) { - sc->cpl_handler[CPL_RX_ISCSI_DDP](iq, rss, m); + t4_cpl_handler[CPL_RX_ISCSI_DDP](iq, rss, m); return (0); } @@ -541,13 +543,14 @@ enable_ddp(struct adapter *sc, struct to __func__, toep->tid, time_uptime); toep->ddp_flags |= DDP_SC_REQ; - t4_set_tcb_field(sc, toep, 1, W_TCB_RX_DDP_FLAGS, + t4_set_tcb_field(sc, toep->ctrlq, toep->tid, W_TCB_RX_DDP_FLAGS, V_TF_DDP_OFF(1) | V_TF_DDP_INDICATE_OUT(1) | V_TF_DDP_BUF0_INDICATE(1) | V_TF_DDP_BUF1_INDICATE(1) | V_TF_DDP_BUF0_VALID(1) | V_TF_DDP_BUF1_VALID(1), - V_TF_DDP_BUF0_INDICATE(1) | V_TF_DDP_BUF1_INDICATE(1)); - t4_set_tcb_field(sc, toep, 1, W_TCB_T_FLAGS, - V_TF_RCV_COALESCE_ENABLE(1), 0); + V_TF_DDP_BUF0_INDICATE(1) | V_TF_DDP_BUF1_INDICATE(1), 0, 0, + toep->ofld_rxq->iq.abs_id); + t4_set_tcb_field(sc, toep->ctrlq, toep->tid, W_TCB_T_FLAGS, + V_TF_RCV_COALESCE_ENABLE(1), 0, 0, 0, toep->ofld_rxq->iq.abs_id); } static inline void @@ -562,10 +565,11 @@ disable_ddp(struct adapter *sc, struct t __func__, toep->tid, time_uptime); toep->ddp_flags |= DDP_SC_REQ; - t4_set_tcb_field(sc, toep, 1, W_TCB_T_FLAGS, - V_TF_RCV_COALESCE_ENABLE(1), V_TF_RCV_COALESCE_ENABLE(1)); - t4_set_tcb_field(sc, toep, 1, W_TCB_RX_DDP_FLAGS, V_TF_DDP_OFF(1), - V_TF_DDP_OFF(1)); + t4_set_tcb_field(sc, toep->ctrlq, toep->tid, W_TCB_T_FLAGS, + V_TF_RCV_COALESCE_ENABLE(1), V_TF_RCV_COALESCE_ENABLE(1), 0, 0, + toep->ofld_rxq->iq.abs_id); + t4_set_tcb_field(sc, toep->ctrlq, toep->tid, W_TCB_RX_DDP_FLAGS, + V_TF_DDP_OFF(1), V_TF_DDP_OFF(1), 0, 0, toep->ofld_rxq->iq.abs_id); } static int @@ -978,9 +982,6 @@ t4_init_ddp(struct adapter *sc, struct t td->ppod_start = sc->vres.ddp.start; td->ppod_arena = vmem_create("DDP page pods", sc->vres.ddp.start, sc->vres.ddp.size, 1, 32, M_FIRSTFIT | M_NOWAIT); - - t4_register_cpl_handler(sc, CPL_RX_DATA_DDP, do_rx_data_ddp); - t4_register_cpl_handler(sc, CPL_RX_DDP_COMPLETE, do_rx_ddp_complete); } void @@ -1276,4 +1277,20 @@ out: return (error); } +int +t4_ddp_mod_load(void) +{ + + t4_register_cpl_handler(CPL_RX_DATA_DDP, do_rx_data_ddp); + t4_register_cpl_handler(CPL_RX_DDP_COMPLETE, do_rx_ddp_complete); + return (0); +} + +void +t4_ddp_mod_unload(void) +{ + + t4_register_cpl_handler(CPL_RX_DATA_DDP, NULL); + t4_register_cpl_handler(CPL_RX_DDP_COMPLETE, NULL); +} #endif Modified: stable/10/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_listen.c Fri Dec 2 20:17:41 2016 (r309441) +++ stable/10/sys/dev/cxgbe/tom/t4_listen.c Fri Dec 2 21:29:52 2016 (r309442) @@ -1641,12 +1641,12 @@ reset: } void -t4_init_listen_cpl_handlers(struct adapter *sc) +t4_init_listen_cpl_handlers(void) { - t4_register_cpl_handler(sc, CPL_PASS_OPEN_RPL, do_pass_open_rpl); - t4_register_cpl_handler(sc, CPL_CLOSE_LISTSRV_RPL, do_close_server_rpl); - t4_register_cpl_handler(sc, CPL_PASS_ACCEPT_REQ, do_pass_accept_req); - t4_register_cpl_handler(sc, CPL_PASS_ESTABLISH, do_pass_establish); + t4_register_cpl_handler(CPL_PASS_OPEN_RPL, do_pass_open_rpl); + t4_register_cpl_handler(CPL_CLOSE_LISTSRV_RPL, do_close_server_rpl); + t4_register_cpl_handler(CPL_PASS_ACCEPT_REQ, do_pass_accept_req); + t4_register_cpl_handler(CPL_PASS_ESTABLISH, do_pass_establish); } #endif Modified: stable/10/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_tom.c Fri Dec 2 20:17:41 2016 (r309441) +++ stable/10/sys/dev/cxgbe/tom/t4_tom.c Fri Dec 2 21:29:52 2016 (r309442) @@ -392,8 +392,9 @@ t4_ctloutput(struct toedev *tod, struct switch (name) { case TCP_NODELAY: - t4_set_tcb_field(sc, toep, 1, W_TCB_T_FLAGS, V_TF_NAGLE(1), - V_TF_NAGLE(tp->t_flags & TF_NODELAY ? 0 : 1)); + t4_set_tcb_field(sc, toep->ctrlq, toep->tid, W_TCB_T_FLAGS, + V_TF_NAGLE(1), V_TF_NAGLE(tp->t_flags & TF_NODELAY ? 0 : 1), + 0, 0, toep->ofld_rxq->iq.abs_id); break; default: break; @@ -939,8 +940,6 @@ free_tom_data(struct adapter *sc, struct KASSERT(td->lctx_count == 0, ("%s: lctx hash table is not empty.", __func__)); - t4_uninit_l2t_cpl_handlers(sc); - t4_uninit_cpl_io_handlers(sc); t4_uninit_ddp(sc, td); destroy_clip_table(sc, td); @@ -1006,7 +1005,8 @@ t4_tom_activate(struct adapter *sc) struct tom_data *td; struct toedev *tod; struct vi_info *vi; - int i, rc, v; + struct sge_ofld_rxq *ofld_rxq; + int i, j, rc, v; ASSERT_SYNCHRONIZED_OP(sc); @@ -1040,12 +1040,6 @@ t4_tom_activate(struct adapter *sc) /* CLIP table for IPv6 offload */ init_clip_table(sc, td); - /* CPL handlers */ - t4_init_connect_cpl_handlers(sc); - t4_init_l2t_cpl_handlers(sc); - t4_init_listen_cpl_handlers(sc); - t4_init_cpl_io_handlers(sc); - /* toedev ops */ tod = &td->tod; init_toedev(tod); @@ -1068,6 +1062,10 @@ t4_tom_activate(struct adapter *sc) for_each_port(sc, i) { for_each_vi(sc->port[i], v, vi) { TOEDEV(vi->ifp) = &td->tod; + for_each_ofld_rxq(vi, j, ofld_rxq) { + ofld_rxq->iq.set_tcb_rpl = do_set_tcb_rpl; + ofld_rxq->iq.l2t_write_rpl = do_l2t_write_rpl2; + } } } @@ -1136,6 +1134,15 @@ t4_tom_mod_load(void) int rc; struct protosw *tcp_protosw, *tcp6_protosw; + /* CPL handlers */ + t4_init_connect_cpl_handlers(); + t4_init_listen_cpl_handlers(); + t4_init_cpl_io_handlers(); + + rc = t4_ddp_mod_load(); + if (rc != 0) + return (rc); + tcp_protosw = pffindproto(PF_INET, IPPROTO_TCP, SOCK_STREAM); if (tcp_protosw == NULL) return (ENOPROTOOPT); @@ -1189,6 +1196,8 @@ t4_tom_mod_unload(void) taskqueue_cancel_timeout(taskqueue_thread, &clip_task, NULL); } + t4_ddp_mod_unload(); + return (0); } #endif /* TCP_OFFLOAD */ Modified: stable/10/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_tom.h Fri Dec 2 20:17:41 2016 (r309441) +++ stable/10/sys/dev/cxgbe/tom/t4_tom.h Fri Dec 2 21:29:52 2016 (r309442) @@ -278,13 +278,13 @@ struct clip_entry *hold_lip(struct tom_d void release_lip(struct tom_data *, struct clip_entry *); /* t4_connect.c */ -void t4_init_connect_cpl_handlers(struct adapter *); +void t4_init_connect_cpl_handlers(void); int t4_connect(struct toedev *, struct socket *, struct rtentry *, struct sockaddr *); void act_open_failure_cleanup(struct adapter *, u_int, u_int); /* t4_listen.c */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Dec 2 21:35:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19302C6364D; Fri, 2 Dec 2016 21:35:16 +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 C24241BBF; Fri, 2 Dec 2016 21:35:15 +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 uB2LZEJ9032187; Fri, 2 Dec 2016 21:35:14 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2LZEYM032186; Fri, 2 Dec 2016 21:35:14 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612022135.uB2LZEYM032186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 2 Dec 2016 21:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309443 - in stable: 10/sys/x86/cpufreq 11/sys/x86/cpufreq X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 21:35:16 -0000 Author: jhb Date: Fri Dec 2 21:35:14 2016 New Revision: 309443 URL: https://svnweb.freebsd.org/changeset/base/309443 Log: MFC 308005: Add powerd(8) support for several families of AMD CPUs. Use the same logic to calculate the nominal CPU frequency from the P-state MSRs on family 0x12, 0x15, and 0x16 CPUs as is used for family 0x10. Family 0x14 was included in the original patch in the PR but I left that out as the BIOS writer's guide for family 0x14 CPUs show a different layout for the relevant MSR and include a different formulate for calculating the frequency. While here, simplify a few expressions and print out the family of unsupported CPUs in hex rather than decimal. PR: 212020 Modified: stable/10/sys/x86/cpufreq/hwpstate.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/x86/cpufreq/hwpstate.c Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/x86/cpufreq/hwpstate.c ============================================================================== --- stable/10/sys/x86/cpufreq/hwpstate.c Fri Dec 2 21:29:52 2016 (r309442) +++ stable/10/sys/x86/cpufreq/hwpstate.c Fri Dec 2 21:35:14 2016 (r309443) @@ -409,25 +409,27 @@ hwpstate_get_info_from_msr(device_t dev) hwpstate_set = sc->hwpstate_settings; for (i = 0; i < sc->cfnum; i++) { msr = rdmsr(MSR_AMD_10H_11H_CONFIG + i); - if ((msr & ((uint64_t)1 << 63)) != ((uint64_t)1 << 63)) { + if ((msr & ((uint64_t)1 << 63)) == 0) { HWPSTATE_DEBUG(dev, "msr is not valid.\n"); return (ENXIO); } did = AMD_10H_11H_CUR_DID(msr); fid = AMD_10H_11H_CUR_FID(msr); + + /* Convert fid/did to frequency. */ switch(family) { case 0x11: - /* fid/did to frequency */ - hwpstate_set[i].freq = 100 * (fid + 0x08) / (1 << did); + hwpstate_set[i].freq = (100 * (fid + 0x08)) >> did; break; case 0x10: - /* fid/did to frequency */ - hwpstate_set[i].freq = 100 * (fid + 0x10) / (1 << did); + case 0x12: + case 0x15: + case 0x16: + hwpstate_set[i].freq = (100 * (fid + 0x10)) >> did; break; default: - HWPSTATE_DEBUG(dev, "get_info_from_msr: AMD family %d CPU's are not implemented yet. sorry.\n", family); + HWPSTATE_DEBUG(dev, "get_info_from_msr: AMD family 0x%02x CPU's are not implemented yet. sorry.\n", family); return (ENXIO); - break; } hwpstate_set[i].pstate_id = i; /* There was volts calculation, but deleted it. */ From owner-svn-src-all@freebsd.org Fri Dec 2 21:35:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FBFFC63654; Fri, 2 Dec 2016 21:35:16 +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 0527B1BC0; Fri, 2 Dec 2016 21:35:15 +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 uB2LZFHA032193; Fri, 2 Dec 2016 21:35:15 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2LZFOF032192; Fri, 2 Dec 2016 21:35:15 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612022135.uB2LZFOF032192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 2 Dec 2016 21:35:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309443 - in stable: 10/sys/x86/cpufreq 11/sys/x86/cpufreq X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 21:35:16 -0000 Author: jhb Date: Fri Dec 2 21:35:14 2016 New Revision: 309443 URL: https://svnweb.freebsd.org/changeset/base/309443 Log: MFC 308005: Add powerd(8) support for several families of AMD CPUs. Use the same logic to calculate the nominal CPU frequency from the P-state MSRs on family 0x12, 0x15, and 0x16 CPUs as is used for family 0x10. Family 0x14 was included in the original patch in the PR but I left that out as the BIOS writer's guide for family 0x14 CPUs show a different layout for the relevant MSR and include a different formulate for calculating the frequency. While here, simplify a few expressions and print out the family of unsupported CPUs in hex rather than decimal. PR: 212020 Modified: stable/11/sys/x86/cpufreq/hwpstate.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/x86/cpufreq/hwpstate.c Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/x86/cpufreq/hwpstate.c ============================================================================== --- stable/11/sys/x86/cpufreq/hwpstate.c Fri Dec 2 21:29:52 2016 (r309442) +++ stable/11/sys/x86/cpufreq/hwpstate.c Fri Dec 2 21:35:14 2016 (r309443) @@ -408,25 +408,27 @@ hwpstate_get_info_from_msr(device_t dev) hwpstate_set = sc->hwpstate_settings; for (i = 0; i < sc->cfnum; i++) { msr = rdmsr(MSR_AMD_10H_11H_CONFIG + i); - if ((msr & ((uint64_t)1 << 63)) != ((uint64_t)1 << 63)) { + if ((msr & ((uint64_t)1 << 63)) == 0) { HWPSTATE_DEBUG(dev, "msr is not valid.\n"); return (ENXIO); } did = AMD_10H_11H_CUR_DID(msr); fid = AMD_10H_11H_CUR_FID(msr); + + /* Convert fid/did to frequency. */ switch(family) { case 0x11: - /* fid/did to frequency */ - hwpstate_set[i].freq = 100 * (fid + 0x08) / (1 << did); + hwpstate_set[i].freq = (100 * (fid + 0x08)) >> did; break; case 0x10: - /* fid/did to frequency */ - hwpstate_set[i].freq = 100 * (fid + 0x10) / (1 << did); + case 0x12: + case 0x15: + case 0x16: + hwpstate_set[i].freq = (100 * (fid + 0x10)) >> did; break; default: - HWPSTATE_DEBUG(dev, "get_info_from_msr: AMD family %d CPU's are not implemented yet. sorry.\n", family); + HWPSTATE_DEBUG(dev, "get_info_from_msr: AMD family 0x%02x CPU's are not implemented yet. sorry.\n", family); return (ENXIO); - break; } hwpstate_set[i].pstate_id = i; /* There was volts calculation, but deleted it. */ From owner-svn-src-all@freebsd.org Fri Dec 2 21:36:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCC84C6377F; Fri, 2 Dec 2016 21:36: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 A766B14E; Fri, 2 Dec 2016 21:36:22 +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 uB2LaLsF032296; Fri, 2 Dec 2016 21:36:21 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2LaLpl032295; Fri, 2 Dec 2016 21:36:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612022136.uB2LaLpl032295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 2 Dec 2016 21:36:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309444 - stable/10/sys/dev/cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 21:36:22 -0000 Author: jhb Date: Fri Dec 2 21:36:21 2016 New Revision: 309444 URL: https://svnweb.freebsd.org/changeset/base/309444 Log: MFC 303204: Install a handler for firmware work request error messages. If a driver sends an malformed or disallowed work request, the firmware responds with a work request error. Previously the driver treated this is as an unexpected message and panicked. Now it decodes the error message to aid in debugging. Modified: stable/10/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_sge.c Fri Dec 2 21:35:14 2016 (r309443) +++ stable/10/sys/dev/cxgbe/t4_sge.c Fri Dec 2 21:36:21 2016 (r309444) @@ -243,6 +243,7 @@ static int handle_sge_egr_update(struct struct mbuf *); static int handle_fw_msg(struct sge_iq *, const struct rss_header *, struct mbuf *); +static int t4_handle_wrerr_rpl(struct adapter *, const __be64 *); static void wrq_tx_drain(void *, int); static void drain_wrq_wr_list(struct adapter *, struct sge_wrq *); @@ -401,6 +402,7 @@ t4_sge_modload(void) t4_register_cpl_handler(CPL_SGE_EGR_UPDATE, handle_sge_egr_update); t4_register_cpl_handler(CPL_RX_PKT, t4_eth_rx); t4_register_fw_msg_handler(FW6_TYPE_CMD_RPL, t4_handle_fw_rpl); + t4_register_fw_msg_handler(FW6_TYPE_WRERR_RPL, t4_handle_wrerr_rpl); } void @@ -4782,6 +4784,71 @@ handle_fw_msg(struct sge_iq *iq, const s return (t4_fw_msg_handler[cpl->type](sc, &cpl->data[0])); } +/** + * t4_handle_wrerr_rpl - process a FW work request error message + * @adap: the adapter + * @rpl: start of the FW message + */ +static int +t4_handle_wrerr_rpl(struct adapter *adap, const __be64 *rpl) +{ + u8 opcode = *(const u8 *)rpl; + const struct fw_error_cmd *e = (const void *)rpl; + unsigned int i; + + if (opcode != FW_ERROR_CMD) { + log(LOG_ERR, + "%s: Received WRERR_RPL message with opcode %#x\n", + device_get_nameunit(adap->dev), opcode); + return (EINVAL); + } + log(LOG_ERR, "%s: FW_ERROR (%s) ", device_get_nameunit(adap->dev), + G_FW_ERROR_CMD_FATAL(be32toh(e->op_to_type)) ? "fatal" : + "non-fatal"); + switch (G_FW_ERROR_CMD_TYPE(be32toh(e->op_to_type))) { + case FW_ERROR_TYPE_EXCEPTION: + log(LOG_ERR, "exception info:\n"); + for (i = 0; i < nitems(e->u.exception.info); i++) + log(LOG_ERR, "%s%08x", i == 0 ? "\t" : " ", + be32toh(e->u.exception.info[i])); + log(LOG_ERR, "\n"); + break; + case FW_ERROR_TYPE_HWMODULE: + log(LOG_ERR, "HW module regaddr %08x regval %08x\n", + be32toh(e->u.hwmodule.regaddr), + be32toh(e->u.hwmodule.regval)); + break; + case FW_ERROR_TYPE_WR: + log(LOG_ERR, "WR cidx %d PF %d VF %d eqid %d hdr:\n", + be16toh(e->u.wr.cidx), + G_FW_ERROR_CMD_PFN(be16toh(e->u.wr.pfn_vfn)), + G_FW_ERROR_CMD_VFN(be16toh(e->u.wr.pfn_vfn)), + be32toh(e->u.wr.eqid)); + for (i = 0; i < nitems(e->u.wr.wrhdr); i++) + log(LOG_ERR, "%s%02x", i == 0 ? "\t" : " ", + e->u.wr.wrhdr[i]); + log(LOG_ERR, "\n"); + break; + case FW_ERROR_TYPE_ACL: + log(LOG_ERR, "ACL cidx %d PF %d VF %d eqid %d %s", + be16toh(e->u.acl.cidx), + G_FW_ERROR_CMD_PFN(be16toh(e->u.acl.pfn_vfn)), + G_FW_ERROR_CMD_VFN(be16toh(e->u.acl.pfn_vfn)), + be32toh(e->u.acl.eqid), + G_FW_ERROR_CMD_MV(be16toh(e->u.acl.mv_pkd)) ? "vlanid" : + "MAC"); + for (i = 0; i < nitems(e->u.acl.val); i++) + log(LOG_ERR, " %02x", e->u.acl.val[i]); + log(LOG_ERR, "\n"); + break; + default: + log(LOG_ERR, "type %#x\n", + G_FW_ERROR_CMD_TYPE(be32toh(e->op_to_type))); + return (EINVAL); + } + return (0); +} + static int sysctl_uint16(SYSCTL_HANDLER_ARGS) { From owner-svn-src-all@freebsd.org Fri Dec 2 22:25:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7209CC628F1; Fri, 2 Dec 2016 22:25:12 +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 413301D15; Fri, 2 Dec 2016 22:25:12 +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 uB2MPBOK052566; Fri, 2 Dec 2016 22:25:11 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2MPB3d052564; Fri, 2 Dec 2016 22:25:11 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612022225.uB2MPB3d052564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 2 Dec 2016 22:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309445 - stable/10/sys/dev/cxgbe/tom X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 22:25:12 -0000 Author: jhb Date: Fri Dec 2 22:25:11 2016 New Revision: 309445 URL: https://svnweb.freebsd.org/changeset/base/309445 Log: Fix build without INVARIANTS. This is a direct commit to stable/10. Modified: stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c stable/10/sys/dev/cxgbe/tom/t4_tom.c Modified: stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Dec 2 21:36:21 2016 (r309444) +++ stable/10/sys/dev/cxgbe/tom/t4_cpl_io.c Fri Dec 2 22:25:11 2016 (r309445) @@ -1713,7 +1713,9 @@ do_fw4_ack(struct sge_iq *iq, const stru int do_set_tcb_rpl(struct sge_iq *iq, const struct rss_header *rss, struct mbuf *m) { +#ifdef INVARIANTS struct adapter *sc = iq->adapter; +#endif const struct cpl_set_tcb_rpl *cpl = (const void *)(rss + 1); unsigned int tid = GET_TID(cpl); #ifdef INVARIANTS Modified: stable/10/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- stable/10/sys/dev/cxgbe/tom/t4_tom.c Fri Dec 2 21:36:21 2016 (r309444) +++ stable/10/sys/dev/cxgbe/tom/t4_tom.c Fri Dec 2 22:25:11 2016 (r309445) @@ -123,6 +123,7 @@ mbufq_drain(struct mbufq *q) q->tail = NULL; } +#ifdef INVARIANTS static inline int mbufq_len(const struct mbufq *q) { @@ -134,6 +135,7 @@ mbufq_len(const struct mbufq *q) len++; return (len); } +#endif struct toepcb * alloc_toepcb(struct vi_info *vi, int txqid, int rxqid, int flags) From owner-svn-src-all@freebsd.org Fri Dec 2 22:27:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11A92C62AC0; Fri, 2 Dec 2016 22:27:56 +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 E09221F75; Fri, 2 Dec 2016 22:27:55 +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 uB2MRt9G052950; Fri, 2 Dec 2016 22:27:55 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2MRt2q052949; Fri, 2 Dec 2016 22:27:55 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612022227.uB2MRt2q052949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 2 Dec 2016 22:27:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309446 - in stable: 10/sys/kern 11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 22:27:56 -0000 Author: jhb Date: Fri Dec 2 22:27:54 2016 New Revision: 309446 URL: https://svnweb.freebsd.org/changeset/base/309446 Log: MFC 308564: Don't place threads on the run queue after waking up other CPUs. The other CPU might resume and see a still-empty runq and go back to sleep before sched_add() adds the thread to the runq. This results in a lost wakeup and a potential hang if the system is otherwise completely idle. The race originated due to a micro-optimization (my fault) in 4BSD in that it avoided putting a thread on the run queue if the scheduler was going to preempt to the new thread. To avoid complexity while fixing this race, just drop this optimization. 4BSD now always sets the "owepreempt" flag when a preemption is warranted and defers the actual preemption to the thread_unlock of the caller the same as ULE. Modified: stable/11/sys/kern/sched_4bsd.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/kern/sched_4bsd.c Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/kern/sched_4bsd.c ============================================================================== --- stable/11/sys/kern/sched_4bsd.c Fri Dec 2 22:25:11 2016 (r309445) +++ stable/11/sys/kern/sched_4bsd.c Fri Dec 2 22:27:54 2016 (r309446) @@ -308,9 +308,8 @@ maybe_resched(struct thread *td) /* * This function is called when a thread is about to be put on run queue * because it has been made runnable or its priority has been adjusted. It - * determines if the new thread should be immediately preempted to. If so, - * it switches to it and eventually returns true. If not, it returns false - * so that the caller may place the thread on an appropriate run queue. + * determines if the new thread should preempt the current thread. If so, + * it sets td_owepreempt to request a preemption. */ int maybe_preempt(struct thread *td) @@ -356,29 +355,8 @@ maybe_preempt(struct thread *td) return (0); #endif - if (ctd->td_critnest > 1) { - CTR1(KTR_PROC, "maybe_preempt: in critical section %d", - ctd->td_critnest); - ctd->td_owepreempt = 1; - return (0); - } - /* - * Thread is runnable but not yet put on system run queue. - */ - MPASS(ctd->td_lock == td->td_lock); - MPASS(TD_ON_RUNQ(td)); - TD_SET_RUNNING(td); - CTR3(KTR_PROC, "preempting to thread %p (pid %d, %s)\n", td, - td->td_proc->p_pid, td->td_name); - mi_switch(SW_INVOL | SW_PREEMPT | SWT_PREEMPT, td); - /* - * td's lock pointer may have changed. We have to return with it - * locked. - */ - spinlock_enter(); - thread_unlock(ctd); - thread_lock(td); - spinlock_exit(); + CTR0(KTR_PROC, "maybe_preempt: scheduling preemption"); + ctd->td_owepreempt = 1; return (1); #else return (0); @@ -1332,6 +1310,12 @@ sched_add(struct thread *td, int flags) ts->ts_runq = &runq; } + if ((td->td_flags & TDF_NOLOAD) == 0) + sched_load_add(); + runq_add(ts->ts_runq, td, flags); + if (cpu != NOCPU) + runq_length[cpu]++; + cpuid = PCPU_GET(cpuid); if (single_cpu && cpu != cpuid) { kick_other_cpu(td->td_priority, cpu); @@ -1348,18 +1332,10 @@ sched_add(struct thread *td, int flags) } if (!forwarded) { - if ((flags & SRQ_YIELDING) == 0 && maybe_preempt(td)) - return; - else + if (!maybe_preempt(td)) maybe_resched(td); } } - - if ((td->td_flags & TDF_NOLOAD) == 0) - sched_load_add(); - runq_add(ts->ts_runq, td, flags); - if (cpu != NOCPU) - runq_length[cpu]++; } #else /* SMP */ { @@ -1393,23 +1369,11 @@ sched_add(struct thread *td, int flags) CTR2(KTR_RUNQ, "sched_add: adding td_sched:%p (td:%p) to runq", ts, td); ts->ts_runq = &runq; - /* - * If we are yielding (on the way out anyhow) or the thread - * being saved is US, then don't try be smart about preemption - * or kicking off another CPU as it won't help and may hinder. - * In the YIEDLING case, we are about to run whoever is being - * put in the queue anyhow, and in the OURSELF case, we are - * putting ourself on the run queue which also only happens - * when we are about to yield. - */ - if ((flags & SRQ_YIELDING) == 0) { - if (maybe_preempt(td)) - return; - } if ((td->td_flags & TDF_NOLOAD) == 0) sched_load_add(); runq_add(ts->ts_runq, td, flags); - maybe_resched(td); + if (!maybe_preempt(td)) + maybe_resched(td); } #endif /* SMP */ From owner-svn-src-all@freebsd.org Fri Dec 2 22:27:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF140C62AB9; Fri, 2 Dec 2016 22:27:55 +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 A9A771F74; Fri, 2 Dec 2016 22:27:55 +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 uB2MRscY052944; Fri, 2 Dec 2016 22:27:54 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2MRst5052943; Fri, 2 Dec 2016 22:27:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612022227.uB2MRst5052943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 2 Dec 2016 22:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309446 - in stable: 10/sys/kern 11/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 22:27:55 -0000 Author: jhb Date: Fri Dec 2 22:27:54 2016 New Revision: 309446 URL: https://svnweb.freebsd.org/changeset/base/309446 Log: MFC 308564: Don't place threads on the run queue after waking up other CPUs. The other CPU might resume and see a still-empty runq and go back to sleep before sched_add() adds the thread to the runq. This results in a lost wakeup and a potential hang if the system is otherwise completely idle. The race originated due to a micro-optimization (my fault) in 4BSD in that it avoided putting a thread on the run queue if the scheduler was going to preempt to the new thread. To avoid complexity while fixing this race, just drop this optimization. 4BSD now always sets the "owepreempt" flag when a preemption is warranted and defers the actual preemption to the thread_unlock of the caller the same as ULE. Modified: stable/10/sys/kern/sched_4bsd.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/kern/sched_4bsd.c Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/kern/sched_4bsd.c ============================================================================== --- stable/10/sys/kern/sched_4bsd.c Fri Dec 2 22:25:11 2016 (r309445) +++ stable/10/sys/kern/sched_4bsd.c Fri Dec 2 22:27:54 2016 (r309446) @@ -304,9 +304,8 @@ maybe_resched(struct thread *td) /* * This function is called when a thread is about to be put on run queue * because it has been made runnable or its priority has been adjusted. It - * determines if the new thread should be immediately preempted to. If so, - * it switches to it and eventually returns true. If not, it returns false - * so that the caller may place the thread on an appropriate run queue. + * determines if the new thread should preempt the current thread. If so, + * it sets td_owepreempt to request a preemption. */ int maybe_preempt(struct thread *td) @@ -352,29 +351,8 @@ maybe_preempt(struct thread *td) return (0); #endif - if (ctd->td_critnest > 1) { - CTR1(KTR_PROC, "maybe_preempt: in critical section %d", - ctd->td_critnest); - ctd->td_owepreempt = 1; - return (0); - } - /* - * Thread is runnable but not yet put on system run queue. - */ - MPASS(ctd->td_lock == td->td_lock); - MPASS(TD_ON_RUNQ(td)); - TD_SET_RUNNING(td); - CTR3(KTR_PROC, "preempting to thread %p (pid %d, %s)\n", td, - td->td_proc->p_pid, td->td_name); - mi_switch(SW_INVOL | SW_PREEMPT | SWT_PREEMPT, td); - /* - * td's lock pointer may have changed. We have to return with it - * locked. - */ - spinlock_enter(); - thread_unlock(ctd); - thread_lock(td); - spinlock_exit(); + CTR0(KTR_PROC, "maybe_preempt: scheduling preemption"); + ctd->td_owepreempt = 1; return (1); #else return (0); @@ -1326,6 +1304,12 @@ sched_add(struct thread *td, int flags) ts->ts_runq = &runq; } + if ((td->td_flags & TDF_NOLOAD) == 0) + sched_load_add(); + runq_add(ts->ts_runq, td, flags); + if (cpu != NOCPU) + runq_length[cpu]++; + cpuid = PCPU_GET(cpuid); if (single_cpu && cpu != cpuid) { kick_other_cpu(td->td_priority, cpu); @@ -1342,18 +1326,10 @@ sched_add(struct thread *td, int flags) } if (!forwarded) { - if ((flags & SRQ_YIELDING) == 0 && maybe_preempt(td)) - return; - else + if (!maybe_preempt(td)) maybe_resched(td); } } - - if ((td->td_flags & TDF_NOLOAD) == 0) - sched_load_add(); - runq_add(ts->ts_runq, td, flags); - if (cpu != NOCPU) - runq_length[cpu]++; } #else /* SMP */ { @@ -1387,23 +1363,11 @@ sched_add(struct thread *td, int flags) CTR2(KTR_RUNQ, "sched_add: adding td_sched:%p (td:%p) to runq", ts, td); ts->ts_runq = &runq; - /* - * If we are yielding (on the way out anyhow) or the thread - * being saved is US, then don't try be smart about preemption - * or kicking off another CPU as it won't help and may hinder. - * In the YIEDLING case, we are about to run whoever is being - * put in the queue anyhow, and in the OURSELF case, we are - * putting ourself on the run queue which also only happens - * when we are about to yield. - */ - if ((flags & SRQ_YIELDING) == 0) { - if (maybe_preempt(td)) - return; - } if ((td->td_flags & TDF_NOLOAD) == 0) sched_load_add(); runq_add(ts->ts_runq, td, flags); - maybe_resched(td); + if (!maybe_preempt(td)) + maybe_resched(td); } #endif /* SMP */ From owner-svn-src-all@freebsd.org Fri Dec 2 22:53:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39391C6317F; Fri, 2 Dec 2016 22:53:36 +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 DB61F13AC; Fri, 2 Dec 2016 22:53:35 +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 uB2MrZkb065030; Fri, 2 Dec 2016 22:53:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2MrYX9065019; Fri, 2 Dec 2016 22:53:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612022253.uB2MrYX9065019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 2 Dec 2016 22:53:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309447 - in stable/10: share/man/man4 sys/arm/conf sys/conf sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/iw_cxgbe sys/modules/cxgbe sys/modules/cxgbe/if_cxgbev sys/modules/cxgbe/if... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 22:53:36 -0000 Author: jhb Date: Fri Dec 2 22:53:33 2016 New Revision: 309447 URL: https://svnweb.freebsd.org/changeset/base/309447 Log: MFC 303522,303647,303860,303880,304168-304170,304479,304482,304485,305548, 305549: Chelsio T4/T5 VF driver. 303522: Various fixes to the t4/5nex character device. - Remove null open/close methods. - Don't set d_flags to 0 explicitly. - Remove t5_cdevsw as the .d_name member isn't really used and doesn't warrant a separate cdevsw just for the name. - Use ENOTTY as the error value for an unknown ioctl request. - Use make_dev_s() to close race with setting si_drv1. 303647: Store the offset of the KDOORBELL and GTS registers in the softc. VF devices use a different register layout than PF devices. Storing the offset in a value in the softc allows code to be shared between the PF and VF drivers. 303860: Reserve an adapter flag IS_VF to mark VF devices vs PF devices. 303880: Track the base absolute ID of ingress and egress queues. Use this to map an absolute queue ID to a logical queue ID in interrupt handlers. For the regular cxgbe/cxl drivers this should be a no-op as the base absolute ID should be zero. VF devices have a non-zero base absolute ID and require this change. While here, export the absolute ID of egress queues via a sysctl. 304168: Make SGE parameter handling more VF-friendly. Add fields to hold the SGE control register and free list buffer sizes to the sge_params structure. Populate these new fields in t4_init_sge_params() for PF devices and change t4_read_chip_settings() to pull these values out of the params structure instead of reading registers directly. This will permit t4_read_chip_settings() to be reused for VF devices which cannot read SGE registers directly. While here, move the call to t4_init_sge_params() to get_params__post_init(). The VF driver will populate the SGE parameters structure via a different method before calling t4_read_chip_settings(). 304169: Update mailbox writes to work with VF devices. - Use alternate register locations for the data and control registers for VFs. - Do a dummy read to force the writes to the mailbox data registers to post before the write to the control register on VFs. - Do not check the PCI-e firmware register for errors on VFs. 304170: Add support for register dumps on VF devices. - Add handling of VF register sets to t4_get_regs_len() and t4_get_regs(). - While here, use t4_get_regs_len() in the ioctl handler for regdump instead of inlining it. 304479: Add structures for VF-specific adapter parameters. While here, mark which parameters are PF-specific and which are VF-specific. 304482: Adjust t4_port_init() to work with VF devices. Specifically, the FW_PORT_CMD may or may not work for a VF (the PF driver can choose whether or not to permit access to this command), so don't attempt to fetch port information on a VF if permission is denied by the PF. 304485: Reorder sysctls so that nodes shared with the VF driver are added first. This permits a single early return for VF devices in the routines that add sysctl nodes. 305548: Don't break out of the m_advance() loop if len drops to zero. If a packet contains the Ethernet header (14 bytes) in the first mbuf and the payload (IP + UDP + data) in the second mbuf, then the attempt to fetch the l3hdr will return a NULL pointer. The first loop iteration will drop len to zero and exit the loop without setting 'p'. However, the desired data is at the start of the second mbuf, so the correct behavior is to loop around and let the conditional set 'p' to m_data of the next mbuf (and leave offset as 0). 305549: Chelsio T4/T5 VF driver. The cxgbev/cxlv driver supports Virtual Function devices for Chelsio T4 and T4 adapters. The VF devices share most of their code with the existing PF4 driver (cxgbe/cxl) and as such the VF device driver currently depends on the PF4 driver. Similar to the cxgbe/cxl drivers, the VF driver includes a t4vf/t5vf PCI device driver that attaches to the VF device. It then creates child cxgbev/cxlv devices representing ports assigned to the VF. By default, the PF driver assigns a single port to each VF. t4vf_hw.c contains VF-specific routines from the shared code used to fetch VF-specific parameters from the firmware. t4_vf.c contains the VF-specific PCI device driver and includes its own attach routine. VF devices are required to use a different firmware request when transmitting packets (which in turn requires a different CPL message to encapsulate messages). This alternate firmware request does not permit chaining multiple packets in a single message, so each packet results in a firmware request. In addition, the different CPL message requires more detailed information when enabling hardware checksums, so parse_pkt() on VF devices must examine L2 and L3 headers for all packets (not just TSO packets) for VF devices. Finally, L2 checksums on non-UDP/non-TCP packets do not work reliably (the firmware trashes the IPv4 fragment field), so IPv4 checksums for such packets are calculated in software. Most of the other changes in the non-VF-specific code are to expose various variables and functions private to the PF driver so that they can be used by the VF driver. Note that a limited subset of cxgbetool functions are supported on VF devices including register dumps, scheduler classes, and clearing of statistics. In addition, TOE is not supported on VF devices, only for the PF interfaces. Sponsored by: Chelsio Communications Added: stable/10/share/man/man4/cxgbev.4 - copied unchanged from r305549, head/share/man/man4/cxgbev.4 stable/10/sys/dev/cxgbe/common/t4vf_hw.c - copied unchanged from r305549, head/sys/dev/cxgbe/common/t4vf_hw.c stable/10/sys/dev/cxgbe/if_cxlv.c - copied unchanged from r305549, head/sys/dev/cxgbe/if_cxlv.c stable/10/sys/dev/cxgbe/t4_vf.c - copied, changed from r305549, head/sys/dev/cxgbe/t4_vf.c stable/10/sys/modules/cxgbe/if_cxgbev/ - copied from r305549, head/sys/modules/cxgbe/if_cxgbev/ stable/10/sys/modules/cxgbe/if_cxlv/ - copied from r305549, head/sys/modules/cxgbe/if_cxlv/ Modified: stable/10/share/man/man4/Makefile stable/10/share/man/man4/cxgbe.4 stable/10/sys/arm/conf/NOTES stable/10/sys/conf/NOTES stable/10/sys/conf/files stable/10/sys/dev/cxgbe/adapter.h stable/10/sys/dev/cxgbe/common/common.h stable/10/sys/dev/cxgbe/common/t4_hw.c stable/10/sys/dev/cxgbe/iw_cxgbe/cq.c stable/10/sys/dev/cxgbe/iw_cxgbe/qp.c stable/10/sys/dev/cxgbe/t4_main.c stable/10/sys/dev/cxgbe/t4_netmap.c stable/10/sys/dev/cxgbe/t4_sge.c stable/10/sys/modules/cxgbe/Makefile stable/10/sys/modules/cxgbe/if_cxgbev/Makefile stable/10/sys/powerpc/conf/NOTES Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Fri Dec 2 22:27:54 2016 (r309446) +++ stable/10/share/man/man4/Makefile Fri Dec 2 22:53:33 2016 (r309447) @@ -107,6 +107,7 @@ MAN= aac.4 \ cue.4 \ cxgb.4 \ cxgbe.4 \ + cxgbev.4 \ cy.4 \ da.4 \ dc.4 \ @@ -585,6 +586,9 @@ MLINKS+=cxgb.4 if_cxgb.4 MLINKS+=cxgbe.4 if_cxgbe.4 \ cxgbe.4 cxl.4 \ cxgbe.4 if_cxl.4 +MLINKS+=cxgbev.4 if_cxgbev.4 \ + cxgbev.4 cxlv.4 \ + cxgbev.4 if_cxlv.4 MLINKS+=dc.4 if_dc.4 MLINKS+=de.4 if_de.4 MLINKS+=disc.4 if_disc.4 Modified: stable/10/share/man/man4/cxgbe.4 ============================================================================== --- stable/10/share/man/man4/cxgbe.4 Fri Dec 2 22:27:54 2016 (r309446) +++ stable/10/share/man/man4/cxgbe.4 Fri Dec 2 22:53:33 2016 (r309447) @@ -78,8 +78,7 @@ For more information on configuring this .Sh HARDWARE The .Nm -driver supports 40Gb, 10Gb and 1Gb Ethernet adapters based on the T5 ASIC -(ports will be named cxl): +driver supports 40Gb, 10Gb and 1Gb Ethernet adapters based on the T5 ASIC: .Pp .Bl -bullet -compact .It @@ -319,6 +318,7 @@ email all the specific information relat .Xr altq 4 , .Xr arp 4 , .Xr cxgb 4 , +.Xr cxgbev 4 , .Xr netintro 4 , .Xr ng_ether 4 , .Xr ifconfig 8 Copied: stable/10/share/man/man4/cxgbev.4 (from r305549, head/share/man/man4/cxgbev.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/cxgbev.4 Fri Dec 2 22:53:33 2016 (r309447, copy of r305549, head/share/man/man4/cxgbev.4) @@ -0,0 +1,290 @@ +.\" Copyright (c) 2011-2016, Chelsio Inc +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions are met: +.\" +.\" 1. Redistributions of source code must retain the above copyright notice, +.\" this list of conditions and the following disclaimer. +.\" +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" 3. Neither the name of the Chelsio Inc nor the names of its +.\" contributors may be used to endorse or promote products derived from +.\" this software without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +.\" POSSIBILITY OF SUCH DAMAGE. +.\" +.\" * Other names and brands may be claimed as the property of others. +.\" +.\" $FreeBSD$ +.\" +.Dd August 22, 2016 +.Dt CXGBEV 4 +.Os +.Sh NAME +.Nm cxgbev +.Nd "Chelsio T4 and T5 based 40Gb, 10Gb, and 1Gb Ethernet VF driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device cxgbe" +.Cd "device cxgbev" +.Ed +.Pp +To load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_cxgbev_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for Virtual Functions on PCI Express Ethernet adapters +based on the Chelsio Terminator 4 and Terminator 5 ASICs (T4 and T5). +The driver supports Jumbo Frames, Transmit/Receive checksum offload, +TCP segmentation offload (TSO), Large Receive Offload (LRO), VLAN +tag insertion/extraction, VLAN checksum offload, VLAN TSO, and +Receive Side Steering (RSS). +For further hardware information and questions related to hardware +requirements, see +.Pa http://www.chelsio.com/ . +.Pp +Note that ports of T5 VFs are named cxlv and attach to a t5vf parent device +(in contrast to ports named cxgbev that attach to a t4vf parent for a T4 VF). +Loader tunables with the hw.cxgbe prefix apply to both T4 and T5 VFs. +The Physical Function driver for T4 and T5 adapters shares these tunables. +The sysctl MIBs are at dev.t5vf and dev.cxlv for T5 cards and at dev.t4vf and +dev.cxgbev for T4 cards. +.Pp +For more information on configuring this device, see +.Xr ifconfig 8 . +.Sh HARDWARE +The +.Nm +driver supports Virtual Functions on 40Gb, 10Gb and 1Gb Ethernet adapters +based on the T5 ASIC: +.Pp +.Bl -bullet -compact +.It +Chelsio T580-CR +.It +Chelsio T580-LP-CR +.It +Chelsio T580-LP-SO-CR +.It +Chelsio T560-CR +.It +Chelsio T540-CR +.It +Chelsio T540-LP-CR +.It +Chelsio T522-CR +.It +Chelsio T520-LL-CR +.It +Chelsio T520-CR +.It +Chelsio T520-SO +.It +Chelsio T520-BT +.It +Chelsio T504-BT +.El +.Pp +The +.Nm +driver supports Virtual Functions on 10Gb and 1Gb Ethernet adapters based +on the T4 ASIC: +.Pp +.Bl -bullet -compact +.It +Chelsio T420-CR +.It +Chelsio T422-CR +.It +Chelsio T440-CR +.It +Chelsio T420-BCH +.It +Chelsio T440-BCH +.It +Chelsio T440-CH +.It +Chelsio T420-SO +.It +Chelsio T420-CX +.It +Chelsio T420-BT +.It +Chelsio T404-BT +.El +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +.Bl -tag -width indent +.It Va hw.cxgbe.ntxq10g +The number of tx queues to use for a 10Gb or 40Gb port. +The default is 16 or the number +of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.nrxq10g +The number of rx queues to use for a 10Gb or 40Gb port. +The default is 8 or the number +of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.ntxq1g +The number of tx queues to use for a 1Gb port. +The default is 4 or the number +of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.nrxq1g +The number of rx queues to use for a 1Gb port. +The default is 2 or the number +of CPU cores in the system, whichever is less. +.It Va hw.cxgbe.holdoff_timer_idx_10G +.It Va hw.cxgbe.holdoff_timer_idx_1G +The timer index value to use to delay interrupts. +The holdoff timer list has the values 1, 5, 10, 50, 100, and 200 +by default (all values are in microseconds) and the index selects a +value from this list. +The default value is 1 which means the timer value is 5us. +Different interfaces can be assigned different values at any time via the +dev.cxgbev.X.holdoff_tmr_idx or dev.cxlv.X.holdoff_tmr_idx sysctl. +.It Va hw.cxgbe.holdoff_pktc_idx_10G +.It Va hw.cxgbe.holdoff_pktc_idx_1G +The packet-count index value to use to delay interrupts. +The packet-count list has the values 1, 8, 16, and 32 by default +and the index selects a value from this list. +The default value is -1 which means packet counting is disabled and interrupts +are generated based solely on the holdoff timer value. +Different interfaces can be assigned different values via the +dev.cxgbev.X.holdoff_pktc_idx or dev.cxlv.X.holdoff_pktc_idx sysctl. +This sysctl works only when the interface has never been marked up (as done by +ifconfig up). +.It Va hw.cxgbe.qsize_txq +The size, in number of entries, of the descriptor ring used for a tx +queue. +A buf_ring of the same size is also allocated for additional +software queuing. +See +.Xr ifnet 9 . +The default value is 1024. +Different interfaces can be assigned different values via the +dev.cxgbev.X.qsize_txq sysctl or dev.cxlv.X.qsize_txq sysctl. +This sysctl works only when the interface has never been marked up (as done by +ifconfig up). +.It Va hw.cxgbe.qsize_rxq +The size, in number of entries, of the descriptor ring used for an +rx queue. +The default value is 1024. +Different interfaces can be assigned different values via the +dev.cxgbev.X.qsize_rxq or dev.cxlv.X.qsize_rxq sysctl. +This sysctl works only when the interface has never been marked up (as done by +ifconfig up). +.It Va hw.cxgbe.interrupt_types +The interrupt types that the driver is allowed to use. +Bit 0 represents INTx (line interrupts), bit 1 MSI, bit 2 MSI-X. +The default is 7 (all allowed). +The driver will select the best possible type out of the allowed types by +itself. +.It Va hw.cxgbe.fl_pktshift +The number of bytes of padding inserted before the beginning of an Ethernet +frame in the receive buffer. +The default value of 2 ensures that the Ethernet payload (usually the IP header) +is at a 4 byte aligned address. +0-7 are all valid values. +.It Va hw.cxgbe.fl_pad +A non-zero value ensures that writes from the hardware to a receive buffer are +padded up to the specified boundary. +The default is -1 which lets the driver pick a pad boundary. +0 disables trailer padding completely. +.It Va hw.cxgbe.buffer_packing +Allow the hardware to deliver multiple frames in the same receive buffer +opportunistically. +The default is -1 which lets the driver decide. +0 or 1 explicitly disable or enable this feature. +.It Va hw.cxgbe.allow_mbufs_in_cluster +1 allows the driver to lay down one or more mbufs within the receive buffer +opportunistically. +This is the default. +0 prohibits the driver from doing so. +.It Va hw.cxgbe.largest_rx_cluster +.It Va hw.cxgbe.safest_rx_cluster +Sizes of rx clusters. +Each of these must be set to one of the sizes available +(usually 2048, 4096, 9216, and 16384) and largest_rx_cluster must be greater +than or equal to safest_rx_cluster. +The defaults are 16384 and 4096 respectively. +The driver will never attempt to allocate a receive buffer larger than +largest_rx_cluster and will fall back to allocating buffers of +safest_rx_cluster size if an allocation larger than safest_rx_cluster fails. +Note that largest_rx_cluster merely establishes a ceiling -- the driver is +allowed to allocate buffers of smaller sizes. +.El +.Pp +Certain settings and resources for Virtual Functions are dictated +by the parent Physical Function driver. +For example, the Physical Function driver limits the number of queues a +Virtual Function is permitted to use. +Some of these limits can be adjusted in the firmware configuration file +used with the Physical Function driver. +.Pp +The PAUSE settings on the port of a Virtual Function are inherited from +the settings of the same port on the Physical Function. +Virtual Functions cannot modify the setting and track changes made to +the associated port's setting by the Physical Function driver. +.Pp +Receive queues on a Virtual Function always drop packets in response to +congestion +.Po +equivalent to setting +.Va hw.cxgbe.cong_drop +to 1 +.Pc . +.Pp +The VF driver currently depends on the PF driver. +As a result, loading the VF driver will also load the PF driver as a +dependency. +.Sh SUPPORT +For general information and support, +go to the Chelsio support website at: +.Pa http://www.chelsio.com/ . +.Pp +If an issue is identified with this driver with a supported adapter, +email all the specific information related to the issue to +.Aq Mt support@chelsio.com . +.Sh SEE ALSO +.Xr altq 4 , +.Xr arp 4 , +.Xr cxgbe 4 , +.Xr netintro 4 , +.Xr ng_ether 4 , +.Xr ifconfig 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 12.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was written by +.An Navdeep Parhar Aq Mt np@FreeBSD.org +and +.An John Baldwin Aq Mt jhb@FreeBSD.org . Modified: stable/10/sys/arm/conf/NOTES ============================================================================== --- stable/10/sys/arm/conf/NOTES Fri Dec 2 22:27:54 2016 (r309446) +++ stable/10/sys/arm/conf/NOTES Fri Dec 2 22:53:33 2016 (r309447) @@ -83,6 +83,6 @@ nodevice star_saver nodevice warp_saver nodevice cxgbe -nodevice pcii +nodevice cxgbev nodevice snd_cmi nodevice tnt4882 Modified: stable/10/sys/conf/NOTES ============================================================================== --- stable/10/sys/conf/NOTES Fri Dec 2 22:27:54 2016 (r309446) +++ stable/10/sys/conf/NOTES Fri Dec 2 22:53:33 2016 (r309447) @@ -1923,6 +1923,7 @@ device xmphy # XaQti XMAC II # (and SMC COM90c66 in '56 compatibility mode) adapters. # cxgb: Chelsio T3 based 1GbE/10GbE PCIe Ethernet adapters. # cxgbe:Chelsio T4 and T5 based 1GbE/10GbE/40GbE PCIe Ethernet adapters. +# cxgbev: Chelsio T4 and T5 based PCIe Virtual Functions. # dc: Support for PCI fast ethernet adapters based on the DEC/Intel 21143 # and various workalikes including: # the ADMtek AL981 Comet and AN985 Centaur, the ASIX Electronics @@ -2104,6 +2105,7 @@ device wb # Winbond W89C840F device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # PCI Ethernet NICs. +device cxgbev # Chelsio T4 and T5 1GbE/10GbE/40GbE VF device de # DEC/Intel DC21x4x (``Tulip'') device em # Intel Pro/1000 Gigabit Ethernet device igb # Intel Pro/1000 PCIE Gigabit Ethernet Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Fri Dec 2 22:27:54 2016 (r309446) +++ stable/10/sys/conf/files Fri Dec 2 22:53:33 2016 (r309447) @@ -1156,8 +1156,12 @@ dev/cxgbe/t4_l2t.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/t4_tracer.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/t4_vf.c optional cxgbev pci \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/common/t4_hw.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/common/t4vf_hw.c optional cxgbev pci \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" t4fw_cfg.c optional cxgbe \ compile-with "${AWK} -f $S/tools/fw_stub.awk t4fw_cfg.fw:t4fw_cfg t4fw_cfg_uwire.fw:t4fw_cfg_uwire t4fw.fw:t4fw -mt4fw_cfg -c${.TARGET}" \ no-implicit-rule before-depend local \ Modified: stable/10/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/10/sys/dev/cxgbe/adapter.h Fri Dec 2 22:27:54 2016 (r309446) +++ stable/10/sys/dev/cxgbe/adapter.h Fri Dec 2 22:53:33 2016 (r309447) @@ -189,6 +189,7 @@ enum { ADAP_SYSCTL_CTX = (1 << 4), /* TOM_INIT_DONE= (1 << 5), No longer used */ BUF_PACKING_OK = (1 << 6), + IS_VF = (1 << 7), CXGBE_BUSY = (1 << 9), @@ -422,6 +423,7 @@ enum {DOORBELL_UDB, DOORBELL_WCWR, DOORB struct sge_eq { unsigned int flags; /* MUST be first */ unsigned int cntxt_id; /* SGE context id for the eq */ + unsigned int abs_id; /* absolute SGE id for the eq */ struct mtx eq_lock; struct tx_desc *desc; /* KVA of descriptor ring */ @@ -730,8 +732,10 @@ struct sge { struct sge_nm_txq *nm_txq; /* netmap tx queues */ struct sge_nm_rxq *nm_rxq; /* netmap rx queues */ - uint16_t iq_start; - int eq_start; + uint16_t iq_start; /* first cntxt_id */ + uint16_t iq_base; /* first abs_id */ + int eq_start; /* first cntxt_id */ + int eq_base; /* first abs_id */ struct sge_iq **iqmap; /* iq->cntxt_id to iq mapping */ struct sge_eq **eqmap; /* eq->cntxt_id to eq mapping */ @@ -774,6 +778,8 @@ struct adapter { struct sge_rxq *rxq; struct sge_nm_rxq *nm_rxq; } __aligned(CACHE_LINE_SIZE) *irq; + int sge_gts_reg; + int sge_kdoorbell_reg; bus_dma_tag_t dmat; /* Parent DMA tag */ @@ -931,6 +937,9 @@ struct adapter { /* One for errors, one for firmware events */ #define T4_EXTRA_INTR 2 +/* One for firmware events */ +#define T4VF_EXTRA_INTR 1 + static inline uint32_t t4_read_reg(struct adapter *sc, uint32_t reg) { @@ -1065,13 +1074,34 @@ t4_use_ldst(struct adapter *sc) } /* t4_main.c */ +extern int t4_ntxq10g; +extern int t4_nrxq10g; +extern int t4_ntxq1g; +extern int t4_nrxq1g; +extern int t4_intr_types; +extern int t4_tmr_idx_10g; +extern int t4_pktc_idx_10g; +extern int t4_tmr_idx_1g; +extern int t4_pktc_idx_1g; +extern unsigned int t4_qsize_rxq; +extern unsigned int t4_qsize_txq; +extern device_method_t cxgbe_methods[]; + int t4_os_find_pci_capability(struct adapter *, int); int t4_os_pci_save_state(struct adapter *); int t4_os_pci_restore_state(struct adapter *); void t4_os_portmod_changed(const struct adapter *, int); void t4_os_link_changed(struct adapter *, int, int, int); void t4_iterate(void (*)(struct adapter *, void *), void *); +void t4_add_adapter(struct adapter *); +int t4_detach_common(device_t); int t4_filter_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *); +int t4_map_bars_0_and_4(struct adapter *); +int t4_map_bar_2(struct adapter *); +int t4_set_sched_class(struct adapter *, struct t4_sched_params *); +int t4_set_sched_queue(struct adapter *, struct t4_sched_queue *); +int t4_setup_intr_handlers(struct adapter *); +void t4_sysctls(struct adapter *); int begin_synchronized_op(struct adapter *, struct vi_info *, int, char *); void doom_vi(struct adapter *, struct vi_info *); void end_synchronized_op(struct adapter *, int); @@ -1112,7 +1142,7 @@ void t4_intr_err(void *); void t4_intr_evt(void *); void t4_wrq_tx_locked(struct adapter *, struct sge_wrq *, struct wrqe *); void t4_update_fl_bufsize(struct ifnet *); -int parse_pkt(struct mbuf **); +int parse_pkt(struct adapter *, struct mbuf **); void *start_wrq_wr(struct sge_wrq *, int, struct wrq_cookie *); void commit_wrq_wr(struct sge_wrq *, void *, struct wrq_cookie *); int tnl_cong(struct port_info *, int); Modified: stable/10/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/10/sys/dev/cxgbe/common/common.h Fri Dec 2 22:27:54 2016 (r309446) +++ stable/10/sys/dev/cxgbe/common/common.h Fri Dec 2 22:53:33 2016 (r309447) @@ -215,6 +215,8 @@ struct sge_params { int pad_boundary; int pack_boundary; int fl_pktshift; + u32 sge_control; + u32 sge_fl_buffer_size[SGE_FLBUF_SIZES]; }; struct tp_params { @@ -278,12 +280,52 @@ struct chip_params { u16 mps_tcam_size; }; +/* VF-only parameters. */ + +/* + * Global Receive Side Scaling (RSS) parameters in host-native format. + */ +struct rss_params { + unsigned int mode; /* RSS mode */ + union { + struct { + u_int synmapen:1; /* SYN Map Enable */ + u_int syn4tupenipv6:1; /* enable hashing 4-tuple IPv6 SYNs */ + u_int syn2tupenipv6:1; /* enable hashing 2-tuple IPv6 SYNs */ + u_int syn4tupenipv4:1; /* enable hashing 4-tuple IPv4 SYNs */ + u_int syn2tupenipv4:1; /* enable hashing 2-tuple IPv4 SYNs */ + u_int ofdmapen:1; /* Offload Map Enable */ + u_int tnlmapen:1; /* Tunnel Map Enable */ + u_int tnlalllookup:1; /* Tunnel All Lookup */ + u_int hashtoeplitz:1; /* use Toeplitz hash */ + } basicvirtual; + } u; +}; + +/* + * Maximum resources provisioned for a PCI VF. + */ +struct vf_resources { + unsigned int nvi; /* N virtual interfaces */ + unsigned int neq; /* N egress Qs */ + unsigned int nethctrl; /* N egress ETH or CTRL Qs */ + unsigned int niqflint; /* N ingress Qs/w free list(s) & intr */ + unsigned int niq; /* N ingress Qs */ + unsigned int tc; /* PCI-E traffic class */ + unsigned int pmask; /* port access rights mask */ + unsigned int nexactf; /* N exact MPS filters */ + unsigned int r_caps; /* read capabilities */ + unsigned int wx_caps; /* write/execute capabilities */ +}; + struct adapter_params { struct sge_params sge; - struct tp_params tp; + struct tp_params tp; /* PF-only */ struct vpd_params vpd; struct pci_params pci; - struct devlog_params devlog; + struct devlog_params devlog; /* PF-only */ + struct rss_params rss; /* VF-only */ + struct vf_resources vfres; /* VF-only */ unsigned int sf_size; /* serial flash size in bytes */ unsigned int sf_nsec; /* # of flash sectors */ @@ -509,6 +551,7 @@ int t4_get_fw_version(struct adapter *ad int t4_get_tp_version(struct adapter *adapter, u32 *vers); int t4_get_exprom_version(struct adapter *adapter, u32 *vers); int t4_init_hw(struct adapter *adapter, u32 fw_params); +const struct chip_params *t4_get_chip_params(int chipid); int t4_prep_adapter(struct adapter *adapter, u8 *buf); int t4_shutdown_adapter(struct adapter *adapter); int t4_init_devlog_params(struct adapter *adapter, int fw_attach); @@ -716,4 +759,32 @@ int t4_config_watchdog(struct adapter *a int t4_get_devlog_level(struct adapter *adapter, unsigned int *level); int t4_set_devlog_level(struct adapter *adapter, unsigned int level); void t4_sge_decode_idma_state(struct adapter *adapter, int state); + +static inline int t4vf_query_params(struct adapter *adapter, + unsigned int nparams, const u32 *params, + u32 *vals) +{ + return t4_query_params(adapter, 0, 0, 0, nparams, params, vals); +} + +static inline int t4vf_set_params(struct adapter *adapter, + unsigned int nparams, const u32 *params, + const u32 *vals) +{ + return t4_set_params(adapter, 0, 0, 0, nparams, params, vals); +} + +static inline int t4vf_wr_mbox(struct adapter *adap, const void *cmd, + int size, void *rpl) +{ + return t4_wr_mbox(adap, adap->mbox, cmd, size, rpl); +} + +int t4vf_wait_dev_ready(struct adapter *adapter); +int t4vf_fw_reset(struct adapter *adapter); +int t4vf_get_sge_params(struct adapter *adapter); +int t4vf_get_rss_glb_config(struct adapter *adapter); +int t4vf_get_vfres(struct adapter *adapter); +int t4vf_prep_adapter(struct adapter *adapter); + #endif /* __CHELSIO_COMMON_H */ Modified: stable/10/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/10/sys/dev/cxgbe/common/t4_hw.c Fri Dec 2 22:27:54 2016 (r309446) +++ stable/10/sys/dev/cxgbe/common/t4_hw.c Fri Dec 2 22:53:33 2016 (r309447) @@ -286,6 +286,14 @@ int t4_wr_mbox_meat_timeout(struct adapt if ((size & 15) || size > MBOX_LEN) return -EINVAL; + if (adap->flags & IS_VF) { + if (is_t6(adap)) + data_reg = FW_T6VF_MBDATA_BASE_ADDR; + else + data_reg = FW_T4VF_MBDATA_BASE_ADDR; + ctl_reg = VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_CTRL); + } + /* * If we have a negative timeout, that implies that we can't sleep. */ @@ -340,6 +348,22 @@ int t4_wr_mbox_meat_timeout(struct adapt for (i = 0; i < size; i += 8, p++) t4_write_reg64(adap, data_reg + i, be64_to_cpu(*p)); + if (adap->flags & IS_VF) { + /* + * For the VFs, the Mailbox Data "registers" are + * actually backed by T4's "MA" interface rather than + * PL Registers (as is the case for the PFs). Because + * these are in different coherency domains, the write + * to the VF's PL-register-backed Mailbox Control can + * race in front of the writes to the MA-backed VF + * Mailbox Data "registers". So we need to do a + * read-back on at least one byte of the VF Mailbox + * Data registers before doing the write to the VF + * Mailbox Control register. + */ + t4_read_reg(adap, data_reg); + } + CH_DUMP_MBOX(adap, mbox, data_reg); t4_write_reg(adap, ctl_reg, F_MBMSGVALID | V_MBOWNER(X_MBOWNER_FW)); @@ -352,10 +376,13 @@ int t4_wr_mbox_meat_timeout(struct adapt * Loop waiting for the reply; bail out if we time out or the firmware * reports an error. */ - for (i = 0; - !((pcie_fw = t4_read_reg(adap, A_PCIE_FW)) & F_PCIE_FW_ERR) && - i < timeout; - i += ms) { + pcie_fw = 0; + for (i = 0; i < timeout; i += ms) { + if (!(adap->flags & IS_VF)) { + pcie_fw = t4_read_reg(adap, A_PCIE_FW); + if (pcie_fw & F_PCIE_FW_ERR) + break; + } if (sleep_ok) { ms = delay[delay_idx]; /* last element may repeat */ if (delay_idx < ARRAY_SIZE(delay) - 1) @@ -695,10 +722,14 @@ unsigned int t4_get_regs_len(struct adap switch (chip_version) { case CHELSIO_T4: + if (adapter->flags & IS_VF) + return FW_T4VF_REGMAP_SIZE; return T4_REGMAP_SIZE; case CHELSIO_T5: case CHELSIO_T6: + if (adapter->flags & IS_VF) + return FW_T4VF_REGMAP_SIZE; return T5_REGMAP_SIZE; } @@ -1177,6 +1208,18 @@ void t4_get_regs(struct adapter *adap, u 0x27e00, 0x27e04, }; + static const unsigned int t4vf_reg_ranges[] = { + VF_SGE_REG(A_SGE_VF_KDOORBELL), VF_SGE_REG(A_SGE_VF_GTS), + VF_MPS_REG(A_MPS_VF_CTL), + VF_MPS_REG(A_MPS_VF_STAT_RX_VF_ERR_FRAMES_H), + VF_PL_REG(A_PL_VF_WHOAMI), VF_PL_REG(A_PL_VF_WHOAMI), + VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_CTRL), + VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_STATUS), + FW_T4VF_MBDATA_BASE_ADDR, + FW_T4VF_MBDATA_BASE_ADDR + + ((NUM_CIM_PF_MAILBOX_DATA_INSTANCES - 1) * 4), + }; + static const unsigned int t5_reg_ranges[] = { 0x1008, 0x10c0, 0x10cc, 0x10f8, @@ -1952,6 +1995,18 @@ void t4_get_regs(struct adapter *adap, u 0x51300, 0x51308, }; + static const unsigned int t5vf_reg_ranges[] = { + VF_SGE_REG(A_SGE_VF_KDOORBELL), VF_SGE_REG(A_SGE_VF_GTS), + VF_MPS_REG(A_MPS_VF_CTL), + VF_MPS_REG(A_MPS_VF_STAT_RX_VF_ERR_FRAMES_H), + VF_PL_REG(A_PL_VF_WHOAMI), VF_PL_REG(A_PL_VF_REVISION), + VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_CTRL), + VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_STATUS), + FW_T4VF_MBDATA_BASE_ADDR, + FW_T4VF_MBDATA_BASE_ADDR + + ((NUM_CIM_PF_MAILBOX_DATA_INSTANCES - 1) * 4), + }; + static const unsigned int t6_reg_ranges[] = { 0x1008, 0x101c, 0x1024, 0x10a8, @@ -2529,6 +2584,18 @@ void t4_get_regs(struct adapter *adap, u 0x51300, 0x51324, }; + static const unsigned int t6vf_reg_ranges[] = { + VF_SGE_REG(A_SGE_VF_KDOORBELL), VF_SGE_REG(A_SGE_VF_GTS), + VF_MPS_REG(A_MPS_VF_CTL), + VF_MPS_REG(A_MPS_VF_STAT_RX_VF_ERR_FRAMES_H), + VF_PL_REG(A_PL_VF_WHOAMI), VF_PL_REG(A_PL_VF_REVISION), + VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_CTRL), + VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_STATUS), + FW_T6VF_MBDATA_BASE_ADDR, + FW_T6VF_MBDATA_BASE_ADDR + + ((NUM_CIM_PF_MAILBOX_DATA_INSTANCES - 1) * 4), + }; + u32 *buf_end = (u32 *)(buf + buf_size); const unsigned int *reg_ranges; int reg_ranges_size, range; @@ -2540,18 +2607,33 @@ void t4_get_regs(struct adapter *adap, u */ switch (chip_version) { case CHELSIO_T4: - reg_ranges = t4_reg_ranges; - reg_ranges_size = ARRAY_SIZE(t4_reg_ranges); + if (adap->flags & IS_VF) { + reg_ranges = t4vf_reg_ranges; + reg_ranges_size = ARRAY_SIZE(t4vf_reg_ranges); + } else { + reg_ranges = t4_reg_ranges; + reg_ranges_size = ARRAY_SIZE(t4_reg_ranges); + } break; case CHELSIO_T5: - reg_ranges = t5_reg_ranges; - reg_ranges_size = ARRAY_SIZE(t5_reg_ranges); + if (adap->flags & IS_VF) { + reg_ranges = t5vf_reg_ranges; + reg_ranges_size = ARRAY_SIZE(t5vf_reg_ranges); + } else { + reg_ranges = t5_reg_ranges; + reg_ranges_size = ARRAY_SIZE(t5_reg_ranges); + } break; case CHELSIO_T6: - reg_ranges = t6_reg_ranges; - reg_ranges_size = ARRAY_SIZE(t6_reg_ranges); + if (adap->flags & IS_VF) { + reg_ranges = t6vf_reg_ranges; + reg_ranges_size = ARRAY_SIZE(t6vf_reg_ranges); + } else { + reg_ranges = t6_reg_ranges; + reg_ranges_size = ARRAY_SIZE(t6_reg_ranges); + } break; default: @@ -7413,7 +7495,7 @@ static void set_pcie_completion_timeout( } } -static const struct chip_params *get_chip_params(int chipid) +const struct chip_params *t4_get_chip_params(int chipid) { static const struct chip_params chip_params[] = { { @@ -7492,7 +7574,7 @@ int t4_prep_adapter(struct adapter *adap } } - adapter->chip_params = get_chip_params(chip_id(adapter)); + adapter->chip_params = t4_get_chip_params(chip_id(adapter)); if (adapter->chip_params == NULL) return -EINVAL; @@ -7641,6 +7723,7 @@ int t4_init_sge_params(struct adapter *a { u32 r; struct sge_params *sp = &adapter->params.sge; + unsigned i; r = t4_read_reg(adapter, A_SGE_INGRESS_RX_THRESHOLD); sp->counter_val[0] = G_THRESHOLD_0(r); @@ -7683,6 +7766,7 @@ int t4_init_sge_params(struct adapter *a sp->page_shift = (r & M_HOSTPAGESIZEPF0) + 10; r = t4_read_reg(adapter, A_SGE_CONTROL); + sp->sge_control = r; sp->spg_len = r & F_EGRSTATUSPAGESIZE ? 128 : 64; sp->fl_pktshift = G_PKTSHIFT(r); sp->pad_boundary = 1 << (G_INGPADBOUNDARY(r) + 5); @@ -7695,6 +7779,9 @@ int t4_init_sge_params(struct adapter *a else sp->pack_boundary = 1 << (G_INGPACKBOUNDARY(r) + 5); } + for (i = 0; i < SGE_FLBUF_SIZES; i++) + sp->sge_fl_buffer_size[i] = t4_read_reg(adapter, + A_SGE_FL_BUFFER_SIZE0 + (4 * i)); return 0; } @@ -7848,15 +7935,26 @@ int t4_port_init(struct adapter *adap, i } while ((adap->params.portvec & (1 << j)) == 0); } - c.op_to_portid = htonl(V_FW_CMD_OP(FW_PORT_CMD) | - F_FW_CMD_REQUEST | F_FW_CMD_READ | - V_FW_PORT_CMD_PORTID(j)); - c.action_to_len16 = htonl( - V_FW_PORT_CMD_ACTION(FW_PORT_ACTION_GET_PORT_INFO) | - FW_LEN16(c)); - ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); - if (ret) - return ret; + if (!(adap->flags & IS_VF) || + adap->params.vfres.r_caps & FW_CMD_CAP_PORT) { + c.op_to_portid = htonl(V_FW_CMD_OP(FW_PORT_CMD) | + F_FW_CMD_REQUEST | F_FW_CMD_READ | + V_FW_PORT_CMD_PORTID(j)); + c.action_to_len16 = htonl( + V_FW_PORT_CMD_ACTION(FW_PORT_ACTION_GET_PORT_INFO) | + FW_LEN16(c)); + ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); + if (ret) + return ret; + + ret = be32_to_cpu(c.u.info.lstatus_to_modtype); + p->mdio_addr = (ret & F_FW_PORT_CMD_MDIOCAP) ? + G_FW_PORT_CMD_MDIOADDR(ret) : -1; + p->port_type = G_FW_PORT_CMD_PTYPE(ret); + p->mod_type = G_FW_PORT_CMD_MODTYPE(ret); + + init_link_config(&p->link_cfg, be16_to_cpu(c.u.info.pcap)); + } ret = t4_alloc_vi(adap, mbox, j, pf, vf, 1, addr, &rss_size); if (ret < 0) @@ -7869,14 +7967,6 @@ int t4_port_init(struct adapter *adap, i p->vi[0].rss_size = rss_size; t4_os_set_hw_addr(adap, p->port_id, addr); - ret = be32_to_cpu(c.u.info.lstatus_to_modtype); - p->mdio_addr = (ret & F_FW_PORT_CMD_MDIOCAP) ? - G_FW_PORT_CMD_MDIOADDR(ret) : -1; - p->port_type = G_FW_PORT_CMD_PTYPE(ret); - p->mod_type = G_FW_PORT_CMD_MODTYPE(ret); - - init_link_config(&p->link_cfg, be16_to_cpu(c.u.info.pcap)); - param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_RSSINFO) | V_FW_PARAMS_PARAM_YZ(p->vi[0].viid); Copied: stable/10/sys/dev/cxgbe/common/t4vf_hw.c (from r305549, head/sys/dev/cxgbe/common/t4vf_hw.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/cxgbe/common/t4vf_hw.c Fri Dec 2 22:53:33 2016 (r309447, copy of r305549, head/sys/dev/cxgbe/common/t4vf_hw.c) @@ -0,0 +1,376 @@ +/*- + * Copyright (c) 2016 Chelsio Communications, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "common.h" +#include "t4_regs.h" + +#undef msleep +#define msleep(x) do { \ + if (cold) \ + DELAY((x) * 1000); \ + else \ + pause("t4hw", (x) * hz / 1000); \ +} while (0) + +/* + * Wait for the device to become ready (signified by our "who am I" register + * returning a value other than all 1's). Return an error if it doesn't + * become ready ... + */ +int t4vf_wait_dev_ready(struct adapter *adapter) +{ + const u32 whoami = VF_PL_REG(A_PL_VF_WHOAMI); + const u32 notready1 = 0xffffffff; + const u32 notready2 = 0xeeeeeeee; + u32 val; + + val = t4_read_reg(adapter, whoami); + if (val != notready1 && val != notready2) + return 0; + msleep(500); + val = t4_read_reg(adapter, whoami); + if (val != notready1 && val != notready2) + return 0; + else + return -EIO; +} + + +/** + * t4vf_fw_reset - issue a reset to FW + * @adapter: the adapter + * + * Issues a reset command to FW. For a Physical Function this would + * result in the Firmware reseting all of its state. For a Virtual + * Function this just resets the state associated with the VF. + */ +int t4vf_fw_reset(struct adapter *adapter) +{ + struct fw_reset_cmd cmd; + + memset(&cmd, 0, sizeof(cmd)); + cmd.op_to_write = cpu_to_be32(V_FW_CMD_OP(FW_RESET_CMD) | + F_FW_CMD_WRITE); + cmd.retval_len16 = cpu_to_be32(V_FW_CMD_LEN16(FW_LEN16(cmd))); + return t4vf_wr_mbox(adapter, &cmd, sizeof(cmd), NULL); +} + +/** + * t4vf_get_sge_params - retrieve adapter Scatter gather Engine parameters + * @adapter: the adapter + * + * Retrieves various core SGE parameters in the form of hardware SGE + * register values. The caller is responsible for decoding these as + * needed. The SGE parameters are stored in @adapter->params.sge. + */ +int t4vf_get_sge_params(struct adapter *adapter) +{ + struct sge_params *sp = &adapter->params.sge; + u32 params[7], vals[7]; + u32 whoami; + unsigned int pf, s_hps; + int i, v; + + params[0] = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) | + V_FW_PARAMS_PARAM_XYZ(A_SGE_CONTROL)); + params[1] = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) | + V_FW_PARAMS_PARAM_XYZ(A_SGE_HOST_PAGE_SIZE)); + params[2] = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) | + V_FW_PARAMS_PARAM_XYZ(A_SGE_TIMER_VALUE_0_AND_1)); + params[3] = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) | + V_FW_PARAMS_PARAM_XYZ(A_SGE_TIMER_VALUE_2_AND_3)); + params[4] = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) | + V_FW_PARAMS_PARAM_XYZ(A_SGE_TIMER_VALUE_4_AND_5)); + params[5] = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) | + V_FW_PARAMS_PARAM_XYZ(A_SGE_CONM_CTRL)); + params[6] = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) | + V_FW_PARAMS_PARAM_XYZ(A_SGE_INGRESS_RX_THRESHOLD)); + v = t4vf_query_params(adapter, 7, params, vals); + if (v != FW_SUCCESS) + return v; + + sp->sge_control = vals[0]; + sp->counter_val[0] = G_THRESHOLD_0(vals[6]); + sp->counter_val[1] = G_THRESHOLD_1(vals[6]); + sp->counter_val[2] = G_THRESHOLD_2(vals[6]); + sp->counter_val[3] = G_THRESHOLD_3(vals[6]); + sp->timer_val[0] = core_ticks_to_us(adapter, G_TIMERVALUE0(vals[2])); + sp->timer_val[1] = core_ticks_to_us(adapter, G_TIMERVALUE1(vals[2])); + sp->timer_val[2] = core_ticks_to_us(adapter, G_TIMERVALUE2(vals[3])); + sp->timer_val[3] = core_ticks_to_us(adapter, G_TIMERVALUE3(vals[3])); + sp->timer_val[4] = core_ticks_to_us(adapter, G_TIMERVALUE4(vals[4])); + sp->timer_val[5] = core_ticks_to_us(adapter, G_TIMERVALUE5(vals[4])); + + sp->fl_starve_threshold = G_EGRTHRESHOLD(vals[5]) * 2 + 1; + if (is_t4(adapter)) + sp->fl_starve_threshold2 = sp->fl_starve_threshold; + else + sp->fl_starve_threshold2 = G_EGRTHRESHOLDPACKING(vals[5]) * 2 + + 1; + + /* + * We need the Queues/Page and Host Page Size for our VF. + * This is based on the PF from which we're instantiated. + */ + whoami = t4_read_reg(adapter, VF_PL_REG(A_PL_VF_WHOAMI)); + pf = G_SOURCEPF(whoami); + + s_hps = (S_HOSTPAGESIZEPF0 + + (S_HOSTPAGESIZEPF1 - S_HOSTPAGESIZEPF0) * pf); + sp->page_shift = ((vals[1] >> s_hps) & M_HOSTPAGESIZEPF0) + 10; + + for (i = 0; i < SGE_FLBUF_SIZES; i++) { + params[0] = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_REG) | + V_FW_PARAMS_PARAM_XYZ(A_SGE_FL_BUFFER_SIZE0 + (4 * i))); + v = t4vf_query_params(adapter, 1, params, vals); + if (v != FW_SUCCESS) + return v; + + sp->sge_fl_buffer_size[i] = vals[0]; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Dec 2 23:01:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4813BC6336B; Fri, 2 Dec 2016 23:01:20 +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 17811167B; Fri, 2 Dec 2016 23:01:20 +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 uB2N1J8G067493; Fri, 2 Dec 2016 23:01:19 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2N1JpS067492; Fri, 2 Dec 2016 23:01:19 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612022301.uB2N1JpS067492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 2 Dec 2016 23:01:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309448 - stable/10/sys/dev/cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 23:01:20 -0000 Author: jhb Date: Fri Dec 2 23:01:19 2016 New Revision: 309448 URL: https://svnweb.freebsd.org/changeset/base/309448 Log: MFC 303454: Mark spg_len and fl_pktshift static. These variables are no longer exported to t4_netmap.c after r296478. Modified: stable/10/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_sge.c Fri Dec 2 22:53:33 2016 (r309447) +++ stable/10/sys/dev/cxgbe/t4_sge.c Fri Dec 2 23:01:19 2016 (r309448) @@ -81,7 +81,7 @@ __FBSDID("$FreeBSD$"); * Ethernet frames are DMA'd at this byte offset into the freelist buffer. * 0-7 are valid values. */ -int fl_pktshift = 2; +static int fl_pktshift = 2; TUNABLE_INT("hw.cxgbe.fl_pktshift", &fl_pktshift); /* @@ -98,7 +98,7 @@ TUNABLE_INT("hw.cxgbe.fl_pad", &fl_pad); * -1: driver should figure out a good value. * 64 or 128 are the only other valid values. */ -int spg_len = -1; +static int spg_len = -1; TUNABLE_INT("hw.cxgbe.spg_len", &spg_len); /* From owner-svn-src-all@freebsd.org Fri Dec 2 23:05:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24962C633E8; Fri, 2 Dec 2016 23:05:16 +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 E7B841A4C; Fri, 2 Dec 2016 23:05:15 +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 uB2N5FmG069081; Fri, 2 Dec 2016 23:05:15 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB2N5FQa069079; Fri, 2 Dec 2016 23:05:15 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612022305.uB2N5FQa069079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 2 Dec 2016 23:05:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309449 - stable/10/sys/dev/cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Dec 2016 23:05:16 -0000 Author: jhb Date: Fri Dec 2 23:05:14 2016 New Revision: 309449 URL: https://svnweb.freebsd.org/changeset/base/309449 Log: MFC 303859,305851: Fix a typo and some whitespace nits. Modified: stable/10/sys/dev/cxgbe/t4_sge.c stable/10/sys/dev/cxgbe/t4_vf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_sge.c Fri Dec 2 23:01:19 2016 (r309448) +++ stable/10/sys/dev/cxgbe/t4_sge.c Fri Dec 2 23:05:14 2016 (r309449) @@ -593,7 +593,7 @@ t4_tweak_chip_settings(struct adapter *s /* * SGE wants the buffer to be at least 64B and then a multiple of 16. If - * padding is is use the buffer's start and end need to be aligned to the pad + * padding is in use, the buffer's start and end need to be aligned to the pad * boundary as well. We'll just make sure that the size is a multiple of the * boundary here, it is up to the buffer allocation code to make sure the start * of the buffer is aligned as well. Modified: stable/10/sys/dev/cxgbe/t4_vf.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_vf.c Fri Dec 2 23:01:19 2016 (r309448) +++ stable/10/sys/dev/cxgbe/t4_vf.c Fri Dec 2 23:05:14 2016 (r309449) @@ -125,7 +125,7 @@ static struct cdevsw t4vf_cdevsw = { static int t4vf_probe(device_t dev) { - uint16_t d; + uint16_t d; size_t i; d = pci_get_device(dev); @@ -141,7 +141,7 @@ t4vf_probe(device_t dev) static int t5vf_probe(device_t dev) { - uint16_t d; + uint16_t d; size_t i; d = pci_get_device(dev); @@ -654,7 +654,7 @@ t4vf_attach(device_t dev) pi->vi[0].dev = pi->dev; device_set_softc(pi->dev, pi); } - + /* * Interrupt type, # of interrupts, # of rx/tx queues, etc. */ From owner-svn-src-all@freebsd.org Sat Dec 3 00:18:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C440C624B6; Sat, 3 Dec 2016 00:18:40 +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 24A1D19C7; Sat, 3 Dec 2016 00:18:40 +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 uB30IdrD098132; Sat, 3 Dec 2016 00:18:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB30IcM3098127; Sat, 3 Dec 2016 00:18:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612030018.uB30IcM3098127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 3 Dec 2016 00:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309450 - in stable: 10/contrib/ofed/libcxgb4/src 10/sys/dev/cxgbe/iw_cxgbe 11/contrib/ofed/libcxgb4/src 11/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 00:18:40 -0000 Author: jhb Date: Sat Dec 3 00:18:38 2016 New Revision: 309450 URL: https://svnweb.freebsd.org/changeset/base/309450 Log: MFC 304854: cxgbe/iw_cxgbe: Various fixes to the iWARP driver. - Return appropriate error code instead of ENOMEM when sosend() fails in send_mpa_req. - Fix for problematic race during destroy_qp. - Abortive close in the failure of send_mpa_reject() instead of normal close. - Remove the unnecessary doorbell flowcontrol logic. Sponsored by: Chelsio Communications Modified: stable/10/contrib/ofed/libcxgb4/src/qp.c stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c stable/10/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h stable/10/sys/dev/cxgbe/iw_cxgbe/qp.c stable/10/sys/dev/cxgbe/iw_cxgbe/t4.h Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/contrib/ofed/libcxgb4/src/qp.c stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h stable/11/sys/dev/cxgbe/iw_cxgbe/qp.c stable/11/sys/dev/cxgbe/iw_cxgbe/t4.h Directory Properties: stable/11/ (props changed) Modified: stable/10/contrib/ofed/libcxgb4/src/qp.c ============================================================================== --- stable/10/contrib/ofed/libcxgb4/src/qp.c Fri Dec 2 23:05:14 2016 (r309449) +++ stable/10/contrib/ofed/libcxgb4/src/qp.c Sat Dec 3 00:18:38 2016 (r309450) @@ -392,11 +392,9 @@ int c4iw_post_send(struct ibv_qp *ibqp, t4_sq_produce(&qhp->wq, len16); idx += DIV_ROUND_UP(len16*16, T4_EQ_ENTRY_SIZE); } - if (t4_wq_db_enabled(&qhp->wq)) { - t4_ring_sq_db(&qhp->wq, idx, dev_is_t5(qhp->rhp), - len16, wqe); - } else - ring_kernel_db(qhp, qhp->wq.sq.qid, idx); + + t4_ring_sq_db(&qhp->wq, idx, dev_is_t5(qhp->rhp), + len16, wqe); qhp->wq.sq.queue[qhp->wq.sq.size].status.host_wq_pidx = \ (qhp->wq.sq.wq_pidx); pthread_spin_unlock(&qhp->lock); @@ -458,11 +456,9 @@ int c4iw_post_receive(struct ibv_qp *ibq wr = wr->next; num_wrs--; } - if (t4_wq_db_enabled(&qhp->wq)) - t4_ring_rq_db(&qhp->wq, idx, dev_is_t5(qhp->rhp), - len16, wqe); - else - ring_kernel_db(qhp, qhp->wq.rq.qid, idx); + + t4_ring_rq_db(&qhp->wq, idx, dev_is_t5(qhp->rhp), + len16, wqe); qhp->wq.rq.queue[qhp->wq.rq.size].status.host_wq_pidx = \ (qhp->wq.rq.wq_pidx); pthread_spin_unlock(&qhp->lock); Modified: stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c Fri Dec 2 23:05:14 2016 (r309449) +++ stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c Sat Dec 3 00:18:38 2016 (r309450) @@ -81,6 +81,8 @@ static void process_req(struct work_stru static void start_ep_timer(struct c4iw_ep *ep); static int stop_ep_timer(struct c4iw_ep *ep); static int set_tcpinfo(struct c4iw_ep *ep); +static void process_timeout(struct c4iw_ep *ep); +static void process_timedout_eps(void); static enum c4iw_ep_state state_read(struct c4iw_ep_common *epc); static void __state_set(struct c4iw_ep_common *epc, enum c4iw_ep_state tostate); static void state_set(struct c4iw_ep_common *epc, enum c4iw_ep_state tostate); @@ -91,7 +93,7 @@ static struct rtentry * find_route(__be3 static int close_socket(struct c4iw_ep_common *epc, int close); static int shutdown_socket(struct c4iw_ep_common *epc); static void abort_socket(struct c4iw_ep *ep); -static void send_mpa_req(struct c4iw_ep *ep); +static int send_mpa_req(struct c4iw_ep *ep); static int send_mpa_reject(struct c4iw_ep *ep, const void *pdata, u8 plen); static int send_mpa_reply(struct c4iw_ep *ep, const void *pdata, u8 plen); static void close_complete_upcall(struct c4iw_ep *ep, int status); @@ -174,20 +176,91 @@ static void ref_qp(struct c4iw_ep *ep) c4iw_qp_add_ref(&ep->com.qp->ibqp); } +static void process_timeout(struct c4iw_ep *ep) +{ + struct c4iw_qp_attributes attrs; + int abort = 1; + + mutex_lock(&ep->com.mutex); + CTR4(KTR_IW_CXGBE, "%s ep :%p, tid:%u, state %d", __func__, + ep, ep->hwtid, ep->com.state); + set_bit(TIMEDOUT, &ep->com.history); + switch (ep->com.state) { + case MPA_REQ_SENT: + connect_reply_upcall(ep, -ETIMEDOUT); + break; + case MPA_REQ_WAIT: + case MPA_REQ_RCVD: + case MPA_REP_SENT: + case FPDU_MODE: + break; + case CLOSING: + case MORIBUND: + if (ep->com.cm_id && ep->com.qp) { + attrs.next_state = C4IW_QP_STATE_ERROR; + c4iw_modify_qp(ep->com.dev, ep->com.qp, + C4IW_QP_ATTR_NEXT_STATE, &attrs, 1); + } + close_complete_upcall(ep, -ETIMEDOUT); + break; + case ABORTING: + case DEAD: + /* + * These states are expected if the ep timed out at the same + * time as another thread was calling stop_ep_timer(). + * So we silently do nothing for these states. + */ + abort = 0; + break; + default: + CTR4(KTR_IW_CXGBE, "%s unexpected state ep %p tid %u state %u\n" + , __func__, ep, ep->hwtid, ep->com.state); + abort = 0; + } + mutex_unlock(&ep->com.mutex); + if (abort) + c4iw_ep_disconnect(ep, 1, GFP_KERNEL); + c4iw_put_ep(&ep->com); + return; +} + +static void process_timedout_eps(void) +{ + struct c4iw_ep *ep; + + spin_lock(&timeout_lock); + while (!list_empty(&timeout_list)) { + struct list_head *tmp; + tmp = timeout_list.next; + list_del(tmp); + tmp->next = tmp->prev = NULL; + spin_unlock(&timeout_lock); + ep = list_entry(tmp, struct c4iw_ep, entry); + process_timeout(ep); + spin_lock(&timeout_lock); + } + spin_unlock(&timeout_lock); + return; +} + static void process_req(struct work_struct *ctx) { struct c4iw_ep_common *epc; + process_timedout_eps(); spin_lock(&req_lock); while (!TAILQ_EMPTY(&req_list)) { epc = TAILQ_FIRST(&req_list); TAILQ_REMOVE(&req_list, epc, entry); epc->entry.tqe_prev = NULL; spin_unlock(&req_lock); + CTR3(KTR_IW_CXGBE, "%s so :%p, ep:%p", __func__, + epc->so, epc); if (epc->so) process_socket_event((struct c4iw_ep *)epc); c4iw_put_ep(epc); + process_timedout_eps(); spin_lock(&req_lock); } spin_unlock(&req_lock); @@ -252,8 +325,17 @@ close_socket(struct c4iw_ep_common *epc, struct socket *so = epc->so; int rc; - CTR4(KTR_IW_CXGBE, "%s: so %p, ep %p, state %s", __func__, epc, so, - states[epc->state]); + CTR5(KTR_IW_CXGBE, "%s:csoB so %p, ep %p, state %s, tid %d", __func__, + so, epc, states[epc->state], + ((struct c4iw_ep *)epc)->hwtid); + mutex_lock(&epc->so_mutex); + if ((so == NULL) || (so->so_count == 0)) { + mutex_unlock(&epc->so_mutex); + CTR5(KTR_IW_CXGBE, "%s:cso1 so %p, ep %p, state %s, tid %d", + __func__, so, epc, states[epc->state], + ((struct c4iw_ep *)epc)->hwtid); + return -EINVAL; + } SOCK_LOCK(so); soupcall_clear(so, SO_RCV); @@ -265,6 +347,7 @@ close_socket(struct c4iw_ep_common *epc, rc = soshutdown(so, SHUT_WR | SHUT_RD); epc->so = NULL; + mutex_unlock(&epc->so_mutex); return (rc); } @@ -272,10 +355,23 @@ static int shutdown_socket(struct c4iw_ep_common *epc) { - CTR4(KTR_IW_CXGBE, "%s: so %p, ep %p, state %s", __func__, epc->so, epc, - states[epc->state]); + struct socket *so = epc->so; + int rc; - return (soshutdown(epc->so, SHUT_WR)); + CTR5(KTR_IW_CXGBE, "%s:ssoB so %p, ep %p, state %s, tid %d", __func__, + epc->so, epc, states[epc->state], + ((struct c4iw_ep *)epc)->hwtid); + mutex_lock(&epc->so_mutex); + if ((so == NULL) || (so->so_count == 0)) { + mutex_unlock(&epc->so_mutex); + CTR5(KTR_IW_CXGBE, "%s:sso1 so %p, ep %p, state %s, tid %d", + __func__, epc->so, epc, states[epc->state], + ((struct c4iw_ep *)epc)->hwtid); + return -EINVAL; + } + rc = soshutdown(so, SHUT_WR); + mutex_unlock(&epc->so_mutex); + return rc; } static void @@ -285,9 +381,9 @@ abort_socket(struct c4iw_ep *ep) int rc; struct linger l; - CTR4(KTR_IW_CXGBE, "%s ep %p so %p state %s", __func__, ep, ep->com.so, - states[ep->com.state]); - + CTR5(KTR_IW_CXGBE, "%s ep %p so %p state %s tid %d", __func__, ep, + ep->com.so, states[ep->com.state], ep->hwtid); + mutex_lock(&ep->com.so_mutex); l.l_onoff = 1; l.l_linger = 0; @@ -303,6 +399,7 @@ abort_socket(struct c4iw_ep *ep) log(LOG_ERR, "%s: can't set linger to 0, no RST! err %d\n", __func__, rc); } + mutex_unlock(&ep->com.so_mutex); } static void @@ -431,7 +528,8 @@ process_conn_error(struct c4iw_ep *ep) int ret; int state; - state = state_read(&ep->com); + mutex_lock(&ep->com.mutex); + state = ep->com.state; CTR5(KTR_IW_CXGBE, "%s:pceB ep %p so %p so->so_error %u state %s", __func__, ep, ep->com.so, ep->com.so->so_error, states[ep->com.state]); @@ -488,6 +586,7 @@ process_conn_error(struct c4iw_ep *ep) case DEAD: CTR2(KTR_IW_CXGBE, "%s so_error %d IN DEAD STATE!!!!", __func__, ep->com.so->so_error); + mutex_unlock(&ep->com.mutex); return; default: @@ -496,12 +595,18 @@ process_conn_error(struct c4iw_ep *ep) } if (state != ABORTING) { + if (ep->parent_ep) { + CTR2(KTR_IW_CXGBE, "%s:pce1 %p", __func__, ep); + close_socket(&ep->com, 1); + } else { + CTR2(KTR_IW_CXGBE, "%s:pce2 %p", __func__, ep); + close_socket(&ep->com, 0); + } - CTR2(KTR_IW_CXGBE, "%s:pce1 %p", __func__, ep); - close_socket(&ep->com, 0); - state_set(&ep->com, DEAD); + __state_set(&ep->com, DEAD); c4iw_put_ep(&ep->com); } + mutex_unlock(&ep->com.mutex); CTR2(KTR_IW_CXGBE, "%s:pceE %p", __func__, ep); return; } @@ -563,16 +668,19 @@ process_close_complete(struct c4iw_ep *e break; case DEAD: - default: CTR2(KTR_IW_CXGBE, "%s:pcc6 %p DEAD", __func__, ep); - panic("%s:pcc6 %p DEAD", __func__, ep); + break; + default: + CTR2(KTR_IW_CXGBE, "%s:pcc7 %p unknown ep state", + __func__, ep); + panic("%s:pcc6 %p unknown ep state", __func__, ep); break; } mutex_unlock(&ep->com.mutex); if (release) { - CTR2(KTR_IW_CXGBE, "%s:pcc7 %p", __func__, ep); + CTR2(KTR_IW_CXGBE, "%s:pcc8 %p", __func__, ep); c4iw_put_ep(&ep->com); } CTR2(KTR_IW_CXGBE, "%s:pccE %p", __func__, ep); @@ -587,6 +695,14 @@ init_sock(struct c4iw_ep_common *epc) struct socket *so = epc->so; int on = 1; + mutex_lock(&epc->so_mutex); + if ((so == NULL) || (so->so_count == 0)) { + mutex_unlock(&epc->so_mutex); + CTR5(KTR_IW_CXGBE, "%s:iso1 so %p, ep %p, state %s, tid %d", + __func__, so, epc, states[epc->state], + ((struct c4iw_ep *)epc)->hwtid); + return; + } SOCK_LOCK(so); soupcall_set(so, SO_RCV, c4iw_so_upcall, epc); so->so_state |= SS_NBIO; @@ -602,6 +718,7 @@ init_sock(struct c4iw_ep_common *epc) log(LOG_ERR, "%s: can't set TCP_NODELAY on so %p (%d)\n", __func__, so, rc); } + mutex_unlock(&epc->so_mutex); } static void @@ -643,14 +760,20 @@ static void process_connected(struct c4iw_ep *ep) { - if ((ep->com.so->so_state & SS_ISCONNECTED) && !ep->com.so->so_error) - send_mpa_req(ep); + if ((ep->com.so->so_state & SS_ISCONNECTED) && !ep->com.so->so_error) { + if (send_mpa_req(ep)) + goto err; + } else { connect_reply_upcall(ep, -ep->com.so->so_error); - close_socket(&ep->com, 0); - state_set(&ep->com, DEAD); - c4iw_put_ep(&ep->com); + goto err; } + return; +err: + close_socket(&ep->com, 0); + state_set(&ep->com, DEAD); + c4iw_put_ep(&ep->com); + return; } void @@ -660,6 +783,7 @@ process_newconn(struct iw_cm_id *parent_ struct sockaddr_in *local; struct sockaddr_in *remote; struct c4iw_ep *parent_ep = parent_cm_id->provider_data; + int ret = 0; if (!child_so) { CTR4(KTR_IW_CXGBE, @@ -703,7 +827,14 @@ process_newconn(struct iw_cm_id *parent_ START_EP_TIMER(child_ep); /* maybe the request has already been queued up on the socket... */ - process_mpa_request(child_ep); + ret = process_mpa_request(child_ep); + if (ret == 2) + /* ABORT */ + c4iw_ep_disconnect(child_ep, 1, GFP_KERNEL); + else if (ret == 1) + /* CLOSE */ + c4iw_ep_disconnect(child_ep, 0, GFP_KERNEL); + return; } @@ -762,7 +893,12 @@ process_socket_event(struct c4iw_ep *ep) /* peer close */ if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) && state <= CLOSING) { process_peer_close(ep); - return; + /* + * check whether socket disconnect event is pending before + * returning. Fallthrough if yes. + */ + if (!(so->so_state & SS_ISDISCONNECTED)) + return; } /* close complete */ @@ -777,11 +913,6 @@ process_socket_event(struct c4iw_ep *ep) SYSCTL_NODE(_hw, OID_AUTO, iw_cxgbe, CTLFLAG_RD, 0, "iw_cxgbe driver parameters"); -int db_delay_usecs = 1; -TUNABLE_INT("hw.iw_cxgbe.db_delay_usecs", &db_delay_usecs); -SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, db_delay_usecs, CTLFLAG_RW, &db_delay_usecs, 0, - "Usecs to delay awaiting db fifo to drain"); - static int dack_mode = 0; TUNABLE_INT("hw.iw_cxgbe.dack_mode", &dack_mode); SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, dack_mode, CTLFLAG_RW, &dack_mode, 0, @@ -852,11 +983,6 @@ TUNABLE_INT("hw.iw_cxgbe.snd_win", &snd_ SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, snd_win, CTLFLAG_RW, &snd_win, 0, "TCP send window in bytes (default = 128KB)"); -int db_fc_threshold = 2000; -TUNABLE_INT("hw.iw_cxgbe.db_fc_threshold", &db_fc_threshold); -SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, db_fc_threshold, CTLFLAG_RW, &db_fc_threshold, 0, - "QP count/threshold that triggers automatic"); - static void start_ep_timer(struct c4iw_ep *ep) { @@ -926,6 +1052,7 @@ alloc_ep(int size, gfp_t gfp) kref_init(&epc->kref); mutex_init(&epc->mutex); + mutex_init(&epc->so_mutex); c4iw_init_wr_wait(&epc->wr_wait); return (epc); @@ -963,7 +1090,7 @@ static void release_ep_resources(struct CTR2(KTR_IW_CXGBE, "%s:rerE %p", __func__, ep); } -static void +static int send_mpa_req(struct c4iw_ep *ep) { int mpalen; @@ -971,7 +1098,7 @@ send_mpa_req(struct c4iw_ep *ep) struct mpa_v2_conn_params mpa_v2_params; struct mbuf *m; char mpa_rev_to_use = mpa_rev; - int err; + int err = 0; if (ep->retry_with_mpa_v1) mpa_rev_to_use = 1; @@ -981,9 +1108,10 @@ send_mpa_req(struct c4iw_ep *ep) mpa = malloc(mpalen, M_CXGBE, M_NOWAIT); if (mpa == NULL) { -failed: - connect_reply_upcall(ep, -ENOMEM); - return; + err = -ENOMEM; + CTR3(KTR_IW_CXGBE, "%s:smr1 ep: %p , error: %d", + __func__, ep, err); + goto err; } memset(mpa, 0, mpalen); @@ -1035,20 +1163,32 @@ failed: m = m_getm(NULL, mpalen, M_NOWAIT, MT_DATA); if (m == NULL) { + err = -ENOMEM; + CTR3(KTR_IW_CXGBE, "%s:smr2 ep: %p , error: %d", + __func__, ep, err); free(mpa, M_CXGBE); - goto failed; + goto err; } m_copyback(m, 0, mpalen, (void *)mpa); free(mpa, M_CXGBE); - err = sosend(ep->com.so, NULL, NULL, m, NULL, MSG_DONTWAIT, - ep->com.thread); - if (err) - goto failed; + err = -sosend(ep->com.so, NULL, NULL, m, NULL, MSG_DONTWAIT, + ep->com.thread); + if (err) { + CTR3(KTR_IW_CXGBE, "%s:smr3 ep: %p , error: %d", + __func__, ep, err); + goto err; + } START_EP_TIMER(ep); state_set(&ep->com, MPA_REQ_SENT); ep->mpa_attr.initiator = 1; + CTR3(KTR_IW_CXGBE, "%s:smrE %p, error: %d", __func__, ep, err); + return 0; +err: + connect_reply_upcall(ep, err); + CTR3(KTR_IW_CXGBE, "%s:smrE %p, error: %d", __func__, ep, err); + return err; } static int send_mpa_reject(struct c4iw_ep *ep, const void *pdata, u8 plen) @@ -1299,10 +1439,11 @@ static void connect_reply_upcall(struct { struct iw_cm_event event; - CTR3(KTR_IW_CXGBE, "%s:cruB %p", __func__, ep, status); + CTR3(KTR_IW_CXGBE, "%s:cruB %p, status: %d", __func__, ep, status); memset(&event, 0, sizeof(event)); event.event = IW_CM_EVENT_CONNECT_REPLY; - event.status = (status ==-ECONNABORTED)?-ECONNRESET: status; + event.status = ((status == -ECONNABORTED) || (status == -EPIPE)) ? + -ECONNRESET : status; event.local_addr = ep->com.local_addr; event.remote_addr = ep->com.remote_addr; @@ -1652,6 +1793,7 @@ static int process_mpa_reply(struct c4iw CTR2(KTR_IW_CXGBE, "%s:pmrl %p", __func__, ep); printf("%s set_tcpinfo error\n", __func__); + err = -ECONNRESET; goto err; } @@ -1917,32 +2059,31 @@ int c4iw_reject_cr(struct iw_cm_id *cm_i int err; struct c4iw_ep *ep = to_ep(cm_id); CTR2(KTR_IW_CXGBE, "%s:crcB %p", __func__, ep); - int disconnect = 0; + int abort = 0; - if (state_read(&ep->com) == DEAD) { + if ((state_read(&ep->com) == DEAD) || + (state_read(&ep->com) != MPA_REQ_RCVD)) { CTR2(KTR_IW_CXGBE, "%s:crc1 %p", __func__, ep); c4iw_put_ep(&ep->com); return -ECONNRESET; } set_bit(ULP_REJECT, &ep->com.history); - BUG_ON(state_read(&ep->com) != MPA_REQ_RCVD); if (mpa_rev == 0) { CTR2(KTR_IW_CXGBE, "%s:crc2 %p", __func__, ep); - disconnect = 2; + abort = 1; } else { CTR2(KTR_IW_CXGBE, "%s:crc3 %p", __func__, ep); - err = send_mpa_reject(ep, pdata, pdata_len); - err = soshutdown(ep->com.so, 3); + abort = send_mpa_reject(ep, pdata, pdata_len); } + stop_ep_timer(ep); + err = c4iw_ep_disconnect(ep, abort != 0, GFP_KERNEL); c4iw_put_ep(&ep->com); - if (disconnect) - err = c4iw_ep_disconnect(ep, disconnect == 2, GFP_KERNEL); - CTR2(KTR_IW_CXGBE, "%s:crc4 %p", __func__, ep); + CTR3(KTR_IW_CXGBE, "%s:crc4 %p, err: %d", __func__, ep, err); return 0; } Modified: stable/10/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h ============================================================================== --- stable/10/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Fri Dec 2 23:05:14 2016 (r309449) +++ stable/10/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Sat Dec 3 00:18:38 2016 (r309450) @@ -131,10 +131,6 @@ struct c4iw_stats { struct c4iw_stat stag; struct c4iw_stat pbl; struct c4iw_stat rqt; - u64 db_full; - u64 db_empty; - u64 db_drop; - u64 db_state_transitions; }; struct c4iw_rdev { @@ -207,12 +203,6 @@ c4iw_wait_for_reply(struct c4iw_rdev *rd return (wr_waitp->ret); } -enum db_state { - NORMAL = 0, - FLOW_CONTROL = 1, - RECOVERY = 2 -}; - struct c4iw_dev { struct ib_device ibdev; struct c4iw_rdev rdev; @@ -222,8 +212,6 @@ struct c4iw_dev { struct idr mmidr; spinlock_t lock; struct dentry *debugfs_root; - enum db_state db_state; - int qpcnt; }; static inline struct c4iw_dev *to_c4iw_dev(struct ib_device *ibdev) @@ -766,6 +754,7 @@ struct c4iw_ep_common { int rpl_done; struct thread *thread; struct socket *so; + struct mutex so_mutex; }; struct c4iw_listen_ep { Modified: stable/10/sys/dev/cxgbe/iw_cxgbe/qp.c ============================================================================== --- stable/10/sys/dev/cxgbe/iw_cxgbe/qp.c Fri Dec 2 23:05:14 2016 (r309449) +++ stable/10/sys/dev/cxgbe/iw_cxgbe/qp.c Sat Dec 3 00:18:38 2016 (r309450) @@ -63,8 +63,6 @@ struct rss_header; #include "iw_cxgbe.h" #include "user.h" -extern int db_delay_usecs; -extern int db_fc_threshold; static void creds(struct toepcb *toep, size_t wrsize); @@ -688,8 +686,8 @@ int c4iw_post_send(struct ib_qp *ibqp, s t4_sq_produce(&qhp->wq, len16); idx += DIV_ROUND_UP(len16*16, T4_EQ_ENTRY_SIZE); } - if (t4_wq_db_enabled(&qhp->wq)) - t4_ring_sq_db(&qhp->wq, idx); + + t4_ring_sq_db(&qhp->wq, idx); spin_unlock_irqrestore(&qhp->lock, flag); return err; } @@ -750,8 +748,8 @@ int c4iw_post_receive(struct ib_qp *ibqp wr = wr->next; num_wrs--; } - if (t4_wq_db_enabled(&qhp->wq)) - t4_ring_rq_db(&qhp->wq, idx); + + t4_ring_rq_db(&qhp->wq, idx); spin_unlock_irqrestore(&qhp->lock, flag); return err; } @@ -1391,14 +1389,6 @@ out: return ret; } -static int enable_qp_db(int id, void *p, void *data) -{ - struct c4iw_qp *qp = p; - - t4_enable_wq_db(&qp->wq); - return 0; -} - int c4iw_destroy_qp(struct ib_qp *ib_qp) { struct c4iw_dev *rhp; @@ -1419,13 +1409,6 @@ int c4iw_destroy_qp(struct ib_qp *ib_qp) spin_lock_irq(&rhp->lock); remove_handle_nolock(rhp, &rhp->qpidr, qhp->wq.sq.qid); - rhp->qpcnt--; - BUG_ON(rhp->qpcnt < 0); - if (rhp->qpcnt <= db_fc_threshold && rhp->db_state == FLOW_CONTROL) { - rhp->rdev.stats.db_state_transitions++; - rhp->db_state = NORMAL; - idr_for_each(&rhp->qpidr, enable_qp_db, NULL); - } spin_unlock_irq(&rhp->lock); atomic_dec(&qhp->refcnt); wait_event(qhp->wait, !atomic_read(&qhp->refcnt)); @@ -1441,14 +1424,6 @@ int c4iw_destroy_qp(struct ib_qp *ib_qp) return 0; } -static int disable_qp_db(int id, void *p, void *data) -{ - struct c4iw_qp *qp = p; - - t4_disable_wq_db(&qp->wq); - return 0; -} - struct ib_qp * c4iw_create_qp(struct ib_pd *pd, struct ib_qp_init_attr *attrs, struct ib_udata *udata) @@ -1538,13 +1513,6 @@ c4iw_create_qp(struct ib_pd *pd, struct atomic_set(&qhp->refcnt, 1); spin_lock_irq(&rhp->lock); - if (rhp->db_state != NORMAL) - t4_disable_wq_db(&qhp->wq); - if (++rhp->qpcnt > db_fc_threshold && rhp->db_state == NORMAL) { - rhp->rdev.stats.db_state_transitions++; - rhp->db_state = FLOW_CONTROL; - idr_for_each(&rhp->qpidr, disable_qp_db, NULL); - } ret = insert_handle_nolock(rhp, &rhp->qpidr, qhp, qhp->wq.sq.qid); spin_unlock_irq(&rhp->lock); if (ret) @@ -1678,15 +1646,6 @@ int c4iw_ib_modify_qp(struct ib_qp *ibqp C4IW_QP_ATTR_ENABLE_RDMA_WRITE | C4IW_QP_ATTR_ENABLE_RDMA_BIND) : 0; - /* - * Use SQ_PSN and RQ_PSN to pass in IDX_INC values for - * ringing the queue db when we're in DB_FULL mode. - */ - attrs.sq_db_inc = attr->sq_psn; - attrs.rq_db_inc = attr->rq_psn; - mask |= (attr_mask & IB_QP_SQ_PSN) ? C4IW_QP_ATTR_SQ_DB : 0; - mask |= (attr_mask & IB_QP_RQ_PSN) ? C4IW_QP_ATTR_RQ_DB : 0; - return c4iw_modify_qp(rhp, qhp, mask, &attrs, 0); } Modified: stable/10/sys/dev/cxgbe/iw_cxgbe/t4.h ============================================================================== --- stable/10/sys/dev/cxgbe/iw_cxgbe/t4.h Fri Dec 2 23:05:14 2016 (r309449) +++ stable/10/sys/dev/cxgbe/iw_cxgbe/t4.h Sat Dec 3 00:18:38 2016 (r309450) @@ -453,21 +453,6 @@ static inline void t4_set_wq_in_error(st wq->rq.queue[wq->rq.size].status.qp_err = 1; } -static inline void t4_disable_wq_db(struct t4_wq *wq) -{ - wq->rq.queue[wq->rq.size].status.db_off = 1; -} - -static inline void t4_enable_wq_db(struct t4_wq *wq) -{ - wq->rq.queue[wq->rq.size].status.db_off = 0; -} - -static inline int t4_wq_db_enabled(struct t4_wq *wq) -{ - return !wq->rq.queue[wq->rq.size].status.db_off; -} - struct t4_cq { struct t4_cqe *queue; bus_addr_t dma_addr; From owner-svn-src-all@freebsd.org Sat Dec 3 00:18:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E88CDC624BC; Sat, 3 Dec 2016 00:18:40 +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 AA7D619C8; Sat, 3 Dec 2016 00:18:40 +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 uB30Idn5098142; Sat, 3 Dec 2016 00:18:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB30Idm0098137; Sat, 3 Dec 2016 00:18:39 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612030018.uB30Idm0098137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 3 Dec 2016 00:18:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309450 - in stable: 10/contrib/ofed/libcxgb4/src 10/sys/dev/cxgbe/iw_cxgbe 11/contrib/ofed/libcxgb4/src 11/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 00:18:41 -0000 Author: jhb Date: Sat Dec 3 00:18:38 2016 New Revision: 309450 URL: https://svnweb.freebsd.org/changeset/base/309450 Log: MFC 304854: cxgbe/iw_cxgbe: Various fixes to the iWARP driver. - Return appropriate error code instead of ENOMEM when sosend() fails in send_mpa_req. - Fix for problematic race during destroy_qp. - Abortive close in the failure of send_mpa_reject() instead of normal close. - Remove the unnecessary doorbell flowcontrol logic. Sponsored by: Chelsio Communications Modified: stable/11/contrib/ofed/libcxgb4/src/qp.c stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h stable/11/sys/dev/cxgbe/iw_cxgbe/qp.c stable/11/sys/dev/cxgbe/iw_cxgbe/t4.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/ofed/libcxgb4/src/qp.c stable/10/sys/dev/cxgbe/iw_cxgbe/cm.c stable/10/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h stable/10/sys/dev/cxgbe/iw_cxgbe/qp.c stable/10/sys/dev/cxgbe/iw_cxgbe/t4.h Directory Properties: stable/10/ (props changed) Modified: stable/11/contrib/ofed/libcxgb4/src/qp.c ============================================================================== --- stable/11/contrib/ofed/libcxgb4/src/qp.c Fri Dec 2 23:05:14 2016 (r309449) +++ stable/11/contrib/ofed/libcxgb4/src/qp.c Sat Dec 3 00:18:38 2016 (r309450) @@ -392,11 +392,9 @@ int c4iw_post_send(struct ibv_qp *ibqp, t4_sq_produce(&qhp->wq, len16); idx += DIV_ROUND_UP(len16*16, T4_EQ_ENTRY_SIZE); } - if (t4_wq_db_enabled(&qhp->wq)) { - t4_ring_sq_db(&qhp->wq, idx, dev_is_t5(qhp->rhp), - len16, wqe); - } else - ring_kernel_db(qhp, qhp->wq.sq.qid, idx); + + t4_ring_sq_db(&qhp->wq, idx, dev_is_t5(qhp->rhp), + len16, wqe); qhp->wq.sq.queue[qhp->wq.sq.size].status.host_wq_pidx = \ (qhp->wq.sq.wq_pidx); pthread_spin_unlock(&qhp->lock); @@ -458,11 +456,9 @@ int c4iw_post_receive(struct ibv_qp *ibq wr = wr->next; num_wrs--; } - if (t4_wq_db_enabled(&qhp->wq)) - t4_ring_rq_db(&qhp->wq, idx, dev_is_t5(qhp->rhp), - len16, wqe); - else - ring_kernel_db(qhp, qhp->wq.rq.qid, idx); + + t4_ring_rq_db(&qhp->wq, idx, dev_is_t5(qhp->rhp), + len16, wqe); qhp->wq.rq.queue[qhp->wq.rq.size].status.host_wq_pidx = \ (qhp->wq.rq.wq_pidx); pthread_spin_unlock(&qhp->lock); Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c Fri Dec 2 23:05:14 2016 (r309449) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c Sat Dec 3 00:18:38 2016 (r309450) @@ -83,6 +83,8 @@ static void process_req(struct work_stru static void start_ep_timer(struct c4iw_ep *ep); static int stop_ep_timer(struct c4iw_ep *ep); static int set_tcpinfo(struct c4iw_ep *ep); +static void process_timeout(struct c4iw_ep *ep); +static void process_timedout_eps(void); static enum c4iw_ep_state state_read(struct c4iw_ep_common *epc); static void __state_set(struct c4iw_ep_common *epc, enum c4iw_ep_state tostate); static void state_set(struct c4iw_ep_common *epc, enum c4iw_ep_state tostate); @@ -93,7 +95,7 @@ static int find_route(__be32 local_ip, _ static int close_socket(struct c4iw_ep_common *epc, int close); static int shutdown_socket(struct c4iw_ep_common *epc); static void abort_socket(struct c4iw_ep *ep); -static void send_mpa_req(struct c4iw_ep *ep); +static int send_mpa_req(struct c4iw_ep *ep); static int send_mpa_reject(struct c4iw_ep *ep, const void *pdata, u8 plen); static int send_mpa_reply(struct c4iw_ep *ep, const void *pdata, u8 plen); static void close_complete_upcall(struct c4iw_ep *ep, int status); @@ -176,20 +178,91 @@ static void ref_qp(struct c4iw_ep *ep) c4iw_qp_add_ref(&ep->com.qp->ibqp); } +static void process_timeout(struct c4iw_ep *ep) +{ + struct c4iw_qp_attributes attrs; + int abort = 1; + + mutex_lock(&ep->com.mutex); + CTR4(KTR_IW_CXGBE, "%s ep :%p, tid:%u, state %d", __func__, + ep, ep->hwtid, ep->com.state); + set_bit(TIMEDOUT, &ep->com.history); + switch (ep->com.state) { + case MPA_REQ_SENT: + connect_reply_upcall(ep, -ETIMEDOUT); + break; + case MPA_REQ_WAIT: + case MPA_REQ_RCVD: + case MPA_REP_SENT: + case FPDU_MODE: + break; + case CLOSING: + case MORIBUND: + if (ep->com.cm_id && ep->com.qp) { + attrs.next_state = C4IW_QP_STATE_ERROR; + c4iw_modify_qp(ep->com.dev, ep->com.qp, + C4IW_QP_ATTR_NEXT_STATE, &attrs, 1); + } + close_complete_upcall(ep, -ETIMEDOUT); + break; + case ABORTING: + case DEAD: + /* + * These states are expected if the ep timed out at the same + * time as another thread was calling stop_ep_timer(). + * So we silently do nothing for these states. + */ + abort = 0; + break; + default: + CTR4(KTR_IW_CXGBE, "%s unexpected state ep %p tid %u state %u\n" + , __func__, ep, ep->hwtid, ep->com.state); + abort = 0; + } + mutex_unlock(&ep->com.mutex); + if (abort) + c4iw_ep_disconnect(ep, 1, GFP_KERNEL); + c4iw_put_ep(&ep->com); + return; +} + +static void process_timedout_eps(void) +{ + struct c4iw_ep *ep; + + spin_lock(&timeout_lock); + while (!list_empty(&timeout_list)) { + struct list_head *tmp; + tmp = timeout_list.next; + list_del(tmp); + tmp->next = tmp->prev = NULL; + spin_unlock(&timeout_lock); + ep = list_entry(tmp, struct c4iw_ep, entry); + process_timeout(ep); + spin_lock(&timeout_lock); + } + spin_unlock(&timeout_lock); + return; +} + static void process_req(struct work_struct *ctx) { struct c4iw_ep_common *epc; + process_timedout_eps(); spin_lock(&req_lock); while (!TAILQ_EMPTY(&req_list)) { epc = TAILQ_FIRST(&req_list); TAILQ_REMOVE(&req_list, epc, entry); epc->entry.tqe_prev = NULL; spin_unlock(&req_lock); + CTR3(KTR_IW_CXGBE, "%s so :%p, ep:%p", __func__, + epc->so, epc); if (epc->so) process_socket_event((struct c4iw_ep *)epc); c4iw_put_ep(epc); + process_timedout_eps(); spin_lock(&req_lock); } spin_unlock(&req_lock); @@ -252,8 +325,17 @@ close_socket(struct c4iw_ep_common *epc, struct socket *so = epc->so; int rc; - CTR4(KTR_IW_CXGBE, "%s: so %p, ep %p, state %s", __func__, epc, so, - states[epc->state]); + CTR5(KTR_IW_CXGBE, "%s:csoB so %p, ep %p, state %s, tid %d", __func__, + so, epc, states[epc->state], + ((struct c4iw_ep *)epc)->hwtid); + mutex_lock(&epc->so_mutex); + if ((so == NULL) || (so->so_count == 0)) { + mutex_unlock(&epc->so_mutex); + CTR5(KTR_IW_CXGBE, "%s:cso1 so %p, ep %p, state %s, tid %d", + __func__, so, epc, states[epc->state], + ((struct c4iw_ep *)epc)->hwtid); + return -EINVAL; + } SOCK_LOCK(so); soupcall_clear(so, SO_RCV); @@ -265,6 +347,7 @@ close_socket(struct c4iw_ep_common *epc, rc = soshutdown(so, SHUT_WR | SHUT_RD); epc->so = NULL; + mutex_unlock(&epc->so_mutex); return (rc); } @@ -272,10 +355,23 @@ static int shutdown_socket(struct c4iw_ep_common *epc) { - CTR4(KTR_IW_CXGBE, "%s: so %p, ep %p, state %s", __func__, epc->so, epc, - states[epc->state]); + struct socket *so = epc->so; + int rc; - return (soshutdown(epc->so, SHUT_WR)); + CTR5(KTR_IW_CXGBE, "%s:ssoB so %p, ep %p, state %s, tid %d", __func__, + epc->so, epc, states[epc->state], + ((struct c4iw_ep *)epc)->hwtid); + mutex_lock(&epc->so_mutex); + if ((so == NULL) || (so->so_count == 0)) { + mutex_unlock(&epc->so_mutex); + CTR5(KTR_IW_CXGBE, "%s:sso1 so %p, ep %p, state %s, tid %d", + __func__, epc->so, epc, states[epc->state], + ((struct c4iw_ep *)epc)->hwtid); + return -EINVAL; + } + rc = soshutdown(so, SHUT_WR); + mutex_unlock(&epc->so_mutex); + return rc; } static void @@ -285,9 +381,9 @@ abort_socket(struct c4iw_ep *ep) int rc; struct linger l; - CTR4(KTR_IW_CXGBE, "%s ep %p so %p state %s", __func__, ep, ep->com.so, - states[ep->com.state]); - + CTR5(KTR_IW_CXGBE, "%s ep %p so %p state %s tid %d", __func__, ep, + ep->com.so, states[ep->com.state], ep->hwtid); + mutex_lock(&ep->com.so_mutex); l.l_onoff = 1; l.l_linger = 0; @@ -303,6 +399,7 @@ abort_socket(struct c4iw_ep *ep) log(LOG_ERR, "%s: can't set linger to 0, no RST! err %d\n", __func__, rc); } + mutex_unlock(&ep->com.so_mutex); } static void @@ -431,7 +528,8 @@ process_conn_error(struct c4iw_ep *ep) int ret; int state; - state = state_read(&ep->com); + mutex_lock(&ep->com.mutex); + state = ep->com.state; CTR5(KTR_IW_CXGBE, "%s:pceB ep %p so %p so->so_error %u state %s", __func__, ep, ep->com.so, ep->com.so->so_error, states[ep->com.state]); @@ -488,6 +586,7 @@ process_conn_error(struct c4iw_ep *ep) case DEAD: CTR2(KTR_IW_CXGBE, "%s so_error %d IN DEAD STATE!!!!", __func__, ep->com.so->so_error); + mutex_unlock(&ep->com.mutex); return; default: @@ -496,12 +595,18 @@ process_conn_error(struct c4iw_ep *ep) } if (state != ABORTING) { + if (ep->parent_ep) { + CTR2(KTR_IW_CXGBE, "%s:pce1 %p", __func__, ep); + close_socket(&ep->com, 1); + } else { + CTR2(KTR_IW_CXGBE, "%s:pce2 %p", __func__, ep); + close_socket(&ep->com, 0); + } - CTR2(KTR_IW_CXGBE, "%s:pce1 %p", __func__, ep); - close_socket(&ep->com, 0); - state_set(&ep->com, DEAD); + __state_set(&ep->com, DEAD); c4iw_put_ep(&ep->com); } + mutex_unlock(&ep->com.mutex); CTR2(KTR_IW_CXGBE, "%s:pceE %p", __func__, ep); return; } @@ -563,16 +668,19 @@ process_close_complete(struct c4iw_ep *e break; case DEAD: - default: CTR2(KTR_IW_CXGBE, "%s:pcc6 %p DEAD", __func__, ep); - panic("%s:pcc6 %p DEAD", __func__, ep); + break; + default: + CTR2(KTR_IW_CXGBE, "%s:pcc7 %p unknown ep state", + __func__, ep); + panic("%s:pcc6 %p unknown ep state", __func__, ep); break; } mutex_unlock(&ep->com.mutex); if (release) { - CTR2(KTR_IW_CXGBE, "%s:pcc7 %p", __func__, ep); + CTR2(KTR_IW_CXGBE, "%s:pcc8 %p", __func__, ep); c4iw_put_ep(&ep->com); } CTR2(KTR_IW_CXGBE, "%s:pccE %p", __func__, ep); @@ -587,6 +695,14 @@ init_sock(struct c4iw_ep_common *epc) struct socket *so = epc->so; int on = 1; + mutex_lock(&epc->so_mutex); + if ((so == NULL) || (so->so_count == 0)) { + mutex_unlock(&epc->so_mutex); + CTR5(KTR_IW_CXGBE, "%s:iso1 so %p, ep %p, state %s, tid %d", + __func__, so, epc, states[epc->state], + ((struct c4iw_ep *)epc)->hwtid); + return; + } SOCK_LOCK(so); soupcall_set(so, SO_RCV, c4iw_so_upcall, epc); so->so_state |= SS_NBIO; @@ -602,6 +718,7 @@ init_sock(struct c4iw_ep_common *epc) log(LOG_ERR, "%s: can't set TCP_NODELAY on so %p (%d)\n", __func__, so, rc); } + mutex_unlock(&epc->so_mutex); } static void @@ -643,14 +760,20 @@ static void process_connected(struct c4iw_ep *ep) { - if ((ep->com.so->so_state & SS_ISCONNECTED) && !ep->com.so->so_error) - send_mpa_req(ep); + if ((ep->com.so->so_state & SS_ISCONNECTED) && !ep->com.so->so_error) { + if (send_mpa_req(ep)) + goto err; + } else { connect_reply_upcall(ep, -ep->com.so->so_error); - close_socket(&ep->com, 0); - state_set(&ep->com, DEAD); - c4iw_put_ep(&ep->com); + goto err; } + return; +err: + close_socket(&ep->com, 0); + state_set(&ep->com, DEAD); + c4iw_put_ep(&ep->com); + return; } void @@ -660,6 +783,7 @@ process_newconn(struct iw_cm_id *parent_ struct sockaddr_in *local; struct sockaddr_in *remote; struct c4iw_ep *parent_ep = parent_cm_id->provider_data; + int ret = 0; if (!child_so) { CTR4(KTR_IW_CXGBE, @@ -703,7 +827,14 @@ process_newconn(struct iw_cm_id *parent_ START_EP_TIMER(child_ep); /* maybe the request has already been queued up on the socket... */ - process_mpa_request(child_ep); + ret = process_mpa_request(child_ep); + if (ret == 2) + /* ABORT */ + c4iw_ep_disconnect(child_ep, 1, GFP_KERNEL); + else if (ret == 1) + /* CLOSE */ + c4iw_ep_disconnect(child_ep, 0, GFP_KERNEL); + return; } @@ -762,7 +893,12 @@ process_socket_event(struct c4iw_ep *ep) /* peer close */ if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) && state <= CLOSING) { process_peer_close(ep); - return; + /* + * check whether socket disconnect event is pending before + * returning. Fallthrough if yes. + */ + if (!(so->so_state & SS_ISDISCONNECTED)) + return; } /* close complete */ @@ -777,10 +913,6 @@ process_socket_event(struct c4iw_ep *ep) SYSCTL_NODE(_hw, OID_AUTO, iw_cxgbe, CTLFLAG_RD, 0, "iw_cxgbe driver parameters"); -int db_delay_usecs = 1; -SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, db_delay_usecs, CTLFLAG_RWTUN, &db_delay_usecs, 0, - "Usecs to delay awaiting db fifo to drain"); - static int dack_mode = 0; SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, dack_mode, CTLFLAG_RWTUN, &dack_mode, 0, "Delayed ack mode (default = 0)"); @@ -837,10 +969,6 @@ static int snd_win = 128 * 1024; SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, snd_win, CTLFLAG_RWTUN, &snd_win, 0, "TCP send window in bytes (default = 128KB)"); -int db_fc_threshold = 2000; -SYSCTL_INT(_hw_iw_cxgbe, OID_AUTO, db_fc_threshold, CTLFLAG_RWTUN, &db_fc_threshold, 0, - "QP count/threshold that triggers automatic"); - static void start_ep_timer(struct c4iw_ep *ep) { @@ -910,6 +1038,7 @@ alloc_ep(int size, gfp_t gfp) kref_init(&epc->kref); mutex_init(&epc->mutex); + mutex_init(&epc->so_mutex); c4iw_init_wr_wait(&epc->wr_wait); return (epc); @@ -947,7 +1076,7 @@ static void release_ep_resources(struct CTR2(KTR_IW_CXGBE, "%s:rerE %p", __func__, ep); } -static void +static int send_mpa_req(struct c4iw_ep *ep) { int mpalen; @@ -955,7 +1084,7 @@ send_mpa_req(struct c4iw_ep *ep) struct mpa_v2_conn_params mpa_v2_params; struct mbuf *m; char mpa_rev_to_use = mpa_rev; - int err; + int err = 0; if (ep->retry_with_mpa_v1) mpa_rev_to_use = 1; @@ -965,9 +1094,10 @@ send_mpa_req(struct c4iw_ep *ep) mpa = malloc(mpalen, M_CXGBE, M_NOWAIT); if (mpa == NULL) { -failed: - connect_reply_upcall(ep, -ENOMEM); - return; + err = -ENOMEM; + CTR3(KTR_IW_CXGBE, "%s:smr1 ep: %p , error: %d", + __func__, ep, err); + goto err; } memset(mpa, 0, mpalen); @@ -1019,20 +1149,32 @@ failed: m = m_getm(NULL, mpalen, M_NOWAIT, MT_DATA); if (m == NULL) { + err = -ENOMEM; + CTR3(KTR_IW_CXGBE, "%s:smr2 ep: %p , error: %d", + __func__, ep, err); free(mpa, M_CXGBE); - goto failed; + goto err; } m_copyback(m, 0, mpalen, (void *)mpa); free(mpa, M_CXGBE); - err = sosend(ep->com.so, NULL, NULL, m, NULL, MSG_DONTWAIT, - ep->com.thread); - if (err) - goto failed; + err = -sosend(ep->com.so, NULL, NULL, m, NULL, MSG_DONTWAIT, + ep->com.thread); + if (err) { + CTR3(KTR_IW_CXGBE, "%s:smr3 ep: %p , error: %d", + __func__, ep, err); + goto err; + } START_EP_TIMER(ep); state_set(&ep->com, MPA_REQ_SENT); ep->mpa_attr.initiator = 1; + CTR3(KTR_IW_CXGBE, "%s:smrE %p, error: %d", __func__, ep, err); + return 0; +err: + connect_reply_upcall(ep, err); + CTR3(KTR_IW_CXGBE, "%s:smrE %p, error: %d", __func__, ep, err); + return err; } static int send_mpa_reject(struct c4iw_ep *ep, const void *pdata, u8 plen) @@ -1283,10 +1425,11 @@ static void connect_reply_upcall(struct { struct iw_cm_event event; - CTR3(KTR_IW_CXGBE, "%s:cruB %p", __func__, ep, status); + CTR3(KTR_IW_CXGBE, "%s:cruB %p, status: %d", __func__, ep, status); memset(&event, 0, sizeof(event)); event.event = IW_CM_EVENT_CONNECT_REPLY; - event.status = (status ==-ECONNABORTED)?-ECONNRESET: status; + event.status = ((status == -ECONNABORTED) || (status == -EPIPE)) ? + -ECONNRESET : status; event.local_addr = ep->com.local_addr; event.remote_addr = ep->com.remote_addr; @@ -1636,6 +1779,7 @@ static int process_mpa_reply(struct c4iw CTR2(KTR_IW_CXGBE, "%s:pmrl %p", __func__, ep); printf("%s set_tcpinfo error\n", __func__); + err = -ECONNRESET; goto err; } @@ -1901,32 +2045,31 @@ int c4iw_reject_cr(struct iw_cm_id *cm_i int err; struct c4iw_ep *ep = to_ep(cm_id); CTR2(KTR_IW_CXGBE, "%s:crcB %p", __func__, ep); - int disconnect = 0; + int abort = 0; - if (state_read(&ep->com) == DEAD) { + if ((state_read(&ep->com) == DEAD) || + (state_read(&ep->com) != MPA_REQ_RCVD)) { CTR2(KTR_IW_CXGBE, "%s:crc1 %p", __func__, ep); c4iw_put_ep(&ep->com); return -ECONNRESET; } set_bit(ULP_REJECT, &ep->com.history); - BUG_ON(state_read(&ep->com) != MPA_REQ_RCVD); if (mpa_rev == 0) { CTR2(KTR_IW_CXGBE, "%s:crc2 %p", __func__, ep); - disconnect = 2; + abort = 1; } else { CTR2(KTR_IW_CXGBE, "%s:crc3 %p", __func__, ep); - err = send_mpa_reject(ep, pdata, pdata_len); - err = soshutdown(ep->com.so, 3); + abort = send_mpa_reject(ep, pdata, pdata_len); } + stop_ep_timer(ep); + err = c4iw_ep_disconnect(ep, abort != 0, GFP_KERNEL); c4iw_put_ep(&ep->com); - if (disconnect) - err = c4iw_ep_disconnect(ep, disconnect == 2, GFP_KERNEL); - CTR2(KTR_IW_CXGBE, "%s:crc4 %p", __func__, ep); + CTR3(KTR_IW_CXGBE, "%s:crc4 %p, err: %d", __func__, ep, err); return 0; } Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Fri Dec 2 23:05:14 2016 (r309449) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/iw_cxgbe.h Sat Dec 3 00:18:38 2016 (r309450) @@ -131,10 +131,6 @@ struct c4iw_stats { struct c4iw_stat stag; struct c4iw_stat pbl; struct c4iw_stat rqt; - u64 db_full; - u64 db_empty; - u64 db_drop; - u64 db_state_transitions; }; struct c4iw_rdev { @@ -207,12 +203,6 @@ c4iw_wait_for_reply(struct c4iw_rdev *rd return (wr_waitp->ret); } -enum db_state { - NORMAL = 0, - FLOW_CONTROL = 1, - RECOVERY = 2 -}; - struct c4iw_dev { struct ib_device ibdev; struct c4iw_rdev rdev; @@ -222,8 +212,6 @@ struct c4iw_dev { struct idr mmidr; spinlock_t lock; struct dentry *debugfs_root; - enum db_state db_state; - int qpcnt; }; static inline struct c4iw_dev *to_c4iw_dev(struct ib_device *ibdev) @@ -766,6 +754,7 @@ struct c4iw_ep_common { int rpl_done; struct thread *thread; struct socket *so; + struct mutex so_mutex; }; struct c4iw_listen_ep { Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/qp.c ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/qp.c Fri Dec 2 23:05:14 2016 (r309449) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/qp.c Sat Dec 3 00:18:38 2016 (r309450) @@ -64,8 +64,6 @@ struct cpl_set_tcb_rpl; #include "iw_cxgbe.h" #include "user.h" -extern int db_delay_usecs; -extern int db_fc_threshold; static void creds(struct toepcb *toep, size_t wrsize); @@ -689,8 +687,8 @@ int c4iw_post_send(struct ib_qp *ibqp, s t4_sq_produce(&qhp->wq, len16); idx += DIV_ROUND_UP(len16*16, T4_EQ_ENTRY_SIZE); } - if (t4_wq_db_enabled(&qhp->wq)) - t4_ring_sq_db(&qhp->wq, idx); + + t4_ring_sq_db(&qhp->wq, idx); spin_unlock_irqrestore(&qhp->lock, flag); return err; } @@ -751,8 +749,8 @@ int c4iw_post_receive(struct ib_qp *ibqp wr = wr->next; num_wrs--; } - if (t4_wq_db_enabled(&qhp->wq)) - t4_ring_rq_db(&qhp->wq, idx); + + t4_ring_rq_db(&qhp->wq, idx); spin_unlock_irqrestore(&qhp->lock, flag); return err; } @@ -1392,14 +1390,6 @@ out: return ret; } -static int enable_qp_db(int id, void *p, void *data) -{ - struct c4iw_qp *qp = p; - - t4_enable_wq_db(&qp->wq); - return 0; -} - int c4iw_destroy_qp(struct ib_qp *ib_qp) { struct c4iw_dev *rhp; @@ -1420,13 +1410,6 @@ int c4iw_destroy_qp(struct ib_qp *ib_qp) spin_lock_irq(&rhp->lock); remove_handle_nolock(rhp, &rhp->qpidr, qhp->wq.sq.qid); - rhp->qpcnt--; - BUG_ON(rhp->qpcnt < 0); - if (rhp->qpcnt <= db_fc_threshold && rhp->db_state == FLOW_CONTROL) { - rhp->rdev.stats.db_state_transitions++; - rhp->db_state = NORMAL; - idr_for_each(&rhp->qpidr, enable_qp_db, NULL); - } spin_unlock_irq(&rhp->lock); atomic_dec(&qhp->refcnt); wait_event(qhp->wait, !atomic_read(&qhp->refcnt)); @@ -1442,14 +1425,6 @@ int c4iw_destroy_qp(struct ib_qp *ib_qp) return 0; } -static int disable_qp_db(int id, void *p, void *data) -{ - struct c4iw_qp *qp = p; - - t4_disable_wq_db(&qp->wq); - return 0; -} - struct ib_qp * c4iw_create_qp(struct ib_pd *pd, struct ib_qp_init_attr *attrs, struct ib_udata *udata) @@ -1539,13 +1514,6 @@ c4iw_create_qp(struct ib_pd *pd, struct atomic_set(&qhp->refcnt, 1); spin_lock_irq(&rhp->lock); - if (rhp->db_state != NORMAL) - t4_disable_wq_db(&qhp->wq); - if (++rhp->qpcnt > db_fc_threshold && rhp->db_state == NORMAL) { - rhp->rdev.stats.db_state_transitions++; - rhp->db_state = FLOW_CONTROL; - idr_for_each(&rhp->qpidr, disable_qp_db, NULL); - } ret = insert_handle_nolock(rhp, &rhp->qpidr, qhp, qhp->wq.sq.qid); spin_unlock_irq(&rhp->lock); if (ret) @@ -1679,15 +1647,6 @@ int c4iw_ib_modify_qp(struct ib_qp *ibqp C4IW_QP_ATTR_ENABLE_RDMA_WRITE | C4IW_QP_ATTR_ENABLE_RDMA_BIND) : 0; - /* - * Use SQ_PSN and RQ_PSN to pass in IDX_INC values for - * ringing the queue db when we're in DB_FULL mode. - */ - attrs.sq_db_inc = attr->sq_psn; - attrs.rq_db_inc = attr->rq_psn; - mask |= (attr_mask & IB_QP_SQ_PSN) ? C4IW_QP_ATTR_SQ_DB : 0; - mask |= (attr_mask & IB_QP_RQ_PSN) ? C4IW_QP_ATTR_RQ_DB : 0; - return c4iw_modify_qp(rhp, qhp, mask, &attrs, 0); } Modified: stable/11/sys/dev/cxgbe/iw_cxgbe/t4.h ============================================================================== --- stable/11/sys/dev/cxgbe/iw_cxgbe/t4.h Fri Dec 2 23:05:14 2016 (r309449) +++ stable/11/sys/dev/cxgbe/iw_cxgbe/t4.h Sat Dec 3 00:18:38 2016 (r309450) @@ -453,21 +453,6 @@ static inline void t4_set_wq_in_error(st wq->rq.queue[wq->rq.size].status.qp_err = 1; } -static inline void t4_disable_wq_db(struct t4_wq *wq) -{ - wq->rq.queue[wq->rq.size].status.db_off = 1; -} - -static inline void t4_enable_wq_db(struct t4_wq *wq) -{ - wq->rq.queue[wq->rq.size].status.db_off = 0; -} - -static inline int t4_wq_db_enabled(struct t4_wq *wq) -{ - return !wq->rq.queue[wq->rq.size].status.db_off; -} - struct t4_cq { struct t4_cqe *queue; bus_addr_t dma_addr; From owner-svn-src-all@freebsd.org Sat Dec 3 00:24:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC339C62753; Sat, 3 Dec 2016 00:24:35 +0000 (UTC) (envelope-from pfg@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 5756E1F80; Sat, 3 Dec 2016 00:24:35 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB30OYB8002034; Sat, 3 Dec 2016 00:24:34 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB30OY7G002033; Sat, 3 Dec 2016 00:24:34 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612030024.uB30OY7G002033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 3 Dec 2016 00:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309451 - head/usr.bin/indent X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 00:24:35 -0000 Author: pfg Date: Sat Dec 3 00:24:34 2016 New Revision: 309451 URL: https://svnweb.freebsd.org/changeset/base/309451 Log: Document undocumented indent(1) options badp/nbadp, bs/nbs, and lc. Submitted by: Piotr Stefaniak Differential Revision: https://reviews.freebsd.org/D8690 Modified: head/usr.bin/indent/indent.1 Modified: head/usr.bin/indent/indent.1 ============================================================================== --- head/usr.bin/indent/indent.1 Sat Dec 3 00:18:38 2016 (r309450) +++ head/usr.bin/indent/indent.1 Sat Dec 3 00:24:34 2016 (r309451) @@ -30,7 +30,7 @@ .\" @(#)indent.1 8.1 (Berkeley) 7/1/93 .\" $FreeBSD$ .\" -.Dd August 3, 2016 +.Dd December 2, 2016 .Dt INDENT 1 .Os .Sh NAME @@ -41,6 +41,7 @@ .Op Ar input-file Op Ar output-file .Op Fl bacc | Fl nbacc .Op Fl bad | Fl nbad +.Op Fl badp | Fl nbadp .Op Fl bap | Fl nbap .Bk -words .Op Fl ei | Fl ei @@ -50,6 +51,7 @@ .Op Fl \&bc | Fl nbc .Op Fl \&bl .Op Fl \&br +.Op Fl bs | Fl nbs .Op Fl c Ns Ar n .Op Fl \&cd Ns Ar n .Bk -words @@ -143,6 +145,14 @@ is specified, a blank line is forced aft declarations. Default: .Fl nbad . +.It Fl badp , nbadp +This is vaguely similar to +.Fl bad +, except that it only applies to the first set of declarations +in a procedure (just after the first `{') and it causes a blank +line to be generated even if there are no declarations. +The default is +.Fl nbadp. .It Fl bap , nbap If .Fl bap @@ -182,6 +192,10 @@ if (...) { code } .Ed +.It Fl bs , nbs +Whether a blank should always be inserted after sizeof. +The default is +.Fl nbs. .It Fl c Ns Ar n The column in which comments on code start. The default is 33. @@ -324,6 +338,10 @@ The default is .It Fl l Ns Ar n Maximum length of an output line. The default is 78. +.It Fl lc Ns Ar n +Maximum length of an output line in a block comment. +The default is 0, which means to limit block comment lines in accordance with +.Fl l. .It Fl \&ldi Ns Ar n Specifies the indentation, in character positions, of local variable names From owner-svn-src-all@freebsd.org Sat Dec 3 00:37:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08B2AC62964; Sat, 3 Dec 2016 00:37:02 +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 C10636E8; Sat, 3 Dec 2016 00:37:01 +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 uB30b0sB006438; Sat, 3 Dec 2016 00:37:00 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB30b0lW006437; Sat, 3 Dec 2016 00:37:00 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612030037.uB30b0lW006437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 00:37:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309452 - stable/11/tools/build/mk X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 00:37:02 -0000 Author: ngie Date: Sat Dec 3 00:37:00 2016 New Revision: 309452 URL: https://svnweb.freebsd.org/changeset/base/309452 Log: MFC r307713: Remove /usr/libexec/bsdinstall/hardening if MK_BSDINSTALL == no Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/11/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 3 00:24:34 2016 (r309451) +++ stable/11/tools/build/mk/OptionalObsoleteFiles.inc Sat Dec 3 00:37:00 2016 (r309452) @@ -682,6 +682,7 @@ OLD_FILES+=usr/libexec/bsdinstall/distex OLD_FILES+=usr/libexec/bsdinstall/distfetch OLD_FILES+=usr/libexec/bsdinstall/docsinstall OLD_FILES+=usr/libexec/bsdinstall/entropy +OLD_FILES+=usr/libexec/bsdinstall/hardening OLD_FILES+=usr/libexec/bsdinstall/hostname OLD_FILES+=usr/libexec/bsdinstall/jail OLD_FILES+=usr/libexec/bsdinstall/keymap From owner-svn-src-all@freebsd.org Sat Dec 3 00:38:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0608C62A12; Sat, 3 Dec 2016 00:38:36 +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 6F8CB8BE; Sat, 3 Dec 2016 00:38:36 +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 uB30cZXn006559; Sat, 3 Dec 2016 00:38:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB30cZct006558; Sat, 3 Dec 2016 00:38:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612030038.uB30cZct006558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 00:38:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309453 - stable/11/lib/libc/tests X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 00:38:36 -0000 Author: ngie Date: Sat Dec 3 00:38:35 2016 New Revision: 309453 URL: https://svnweb.freebsd.org/changeset/base/309453 Log: MFC r307700: Only build lib/libc/tests/iconv if MK_ICONV != no Modified: stable/11/lib/libc/tests/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/tests/Makefile ============================================================================== --- stable/11/lib/libc/tests/Makefile Sat Dec 3 00:37:00 2016 (r309452) +++ stable/11/lib/libc/tests/Makefile Sat Dec 3 00:38:35 2016 (r309453) @@ -8,7 +8,6 @@ TESTS_SUBDIRS= c063 TESTS_SUBDIRS+= db TESTS_SUBDIRS+= gen TESTS_SUBDIRS+= hash -TESTS_SUBDIRS+= iconv TESTS_SUBDIRS+= inet TESTS_SUBDIRS+= net TESTS_SUBDIRS+= nss @@ -26,6 +25,10 @@ TESTS_SUBDIRS+= ttyio SUBDIR_DEPEND_tls= tls_dso +.if ${MK_ICONV} != "no" +TESTS_SUBDIRS+= iconv +.endif + .if ${MK_LOCALES} != "no" TESTS_SUBDIRS+= locale .endif From owner-svn-src-all@freebsd.org Sat Dec 3 00:40:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96503C62AF3; Sat, 3 Dec 2016 00:40: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 65B8DA2C; Sat, 3 Dec 2016 00:40: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 uB30e8rt006711; Sat, 3 Dec 2016 00:40:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB30e8Qc006710; Sat, 3 Dec 2016 00:40:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612030040.uB30e8Qc006710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 00:40:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309454 - stable/10/lib/libc/tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 00:40:09 -0000 Author: ngie Date: Sat Dec 3 00:40:08 2016 New Revision: 309454 URL: https://svnweb.freebsd.org/changeset/base/309454 Log: MFstable/11 r309453: MFC r307700: Only build lib/libc/tests/iconv if MK_ICONV != no Modified: stable/10/lib/libc/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/tests/Makefile ============================================================================== --- stable/10/lib/libc/tests/Makefile Sat Dec 3 00:38:35 2016 (r309453) +++ stable/10/lib/libc/tests/Makefile Sat Dec 3 00:40:08 2016 (r309454) @@ -24,6 +24,10 @@ TESTS_SUBDIRS+= termios TESTS_SUBDIRS+= tls TESTS_SUBDIRS+= ttyio +.if ${MK_ICONV} != "no" +TESTS_SUBDIRS+= iconv +.endif + .if ${MK_LOCALES} != "no" TESTS_SUBDIRS+= locale .endif From owner-svn-src-all@freebsd.org Sat Dec 3 00:43:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B1F5C62D57; Sat, 3 Dec 2016 00:43:12 +0000 (UTC) (envelope-from pfg@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 0A6FDEC5; Sat, 3 Dec 2016 00:43:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB30hBi1010579; Sat, 3 Dec 2016 00:43:11 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB30hBOc010578; Sat, 3 Dec 2016 00:43:11 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612030043.uB30hBOc010578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 3 Dec 2016 00:43:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309455 - stable/11/sys/fs/ext2fs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 00:43:12 -0000 Author: pfg Date: Sat Dec 3 00:43:11 2016 New Revision: 309455 URL: https://svnweb.freebsd.org/changeset/base/309455 Log: MFC r309179: ext2fs: avoid possible overflow when calculating malloc size. This is inspired on r308064 for the case of mounting UFS. Modified: stable/11/sys/fs/ext2fs/ext2_vfsops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- stable/11/sys/fs/ext2fs/ext2_vfsops.c Sat Dec 3 00:40:08 2016 (r309454) +++ stable/11/sys/fs/ext2fs/ext2_vfsops.c Sat Dec 3 00:43:11 2016 (r309455) @@ -537,7 +537,8 @@ ext2_mountfs(struct vnode *devvp, struct struct csum *sump; int error; int ronly; - int i, size; + int i; + u_long size; int32_t *lp; int32_t e2fs_maxcontig; From owner-svn-src-all@freebsd.org Sat Dec 3 00:45:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80288C62E13; Sat, 3 Dec 2016 00:45:14 +0000 (UTC) (envelope-from pfg@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 48B291055; Sat, 3 Dec 2016 00:45:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB30jDBp010735; Sat, 3 Dec 2016 00:45:13 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB30jDBB010734; Sat, 3 Dec 2016 00:45:13 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612030045.uB30jDBB010734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 3 Dec 2016 00:45:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309456 - stable/10/sys/fs/ext2fs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 00:45:14 -0000 Author: pfg Date: Sat Dec 3 00:45:13 2016 New Revision: 309456 URL: https://svnweb.freebsd.org/changeset/base/309456 Log: MFC r309179: ext2fs: avoid possible overflow when calculating malloc size. This is inspired on r308064 for the case of mounting UFS. Modified: stable/10/sys/fs/ext2fs/ext2_vfsops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_vfsops.c Sat Dec 3 00:43:11 2016 (r309455) +++ stable/10/sys/fs/ext2fs/ext2_vfsops.c Sat Dec 3 00:45:13 2016 (r309456) @@ -541,7 +541,8 @@ ext2_mountfs(struct vnode *devvp, struct struct csum *sump; int error; int ronly; - int i, size; + int i; + u_long size; int32_t *lp; int32_t e2fs_maxcontig; From owner-svn-src-all@freebsd.org Sat Dec 3 00:46:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05095C62E98; Sat, 3 Dec 2016 00:46:20 +0000 (UTC) (envelope-from pfg@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 C84F6120A; Sat, 3 Dec 2016 00:46:19 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB30kIGr010818; Sat, 3 Dec 2016 00:46:18 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB30kIRt010817; Sat, 3 Dec 2016 00:46:18 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612030046.uB30kIRt010817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 3 Dec 2016 00:46:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r309457 - stable/9/sys/fs/ext2fs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 00:46:20 -0000 Author: pfg Date: Sat Dec 3 00:46:18 2016 New Revision: 309457 URL: https://svnweb.freebsd.org/changeset/base/309457 Log: MFC r309179: ext2fs: avoid possible overflow when calculating malloc size. This is inspired on r308064 for the case of mounting UFS. Modified: stable/9/sys/fs/ext2fs/ext2_vfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_vfsops.c Sat Dec 3 00:45:13 2016 (r309456) +++ stable/9/sys/fs/ext2fs/ext2_vfsops.c Sat Dec 3 00:46:18 2016 (r309457) @@ -527,7 +527,8 @@ ext2_mountfs(struct vnode *devvp, struct struct csum *sump; int error; int ronly; - int i, size; + int i; + u_long size; int32_t *lp; int32_t e2fs_maxcontig; From owner-svn-src-all@freebsd.org Sat Dec 3 01:05:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CD2CC63279; Sat, 3 Dec 2016 01:05:01 +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 02CFF1BA2; Sat, 3 Dec 2016 01:05:00 +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 uB3150Bd018783; Sat, 3 Dec 2016 01:05:00 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB314x9I018767; Sat, 3 Dec 2016 01:04:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612030104.uB314x9I018767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 3 Dec 2016 01:04:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309458 - in stable: 10/sys/dev/cxgbe 10/sys/dev/cxgbe/common 10/sys/dev/cxgbe/firmware 11/sys/dev/cxgbe 11/sys/dev/cxgbe/common 11/sys/dev/cxgbe/firmware X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 01:05:01 -0000 Author: jhb Date: Sat Dec 3 01:04:59 2016 New Revision: 309458 URL: https://svnweb.freebsd.org/changeset/base/309458 Log: MFC 302440,304873,305704,305985,306787,307531: Fixes for sysctls. 302440: cxgbe(4): Add sysctl to display the RSS indirection table size for an interface. dev.cxl..rss_size dev.vcxl..rss_size 304873: cxgbe(4): Provide more details about the card in the sysctl MIB. dev.t5nex.0.%desc: Chelsio T580-CR dev.t5nex.0.hw_revision: 1 dev.t5nex.0.sn: PT13140042 dev.t5nex.0.pn: 110117150A0 dev.t5nex.0.ec: 0000000000000000 dev.t5nex.0.na: 0007432AF490 dev.t5nex.0.vpd_version: 3 dev.t5nex.0.scfg_version: 53255 dev.t5nex.0.bs_version: 1.1.0.0 dev.t5nex.0.er_version: 1.0.0.68 dev.t5nex.0.tp_version: 0.1.4.9 dev.t5nex.0.firmware_version: 1.16.2.0 305704: cxgbe(4): Rename the debug_flags driver tunable/sysctl to dflags. Tunables that end with _flags are special. 305985: cxgbe(4): Fixes to wrq stats. - Increment tx_wrs_copied in the correct place. - Add tx_wrs_sspace to the sysctl MIB. 306787: cxgbe(4): Fix whitespace in the pm_stats display. 307531: cxgbe(4): Adjust whitespace to line up the column titles in cim_qcfg with the values displayed. Sponsored by: Chelsio Communications Modified: stable/10/sys/dev/cxgbe/adapter.h stable/10/sys/dev/cxgbe/common/common.h stable/10/sys/dev/cxgbe/common/t4_hw.c stable/10/sys/dev/cxgbe/firmware/t4fw_interface.h stable/10/sys/dev/cxgbe/t4_main.c stable/10/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/cxgbe/adapter.h stable/11/sys/dev/cxgbe/common/common.h stable/11/sys/dev/cxgbe/common/t4_hw.c stable/11/sys/dev/cxgbe/firmware/t4fw_interface.h stable/11/sys/dev/cxgbe/t4_main.c stable/11/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/10/sys/dev/cxgbe/adapter.h Sat Dec 3 00:46:18 2016 (r309457) +++ stable/10/sys/dev/cxgbe/adapter.h Sat Dec 3 01:04:59 2016 (r309458) @@ -814,7 +814,8 @@ struct adapter { char fw_version[16]; char tp_version[16]; - char exprom_version[16]; + char er_version[16]; + char bs_version[16]; char cfg_file[32]; u_int cfcsum; struct adapter_params params; Modified: stable/10/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/10/sys/dev/cxgbe/common/common.h Sat Dec 3 00:46:18 2016 (r309457) +++ stable/10/sys/dev/cxgbe/common/common.h Sat Dec 3 01:04:59 2016 (r309458) @@ -330,9 +330,12 @@ struct adapter_params { unsigned int sf_size; /* serial flash size in bytes */ unsigned int sf_nsec; /* # of flash sectors */ - unsigned int fw_vers; - unsigned int tp_vers; - unsigned int exprom_vers; + unsigned int fw_vers; /* firmware version */ + unsigned int bs_vers; /* bootstrap version */ + unsigned int tp_vers; /* TP microcode version */ + unsigned int er_vers; /* expansion ROM version */ + unsigned int scfg_vers; /* Serial Configuration version */ + unsigned int vpd_vers; /* VPD version */ unsigned short mtus[NMTUS]; unsigned short a_wnd[NCCTRL_WIN]; @@ -548,8 +551,12 @@ int t4_flash_erase_sectors(struct adapte int t4_flash_cfg_addr(struct adapter *adapter); int t4_load_cfg(struct adapter *adapter, const u8 *cfg_data, unsigned int size); int t4_get_fw_version(struct adapter *adapter, u32 *vers); +int t4_get_bs_version(struct adapter *adapter, u32 *vers); int t4_get_tp_version(struct adapter *adapter, u32 *vers); int t4_get_exprom_version(struct adapter *adapter, u32 *vers); +int t4_get_scfg_version(struct adapter *adapter, u32 *vers); +int t4_get_vpd_version(struct adapter *adapter, u32 *vers); +int t4_get_version_info(struct adapter *adapter); int t4_init_hw(struct adapter *adapter, u32 fw_params); const struct chip_params *t4_get_chip_params(int chipid); int t4_prep_adapter(struct adapter *adapter, u8 *buf); Modified: stable/10/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/10/sys/dev/cxgbe/common/t4_hw.c Sat Dec 3 00:46:18 2016 (r309457) +++ stable/10/sys/dev/cxgbe/common/t4_hw.c Sat Dec 3 01:04:59 2016 (r309458) @@ -3231,6 +3231,20 @@ int t4_get_fw_version(struct adapter *ad } /** + * t4_get_bs_version - read the firmware bootstrap version + * @adapter: the adapter + * @vers: where to place the version + * + * Reads the FW Bootstrap version from flash. + */ +int t4_get_bs_version(struct adapter *adapter, u32 *vers) +{ + return t4_read_flash(adapter, FLASH_FWBOOTSTRAP_START + + offsetof(struct fw_hdr, fw_ver), 1, + vers, 0); +} + +/** * t4_get_tp_version - read the TP microcode version * @adapter: the adapter * @vers: where to place the version @@ -3282,6 +3296,110 @@ int t4_get_exprom_version(struct adapter } /** + * t4_get_scfg_version - return the Serial Configuration version + * @adapter: the adapter + * @vers: where to place the version + * + * Reads the Serial Configuration Version via the Firmware interface + * (thus this can only be called once we're ready to issue Firmware + * commands). The format of the Serial Configuration version is + * adapter specific. Returns 0 on success, an error on failure. + * + * Note that early versions of the Firmware didn't include the ability + * to retrieve the Serial Configuration version, so we zero-out the + * return-value parameter in that case to avoid leaving it with + * garbage in it. + * + * Also note that the Firmware will return its cached copy of the Serial + * Initialization Revision ID, not the actual Revision ID as written in + * the Serial EEPROM. This is only an issue if a new VPD has been written + * and the Firmware/Chip haven't yet gone through a RESET sequence. So + * it's best to defer calling this routine till after a FW_RESET_CMD has + * been issued if the Host Driver will be performing a full adapter + * initialization. + */ +int t4_get_scfg_version(struct adapter *adapter, u32 *vers) +{ + u32 scfgrev_param; + int ret; + + scfgrev_param = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | + V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_SCFGREV)); + ret = t4_query_params(adapter, adapter->mbox, adapter->pf, 0, + 1, &scfgrev_param, vers); + if (ret) + *vers = 0; + return ret; +} + +/** + * t4_get_vpd_version - return the VPD version + * @adapter: the adapter + * @vers: where to place the version + * + * Reads the VPD via the Firmware interface (thus this can only be called + * once we're ready to issue Firmware commands). The format of the + * VPD version is adapter specific. Returns 0 on success, an error on + * failure. + * + * Note that early versions of the Firmware didn't include the ability + * to retrieve the VPD version, so we zero-out the return-value parameter + * in that case to avoid leaving it with garbage in it. + * + * Also note that the Firmware will return its cached copy of the VPD + * Revision ID, not the actual Revision ID as written in the Serial + * EEPROM. This is only an issue if a new VPD has been written and the + * Firmware/Chip haven't yet gone through a RESET sequence. So it's best + * to defer calling this routine till after a FW_RESET_CMD has been issued + * if the Host Driver will be performing a full adapter initialization. + */ +int t4_get_vpd_version(struct adapter *adapter, u32 *vers) +{ + u32 vpdrev_param; + int ret; + + vpdrev_param = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | + V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_VPDREV)); + ret = t4_query_params(adapter, adapter->mbox, adapter->pf, 0, + 1, &vpdrev_param, vers); + if (ret) + *vers = 0; + return ret; +} + +/** + * t4_get_version_info - extract various chip/firmware version information + * @adapter: the adapter + * + * Reads various chip/firmware version numbers and stores them into the + * adapter Adapter Parameters structure. If any of the efforts fails + * the first failure will be returned, but all of the version numbers + * will be read. + */ +int t4_get_version_info(struct adapter *adapter) +{ + int ret = 0; + + #define FIRST_RET(__getvinfo) \ + do { \ + int __ret = __getvinfo; \ + if (__ret && !ret) \ + ret = __ret; \ + } while (0) + + FIRST_RET(t4_get_fw_version(adapter, &adapter->params.fw_vers)); + FIRST_RET(t4_get_bs_version(adapter, &adapter->params.bs_vers)); + FIRST_RET(t4_get_tp_version(adapter, &adapter->params.tp_vers)); + FIRST_RET(t4_get_exprom_version(adapter, &adapter->params.er_vers)); + FIRST_RET(t4_get_scfg_version(adapter, &adapter->params.scfg_vers)); + FIRST_RET(t4_get_vpd_version(adapter, &adapter->params.vpd_vers)); + + #undef FIRST_RET + + return ret; +} + +/** * t4_flash_erase_sectors - erase a range of flash sectors * @adapter: the adapter * @start: the first sector to erase Modified: stable/10/sys/dev/cxgbe/firmware/t4fw_interface.h ============================================================================== --- stable/10/sys/dev/cxgbe/firmware/t4fw_interface.h Sat Dec 3 00:46:18 2016 (r309457) +++ stable/10/sys/dev/cxgbe/firmware/t4fw_interface.h Sat Dec 3 01:04:59 2016 (r309458) @@ -4206,6 +4206,8 @@ enum fw_params_param_dev { FW_PARAMS_PARAM_DEV_ULPTX_MEMWRITE_DSGL = 0x17, FW_PARAMS_PARAM_DEV_FWCACHE = 0x18, FW_PARAMS_PARAM_DEV_RSSINFO = 0x19, + FW_PARAMS_PARAM_DEV_SCFGREV = 0x1A, + FW_PARAMS_PARAM_DEV_VPDREV = 0x1B, }; /* Modified: stable/10/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_main.c Sat Dec 3 00:46:18 2016 (r309457) +++ stable/10/sys/dev/cxgbe/t4_main.c Sat Dec 3 01:04:59 2016 (r309458) @@ -666,7 +666,7 @@ t4_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; - TUNABLE_INT_FETCH("hw.cxgbe.debug_flags", &sc->debug_flags); + TUNABLE_INT_FETCH("hw.cxgbe.dflags", &sc->debug_flags); if ((pci_get_device(dev) & 0xff00) == 0x5400) t5_attribute_workaround(dev); @@ -2711,32 +2711,6 @@ prep_firmware(struct adapter *sc) goto done; } - /* We're using whatever's on the card and it's known to be good. */ - sc->params.fw_vers = ntohl(card_fw->fw_ver); - snprintf(sc->fw_version, sizeof(sc->fw_version), "%u.%u.%u.%u", - G_FW_HDR_FW_VER_MAJOR(sc->params.fw_vers), - G_FW_HDR_FW_VER_MINOR(sc->params.fw_vers), - G_FW_HDR_FW_VER_MICRO(sc->params.fw_vers), - G_FW_HDR_FW_VER_BUILD(sc->params.fw_vers)); - - t4_get_tp_version(sc, &sc->params.tp_vers); - snprintf(sc->tp_version, sizeof(sc->tp_version), "%u.%u.%u.%u", - G_FW_HDR_FW_VER_MAJOR(sc->params.tp_vers), - G_FW_HDR_FW_VER_MINOR(sc->params.tp_vers), - G_FW_HDR_FW_VER_MICRO(sc->params.tp_vers), - G_FW_HDR_FW_VER_BUILD(sc->params.tp_vers)); - - if (t4_get_exprom_version(sc, &sc->params.exprom_vers) != 0) - sc->params.exprom_vers = 0; - else { - snprintf(sc->exprom_version, sizeof(sc->exprom_version), - "%u.%u.%u.%u", - G_FW_HDR_FW_VER_MAJOR(sc->params.exprom_vers), - G_FW_HDR_FW_VER_MINOR(sc->params.exprom_vers), - G_FW_HDR_FW_VER_MICRO(sc->params.exprom_vers), - G_FW_HDR_FW_VER_BUILD(sc->params.exprom_vers)); - } - /* Reset device */ if (need_fw_reset && (rc = -t4_fw_reset(sc, sc->mbox, F_PIORSTMODE | F_PIORST)) != 0) { @@ -2981,6 +2955,32 @@ get_params__pre_init(struct adapter *sc) int rc; uint32_t param[2], val[2]; + t4_get_version_info(sc); + + snprintf(sc->fw_version, sizeof(sc->fw_version), "%u.%u.%u.%u", + G_FW_HDR_FW_VER_MAJOR(sc->params.fw_vers), + G_FW_HDR_FW_VER_MINOR(sc->params.fw_vers), + G_FW_HDR_FW_VER_MICRO(sc->params.fw_vers), + G_FW_HDR_FW_VER_BUILD(sc->params.fw_vers)); + + snprintf(sc->bs_version, sizeof(sc->bs_version), "%u.%u.%u.%u", + G_FW_HDR_FW_VER_MAJOR(sc->params.bs_vers), + G_FW_HDR_FW_VER_MINOR(sc->params.bs_vers), + G_FW_HDR_FW_VER_MICRO(sc->params.bs_vers), + G_FW_HDR_FW_VER_BUILD(sc->params.bs_vers)); + + snprintf(sc->tp_version, sizeof(sc->tp_version), "%u.%u.%u.%u", + G_FW_HDR_FW_VER_MAJOR(sc->params.tp_vers), + G_FW_HDR_FW_VER_MINOR(sc->params.tp_vers), + G_FW_HDR_FW_VER_MICRO(sc->params.tp_vers), + G_FW_HDR_FW_VER_BUILD(sc->params.tp_vers)); + + snprintf(sc->er_version, sizeof(sc->er_version), "%u.%u.%u.%u", + G_FW_HDR_FW_VER_MAJOR(sc->params.er_vers), + G_FW_HDR_FW_VER_MINOR(sc->params.er_vers), + G_FW_HDR_FW_VER_MICRO(sc->params.er_vers), + G_FW_HDR_FW_VER_BUILD(sc->params.er_vers)); + param[0] = FW_PARAM_DEV(PORTVEC); param[1] = FW_PARAM_DEV(CCLK); rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 2, param, val); @@ -3194,9 +3194,7 @@ t4_set_desc(struct adapter *sc) char buf[128]; struct adapter_params *p = &sc->params; - snprintf(buf, sizeof(buf), "Chelsio %s %sNIC (rev %d), S/N:%s, " - "P/N:%s, E/C:%s", p->vpd.id, is_offload(sc) ? "R" : "", - chip_rev(sc), p->vpd.sn, p->vpd.pn, p->vpd.ec); + snprintf(buf, sizeof(buf), "Chelsio %s", p->vpd.id); device_set_desc_copy(sc->dev, buf); } @@ -4496,7 +4494,7 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_INT(ctx, children, OID_AUTO, "lro_timeout", CTLFLAG_RW, &sc->lro_timeout, 0, "lro inactive-flush timeout (in us)"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "debug_flags", CTLFLAG_RW, + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "dflags", CTLFLAG_RW, &sc->debug_flags, 0, "flags to enable runtime debugging"); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "tp_version", @@ -4511,10 +4509,29 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_INT(ctx, children, OID_AUTO, "hw_revision", CTLFLAG_RD, NULL, chip_rev(sc), "chip hardware revision"); - if (sc->params.exprom_vers != 0) { - SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "exprom_version", - CTLFLAG_RD, sc->exprom_version, 0, "expansion ROM version"); - } + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "sn", + CTLFLAG_RD, sc->params.vpd.sn, 0, "serial number"); + + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "pn", + CTLFLAG_RD, sc->params.vpd.pn, 0, "part number"); + + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "ec", + CTLFLAG_RD, sc->params.vpd.ec, 0, "engineering change"); + + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "na", + CTLFLAG_RD, sc->params.vpd.na, 0, "network address"); + + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "er_version", CTLFLAG_RD, + sc->er_version, 0, "expansion ROM version"); + + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "bs_version", CTLFLAG_RD, + sc->bs_version, 0, "bootstrap firmware version"); + + SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "scfg_version", CTLFLAG_RD, + NULL, sc->params.scfg_vers, "serial config version"); + + SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "vpd_version", CTLFLAG_RD, + NULL, sc->params.vpd_vers, "VPD version"); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "cf", CTLFLAG_RD, sc->cfg_file, 0, "configuration file"); @@ -4525,7 +4542,7 @@ t4_sysctls(struct adapter *sc) #define SYSCTL_CAP(name, n, text) \ SYSCTL_ADD_PROC(ctx, children, OID_AUTO, #name, \ CTLTYPE_STRING | CTLFLAG_RD, caps_decoder[n], sc->name, \ - sysctl_bitfield, "A", "available " text "capabilities") + sysctl_bitfield, "A", "available " text " capabilities") SYSCTL_CAP(nbmcaps, 0, "NBM"); SYSCTL_CAP(linkcaps, 1, "link"); @@ -4827,6 +4844,8 @@ vi_sysctls(struct vi_info *vi) &vi->first_rxq, 0, "index of first rx queue"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "first_txq", CTLFLAG_RD, &vi->first_txq, 0, "index of first tx queue"); + SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "rss_size", CTLFLAG_RD, NULL, + vi->rss_size, "size of RSS indirection table"); if (IS_MAIN_VI(vi)) { SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rsrv_noflowq", @@ -5772,7 +5791,8 @@ sysctl_cim_qcfg(SYSCTL_HANDLER_ARGS) if (sb == NULL) return (ENOMEM); - sbuf_printf(sb, "Queue Base Size Thres RdPtr WrPtr SOP EOP Avail"); + sbuf_printf(sb, + " Queue Base Size Thres RdPtr WrPtr SOP EOP Avail"); for (i = 0; i < CIM_NUM_IBQ; i++, p += 4) sbuf_printf(sb, "\n%7s %5x %5u %5u %6x %4x %4u %4u %5u", @@ -6716,7 +6736,7 @@ sysctl_pm_stats(SYSCTL_HANDLER_ARGS) }; static const char *rx_stats[MAX_PM_NSTATS] = { "Read:", "Write bypass:", "Write mem:", "Flush:", - " Rx FIFO wait", NULL, "Rx latency" + "Rx FIFO wait", NULL, "Rx latency" }; rc = sysctl_wire_old_buffer(req, 0); Modified: stable/10/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_sge.c Sat Dec 3 00:46:18 2016 (r309457) +++ stable/10/sys/dev/cxgbe/t4_sge.c Sat Dec 3 01:04:59 2016 (r309458) @@ -1890,6 +1890,7 @@ drain_wrq_wr_list(struct adapter *sc, st } eq->pidx = n - (eq->sidx - eq->pidx); } + wrq->tx_wrs_copied++; if (available < eq->sidx / 4 && atomic_cmpset_int(&eq->equiq, 0, 1)) { @@ -3545,6 +3546,8 @@ alloc_wrq(struct adapter *sc, struct vi_ &wrq->tx_wrs_direct, "# of work requests (direct)"); SYSCTL_ADD_UQUAD(ctx, children, OID_AUTO, "tx_wrs_copied", CTLFLAG_RD, &wrq->tx_wrs_copied, "# of work requests (copied)"); + SYSCTL_ADD_UQUAD(ctx, children, OID_AUTO, "tx_wrs_sspace", CTLFLAG_RD, + &wrq->tx_wrs_ss, "# of work requests (copied from scratch space)"); return (rc); } From owner-svn-src-all@freebsd.org Sat Dec 3 01:05:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC129C63281; Sat, 3 Dec 2016 01:05:01 +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 A99611BA3; Sat, 3 Dec 2016 01:05:01 +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 uB3150ud018794; Sat, 3 Dec 2016 01:05:00 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3150I8018788; Sat, 3 Dec 2016 01:05:00 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612030105.uB3150I8018788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 3 Dec 2016 01:05:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309458 - in stable: 10/sys/dev/cxgbe 10/sys/dev/cxgbe/common 10/sys/dev/cxgbe/firmware 11/sys/dev/cxgbe 11/sys/dev/cxgbe/common 11/sys/dev/cxgbe/firmware X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 01:05:02 -0000 Author: jhb Date: Sat Dec 3 01:04:59 2016 New Revision: 309458 URL: https://svnweb.freebsd.org/changeset/base/309458 Log: MFC 302440,304873,305704,305985,306787,307531: Fixes for sysctls. 302440: cxgbe(4): Add sysctl to display the RSS indirection table size for an interface. dev.cxl..rss_size dev.vcxl..rss_size 304873: cxgbe(4): Provide more details about the card in the sysctl MIB. dev.t5nex.0.%desc: Chelsio T580-CR dev.t5nex.0.hw_revision: 1 dev.t5nex.0.sn: PT13140042 dev.t5nex.0.pn: 110117150A0 dev.t5nex.0.ec: 0000000000000000 dev.t5nex.0.na: 0007432AF490 dev.t5nex.0.vpd_version: 3 dev.t5nex.0.scfg_version: 53255 dev.t5nex.0.bs_version: 1.1.0.0 dev.t5nex.0.er_version: 1.0.0.68 dev.t5nex.0.tp_version: 0.1.4.9 dev.t5nex.0.firmware_version: 1.16.2.0 305704: cxgbe(4): Rename the debug_flags driver tunable/sysctl to dflags. Tunables that end with _flags are special. 305985: cxgbe(4): Fixes to wrq stats. - Increment tx_wrs_copied in the correct place. - Add tx_wrs_sspace to the sysctl MIB. 306787: cxgbe(4): Fix whitespace in the pm_stats display. 307531: cxgbe(4): Adjust whitespace to line up the column titles in cim_qcfg with the values displayed. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/adapter.h stable/11/sys/dev/cxgbe/common/common.h stable/11/sys/dev/cxgbe/common/t4_hw.c stable/11/sys/dev/cxgbe/firmware/t4fw_interface.h stable/11/sys/dev/cxgbe/t4_main.c stable/11/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/cxgbe/adapter.h stable/10/sys/dev/cxgbe/common/common.h stable/10/sys/dev/cxgbe/common/t4_hw.c stable/10/sys/dev/cxgbe/firmware/t4fw_interface.h stable/10/sys/dev/cxgbe/t4_main.c stable/10/sys/dev/cxgbe/t4_sge.c Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/11/sys/dev/cxgbe/adapter.h Sat Dec 3 00:46:18 2016 (r309457) +++ stable/11/sys/dev/cxgbe/adapter.h Sat Dec 3 01:04:59 2016 (r309458) @@ -821,7 +821,8 @@ struct adapter { char fw_version[16]; char tp_version[16]; - char exprom_version[16]; + char er_version[16]; + char bs_version[16]; char cfg_file[32]; u_int cfcsum; struct adapter_params params; Modified: stable/11/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/11/sys/dev/cxgbe/common/common.h Sat Dec 3 00:46:18 2016 (r309457) +++ stable/11/sys/dev/cxgbe/common/common.h Sat Dec 3 01:04:59 2016 (r309458) @@ -330,9 +330,12 @@ struct adapter_params { unsigned int sf_size; /* serial flash size in bytes */ unsigned int sf_nsec; /* # of flash sectors */ - unsigned int fw_vers; - unsigned int tp_vers; - unsigned int exprom_vers; + unsigned int fw_vers; /* firmware version */ + unsigned int bs_vers; /* bootstrap version */ + unsigned int tp_vers; /* TP microcode version */ + unsigned int er_vers; /* expansion ROM version */ + unsigned int scfg_vers; /* Serial Configuration version */ + unsigned int vpd_vers; /* VPD version */ unsigned short mtus[NMTUS]; unsigned short a_wnd[NCCTRL_WIN]; @@ -548,8 +551,12 @@ int t4_flash_erase_sectors(struct adapte int t4_flash_cfg_addr(struct adapter *adapter); int t4_load_cfg(struct adapter *adapter, const u8 *cfg_data, unsigned int size); int t4_get_fw_version(struct adapter *adapter, u32 *vers); +int t4_get_bs_version(struct adapter *adapter, u32 *vers); int t4_get_tp_version(struct adapter *adapter, u32 *vers); int t4_get_exprom_version(struct adapter *adapter, u32 *vers); +int t4_get_scfg_version(struct adapter *adapter, u32 *vers); +int t4_get_vpd_version(struct adapter *adapter, u32 *vers); +int t4_get_version_info(struct adapter *adapter); int t4_init_hw(struct adapter *adapter, u32 fw_params); const struct chip_params *t4_get_chip_params(int chipid); int t4_prep_adapter(struct adapter *adapter, u8 *buf); Modified: stable/11/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/11/sys/dev/cxgbe/common/t4_hw.c Sat Dec 3 00:46:18 2016 (r309457) +++ stable/11/sys/dev/cxgbe/common/t4_hw.c Sat Dec 3 01:04:59 2016 (r309458) @@ -3234,6 +3234,20 @@ int t4_get_fw_version(struct adapter *ad } /** + * t4_get_bs_version - read the firmware bootstrap version + * @adapter: the adapter + * @vers: where to place the version + * + * Reads the FW Bootstrap version from flash. + */ +int t4_get_bs_version(struct adapter *adapter, u32 *vers) +{ + return t4_read_flash(adapter, FLASH_FWBOOTSTRAP_START + + offsetof(struct fw_hdr, fw_ver), 1, + vers, 0); +} + +/** * t4_get_tp_version - read the TP microcode version * @adapter: the adapter * @vers: where to place the version @@ -3285,6 +3299,110 @@ int t4_get_exprom_version(struct adapter } /** + * t4_get_scfg_version - return the Serial Configuration version + * @adapter: the adapter + * @vers: where to place the version + * + * Reads the Serial Configuration Version via the Firmware interface + * (thus this can only be called once we're ready to issue Firmware + * commands). The format of the Serial Configuration version is + * adapter specific. Returns 0 on success, an error on failure. + * + * Note that early versions of the Firmware didn't include the ability + * to retrieve the Serial Configuration version, so we zero-out the + * return-value parameter in that case to avoid leaving it with + * garbage in it. + * + * Also note that the Firmware will return its cached copy of the Serial + * Initialization Revision ID, not the actual Revision ID as written in + * the Serial EEPROM. This is only an issue if a new VPD has been written + * and the Firmware/Chip haven't yet gone through a RESET sequence. So + * it's best to defer calling this routine till after a FW_RESET_CMD has + * been issued if the Host Driver will be performing a full adapter + * initialization. + */ +int t4_get_scfg_version(struct adapter *adapter, u32 *vers) +{ + u32 scfgrev_param; + int ret; + + scfgrev_param = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | + V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_SCFGREV)); + ret = t4_query_params(adapter, adapter->mbox, adapter->pf, 0, + 1, &scfgrev_param, vers); + if (ret) + *vers = 0; + return ret; +} + +/** + * t4_get_vpd_version - return the VPD version + * @adapter: the adapter + * @vers: where to place the version + * + * Reads the VPD via the Firmware interface (thus this can only be called + * once we're ready to issue Firmware commands). The format of the + * VPD version is adapter specific. Returns 0 on success, an error on + * failure. + * + * Note that early versions of the Firmware didn't include the ability + * to retrieve the VPD version, so we zero-out the return-value parameter + * in that case to avoid leaving it with garbage in it. + * + * Also note that the Firmware will return its cached copy of the VPD + * Revision ID, not the actual Revision ID as written in the Serial + * EEPROM. This is only an issue if a new VPD has been written and the + * Firmware/Chip haven't yet gone through a RESET sequence. So it's best + * to defer calling this routine till after a FW_RESET_CMD has been issued + * if the Host Driver will be performing a full adapter initialization. + */ +int t4_get_vpd_version(struct adapter *adapter, u32 *vers) +{ + u32 vpdrev_param; + int ret; + + vpdrev_param = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | + V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_VPDREV)); + ret = t4_query_params(adapter, adapter->mbox, adapter->pf, 0, + 1, &vpdrev_param, vers); + if (ret) + *vers = 0; + return ret; +} + +/** + * t4_get_version_info - extract various chip/firmware version information + * @adapter: the adapter + * + * Reads various chip/firmware version numbers and stores them into the + * adapter Adapter Parameters structure. If any of the efforts fails + * the first failure will be returned, but all of the version numbers + * will be read. + */ +int t4_get_version_info(struct adapter *adapter) +{ + int ret = 0; + + #define FIRST_RET(__getvinfo) \ + do { \ + int __ret = __getvinfo; \ + if (__ret && !ret) \ + ret = __ret; \ + } while (0) + + FIRST_RET(t4_get_fw_version(adapter, &adapter->params.fw_vers)); + FIRST_RET(t4_get_bs_version(adapter, &adapter->params.bs_vers)); + FIRST_RET(t4_get_tp_version(adapter, &adapter->params.tp_vers)); + FIRST_RET(t4_get_exprom_version(adapter, &adapter->params.er_vers)); + FIRST_RET(t4_get_scfg_version(adapter, &adapter->params.scfg_vers)); + FIRST_RET(t4_get_vpd_version(adapter, &adapter->params.vpd_vers)); + + #undef FIRST_RET + + return ret; +} + +/** * t4_flash_erase_sectors - erase a range of flash sectors * @adapter: the adapter * @start: the first sector to erase Modified: stable/11/sys/dev/cxgbe/firmware/t4fw_interface.h ============================================================================== --- stable/11/sys/dev/cxgbe/firmware/t4fw_interface.h Sat Dec 3 00:46:18 2016 (r309457) +++ stable/11/sys/dev/cxgbe/firmware/t4fw_interface.h Sat Dec 3 01:04:59 2016 (r309458) @@ -4206,6 +4206,8 @@ enum fw_params_param_dev { FW_PARAMS_PARAM_DEV_ULPTX_MEMWRITE_DSGL = 0x17, FW_PARAMS_PARAM_DEV_FWCACHE = 0x18, FW_PARAMS_PARAM_DEV_RSSINFO = 0x19, + FW_PARAMS_PARAM_DEV_SCFGREV = 0x1A, + FW_PARAMS_PARAM_DEV_VPDREV = 0x1B, }; /* Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Sat Dec 3 00:46:18 2016 (r309457) +++ stable/11/sys/dev/cxgbe/t4_main.c Sat Dec 3 01:04:59 2016 (r309458) @@ -675,7 +675,7 @@ t4_attach(device_t dev) sc = device_get_softc(dev); sc->dev = dev; - TUNABLE_INT_FETCH("hw.cxgbe.debug_flags", &sc->debug_flags); + TUNABLE_INT_FETCH("hw.cxgbe.dflags", &sc->debug_flags); if ((pci_get_device(dev) & 0xff00) == 0x5400) t5_attribute_workaround(dev); @@ -2897,32 +2897,6 @@ prep_firmware(struct adapter *sc) goto done; } - /* We're using whatever's on the card and it's known to be good. */ - sc->params.fw_vers = ntohl(card_fw->fw_ver); - snprintf(sc->fw_version, sizeof(sc->fw_version), "%u.%u.%u.%u", - G_FW_HDR_FW_VER_MAJOR(sc->params.fw_vers), - G_FW_HDR_FW_VER_MINOR(sc->params.fw_vers), - G_FW_HDR_FW_VER_MICRO(sc->params.fw_vers), - G_FW_HDR_FW_VER_BUILD(sc->params.fw_vers)); - - t4_get_tp_version(sc, &sc->params.tp_vers); - snprintf(sc->tp_version, sizeof(sc->tp_version), "%u.%u.%u.%u", - G_FW_HDR_FW_VER_MAJOR(sc->params.tp_vers), - G_FW_HDR_FW_VER_MINOR(sc->params.tp_vers), - G_FW_HDR_FW_VER_MICRO(sc->params.tp_vers), - G_FW_HDR_FW_VER_BUILD(sc->params.tp_vers)); - - if (t4_get_exprom_version(sc, &sc->params.exprom_vers) != 0) - sc->params.exprom_vers = 0; - else { - snprintf(sc->exprom_version, sizeof(sc->exprom_version), - "%u.%u.%u.%u", - G_FW_HDR_FW_VER_MAJOR(sc->params.exprom_vers), - G_FW_HDR_FW_VER_MINOR(sc->params.exprom_vers), - G_FW_HDR_FW_VER_MICRO(sc->params.exprom_vers), - G_FW_HDR_FW_VER_BUILD(sc->params.exprom_vers)); - } - /* Reset device */ if (need_fw_reset && (rc = -t4_fw_reset(sc, sc->mbox, F_PIORSTMODE | F_PIORST)) != 0) { @@ -3167,6 +3141,32 @@ get_params__pre_init(struct adapter *sc) int rc; uint32_t param[2], val[2]; + t4_get_version_info(sc); + + snprintf(sc->fw_version, sizeof(sc->fw_version), "%u.%u.%u.%u", + G_FW_HDR_FW_VER_MAJOR(sc->params.fw_vers), + G_FW_HDR_FW_VER_MINOR(sc->params.fw_vers), + G_FW_HDR_FW_VER_MICRO(sc->params.fw_vers), + G_FW_HDR_FW_VER_BUILD(sc->params.fw_vers)); + + snprintf(sc->bs_version, sizeof(sc->bs_version), "%u.%u.%u.%u", + G_FW_HDR_FW_VER_MAJOR(sc->params.bs_vers), + G_FW_HDR_FW_VER_MINOR(sc->params.bs_vers), + G_FW_HDR_FW_VER_MICRO(sc->params.bs_vers), + G_FW_HDR_FW_VER_BUILD(sc->params.bs_vers)); + + snprintf(sc->tp_version, sizeof(sc->tp_version), "%u.%u.%u.%u", + G_FW_HDR_FW_VER_MAJOR(sc->params.tp_vers), + G_FW_HDR_FW_VER_MINOR(sc->params.tp_vers), + G_FW_HDR_FW_VER_MICRO(sc->params.tp_vers), + G_FW_HDR_FW_VER_BUILD(sc->params.tp_vers)); + + snprintf(sc->er_version, sizeof(sc->er_version), "%u.%u.%u.%u", + G_FW_HDR_FW_VER_MAJOR(sc->params.er_vers), + G_FW_HDR_FW_VER_MINOR(sc->params.er_vers), + G_FW_HDR_FW_VER_MICRO(sc->params.er_vers), + G_FW_HDR_FW_VER_BUILD(sc->params.er_vers)); + param[0] = FW_PARAM_DEV(PORTVEC); param[1] = FW_PARAM_DEV(CCLK); rc = -t4_query_params(sc, sc->mbox, sc->pf, 0, 2, param, val); @@ -3380,9 +3380,7 @@ t4_set_desc(struct adapter *sc) char buf[128]; struct adapter_params *p = &sc->params; - snprintf(buf, sizeof(buf), "Chelsio %s %sNIC (rev %d), S/N:%s, " - "P/N:%s, E/C:%s", p->vpd.id, is_offload(sc) ? "R" : "", - chip_rev(sc), p->vpd.sn, p->vpd.pn, p->vpd.ec); + snprintf(buf, sizeof(buf), "Chelsio %s", p->vpd.id); device_set_desc_copy(sc->dev, buf); } @@ -4643,7 +4641,7 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_INT(ctx, children, OID_AUTO, "lro_timeout", CTLFLAG_RW, &sc->lro_timeout, 0, "lro inactive-flush timeout (in us)"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "debug_flags", CTLFLAG_RW, + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "dflags", CTLFLAG_RW, &sc->debug_flags, 0, "flags to enable runtime debugging"); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "tp_version", @@ -4658,10 +4656,29 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_INT(ctx, children, OID_AUTO, "hw_revision", CTLFLAG_RD, NULL, chip_rev(sc), "chip hardware revision"); - if (sc->params.exprom_vers != 0) { - SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "exprom_version", - CTLFLAG_RD, sc->exprom_version, 0, "expansion ROM version"); - } + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "sn", + CTLFLAG_RD, sc->params.vpd.sn, 0, "serial number"); + + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "pn", + CTLFLAG_RD, sc->params.vpd.pn, 0, "part number"); + + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "ec", + CTLFLAG_RD, sc->params.vpd.ec, 0, "engineering change"); + + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "na", + CTLFLAG_RD, sc->params.vpd.na, 0, "network address"); + + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "er_version", CTLFLAG_RD, + sc->er_version, 0, "expansion ROM version"); + + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "bs_version", CTLFLAG_RD, + sc->bs_version, 0, "bootstrap firmware version"); + + SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "scfg_version", CTLFLAG_RD, + NULL, sc->params.scfg_vers, "serial config version"); + + SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "vpd_version", CTLFLAG_RD, + NULL, sc->params.vpd_vers, "VPD version"); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "cf", CTLFLAG_RD, sc->cfg_file, 0, "configuration file"); @@ -4672,7 +4689,7 @@ t4_sysctls(struct adapter *sc) #define SYSCTL_CAP(name, n, text) \ SYSCTL_ADD_PROC(ctx, children, OID_AUTO, #name, \ CTLTYPE_STRING | CTLFLAG_RD, caps_decoder[n], sc->name, \ - sysctl_bitfield, "A", "available " text "capabilities") + sysctl_bitfield, "A", "available " text " capabilities") SYSCTL_CAP(nbmcaps, 0, "NBM"); SYSCTL_CAP(linkcaps, 1, "link"); @@ -4970,6 +4987,8 @@ vi_sysctls(struct vi_info *vi) &vi->first_rxq, 0, "index of first rx queue"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "first_txq", CTLFLAG_RD, &vi->first_txq, 0, "index of first tx queue"); + SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "rss_size", CTLFLAG_RD, NULL, + vi->rss_size, "size of RSS indirection table"); if (IS_MAIN_VI(vi)) { SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rsrv_noflowq", @@ -5914,7 +5933,8 @@ sysctl_cim_qcfg(SYSCTL_HANDLER_ARGS) if (sb == NULL) return (ENOMEM); - sbuf_printf(sb, "Queue Base Size Thres RdPtr WrPtr SOP EOP Avail"); + sbuf_printf(sb, + " Queue Base Size Thres RdPtr WrPtr SOP EOP Avail"); for (i = 0; i < CIM_NUM_IBQ; i++, p += 4) sbuf_printf(sb, "\n%7s %5x %5u %5u %6x %4x %4u %4u %5u", @@ -6858,7 +6878,7 @@ sysctl_pm_stats(SYSCTL_HANDLER_ARGS) }; static const char *rx_stats[MAX_PM_NSTATS] = { "Read:", "Write bypass:", "Write mem:", "Flush:", - " Rx FIFO wait", NULL, "Rx latency" + "Rx FIFO wait", NULL, "Rx latency" }; rc = sysctl_wire_old_buffer(req, 0); Modified: stable/11/sys/dev/cxgbe/t4_sge.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_sge.c Sat Dec 3 00:46:18 2016 (r309457) +++ stable/11/sys/dev/cxgbe/t4_sge.c Sat Dec 3 01:04:59 2016 (r309458) @@ -1890,6 +1890,7 @@ drain_wrq_wr_list(struct adapter *sc, st } eq->pidx = n - (eq->sidx - eq->pidx); } + wrq->tx_wrs_copied++; if (available < eq->sidx / 4 && atomic_cmpset_int(&eq->equiq, 0, 1)) { @@ -3545,6 +3546,8 @@ alloc_wrq(struct adapter *sc, struct vi_ &wrq->tx_wrs_direct, "# of work requests (direct)"); SYSCTL_ADD_UQUAD(ctx, children, OID_AUTO, "tx_wrs_copied", CTLFLAG_RD, &wrq->tx_wrs_copied, "# of work requests (copied)"); + SYSCTL_ADD_UQUAD(ctx, children, OID_AUTO, "tx_wrs_sspace", CTLFLAG_RD, + &wrq->tx_wrs_ss, "# of work requests (copied from scratch space)"); return (rc); } From owner-svn-src-all@freebsd.org Sat Dec 3 01:10:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEB08C634E9; Sat, 3 Dec 2016 01:10:46 +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 9DD5B1F6D; Sat, 3 Dec 2016 01:10:46 +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 uB31Ajs3021341; Sat, 3 Dec 2016 01:10:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB31AjkJ021340; Sat, 3 Dec 2016 01:10:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612030110.uB31AjkJ021340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 3 Dec 2016 01:10:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309459 - in stable: 10/sys/dev/cxgbe 11/sys/dev/cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 01:10:46 -0000 Author: jhb Date: Sat Dec 3 01:10:45 2016 New Revision: 309459 URL: https://svnweb.freebsd.org/changeset/base/309459 Log: MFC 303348: cxgbe(4): Initialize the adapter queues (fwq and mgmtq) instead of returning EAGAIN if they aren't available when the user tries to program a filter. Do this after validating the filter so that the driver doesn't bring up the queues if it doesn't have to. Modified: stable/10/sys/dev/cxgbe/t4_main.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/10/sys/dev/cxgbe/t4_main.c Sat Dec 3 01:04:59 2016 (r309458) +++ stable/10/sys/dev/cxgbe/t4_main.c Sat Dec 3 01:10:45 2016 (r309459) @@ -7818,11 +7818,6 @@ set_filter(struct adapter *sc, struct t4 goto done; } - if (!(sc->flags & FULL_INIT_DONE)) { - rc = EAGAIN; - goto done; - } - if (t->idx >= nfilters) { rc = EINVAL; goto done; @@ -7856,6 +7851,10 @@ set_filter(struct adapter *sc, struct t4 goto done; } + if (!(sc->flags & FULL_INIT_DONE) && + ((rc = adapter_full_init(sc)) != 0)) + goto done; + if (sc->tids.ftid_tab == NULL) { KASSERT(sc->tids.ftids_in_use == 0, ("%s: no memory allocated but filters_in_use > 0", From owner-svn-src-all@freebsd.org Sat Dec 3 01:10:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18C70C634F1; Sat, 3 Dec 2016 01:10:47 +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 D209F1F6E; Sat, 3 Dec 2016 01:10:46 +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 uB31AkhH021347; Sat, 3 Dec 2016 01:10:46 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB31AkE8021346; Sat, 3 Dec 2016 01:10:46 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201612030110.uB31AkE8021346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 3 Dec 2016 01:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309459 - in stable: 10/sys/dev/cxgbe 11/sys/dev/cxgbe X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 01:10:47 -0000 Author: jhb Date: Sat Dec 3 01:10:45 2016 New Revision: 309459 URL: https://svnweb.freebsd.org/changeset/base/309459 Log: MFC 303348: cxgbe(4): Initialize the adapter queues (fwq and mgmtq) instead of returning EAGAIN if they aren't available when the user tries to program a filter. Do this after validating the filter so that the driver doesn't bring up the queues if it doesn't have to. Modified: stable/11/sys/dev/cxgbe/t4_main.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/cxgbe/t4_main.c Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Sat Dec 3 01:04:59 2016 (r309458) +++ stable/11/sys/dev/cxgbe/t4_main.c Sat Dec 3 01:10:45 2016 (r309459) @@ -7960,11 +7960,6 @@ set_filter(struct adapter *sc, struct t4 goto done; } - if (!(sc->flags & FULL_INIT_DONE)) { - rc = EAGAIN; - goto done; - } - if (t->idx >= nfilters) { rc = EINVAL; goto done; @@ -7998,6 +7993,10 @@ set_filter(struct adapter *sc, struct t4 goto done; } + if (!(sc->flags & FULL_INIT_DONE) && + ((rc = adapter_full_init(sc)) != 0)) + goto done; + if (sc->tids.ftid_tab == NULL) { KASSERT(sc->tids.ftids_in_use == 0, ("%s: no memory allocated but filters_in_use > 0", From owner-svn-src-all@freebsd.org Sat Dec 3 01:14:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1773C637FB; Sat, 3 Dec 2016 01:14:22 +0000 (UTC) (envelope-from vangyzen@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 ABFC282E; Sat, 3 Dec 2016 01:14:22 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB31ELrH023261; Sat, 3 Dec 2016 01:14:21 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB31EL1P023258; Sat, 3 Dec 2016 01:14:21 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201612030114.uB31EL1P023258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Sat, 3 Dec 2016 01:14:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309460 - in head: lib/libc/sys share/man/man3 sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 01:14:22 -0000 Author: vangyzen Date: Sat Dec 3 01:14:21 2016 New Revision: 309460 URL: https://svnweb.freebsd.org/changeset/base/309460 Log: thr_set_name(): silently truncate the given name as needed Instead of failing with ENAMETOOLONG, which is swallowed by pthread_set_name_np() anyway, truncate the given name to MAXCOMLEN+1 bytes. This is more likely what the user wants, and saves the caller from truncating it before the call (which was the only recourse). Polish pthread_set_name_np(3) and add a .Xr to thr_set_name(2) so the user might find the documentation for this behavior. Reviewed by: jilles MFC after: 3 days Sponsored by: Dell EMC Modified: head/lib/libc/sys/thr_set_name.2 head/share/man/man3/pthread_set_name_np.3 head/sys/kern/kern_thr.c Modified: head/lib/libc/sys/thr_set_name.2 ============================================================================== --- head/lib/libc/sys/thr_set_name.2 Sat Dec 3 01:10:45 2016 (r309459) +++ head/lib/libc/sys/thr_set_name.2 Sat Dec 3 01:14:21 2016 (r309460) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 1, 2016 +.Dd December 2, 2016 .Dt THR_SET_NAME 2 .Os .Sh NAME @@ -43,37 +43,34 @@ .Sh DESCRIPTION The .Fn thr_set_name -sets the user-visible name for the kernel thread with the identifier +system call sets the user-visible name for the thread with the identifier .Va id -in the current process, to the NUL-terminated string +in the current process to the NUL-terminated string .Va name . +The name will be silently truncated to fit into a buffer of +.Dv MAXCOMLEN + 1 +bytes. The thread name can be seen in the output of the .Xr ps 1 and .Xr top 1 commands, in the kernel debuggers and kernel tracing facility outputs, -also in userland debuggers and program core files, as notes. +and in userland debuggers and program core files, as notes. .Sh RETURN VALUES If successful, .Fn thr_set_name -will return zero, otherwise \-1 is returned, and +returns zero; otherwise, \-1 is returned, and .Va errno is set to indicate the error. .Sh ERRORS The .Fn thr_set_name -operation may return the following errors: +system call may return the following errors: .Bl -tag -width Er .It Bq Er EFAULT The memory pointed to by the .Fa name argument is not valid. -.It Bq Er ENAMETOOLONG -The string pointed to by the -.Fa name -argument exceeds -.Dv MAXCOMLEN + 1 -bytes in length. .It Bq Er ESRCH The thread with the identifier .Fa id @@ -92,6 +89,6 @@ does not exist in the current process. .Xr ktr 9 .Sh STANDARDS The -.Fn thr_new -system call is non-standard and is used by +.Fn thr_set_name +system call is non-standard and is used by the .Lb libthr . Modified: head/share/man/man3/pthread_set_name_np.3 ============================================================================== --- head/share/man/man3/pthread_set_name_np.3 Sat Dec 3 01:10:45 2016 (r309459) +++ head/share/man/man3/pthread_set_name_np.3 Sat Dec 3 01:14:21 2016 (r309460) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2003 +.Dd December 2, 2016 .Dt PTHREAD_SET_NAME_NP 3 .Os .Sh NAME @@ -35,18 +35,19 @@ .Sh SYNOPSIS .In pthread_np.h .Ft void -.Fn pthread_set_name_np "pthread_t tid" "const char *name" +.Fn pthread_set_name_np "pthread_t thread" "const char *name" .Sh DESCRIPTION The .Fn pthread_set_name_np -function sets internal name for thread specified by -.Fa tid -argument to string value specified by +function applies a copy of the given .Fa name -argument. +to the given +.Fa thread . .Sh ERRORS Because of the debugging nature of this function, all errors that may appear inside are silently ignored. +.Sh SEE ALSO +.Xr thr_set_name 2 .Sh AUTHORS This manual page was written by .An Alexey Zelkin Aq Mt phantom@FreeBSD.org . Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Sat Dec 3 01:10:45 2016 (r309459) +++ head/sys/kern/kern_thr.c Sat Dec 3 01:14:21 2016 (r309460) @@ -578,8 +578,11 @@ sys_thr_set_name(struct thread *td, stru error = 0; name[0] = '\0'; if (uap->name != NULL) { - error = copyinstr(uap->name, name, sizeof(name), - NULL); + error = copyinstr(uap->name, name, sizeof(name), NULL); + if (error == ENAMETOOLONG) { + error = copyin(uap->name, name, sizeof(name) - 1); + name[sizeof(name) - 1] = '\0'; + } if (error) return (error); } From owner-svn-src-all@freebsd.org Sat Dec 3 01:55:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF23BC633A5; Sat, 3 Dec 2016 01:55:39 +0000 (UTC) (envelope-from loos@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 99DB01D8; Sat, 3 Dec 2016 01:55:39 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB31tc25039225; Sat, 3 Dec 2016 01:55:38 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB31tcUq039224; Sat, 3 Dec 2016 01:55:38 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201612030155.uB31tcUq039224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sat, 3 Dec 2016 01:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309461 - head/sys/dev/etherswitch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 01:55:39 -0000 Author: loos Date: Sat Dec 3 01:55:38 2016 New Revision: 309461 URL: https://svnweb.freebsd.org/changeset/base/309461 Log: Allow simultaneous access to switch device, there is no reason to prevent it. Remove bogus wrappers and use the kernel defaults. While here, use DEVMETHOD_END. Obtained from: pfSense MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/dev/etherswitch/etherswitch.c Modified: head/sys/dev/etherswitch/etherswitch.c ============================================================================== --- head/sys/dev/etherswitch/etherswitch.c Sat Dec 3 01:14:21 2016 (r309460) +++ head/sys/dev/etherswitch/etherswitch.c Sat Dec 3 01:55:38 2016 (r309461) @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -45,19 +44,11 @@ #include "etherswitch_if.h" -#define BUFSIZE 1024 - struct etherswitch_softc { device_t sc_dev; - int sc_count; - struct cdev *sc_devnode; - struct sx sc_lock; }; -#define SWITCH_LOCK(sc) sx_xlock(&(sc)->sc_lock) -#define SWITCH_UNLOCK(sc) sx_xunlock(&(sc)->sc_lock) - static int etherswitch_probe(device_t); static int etherswitch_attach(device_t); static int etherswitch_detach(device_t); @@ -72,7 +63,7 @@ static device_method_t etherswitch_metho DEVMETHOD(device_attach, etherswitch_attach), DEVMETHOD(device_detach, etherswitch_detach), - { 0, 0 } + DEVMETHOD_END }; driver_t etherswitch_driver = { @@ -81,19 +72,11 @@ driver_t etherswitch_driver = { sizeof(struct etherswitch_softc), }; -static d_open_t etherswitchopen; -static d_close_t etherswitchclose; -static d_write_t etherswitchwrite; -static d_read_t etherswitchread; static d_ioctl_t etherswitchioctl; static struct cdevsw etherswitch_cdevsw = { .d_version = D_VERSION, .d_flags = D_TRACKCLOSE, - .d_open = etherswitchopen, - .d_close = etherswitchclose, - .d_read = etherswitchread, - .d_write = etherswitchwrite, .d_ioctl = etherswitchioctl, .d_name = "etherswitch", }; @@ -119,13 +102,11 @@ etherswitch_attach(device_t dev) struct etherswitch_softc *sc = (struct etherswitch_softc *)device_get_softc(dev); sc->sc_dev = dev; - sx_init(&sc->sc_lock, "etherswitch"); sc->sc_devnode = make_dev(ðerswitch_cdevsw, device_get_unit(dev), UID_ROOT, GID_WHEEL, 0600, "etherswitch%d", device_get_unit(dev)); if (sc->sc_devnode == NULL) { device_printf(dev, "failed to create character device\n"); - sx_destroy(&sc->sc_lock); return (ENXIO); } sc->sc_devnode->si_drv1 = sc; @@ -140,61 +121,11 @@ etherswitch_detach(device_t dev) if (sc->sc_devnode) destroy_dev(sc->sc_devnode); - sx_destroy(&sc->sc_lock); - - return (0); -} - -static int -etherswitchopen(struct cdev *dev, int flags, int fmt, struct thread *td) -{ - struct etherswitch_softc *sc = dev->si_drv1; - - SWITCH_LOCK(sc); - if (sc->sc_count > 0) { - SWITCH_UNLOCK(sc); - return (EBUSY); - } - - sc->sc_count++; - SWITCH_UNLOCK(sc); - - return (0); -} - -static int -etherswitchclose(struct cdev *dev, int flags, int fmt, struct thread *td) -{ - struct etherswitch_softc *sc = dev->si_drv1; - - SWITCH_LOCK(sc); - if (sc->sc_count == 0) { - SWITCH_UNLOCK(sc); - return (EINVAL); - } - - sc->sc_count--; - - if (sc->sc_count < 0) - panic("%s: etherswitch_count < 0!", __func__); - SWITCH_UNLOCK(sc); return (0); } static int -etherswitchwrite(struct cdev *dev, struct uio * uio, int ioflag) -{ - return (EINVAL); -} - -static int -etherswitchread(struct cdev *dev, struct uio * uio, int ioflag) -{ - return (EINVAL); -} - -static int etherswitchioctl(struct cdev *cdev, u_long cmd, caddr_t data, int flags, struct thread *td) { struct etherswitch_softc *sc = cdev->si_drv1; From owner-svn-src-all@freebsd.org Sat Dec 3 02:09:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 648C7C63A14; Sat, 3 Dec 2016 02:09:24 +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 2E6C3A5C; Sat, 3 Dec 2016 02:09:24 +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 uB329NrU043255; Sat, 3 Dec 2016 02:09:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB329Ngb043254; Sat, 3 Dec 2016 02:09:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612030209.uB329Ngb043254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 02:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309462 - head/tests/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 02:09:24 -0000 Author: ngie Date: Sat Dec 3 02:09:23 2016 New Revision: 309462 URL: https://svnweb.freebsd.org/changeset/base/309462 Log: Fix test coredump_phnum_test:coredump_phnum require.config specification The requirement is set via `atf_set "require.config" "allow_sysctl_side_effects"', not `atf_set "require.config" "allow_sysctl_side_effects"' X-MFC with: r308177 Pointyhat to: cmeyer Modified: head/tests/sys/kern/coredump_phnum_test.sh Modified: head/tests/sys/kern/coredump_phnum_test.sh ============================================================================== --- head/tests/sys/kern/coredump_phnum_test.sh Sat Dec 3 01:55:38 2016 (r309461) +++ head/tests/sys/kern/coredump_phnum_test.sh Sat Dec 3 02:09:23 2016 (r309462) @@ -32,8 +32,8 @@ atf_test_case coredump_phnum cleanup coredump_phnum_head() { - atf_set "allow_sysctl_side_effects" "1" atf_set "descr" "More than 65534 segments" + atf_set "require.config" "allow_sysctl_side_effects" atf_set "require.progs" "readelf procstat" atf_set "require.user" "root" } From owner-svn-src-all@freebsd.org Sat Dec 3 02:17:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E57BC63080; Sat, 3 Dec 2016 02:17:51 +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 3E1B91079; Sat, 3 Dec 2016 02:17:51 +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 uB32HosN047390; Sat, 3 Dec 2016 02:17:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB32HoWZ047389; Sat, 3 Dec 2016 02:17:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612030217.uB32HoWZ047389@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 02:17:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309463 - head/tests/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 02:17:51 -0000 Author: ngie Date: Sat Dec 3 02:17:50 2016 New Revision: 309463 URL: https://svnweb.freebsd.org/changeset/base/309463 Log: Expect :coredump_phnum to fail The number of program headers on my system (GENERIC-NODEBUG) don't match the expected (hardcoded) number in the test PR: 215019 Modified: head/tests/sys/kern/coredump_phnum_test.sh Modified: head/tests/sys/kern/coredump_phnum_test.sh ============================================================================== --- head/tests/sys/kern/coredump_phnum_test.sh Sat Dec 3 02:09:23 2016 (r309462) +++ head/tests/sys/kern/coredump_phnum_test.sh Sat Dec 3 02:17:50 2016 (r309463) @@ -39,6 +39,8 @@ coredump_phnum_head() } coredump_phnum_body() { + atf_expect_fail "the value parsed doesn't always match the value obtained on the running system; bug # 215019" + # Set up core dumping cat > coredump_phnum_restore_state.sh <<-EOF #!/bin/sh From owner-svn-src-all@freebsd.org Sat Dec 3 02:24:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AF0CC634F9; Sat, 3 Dec 2016 02:24:16 +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 5AB86166F; Sat, 3 Dec 2016 02:24:16 +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 uB32OFTK051360; Sat, 3 Dec 2016 02:24:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB32OFLd051359; Sat, 3 Dec 2016 02:24:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612030224.uB32OFLd051359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 02:24:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309464 - head/tests/sys/acl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 02:24:16 -0000 Author: ngie Date: Sat Dec 3 02:24:15 2016 New Revision: 309464 URL: https://svnweb.freebsd.org/changeset/base/309464 Log: Expect 01:main to fail Changes were made to ZFS in the past year with respect to how ACLs are handled, causing failures in this test. Mark it TODO so (hopefully) someone more knowledgeable (like mav or trasz) will fix the code or the test. PR: 212323 Modified: head/tests/sys/acl/01.sh Modified: head/tests/sys/acl/01.sh ============================================================================== --- head/tests/sys/acl/01.sh Sat Dec 3 02:17:50 2016 (r309463) +++ head/tests/sys/acl/01.sh Sat Dec 3 02:24:15 2016 (r309464) @@ -81,7 +81,7 @@ perl $TESTDIR/run $TESTDIR/tools-nfs4-ps if [ $? -eq 0 ]; then echo "ok 3" else - echo "not ok 3" + echo "not ok 3 # TODO: fails due to ACL changes in ZFS; bug 212323" fi echo "ok 4" From owner-svn-src-all@freebsd.org Sat Dec 3 02:45:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB26DC63314; Sat, 3 Dec 2016 02:45:19 +0000 (UTC) (envelope-from adrian@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 B5CE23F9; Sat, 3 Dec 2016 02:45:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB32jIhS059275; Sat, 3 Dec 2016 02:45:18 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB32jI4L059273; Sat, 3 Dec 2016 02:45:18 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201612030245.uB32jI4L059273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 3 Dec 2016 02:45:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309465 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 02:45:20 -0000 Author: adrian Date: Sat Dec 3 02:45:18 2016 New Revision: 309465 URL: https://svnweb.freebsd.org/changeset/base/309465 Log: [net80211] prepare for 11ac aware NICs that want to know per-vdev channel and centre frequencies. * ic_freq is the centre of the primary channel, not the centre of the HT40/HT80/etc channel. Add a method to access that. * Add a method to access the centre of the primary channel, including knowing the centre of the 5/10/20/40/80, versus the primary channel. Ie, it's the centre of the 40, 80, 160MHz channel. * Add a method to access the centre frequency of the secondary 80MHz channel - we don't support VHT yet, but when we do. * Add methods to access the current channel and the per-dev desired channel. Ideally drivers that do full offload with a per-vap channel configuration should use the vap channel, NOT ic_curchan. Non-offload drivers that require net80211 to change the channel should be accessing ic_curchan. Modified: head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Sat Dec 3 02:24:15 2016 (r309464) +++ head/sys/net80211/ieee80211.c Sat Dec 3 02:45:18 2016 (r309465) @@ -1170,6 +1170,53 @@ ieee80211_add_channel_ht40(struct ieee80 } /* + * Fetch the center frequency for the primary channel. + */ +uint32_t +ieee80211_get_channel_center_freq(const struct ieee80211_channel *c) +{ + + return (c->ic_freq); +} + +/* + * Fetch the center frequency for the primary BAND channel. + * + * For 5, 10, 20MHz channels it'll be the normally configured channel + * frequency. + * + * For 40MHz, 80MHz, 160Mhz channels it'll the the centre of the + * wide channel, not the centre of the primary channel (that's ic_freq). + * + * For 80+80MHz channels this will be the centre of the primary + * 80MHz channel; the secondary 80MHz channel will be center_freq2(). + */ + +uint32_t +ieee80211_get_channel_center_freq1(const struct ieee80211_channel *c) +{ + + if (IEEE80211_IS_CHAN_HT40U(c)) { + return (c->ic_freq + 10); + } + if (IEEE80211_IS_CHAN_HT40D(c)) { + return (c->ic_freq - 10); + } + + return (c->ic_freq); +} + +/* + * For now, no 80+80 support; this is zero. + */ +uint32_t +ieee80211_get_channel_center_freq2(const struct ieee80211_channel *c) +{ + + return (0); +} + +/* * Adds channels into specified channel list (ieee[] array must be sorted). * Channels are already sorted. */ Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Sat Dec 3 02:24:15 2016 (r309464) +++ head/sys/net80211/ieee80211_var.h Sat Dec 3 02:45:18 2016 (r309465) @@ -668,6 +668,9 @@ int ieee80211_add_channel(struct ieee802 uint8_t, uint16_t, int8_t, uint32_t, const uint8_t[]); int ieee80211_add_channel_ht40(struct ieee80211_channel[], int, int *, uint8_t, int8_t, uint32_t); +uint32_t ieee80211_get_channel_center_freq(const struct ieee80211_channel *); +uint32_t ieee80211_get_channel_center_freq1(const struct ieee80211_channel *); +uint32_t ieee80211_get_channel_center_freq2(const struct ieee80211_channel *); int ieee80211_add_channel_list_2ghz(struct ieee80211_channel[], int, int *, const uint8_t[], int, const uint8_t[], int); int ieee80211_add_channel_list_5ghz(struct ieee80211_channel[], int, int *, @@ -684,6 +687,10 @@ uint32_t ieee80211_mac_hash(const struct const uint8_t addr[IEEE80211_ADDR_LEN]); char ieee80211_channel_type_char(const struct ieee80211_channel *c); +#define ieee80211_get_current_channel(_ic) ((_ic)->ic_curchan) +#define ieee80211_get_home_channel(_ic) ((_ic)->ic_bsschan) +#define ieee80211_get_vap_desired_channel(_iv) ((_iv)->iv_des_chan) + void ieee80211_radiotap_attach(struct ieee80211com *, struct ieee80211_radiotap_header *th, int tlen, uint32_t tx_radiotap, From owner-svn-src-all@freebsd.org Sat Dec 3 02:47:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B2AAC63487; Sat, 3 Dec 2016 02:47:43 +0000 (UTC) (envelope-from adrian@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 C68C19A6; Sat, 3 Dec 2016 02:47:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB32lflw059450; Sat, 3 Dec 2016 02:47:41 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB32lfin059449; Sat, 3 Dec 2016 02:47:41 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201612030247.uB32lfin059449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 3 Dec 2016 02:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309467 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 02:47:43 -0000 Author: adrian Date: Sat Dec 3 02:47:41 2016 New Revision: 309467 URL: https://svnweb.freebsd.org/changeset/base/309467 Log: [ath] use the correct AMPDU frame limit for the given node, rather than the global config. This is important in hostap, ibss, (11s at some magical future date, etc) where different nodes may have smaller limits. Oops! MFC after: 1 week Relnotes: Yes Modified: head/sys/dev/ath/if_ath_tx_ht.c Modified: head/sys/dev/ath/if_ath_tx_ht.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_ht.c Sat Dec 3 02:47:16 2016 (r309466) +++ head/sys/dev/ath/if_ath_tx_ht.c Sat Dec 3 02:47:41 2016 (r309467) @@ -529,6 +529,29 @@ ath_compute_num_delims(struct ath_softc } /* + * XXX TODO: put into net80211 + */ +static int +ath_rx_ampdu_to_byte(char a) +{ + switch (a) { + case IEEE80211_HTCAP_MAXRXAMPDU_16K: + return 16384; + break; + case IEEE80211_HTCAP_MAXRXAMPDU_32K: + return 32768; + break; + case IEEE80211_HTCAP_MAXRXAMPDU_64K: + return 65536; + break; + case IEEE80211_HTCAP_MAXRXAMPDU_8K: + default: + return 8192; + break; + } +} + +/* * Fetch the aggregation limit. * * It's the lowest of the four rate series 4ms frame length. @@ -540,6 +563,8 @@ static int ath_get_aggr_limit(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf *bf) { + struct ieee80211vap *vap = ni->ni_vap; + #define MS(_v, _f) (((_v) & _f) >> _f##_S) int amin = ATH_AGGR_MAXSIZE; int i; @@ -548,25 +573,15 @@ ath_get_aggr_limit(struct ath_softc *sc, if (sc->sc_aggr_limit > 0 && sc->sc_aggr_limit < ATH_AGGR_MAXSIZE) amin = sc->sc_aggr_limit; + /* Check the vap configured transmit limit */ + amin = MIN(amin, ath_rx_ampdu_to_byte(vap->iv_ampdu_limit)); + /* * Check the HTCAP field for the maximum size the node has * negotiated. If it's smaller than what we have, cap it there. */ - switch (MS(ni->ni_htparam, IEEE80211_HTCAP_MAXRXAMPDU)) { - case IEEE80211_HTCAP_MAXRXAMPDU_16K: - amin = MIN(amin, 16384); - break; - case IEEE80211_HTCAP_MAXRXAMPDU_32K: - amin = MIN(amin, 32768); - break; - case IEEE80211_HTCAP_MAXRXAMPDU_64K: - amin = MIN(amin, 65536); - break; - case IEEE80211_HTCAP_MAXRXAMPDU_8K: - default: - amin = MIN(amin, 8192); - break; - } + amin = MIN(amin, ath_rx_ampdu_to_byte(MS(ni->ni_htparam, + IEEE80211_HTCAP_MAXRXAMPDU))); for (i = 0; i < ATH_RC_NUM; i++) { if (bf->bf_state.bfs_rc[i].tries == 0) From owner-svn-src-all@freebsd.org Sat Dec 3 02:47:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACDC7C633FE; Sat, 3 Dec 2016 02:47:18 +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 5108683F; Sat, 3 Dec 2016 02:47:18 +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 uB32lHAU059394; Sat, 3 Dec 2016 02:47:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB32lGtU059384; Sat, 3 Dec 2016 02:47:16 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612030247.uB32lGtU059384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 02:47:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309466 - in stable/11: bin/cat/tests contrib/netbsd-tests contrib/netbsd-tests/bin/cat contrib/netbsd-tests/bin/sh contrib/netbsd-tests/bin/sh/dotcmd contrib/netbsd-tests/crypto/opencr... X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 02:47:18 -0000 Author: ngie Date: Sat Dec 3 02:47:16 2016 New Revision: 309466 URL: https://svnweb.freebsd.org/changeset/base/309466 Log: MFC r305358: Update contrib/netbsd-tests with new content from NetBSD This updates the snapshot from 09/30/2014 to 08/11/2016 This brings in a number of new testcases from upstream, most notably: - bin/cat - lib/libc - lib/msun - lib/libthr - usr.bin/sort lib/libc/tests/stdio/open_memstream_test.c was moved to lib/libc/tests/stdio/open_memstream2_test.c to accomodate the new open_memstream test from NetBSD. Tested on: amd64 (VMware fusion VM; various bare metal platforms); i386 (VMware fusion VM); make tinderbox Added: stable/11/contrib/netbsd-tests/bin/cat/d_se_output.in - copied unchanged from r305358, head/contrib/netbsd-tests/bin/cat/d_se_output.in stable/11/contrib/netbsd-tests/bin/cat/d_se_output.out - copied unchanged from r305358, head/contrib/netbsd-tests/bin/cat/d_se_output.out stable/11/contrib/netbsd-tests/bin/sh/t_arith.sh - copied unchanged from r305358, head/contrib/netbsd-tests/bin/sh/t_arith.sh stable/11/contrib/netbsd-tests/bin/sh/t_cmdsub.sh - copied unchanged from r305358, head/contrib/netbsd-tests/bin/sh/t_cmdsub.sh stable/11/contrib/netbsd-tests/bin/sh/t_option.sh - copied unchanged from r305358, head/contrib/netbsd-tests/bin/sh/t_option.sh stable/11/contrib/netbsd-tests/bin/sh/t_redir.sh - copied unchanged from r305358, head/contrib/netbsd-tests/bin/sh/t_redir.sh stable/11/contrib/netbsd-tests/bin/sh/t_redircloexec.sh - copied unchanged from r305358, head/contrib/netbsd-tests/bin/sh/t_redircloexec.sh stable/11/contrib/netbsd-tests/bin/sh/t_shift.sh - copied unchanged from r305358, head/contrib/netbsd-tests/bin/sh/t_shift.sh stable/11/contrib/netbsd-tests/bin/sh/t_varval.sh - copied unchanged from r305358, head/contrib/netbsd-tests/bin/sh/t_varval.sh stable/11/contrib/netbsd-tests/dev/fss/ - copied from r305358, head/contrib/netbsd-tests/dev/fss/ stable/11/contrib/netbsd-tests/dev/usb/ - copied from r305358, head/contrib/netbsd-tests/dev/usb/ stable/11/contrib/netbsd-tests/include/sys/t_pslist.c - copied unchanged from r305358, head/contrib/netbsd-tests/include/sys/t_pslist.c stable/11/contrib/netbsd-tests/kernel/kqueue/t_vnode.c - copied unchanged from r305358, head/contrib/netbsd-tests/kernel/kqueue/t_vnode.c stable/11/contrib/netbsd-tests/lib/libc/db/h_lfsr.c - copied unchanged from r305358, head/contrib/netbsd-tests/lib/libc/db/h_lfsr.c stable/11/contrib/netbsd-tests/lib/libc/db/t_db_hash_seq.c - copied unchanged from r305358, head/contrib/netbsd-tests/lib/libc/db/t_db_hash_seq.c stable/11/contrib/netbsd-tests/lib/libc/inet/t_inet_addr.c - copied unchanged from r305358, head/contrib/netbsd-tests/lib/libc/inet/t_inet_addr.c stable/11/contrib/netbsd-tests/lib/libc/stdio/t_open_memstream.c - copied unchanged from r305358, head/contrib/netbsd-tests/lib/libc/stdio/t_open_memstream.c stable/11/contrib/netbsd-tests/lib/libc/stdlib/t_strtoi.c - copied unchanged from r305358, head/contrib/netbsd-tests/lib/libc/stdlib/t_strtoi.c stable/11/contrib/netbsd-tests/lib/libc/sync/cpp_atomic_ops_linkable.cc - copied unchanged from r305358, head/contrib/netbsd-tests/lib/libc/sync/cpp_atomic_ops_linkable.cc stable/11/contrib/netbsd-tests/lib/libc/sys/t_bind.c - copied unchanged from r305358, head/contrib/netbsd-tests/lib/libc/sys/t_bind.c stable/11/contrib/netbsd-tests/lib/libc/sys/t_getsockname.c - copied unchanged from r305358, head/contrib/netbsd-tests/lib/libc/sys/t_getsockname.c stable/11/contrib/netbsd-tests/lib/libc/sys/t_posix_fallocate.c - copied unchanged from r305358, head/contrib/netbsd-tests/lib/libc/sys/t_posix_fallocate.c stable/11/contrib/netbsd-tests/lib/libc/sys/t_wait.c - copied unchanged from r305358, head/contrib/netbsd-tests/lib/libc/sys/t_wait.c stable/11/contrib/netbsd-tests/lib/libm/t_fenv.c - copied unchanged from r305358, head/contrib/netbsd-tests/lib/libm/t_fenv.c stable/11/contrib/netbsd-tests/lib/libm/t_hypot.c - copied unchanged from r305358, head/contrib/netbsd-tests/lib/libm/t_hypot.c stable/11/contrib/netbsd-tests/lib/libusbhid/ - copied from r305358, head/contrib/netbsd-tests/lib/libusbhid/ stable/11/contrib/netbsd-tests/net/arp/ - copied from r305358, head/contrib/netbsd-tests/net/arp/ stable/11/contrib/netbsd-tests/net/icmp/t_icmp6_redirect.sh - copied unchanged from r305358, head/contrib/netbsd-tests/net/icmp/t_icmp6_redirect.sh stable/11/contrib/netbsd-tests/net/icmp/t_icmp_redirect.sh - copied unchanged from r305358, head/contrib/netbsd-tests/net/icmp/t_icmp_redirect.sh stable/11/contrib/netbsd-tests/net/if/ifconf.c - copied unchanged from r305358, head/contrib/netbsd-tests/net/if/ifconf.c stable/11/contrib/netbsd-tests/net/if/t_ifconf.sh - copied unchanged from r305358, head/contrib/netbsd-tests/net/if/t_ifconf.sh stable/11/contrib/netbsd-tests/net/if/t_ifconfig.sh - copied unchanged from r305358, head/contrib/netbsd-tests/net/if/t_ifconfig.sh stable/11/contrib/netbsd-tests/net/if_gif/ - copied from r305358, head/contrib/netbsd-tests/net/if_gif/ stable/11/contrib/netbsd-tests/net/if_pppoe/ - copied from r305358, head/contrib/netbsd-tests/net/if_pppoe/ stable/11/contrib/netbsd-tests/net/if_tap/ - copied from r305358, head/contrib/netbsd-tests/net/if_tap/ stable/11/contrib/netbsd-tests/net/in_cksum/ - copied from r305358, head/contrib/netbsd-tests/net/in_cksum/ stable/11/contrib/netbsd-tests/net/mcast/ - copied from r305358, head/contrib/netbsd-tests/net/mcast/ stable/11/contrib/netbsd-tests/net/mpls/t_mpls_fw6.sh - copied unchanged from r305358, head/contrib/netbsd-tests/net/mpls/t_mpls_fw6.sh stable/11/contrib/netbsd-tests/net/mpls/t_mpls_fw64.sh - copied unchanged from r305358, head/contrib/netbsd-tests/net/mpls/t_mpls_fw64.sh stable/11/contrib/netbsd-tests/net/ndp/ - copied from r305358, head/contrib/netbsd-tests/net/ndp/ stable/11/contrib/netbsd-tests/net/net/t_forwarding.sh - copied unchanged from r305358, head/contrib/netbsd-tests/net/net/t_forwarding.sh stable/11/contrib/netbsd-tests/net/net/t_ipaddress.sh - copied unchanged from r305358, head/contrib/netbsd-tests/net/net/t_ipaddress.sh stable/11/contrib/netbsd-tests/net/net/t_ipv6_lifetime.sh - copied unchanged from r305358, head/contrib/netbsd-tests/net/net/t_ipv6_lifetime.sh stable/11/contrib/netbsd-tests/net/net/t_ipv6address.sh - copied unchanged from r305358, head/contrib/netbsd-tests/net/net/t_ipv6address.sh stable/11/contrib/netbsd-tests/net/route/t_flags.sh - copied unchanged from r305358, head/contrib/netbsd-tests/net/route/t_flags.sh stable/11/contrib/netbsd-tests/net/route/t_flags6.sh - copied unchanged from r305358, head/contrib/netbsd-tests/net/route/t_flags6.sh stable/11/contrib/netbsd-tests/net/route/t_route.sh - copied unchanged from r305358, head/contrib/netbsd-tests/net/route/t_route.sh stable/11/contrib/netbsd-tests/sbin/gpt/ - copied from r305358, head/contrib/netbsd-tests/sbin/gpt/ stable/11/contrib/netbsd-tests/sbin/resize_ffs/t_check.sh - copied unchanged from r305358, head/contrib/netbsd-tests/sbin/resize_ffs/t_check.sh stable/11/contrib/netbsd-tests/sys/net/ - copied from r305358, head/contrib/netbsd-tests/sys/net/ stable/11/contrib/netbsd-tests/sys/netatalk/ - copied from r305358, head/contrib/netbsd-tests/sys/netatalk/ stable/11/contrib/netbsd-tests/sys/netinet/ - copied from r305358, head/contrib/netbsd-tests/sys/netinet/ stable/11/contrib/netbsd-tests/sys/netinet6/ - copied from r305358, head/contrib/netbsd-tests/sys/netinet6/ stable/11/contrib/netbsd-tests/usr.bin/config/d_min - copied unchanged from r305358, head/contrib/netbsd-tests/usr.bin/config/d_min stable/11/contrib/netbsd-tests/usr.bin/gdb/ - copied from r305358, head/contrib/netbsd-tests/usr.bin/gdb/ stable/11/contrib/netbsd-tests/usr.bin/ld/ - copied from r305358, head/contrib/netbsd-tests/usr.bin/ld/ stable/11/contrib/netbsd-tests/usr.bin/netpgpverify/Testspec - copied unchanged from r305358, head/contrib/netbsd-tests/usr.bin/netpgpverify/Testspec stable/11/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_anon_struct.c - copied unchanged from r305358, head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_anon_struct.c stable/11/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_compound_literal_comma.c - copied unchanged from r305358, head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_compound_literal_comma.c stable/11/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_flex_array_packed.c - copied unchanged from r305358, head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_flex_array_packed.c stable/11/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_nested_struct.c - copied unchanged from r305358, head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_nested_struct.c stable/11/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_union_init4.c - copied unchanged from r305358, head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_c99_union_init4.c stable/11/contrib/netbsd-tests/usr.bin/xlint/lint1/d_cast_fun_array_param.c - copied unchanged from r305358, head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_cast_fun_array_param.c stable/11/contrib/netbsd-tests/usr.bin/xlint/lint1/d_type_question_colon.c - copied unchanged from r305358, head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_type_question_colon.c stable/11/contrib/netbsd-tests/usr.bin/xlint/lint1/d_typefun.c - copied unchanged from r305358, head/contrib/netbsd-tests/usr.bin/xlint/lint1/d_typefun.c stable/11/lib/libc/tests/stdio/open_memstream2_test.c - copied unchanged from r305358, head/lib/libc/tests/stdio/open_memstream2_test.c Deleted: stable/11/contrib/netbsd-tests/bin/sh/t_compexit.sh stable/11/contrib/netbsd-tests/fs/nfs/nfsservice/mountd.c stable/11/contrib/netbsd-tests/fs/nfs/nfsservice/nfsd.c stable/11/lib/libc/tests/stdio/open_memstream_test.c Modified: stable/11/bin/cat/tests/Makefile stable/11/contrib/netbsd-tests/bin/cat/d_align.in stable/11/contrib/netbsd-tests/bin/cat/d_align.out stable/11/contrib/netbsd-tests/bin/cat/t_cat.sh stable/11/contrib/netbsd-tests/bin/sh/dotcmd/scoped_command stable/11/contrib/netbsd-tests/bin/sh/dotcmd/t_dotcmd.sh stable/11/contrib/netbsd-tests/bin/sh/t_evaltested.sh stable/11/contrib/netbsd-tests/bin/sh/t_exit.sh stable/11/contrib/netbsd-tests/bin/sh/t_expand.sh stable/11/contrib/netbsd-tests/bin/sh/t_fsplit.sh stable/11/contrib/netbsd-tests/bin/sh/t_here.sh stable/11/contrib/netbsd-tests/bin/sh/t_set_e.sh stable/11/contrib/netbsd-tests/bin/sh/t_ulimit.sh stable/11/contrib/netbsd-tests/bin/sh/t_varquote.sh stable/11/contrib/netbsd-tests/bin/sh/t_wait.sh stable/11/contrib/netbsd-tests/crypto/opencrypto/t_opencrypto.sh stable/11/contrib/netbsd-tests/dev/audio/t_pad_output.bz2.uue stable/11/contrib/netbsd-tests/dev/dm/h_dm.c stable/11/contrib/netbsd-tests/dev/sysmon/t_swsensor.sh stable/11/contrib/netbsd-tests/dev/sysmon/t_swwdog.c stable/11/contrib/netbsd-tests/fs/common/fstest_lfs.c stable/11/contrib/netbsd-tests/fs/common/h_fsmacros.h stable/11/contrib/netbsd-tests/fs/nfs/nfsservice/rumpnfsd.c stable/11/contrib/netbsd-tests/fs/nfs/t_rquotad.sh stable/11/contrib/netbsd-tests/fs/tmpfs/t_vnd.sh stable/11/contrib/netbsd-tests/fs/vfs/t_io.c stable/11/contrib/netbsd-tests/fs/vfs/t_renamerace.c stable/11/contrib/netbsd-tests/fs/vfs/t_unpriv.c stable/11/contrib/netbsd-tests/fs/vfs/t_vnops.c stable/11/contrib/netbsd-tests/games/t_factor.sh stable/11/contrib/netbsd-tests/h_macros.h stable/11/contrib/netbsd-tests/include/sys/t_bitops.c stable/11/contrib/netbsd-tests/include/sys/t_cdefs.c stable/11/contrib/netbsd-tests/include/sys/t_socket.c stable/11/contrib/netbsd-tests/include/t_paths.c stable/11/contrib/netbsd-tests/ipf/expected/n14 stable/11/contrib/netbsd-tests/ipf/expected/n14_6 stable/11/contrib/netbsd-tests/ipf/t_filter_parse.sh stable/11/contrib/netbsd-tests/ipf/t_nat_exec.sh stable/11/contrib/netbsd-tests/kernel/kqueue/t_ioctl.c stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc1.c stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc2.c stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc3.c stable/11/contrib/netbsd-tests/kernel/t_rnd.c stable/11/contrib/netbsd-tests/lib/libbpfjit/t_bpfjit.c stable/11/contrib/netbsd-tests/lib/libc/arch/ia64/return_one.S stable/11/contrib/netbsd-tests/lib/libc/arch/powerpc/return_one.S stable/11/contrib/netbsd-tests/lib/libc/arch/riscv/return_one.S stable/11/contrib/netbsd-tests/lib/libc/db/t_db.sh stable/11/contrib/netbsd-tests/lib/libc/gen/execve/t_execve.c stable/11/contrib/netbsd-tests/lib/libc/gen/isqemu.h stable/11/contrib/netbsd-tests/lib/libc/gen/posix_spawn/t_spawn.c stable/11/contrib/netbsd-tests/lib/libc/gen/t_fnmatch.c stable/11/contrib/netbsd-tests/lib/libc/gen/t_fpsetmask.c stable/11/contrib/netbsd-tests/lib/libc/gen/t_randomid.c stable/11/contrib/netbsd-tests/lib/libc/gen/t_siginfo.c stable/11/contrib/netbsd-tests/lib/libc/gen/t_sleep.c stable/11/contrib/netbsd-tests/lib/libc/gen/t_time.c stable/11/contrib/netbsd-tests/lib/libc/gen/t_vis.c stable/11/contrib/netbsd-tests/lib/libc/inet/t_inet_network.c stable/11/contrib/netbsd-tests/lib/libc/net/t_servent.sh stable/11/contrib/netbsd-tests/lib/libc/rpc/t_rpc.c stable/11/contrib/netbsd-tests/lib/libc/stdlib/t_getenv.c stable/11/contrib/netbsd-tests/lib/libc/stdlib/t_posix_memalign.c stable/11/contrib/netbsd-tests/lib/libc/stdlib/t_strtod.c stable/11/contrib/netbsd-tests/lib/libc/stdlib/t_strtol.c stable/11/contrib/netbsd-tests/lib/libc/string/t_memset.c stable/11/contrib/netbsd-tests/lib/libc/sys/t_connect.c stable/11/contrib/netbsd-tests/lib/libc/sys/t_getrusage.c stable/11/contrib/netbsd-tests/lib/libc/sys/t_kevent.c stable/11/contrib/netbsd-tests/lib/libc/sys/t_mlock.c stable/11/contrib/netbsd-tests/lib/libc/sys/t_mmap.c stable/11/contrib/netbsd-tests/lib/libc/sys/t_mprotect.c stable/11/contrib/netbsd-tests/lib/libc/sys/t_setrlimit.c stable/11/contrib/netbsd-tests/lib/libc/sys/t_sigqueue.c stable/11/contrib/netbsd-tests/lib/libc/time/t_strptime.c stable/11/contrib/netbsd-tests/lib/libcurses/director/testlang_parse.y stable/11/contrib/netbsd-tests/lib/libm/t_exp.c stable/11/contrib/netbsd-tests/lib/libm/t_fmod.c stable/11/contrib/netbsd-tests/lib/libm/t_log.c stable/11/contrib/netbsd-tests/lib/libm/t_pow.c stable/11/contrib/netbsd-tests/lib/libpthread/t_cond.c stable/11/contrib/netbsd-tests/lib/libpthread/t_mutex.c stable/11/contrib/netbsd-tests/lib/libpthread/t_rwlock.c stable/11/contrib/netbsd-tests/lib/librumpclient/t_exec.sh stable/11/contrib/netbsd-tests/lib/librumpclient/t_fd.c stable/11/contrib/netbsd-tests/lib/librumphijack/t_tcpip.sh stable/11/contrib/netbsd-tests/lib/libutil/t_parsedate.c stable/11/contrib/netbsd-tests/net/bpfilter/t_bpfilter.c stable/11/contrib/netbsd-tests/net/bpfjit/t_bpfjit.c stable/11/contrib/netbsd-tests/net/icmp/t_forward.c stable/11/contrib/netbsd-tests/net/icmp/t_ping.c stable/11/contrib/netbsd-tests/net/icmp/t_ping2.sh stable/11/contrib/netbsd-tests/net/if_bridge/t_bridge.sh stable/11/contrib/netbsd-tests/net/mpls/t_ldp_regen.sh stable/11/contrib/netbsd-tests/net/mpls/t_mpls_fw.sh stable/11/contrib/netbsd-tests/net/mpls/t_rfc4182.sh stable/11/contrib/netbsd-tests/net/net/t_tcp.c stable/11/contrib/netbsd-tests/net/route/t_change.sh stable/11/contrib/netbsd-tests/rump/modautoload/t_modautoload.c stable/11/contrib/netbsd-tests/rump/rumpkern/h_server/h_simpleserver.c stable/11/contrib/netbsd-tests/rump/rumpkern/t_lwproc.c stable/11/contrib/netbsd-tests/rump/rumpkern/t_sp.sh stable/11/contrib/netbsd-tests/rump/rumpnet/t_shmif.sh stable/11/contrib/netbsd-tests/rump/rumpvfs/t_p2kifs.c stable/11/contrib/netbsd-tests/sbin/resize_ffs/common.sh stable/11/contrib/netbsd-tests/sbin/resize_ffs/t_grow.sh stable/11/contrib/netbsd-tests/sbin/resize_ffs/t_grow_swapped.sh stable/11/contrib/netbsd-tests/sbin/resize_ffs/t_shrink.sh stable/11/contrib/netbsd-tests/sbin/resize_ffs/t_shrink_swapped.sh stable/11/contrib/netbsd-tests/sbin/sysctl/t_perm.sh stable/11/contrib/netbsd-tests/share/mk/t_lib.sh stable/11/contrib/netbsd-tests/share/mk/t_prog.sh stable/11/contrib/netbsd-tests/share/mk/t_test.sh stable/11/contrib/netbsd-tests/usr.bin/cc/t_hello.sh stable/11/contrib/netbsd-tests/usr.bin/config/support/conf/files stable/11/contrib/netbsd-tests/usr.bin/config/t_config.sh stable/11/contrib/netbsd-tests/usr.bin/make/t_make.sh stable/11/contrib/netbsd-tests/usr.bin/netpgpverify/t_netpgpverify.sh stable/11/contrib/netbsd-tests/usr.bin/sed/t_sed.sh stable/11/contrib/netbsd-tests/usr.bin/sort/d_any_char_dflag_out.txt (contents, props changed) stable/11/contrib/netbsd-tests/usr.bin/sort/d_any_char_fflag_out.txt (contents, props changed) stable/11/contrib/netbsd-tests/usr.bin/sort/d_any_char_iflag_out.txt (contents, props changed) stable/11/contrib/netbsd-tests/usr.sbin/traceroute/t_traceroute.sh stable/11/lib/libc/tests/db/Makefile stable/11/lib/libc/tests/hash/Makefile stable/11/lib/libc/tests/inet/Makefile stable/11/lib/libc/tests/stdio/Makefile stable/11/lib/libc/tests/stdlib/Makefile stable/11/lib/libc/tests/sys/Makefile stable/11/lib/msun/tests/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/cat/tests/Makefile ============================================================================== --- stable/11/bin/cat/tests/Makefile Sat Dec 3 02:45:18 2016 (r309465) +++ stable/11/bin/cat/tests/Makefile Sat Dec 3 02:47:16 2016 (r309466) @@ -6,7 +6,15 @@ NETBSD_ATF_TESTS_SH= cat_test ${PACKAGE}FILES+= d_align.in ${PACKAGE}FILES+= d_align.out +${PACKAGE}FILES+= d_se_output.in +${PACKAGE}FILES+= d_se_output.out .include +d_align.out: ${TESTSRC}/d_align.out + sed -E -e 's,^[[:space:]]{7}\$$$$,\$$,' < ${.ALLSRC} > ${.TARGET}.tmp + mv ${.TARGET}.tmp ${.TARGET} + +CLEANFILES+= d_align.out d_align.out.tmp + .include Modified: stable/11/contrib/netbsd-tests/bin/cat/d_align.in ============================================================================== --- stable/11/contrib/netbsd-tests/bin/cat/d_align.in Sat Dec 3 02:45:18 2016 (r309465) +++ stable/11/contrib/netbsd-tests/bin/cat/d_align.in Sat Dec 3 02:47:16 2016 (r309466) @@ -1,3 +1,5 @@ a b c + 1 2 3 + x y z Modified: stable/11/contrib/netbsd-tests/bin/cat/d_align.out ============================================================================== --- stable/11/contrib/netbsd-tests/bin/cat/d_align.out Sat Dec 3 02:45:18 2016 (r309465) +++ stable/11/contrib/netbsd-tests/bin/cat/d_align.out Sat Dec 3 02:47:16 2016 (r309466) @@ -1,3 +1,5 @@ 1 a b c$ + $ 2 1 2 3$ + $ 3 x y z$ Copied: stable/11/contrib/netbsd-tests/bin/cat/d_se_output.in (from r305358, head/contrib/netbsd-tests/bin/cat/d_se_output.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/netbsd-tests/bin/cat/d_se_output.in Sat Dec 3 02:47:16 2016 (r309466, copy of r305358, head/contrib/netbsd-tests/bin/cat/d_se_output.in) @@ -0,0 +1,3 @@ + +Of course it runs NetBSD + Copied: stable/11/contrib/netbsd-tests/bin/cat/d_se_output.out (from r305358, head/contrib/netbsd-tests/bin/cat/d_se_output.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/netbsd-tests/bin/cat/d_se_output.out Sat Dec 3 02:47:16 2016 (r309466, copy of r305358, head/contrib/netbsd-tests/bin/cat/d_se_output.out) @@ -0,0 +1,3 @@ +$ +Of course it runs NetBSD$ +$ Modified: stable/11/contrib/netbsd-tests/bin/cat/t_cat.sh ============================================================================== --- stable/11/contrib/netbsd-tests/bin/cat/t_cat.sh Sat Dec 3 02:45:18 2016 (r309465) +++ stable/11/contrib/netbsd-tests/bin/cat/t_cat.sh Sat Dec 3 02:47:16 2016 (r309466) @@ -1,4 +1,4 @@ -# $NetBSD: t_cat.sh,v 1.2 2012/03/27 17:57:02 jruoho Exp $ +# $NetBSD: t_cat.sh,v 1.3 2016/06/16 01:04:58 sevan Exp $ # # Copyright (c) 2012 The NetBSD Foundation, Inc. # All rights reserved. @@ -52,8 +52,20 @@ nonexistent_body() { -x "cat /some/name/that/does/not/exist" } +atf_test_case se_output +se_output_head() { + atf_set "descr" "Test that cat(1) prints a $ sign " \ + "on blank lines with options '-se' (PR bin/51250)" +} + +se_output_body() { + atf_check -s ignore -o file:$(atf_get_srcdir)/d_se_output.out \ + -x "cat -se $(atf_get_srcdir)/d_se_output.in" +} + atf_init_test_cases() { atf_add_test_case align atf_add_test_case nonexistent + atf_add_test_case se_output } Modified: stable/11/contrib/netbsd-tests/bin/sh/dotcmd/scoped_command ============================================================================== --- stable/11/contrib/netbsd-tests/bin/sh/dotcmd/scoped_command Sat Dec 3 02:45:18 2016 (r309465) +++ stable/11/contrib/netbsd-tests/bin/sh/dotcmd/scoped_command Sat Dec 3 02:47:16 2016 (r309466) @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: scoped_command,v 1.1 2014/05/31 14:29:06 christos Exp $ +# $NetBSD: scoped_command,v 1.2 2016/03/27 14:57:50 christos Exp $ # # Copyright (c) 2014 The NetBSD Foundation, Inc. # All rights reserved. @@ -30,6 +30,27 @@ # POSSIBILITY OF SUCH DAMAGE. # +: ${TEST_SH:=/bin/sh} + +sane_sh() +{ + set -- ${TEST_SH} + case "$#" in + (0) set /bin/sh;; + (1|2) ;; + (*) set "$1";; # Just ignore options if we cannot make them work + esac + + case "$1" in + /*) TEST_SH="$1${2+ }$2";; + ./*) TEST_SH="${PWD}${1#.}${2+ }$2";; + */*) TEST_SH="${PWD}/$1${2+ }$2";; + *) TEST_SH="$( command -v "$1" )${2+ }$2";; + esac +} + +sane_sh + set -e # USAGE: @@ -52,7 +73,7 @@ cmd="echo 'before ${3}' ${2} echo 'after ${3}, return value:' ${?}" -echo "#!/bin/sh" +echo "#!${TEST_SH}" [ 'func' = "${1}" ] && cat </dev/null + then + # 16 bits or less, or hex unsupported, just give up... + return + fi + test $( ${TEST_SH} -c 'echo $(( 0x1FFFF ))' ) = 131071 || return + + # when attempting to exceed the number of available bits + # the shell may react in any of 3 (rational) ways + # 1. syntax error (maybe even core dump...) and fail + # 2. represent a positive number input as negative value + # 3. keep the number positive, but not the value expected + # (perhaps pegged at the max possible value) + # any of those may be accompanied by a message to stderr + + # Must check all 3 possibilities for each plausible size + # Tests do not use 0x8000... because that value can have weird + # other side effects that are not relevant to discover here. + # But we do want to try and force the sign bit set. + + if ! ${TEST_SH} -c ': $(( 0xC0000000 ))' 2>/dev/null + then + # proobably shell detected overflow and complained + ARITH_BITS=32 + return + fi + if ${TEST_SH} 2>/dev/null \ + -c 'case $(( 0xC0000000 )); in (-*) exit 0;; esac; exit 1' + then + ARITH_BITS=32 + return + fi + if ${TEST_SH} -c '[ $(( 0xC0000000 )) != 3221225472 ]' 2>/dev/null + then + ARITH_BITS=32 + return + fi + + if ! ${TEST_SH} -c ': $(( 0xC000000000000000 ))' 2>/dev/null + then + ARITH_BITS=64 + return + fi + if ${TEST_SH} 2>/dev/null \ + -c 'case $(( 0xC000000000000000 )); in (-*) exit 0;; esac; exit 1' + then + ARITH_BITS=64 + return + fi + if ${TEST_SH} 2>/dev/null \ + -c '[ $((0xC000000000000000)) != 13835058055282163712 ]' + then + ARITH_BITS=64 + return + fi + + if ${TEST_SH} 2>/dev/null -c \ + '[ $((0x123456781234567812345678)) = 5634002657842756053938493048 ]' + then + # just assume... (for now anyway, revisit when it happens...) + ARITH_BITS=96 + return + fi +} + +atf_test_case constants +constants_head() +{ + atf_set "descr" "Tests that arithmetic expansion can handle constants" +} +constants_body() +{ + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $((0x0))' + + # atf_expect_fail "PR bin/50959" + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $((0X0))' + # atf_expect_pass + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $((000))' + + atf_check -s exit:0 -o inline:'1\n' -e empty \ + ${TEST_SH} -c 'echo $(( 000000001 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty \ + ${TEST_SH} -c 'echo $(( 0x000000 ))' + + atf_check -s exit:0 -o inline:'99999\n' -e empty \ + ${TEST_SH} -c 'echo $((99999))' + + [ ${ARITH_BITS} -gt 44 ] && + atf_check -s exit:0 -o inline:'9191919191919\n' -e empty \ + ${TEST_SH} -c 'echo $((9191919191919))' + + atf_check -s exit:0 -o inline:'13\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xD ))' + atf_check -s exit:0 -o inline:'11\n' -e empty ${TEST_SH} -c \ + 'echo $(( 013 ))' + atf_check -s exit:0 -o inline:'7\n' -e empty ${TEST_SH} -c \ + 'x=7;echo $(($x))' + atf_check -s exit:0 -o inline:'9\n' -e empty ${TEST_SH} -c \ + 'x=9;echo $((x))' + + atf_check -s exit:0 -o inline:'11\n' -e empty \ + ${TEST_SH} -c 'x=0xB; echo $(( $x ))' + atf_check -s exit:0 -o inline:'27\n' -e empty \ + ${TEST_SH} -c 'x=0X1B; echo $(( x ))' + atf_check -s exit:0 -o inline:'27\n' -e empty \ + ${TEST_SH} -c 'X=033; echo $(( $X ))' + atf_check -s exit:0 -o inline:'219\n' -e empty \ + ${TEST_SH} -c 'X=0333; echo $(( X ))' + atf_check -s exit:0 -o inline:'0\n' -e empty \ + ${TEST_SH} -c 'NULL=; echo $(( NULL ))' + + # Not clear if this is 0, nothing, or an error, so omit for now + # atf_check -s exit:0 -o inline:'0\n' -e empty \ + # ${TEST_SH} -c 'echo $(( ))' + + # not clear whether this should return 0 or an error, so omit for now + # atf_check -s exit:0 -o inline:'0\n' -e empty \ + # ${TEST_SH} -c 'echo $(( UNDEFINED_VAR ))' +} + + +atf_test_case do_unary_plus +do_unary_plus_head() +{ + atf_set "descr" "Tests that unary plus works as expected" +} +do_unary_plus_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( +0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( +1 ))' + atf_check -s exit:0 -o inline:'6\n' -e empty ${TEST_SH} -c \ + 'echo $(( + 6 ))' + atf_check -s exit:0 -o inline:'4321\n' -e empty ${TEST_SH} -c \ + 'echo $(( + 4321 ))' + atf_check -s exit:0 -o inline:'17185\n' -e empty ${TEST_SH} -c \ + 'echo $(( + 0x4321 ))' +} + +atf_test_case do_unary_minus +do_unary_minus_head() +{ + atf_set "descr" "Tests that unary minus works as expected" +} +do_unary_minus_body() +{ + atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \ + 'echo $(( -1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( - 0 ))' + atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \ + 'echo $(( - 1 ))' + atf_check -s exit:0 -o inline:'-6\n' -e empty ${TEST_SH} -c \ + 'echo $(( - 6 ))' + atf_check -s exit:0 -o inline:'-4321\n' -e empty ${TEST_SH} -c \ + 'echo $(( - 4321 ))' + atf_check -s exit:0 -o inline:'-2257\n' -e empty ${TEST_SH} -c \ + 'echo $(( - 04321 ))' + atf_check -s exit:0 -o inline:'-7\n' -e empty ${TEST_SH} -c \ + 'echo $((-7))' +} + +atf_test_case do_unary_not +do_unary_not_head() +{ + atf_set "descr" "Tests that unary not (boolean) works as expected" +} +do_unary_not_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( ! 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( ! 0 ))' + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( !1234 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( !0xFFFF ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( ! 000000 ))' +} + +atf_test_case do_unary_tilde +do_unary_tilde_head() +{ + atf_set "descr" "Tests that unary not (bitwise) works as expected" +} +do_unary_tilde_body() +{ + # definitely 2's complement arithmetic here... + + atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \ + 'echo $(( ~ 0 ))' + atf_check -s exit:0 -o inline:'-2\n' -e empty ${TEST_SH} -c \ + 'echo $(( ~ 1 ))' + + atf_check -s exit:0 -o inline:'-1235\n' -e empty ${TEST_SH} -c \ + 'echo $(( ~1234 ))' + atf_check -s exit:0 -o inline:'-256\n' -e empty ${TEST_SH} -c \ + 'echo $(( ~0xFF ))' +} + +atf_test_case elementary_add +elementary_add_head() +{ + atf_set "descr" "Tests that simple addition works as expected" +} +elementary_add_body() +{ + # some of these tests actually test unary ops & op precedence... + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 + 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 + 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 + 1 ))' + atf_check -s exit:0 -o inline:'2\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 + 1 ))' + atf_check -s exit:0 -o inline:'10\n' -e empty ${TEST_SH} -c \ + 'echo $(( 4 + 6 ))' + atf_check -s exit:0 -o inline:'10\n' -e empty ${TEST_SH} -c \ + 'echo $(( 6 + 4 ))' + atf_check -s exit:0 -o inline:'5555\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1234 + 4321 ))' + atf_check -s exit:0 -o inline:'3333\n' -e empty ${TEST_SH} -c \ + 'echo $((1111+2222))' + atf_check -s exit:0 -o inline:'5555\n' -e empty ${TEST_SH} -c \ + 'echo $((+3333+2222))' + atf_check -s exit:0 -o inline:'7777\n' -e empty ${TEST_SH} -c \ + 'echo $((+3333 + +4444))' + atf_check -s exit:0 -o inline:'-7777\n' -e empty ${TEST_SH} -c \ + 'echo -$((+4125+ +3652))' +} + +atf_test_case elementary_sub +elementary_sub_head() +{ + atf_set "descr" "Tests that simple subtraction works as expected" +} +elementary_sub_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 - 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 - 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 - 1 ))' + atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 - 1 ))' + atf_check -s exit:0 -o inline:'488\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1066 - 578 ))' + atf_check -s exit:0 -o inline:'-3662\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2016-5678 ))' + atf_check -s exit:0 -o inline:'-3662\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2016+-5678 ))' + atf_check -s exit:0 -o inline:'-3662\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2016-+5678 ))' + atf_check -s exit:0 -o inline:'-7694\n' -e empty ${TEST_SH} -c \ + 'echo $(( -2016-5678 ))' + atf_check -s exit:0 -o inline:'--1\n' -e empty ${TEST_SH} -c \ + 'echo -$(( -1018 - -1017 ))' +} + +atf_test_case elementary_mul +elementary_mul_head() +{ + atf_set "descr" "Tests that simple multiplication works as expected" +} +elementary_mul_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 * 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 * 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 * 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 * 1 ))' + atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \ + 'echo $(( -1 * 1 ))' + atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 * -1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( -1 * -1 ))' + atf_check -s exit:0 -o inline:'391\n' -e empty ${TEST_SH} -c \ + 'echo $(( 17 * 23 ))' + atf_check -s exit:0 -o inline:'169\n' -e empty ${TEST_SH} -c \ + 'echo $(( 13*13 ))' + atf_check -s exit:0 -o inline:'-11264\n' -e empty ${TEST_SH} -c \ + 'echo $(( -11 *1024 ))' + atf_check -s exit:0 -o inline:'-16983\n' -e empty ${TEST_SH} -c \ + 'echo $(( 17* -999 ))' + atf_check -s exit:0 -o inline:'9309\n' -e empty ${TEST_SH} -c \ + 'echo $(( -29*-321 ))' +} + +atf_test_case elementary_div +elementary_div_head() +{ + atf_set "descr" "Tests that simple division works as expected" +} +elementary_div_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 / 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 / 1 ))' + test ${ARITH_BITS} -ge 38 && + atf_check -s exit:0 -o inline:'99999999999\n' -e empty \ + ${TEST_SH} -c 'echo $(( 99999999999 / 1 ))' + atf_check -s exit:0 -o inline:'2\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2 / 1 ))' + + atf_check -s exit:0 -o inline:'3\n' -e empty ${TEST_SH} -c \ + 'echo $(( 3 / 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 3 / 2 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 3 / 3 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 3 / 4 ))' + + atf_check -s exit:0 -o inline:'173\n' -e empty ${TEST_SH} -c \ + 'echo $(( 123456 / 713 ))' + atf_check -s exit:0 -o inline:'13\n' -e empty ${TEST_SH} -c \ + 'echo $(( 169 / 13 ))' +} + +atf_test_case elementary_rem +elementary_rem_head() +{ + atf_set "descr" "Tests that simple modulus works as expected" +} +elementary_rem_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 % 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 % 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2 % 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 9999 % 1 ))' + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 % 2 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 % 2 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2 % 2 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xFFFF % 2 ))' + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 % 3 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 % 3 ))' + atf_check -s exit:0 -o inline:'2\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2 % 3 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 3 % 3 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 3123 % 3 ))' + + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 9999 % 2 ))' + + atf_check -s exit:0 -o inline:'107\n' -e empty ${TEST_SH} -c \ + 'echo $(( 123456%173 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $((169%13))' +} + +atf_test_case elementary_shl +elementary_shl_head() +{ + atf_set "descr" "Tests that simple shift left works as expected" +} +elementary_shl_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 << 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 << 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 << 17 ))' + + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 << 0 ))' + atf_check -s exit:0 -o inline:'2\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 << 1 ))' + atf_check -s exit:0 -o inline:'131072\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 << 17 ))' + + atf_check -s exit:0 -o inline:'2021161080\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x3C3C3C3C << 1 ))' + + test "${ARITH_BITS}" -ge 40 && + atf_check -s exit:0 -o inline:'129354309120\n' -e empty \ + ${TEST_SH} -c 'echo $(( 0x3C3C3C3C << 7 ))' + test "${ARITH_BITS}" -ge 72 && + atf_check -s exit:0 -o inline:'1111145054534149079040\n' \ + -e empty ${TEST_SH} -c 'echo $(( 0x3C3C3C3C << 40 ))' + + return 0 +} + +atf_test_case elementary_shr +elementary_shr_head() +{ + atf_set "descr" "Tests that simple shift right works as expected" +} +elementary_shr_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 >> 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 >> 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 >> 17 ))' + + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 >> 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 >> 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2 >> 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 3 >> 1 ))' + + atf_check -s exit:0 -o inline:'4\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x10 >> 2 ))' + atf_check -s exit:0 -o inline:'4\n' -e empty ${TEST_SH} -c \ + 'echo $(( 022 >> 2 ))' + + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 131072 >> 17 ))' + + test ${ARITH_BITS} -ge 40 && + atf_check -s exit:0 -o inline:'8\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x4000000000 >> 35 ))' + test ${ARITH_BITS} -ge 80 && + atf_check -s exit:0 -o inline:'4464\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x93400FACE005C871000 >> 64 ))' + + return 0 +} + +atf_test_case elementary_eq +elementary_eq_head() +{ + atf_set "descr" "Tests that simple equality test works as expected" +} +elementary_eq_body() +{ + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 == 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 == 0000 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 == 0x00 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 == 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'X=30; Y=0x1E; echo $(( X == Y ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x1234 == 4660 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x1234 == 011064 ))' + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 == 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 == 0000000000000001 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 == 0x10000000000000 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 == 2 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'X=3; Y=7; echo $(( X == Y ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1234 == 0x4660 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 01234 == 0x11064 ))' +} +atf_test_case elementary_ne +elementary_ne_head() +{ + atf_set "descr" "Tests that simple inequality test works as expected" +} +elementary_ne_body() +{ + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 != 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x71 != 17 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1234 != 01234 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x1234 != 01234 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'X=3; echo $(( X != 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'X=3; Y=0x11; echo $(( X != Y ))' + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 3 != 3 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 != 0x0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xA != 012 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'X=1; echo $(( X != 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'X=0xC; Y=014; echo $(( X != Y ))' +} +atf_test_case elementary_lt +elementary_lt_head() +{ + atf_set "descr" "Tests that simple less than test works as expected" +} +elementary_lt_body() +{ + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 < 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( -1 < 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 < 10 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 100 < 101 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xA1 < 200 ))' + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 < 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 < 0 ))' + + test ${ARITH_BITS} -ge 40 && + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x1BEEFF00D < 0x1FACECAFE ))' + + return 0 +} +atf_test_case elementary_le +elementary_le_head() +{ + atf_set "descr" "Tests that simple less or equal test works as expected" +} +elementary_le_body() +{ + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 <= 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( -1 <= 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 <= 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 <= 10 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 100 <= 101 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xA1 <= 161 ))' + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 <= 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( -100 <= -200 ))' + + test ${ARITH_BITS} -ge 40 && + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'cost=; AUD=; echo $(( $cost 0x2FEEDBABE <= $AUD 12866927294 ))' + + return 0 +} +atf_test_case elementary_gt +elementary_gt_head() +{ + atf_set "descr" "Tests that simple greater than works as expected" +} +elementary_gt_body() +{ + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 > 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 > -1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 11 > 012 ))' + + # atf_expect_fail "PR bin/50959" + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2147483647 > 0X7FFFFF0 ))' + # atf_expect_pass + + test ${ARITH_BITS} -gt 32 && + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x80000000 > 0x7FFFFFFF ))' + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 > 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 > 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( -1 > 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 > 10 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2015 > 2016 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xA1 > 200 ))' + + test ${ARITH_BITS} -ge 44 && + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x7F07F07F0 > 34099628014 ))' + + return 0 +} +atf_test_case elementary_ge +elementary_ge_head() +{ + atf_set "descr" "Tests that simple greater or equal works as expected" +} +elementary_ge_body() +{ + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 >= 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 >= 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( -100 >= -101 ))' + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( -1 >= 0 ))' +} + +atf_test_case fiddle_bits_and +fiddle_bits_and_head() +{ + atf_set "descr" "Test bitwise and operations in arithmetic expressions" +} +fiddle_bits_and_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 & 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 & 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 & 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 & 1 ))' + + atf_check -s exit:0 -o inline:'255\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xFF & 0xFF ))' + atf_check -s exit:0 -o inline:'255\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xFFFF & 0377 ))' + + test "${ARITH_BITS}" -ge 48 && + atf_check -s exit:0 -o inline:'70377641607203\n' -e empty \ + ${TEST_SH} -c 'echo $(( 0x5432FEDC0123 & 0x42871357BAB3 ))' + + return 0 +} +atf_test_case fiddle_bits_or +fiddle_bits_or_head() +{ + atf_set "descr" "Test bitwise or operations in arithmetic expressions" +} +fiddle_bits_or_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 | 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 | 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 | 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 | 1 ))' + + atf_check -s exit:0 -o inline:'4369\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x1111 | 0x1111 ))' + atf_check -s exit:0 -o inline:'255\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xAA | 0125 ))' + + test "${ARITH_BITS}" -ge 48 && + atf_check -s exit:0 -o inline:'95348271856563\n' -e empty \ + ${TEST_SH} -c 'echo $(( 0x5432FEDC0123 | 0x42871357BAB3 ))' + + return 0 +} +atf_test_case fiddle_bits_xor +fiddle_bits_xor_head() +{ + atf_set "descr" "Test bitwise xor operations in arithmetic expressions" +} +fiddle_bits_xor_body() +{ + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 ^ 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 ^ 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 ^ 1 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 ^ 1 ))' + + atf_check -s exit:0 -o inline:'255\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xF0 ^ 0x0F ))' + atf_check -s exit:0 -o inline:'15\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xF0 ^ 0xFF ))' + + test "${ARITH_BITS}" -ge 48 && + atf_check -s exit:0 -o inline:'24970630249360\n' -e empty \ + ${TEST_SH} -c 'echo $(( 0x5432FEDC0123 ^ 0x42871357BAB3 ))' + + return 0 +} + +atf_test_case logical_and +logical_and_head() +{ + atf_set "descr" "Test logical and operations in arithmetic expressions" +} +logical_and_body() +{ + # cannot test short-circuit eval until sh implements side effects... + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 && 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 && 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 && 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 && 1 ))' + + # atf_expect_fail "PR bin/50960" + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x1111 && 01234 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0xFFFF && 0xF0F0 ))' +} +atf_test_case logical_or +logical_or_head() +{ + atf_set "descr" "Test logical or operations in arithmetic expressions" +} +logical_or_body() +{ + # cannot test short-circuit eval until sh implements side effects... + + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 || 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 || 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 || 1 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 || 1 ))' + + # atf_expect_fail "PR bin/50960" + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x1111 || 01234 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x33 || 0xF0F0 ))' +} + +atf_test_case make_selection +make_selection_head() +{ + atf_set "descr" "Test ?: operator in arithmetic expressions" +} +make_selection_body() +{ + # atf_expect_fail "PR bin/50958" + + atf_check -s exit:0 -o inline:'3\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0 ? 2 : 3 ))' + atf_check -s exit:0 -o inline:'2\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 ? 2 : 3 ))' + + atf_check -s exit:0 -o inline:'111\n' -e empty ${TEST_SH} -c \ + 'echo $(( 0x1234 ? 111 : 222 ))' + + atf_check -s exit:0 -o inline:'-1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 < 2 ? -1 : 1 > 2 ? 1 : 0 ))' + atf_check -s exit:0 -o inline:'0\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 < 1 ? -1 : 1 > 1 ? 1 : 0 ))' + atf_check -s exit:0 -o inline:'1\n' -e empty ${TEST_SH} -c \ + 'echo $(( 2 < 1 ? -1 : 2 > 1 ? 1 : 0 ))' +} + +atf_test_case operator_precedence +operator_precedence_head() +{ + atf_set "descr" "Test operator precedence without parentheses" +} +operator_precedence_body() +{ + # NB: apart from $(( )) ** NO ** parentheses in the expressions. + + atf_check -s exit:0 -o inline:'6\n' -e empty ${TEST_SH} -c \ + 'echo $(( 1 + 2 + 3 ))' *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Dec 3 02:48:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FEB6C635AC; Sat, 3 Dec 2016 02:48:57 +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 1257AB80; Sat, 3 Dec 2016 02:48:57 +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 uB32mu6R059567; Sat, 3 Dec 2016 02:48:56 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB32muUC059565; Sat, 3 Dec 2016 02:48:56 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612030248.uB32muUC059565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 02:48:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309468 - stable/11/lib/libc/tests/stdio X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 02:48:57 -0000 Author: ngie Date: Sat Dec 3 02:48:55 2016 New Revision: 309468 URL: https://svnweb.freebsd.org/changeset/base/309468 Log: MFC r305921: Similar to r305920, remove spurious newlines from ATF_REQUIRE_MSG calls Modified: stable/11/lib/libc/tests/stdio/open_memstream2_test.c stable/11/lib/libc/tests/stdio/open_wmemstream_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/tests/stdio/open_memstream2_test.c ============================================================================== --- stable/11/lib/libc/tests/stdio/open_memstream2_test.c Sat Dec 3 02:47:41 2016 (r309467) +++ stable/11/lib/libc/tests/stdio/open_memstream2_test.c Sat Dec 3 02:48:55 2016 (r309468) @@ -159,11 +159,11 @@ ATF_TC_BODY(seek_tests, tc) #define SEEK_FAIL(offset, whence, error) do { \ errno = 0; \ ATF_REQUIRE_MSG(fseeko(fp, (offset), (whence)) != 0, \ - "fseeko(%s, %s) did not fail, set pos to %jd\n", \ + "fseeko(%s, %s) did not fail, set pos to %jd", \ __STRING(offset), __STRING(whence), \ (intmax_t)ftello(fp)); \ ATF_REQUIRE_MSG(errno == (error), \ - "fseeko(%s, %s) failed with %d rather than %s\n", \ + "fseeko(%s, %s) failed with %d rather than %s", \ __STRING(offset), __STRING(whence), errno, \ __STRING(error)); \ } while (0) @@ -173,7 +173,7 @@ ATF_TC_BODY(seek_tests, tc) "fseeko(%s, %s) failed: %s", \ __STRING(offset), __STRING(whence), strerror(errno)); \ ATF_REQUIRE_MSG(ftello(fp) == (result), \ - "fseeko(%s, %s) seeked to %jd rather than %s\n", \ + "fseeko(%s, %s) seeked to %jd rather than %s", \ __STRING(offset), __STRING(whence), \ (intmax_t)ftello(fp), __STRING(result)); \ } while (0) Modified: stable/11/lib/libc/tests/stdio/open_wmemstream_test.c ============================================================================== --- stable/11/lib/libc/tests/stdio/open_wmemstream_test.c Sat Dec 3 02:47:41 2016 (r309467) +++ stable/11/lib/libc/tests/stdio/open_wmemstream_test.c Sat Dec 3 02:48:55 2016 (r309468) @@ -159,11 +159,11 @@ ATF_TC_BODY(seek_tests, tc) #define SEEK_FAIL(offset, whence, error) do { \ errno = 0; \ ATF_REQUIRE_MSG(fseeko(fp, (offset), (whence)) != 0, \ - "fseeko(%s, %s) did not fail, set pos to %jd\n", \ + "fseeko(%s, %s) did not fail, set pos to %jd", \ __STRING(offset), __STRING(whence), \ (intmax_t)ftello(fp)); \ ATF_REQUIRE_MSG(errno == (error), \ - "fseeko(%s, %s) failed with %d rather than %s\n", \ + "fseeko(%s, %s) failed with %d rather than %s", \ __STRING(offset), __STRING(whence), errno, \ __STRING(error)); \ } while (0) @@ -173,7 +173,7 @@ ATF_TC_BODY(seek_tests, tc) "fseeko(%s, %s) failed: %s", \ __STRING(offset), __STRING(whence), strerror(errno)); \ ATF_REQUIRE_MSG(ftello(fp) == (result), \ - "fseeko(%s, %s) seeked to %jd rather than %s\n", \ + "fseeko(%s, %s) seeked to %jd rather than %s", \ __STRING(offset), __STRING(whence), \ (intmax_t)ftello(fp), __STRING(result)); \ } while (0) From owner-svn-src-all@freebsd.org Sat Dec 3 02:55:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA985C63986; Sat, 3 Dec 2016 02:55:21 +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 82A701032; Sat, 3 Dec 2016 02:55:21 +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 uB32tKjf063527; Sat, 3 Dec 2016 02:55:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB32tJN5063515; Sat, 3 Dec 2016 02:55:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612030255.uB32tJN5063515@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 02:55:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309469 - in stable/11: . contrib/netbsd-tests/kernel/kqueue contrib/netbsd-tests/kernel/kqueue/read etc/mtree tests/sys/kqueue tests/sys/kqueue/libkqueue X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 02:55:21 -0000 Author: ngie Date: Sat Dec 3 02:55:19 2016 New Revision: 309469 URL: https://svnweb.freebsd.org/changeset/base/309469 Log: MFC r304797,r305467,r305468,r305483: r304797 (by jmmv): Make use of Kyua's work directories. Change the vnode tests to use the current directory when creating temporary files, which we can assume is a volatile work directory, and then make the kqueue_test.sh driver _not_ abandon the directory created by Kyua. This makes the various kqueue tests independent of each other, and ensures the temporary file is cleaned up on failure. Problem spotted by asomers@ when reviewing D4254. r305467: Move tests/sys/kqueue/... to tests/sys/kqueue/libkqueue/... This is being done to clearly distinguish the libkqueue tests from the (soon to be imported) NetBSD tests. r305468: Port contrib/netbsd-tests/kernel/kqueue/... as tests/sys/kqueue/... proc2_test must be skipped because the invariant tested (`ke.fflags & NOTE_TRACKERR`) doesn't pass. r305483: Fix tests/sys/kqueue NetBSD tests on 32-bit platforms by using proper format specifier for pointers when printing them out with printf(3) Pointyhat to: ngie Added: stable/11/tests/sys/kqueue/libkqueue/ - copied from r305467, head/tests/sys/kqueue/libkqueue/ Replaced: stable/11/tests/sys/kqueue/Makefile - copied, changed from r305467, head/tests/sys/kqueue/Makefile Deleted: stable/11/tests/sys/kqueue/Makefile.depend stable/11/tests/sys/kqueue/common.h stable/11/tests/sys/kqueue/config.h stable/11/tests/sys/kqueue/kqueue_test.sh stable/11/tests/sys/kqueue/main.c stable/11/tests/sys/kqueue/proc.c stable/11/tests/sys/kqueue/read.c stable/11/tests/sys/kqueue/signal.c stable/11/tests/sys/kqueue/timer.c stable/11/tests/sys/kqueue/user.c stable/11/tests/sys/kqueue/vnode.c Modified: stable/11/ObsoleteFiles.inc stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_fifo.c stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_file.c stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_pipe.c stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_ttypty.c stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc1.c stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc2.c stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc3.c stable/11/contrib/netbsd-tests/kernel/kqueue/t_sig.c stable/11/contrib/netbsd-tests/kernel/kqueue/t_vnode.c stable/11/etc/mtree/BSD.tests.dist Directory Properties: stable/11/ (props changed) Modified: stable/11/ObsoleteFiles.inc ============================================================================== --- stable/11/ObsoleteFiles.inc Sat Dec 3 02:48:55 2016 (r309468) +++ stable/11/ObsoleteFiles.inc Sat Dec 3 02:55:19 2016 (r309469) @@ -51,6 +51,9 @@ OLD_FILES+=usr/share/man/man4/hv_vss.4.g OLD_FILES+=usr/share/man/man4/hv_ata_pci_disengage.4.gz # 20161015: remove link to removed m_getclr(9) macro OLD_FILES+=usr/share/man/man9/m_getclr.9.gz +# 20160906: libkqueue tests moved to /usr/tests/sys/kqueue/libkqueue +OLD_FILES+=usr/tests/sys/kqueue/kqtest +OLD_FILES+=usr/tests/sys/kqueue/kqueue_test # 20160703: POSIXify locales with variants OLD_FILES+=usr/share/locale/zh_Hant_TW.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/zh_Hant_TW.UTF-8/LC_CTYPE Modified: stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_fifo.c ============================================================================== --- stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_fifo.c Sat Dec 3 02:48:55 2016 (r309468) +++ stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_fifo.c Sat Dec 3 02:55:19 2016 (r309469) @@ -78,7 +78,11 @@ ATF_TC_BODY(fifo, tc) RL(n = kevent(kq, NULL, 0, event, 1, NULL)); (void)printf("kevent num %d filt %d flags: %#x, fflags: %#x, " +#ifdef __FreeBSD__ + "data: %" PRIdPTR "\n", n, event[0].filter, event[0].flags, +#else "data: %" PRId64 "\n", n, event[0].filter, event[0].flags, +#endif event[0].fflags, event[0].data); ATF_REQUIRE_EQ(event[0].filter, EVFILT_READ); Modified: stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_file.c ============================================================================== --- stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_file.c Sat Dec 3 02:48:55 2016 (r309468) +++ stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_file.c Sat Dec 3 02:55:19 2016 (r309469) @@ -111,7 +111,11 @@ ATF_TC_BODY(file, tc) num += n; (void)printf("kevent num %d flags: %#x, fflags: %#x, data: " +#ifdef __FreeBSD__ + "%" PRIdPTR "\n", n, event[0].flags, event[0].fflags, +#else "%" PRId64 "\n", n, event[0].flags, event[0].fflags, +#endif event[0].data); if (event[0].data < 0) Modified: stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_pipe.c ============================================================================== --- stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_pipe.c Sat Dec 3 02:48:55 2016 (r309468) +++ stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_pipe.c Sat Dec 3 02:55:19 2016 (r309469) @@ -67,7 +67,11 @@ ATF_TC_BODY(pipe, tc) RL(n = kevent(kq, NULL, 0, event, 1, NULL)); (void)printf("kevent num %d flags: %#x, fflags: %#x, data: " +#ifdef __FreeBSD__ + "%" PRIdPTR "\n", n, event[0].flags, event[0].fflags, event[0].data); +#else "%" PRId64 "\n", n, event[0].flags, event[0].fflags, event[0].data); +#endif RL(n = read(fds[0], buffer, event[0].data)); buffer[n] = '\0'; Modified: stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_ttypty.c ============================================================================== --- stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_ttypty.c Sat Dec 3 02:48:55 2016 (r309468) +++ stable/11/contrib/netbsd-tests/kernel/kqueue/read/t_ttypty.c Sat Dec 3 02:55:19 2016 (r309469) @@ -103,7 +103,11 @@ h_check(bool check_master) RL(n = kevent(kq, NULL, 0, event, 1, NULL)); (void)printf("kevent num %d filt %d flags: %#x, fflags: %#x, " +#ifdef __FreeBSD__ + "data: %" PRIdPTR "\n", n, event[0].filter, event[0].flags, +#else "data: %" PRId64 "\n", n, event[0].filter, event[0].flags, +#endif event[0].fflags, event[0].data); ATF_REQUIRE_EQ(event[0].filter, EVFILT_READ); Modified: stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc1.c ============================================================================== --- stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc1.c Sat Dec 3 02:48:55 2016 (r309468) +++ stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc1.c Sat Dec 3 02:55:19 2016 (r309469) @@ -139,7 +139,11 @@ ATF_TC_BODY(proc1, tc) printf(" NOTE_FORK"); } if (event[0].fflags & NOTE_CHILD) +#ifdef __FreeBSD__ + printf(" NOTE_CHILD, parent = %" PRIdPTR, event[0].data); +#else printf(" NOTE_CHILD, parent = %" PRId64, event[0].data); +#endif printf("\n"); } Modified: stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc2.c ============================================================================== --- stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc2.c Sat Dec 3 02:48:55 2016 (r309468) +++ stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc2.c Sat Dec 3 02:55:19 2016 (r309469) @@ -34,6 +34,9 @@ __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); __RCSID("$NetBSD: t_proc2.c,v 1.2 2015/01/14 22:22:32 christos Exp $"); +#ifdef __FreeBSD__ +#include +#endif #include #include #include Modified: stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc3.c ============================================================================== --- stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc3.c Sat Dec 3 02:48:55 2016 (r309468) +++ stable/11/contrib/netbsd-tests/kernel/kqueue/t_proc3.c Sat Dec 3 02:55:19 2016 (r309469) @@ -32,6 +32,9 @@ #include __RCSID("$NetBSD: t_proc3.c,v 1.2 2015/01/14 22:22:32 christos Exp $"); +#ifdef __FreeBSD__ +#include +#endif #include #include #include Modified: stable/11/contrib/netbsd-tests/kernel/kqueue/t_sig.c ============================================================================== --- stable/11/contrib/netbsd-tests/kernel/kqueue/t_sig.c Sat Dec 3 02:48:55 2016 (r309468) +++ stable/11/contrib/netbsd-tests/kernel/kqueue/t_sig.c Sat Dec 3 02:55:19 2016 (r309469) @@ -34,6 +34,9 @@ __COPYRIGHT("@(#) Copyright (c) 2008\ The NetBSD Foundation, inc. All rights reserved."); __RCSID("$NetBSD: t_sig.c,v 1.2 2010/11/03 16:10:20 christos Exp $"); +#ifdef __FreeBSD__ +#include +#endif #include #include #include @@ -60,9 +63,13 @@ ATF_TC_HEAD(sig, tc) ATF_TC_BODY(sig, tc) { struct timespec timeout; +#ifdef __NetBSD__ struct kfilter_mapping km; +#endif struct kevent event[1]; +#ifdef __NetBSD__ char namebuf[32]; +#endif pid_t pid, child; int kq, n, num, status; @@ -84,16 +91,22 @@ ATF_TC_BODY(sig, tc) RL(kq = kqueue()); +#ifdef __NetBSD__ (void)strlcpy(namebuf, "EVFILT_SIGNAL", sizeof(namebuf)); km.name = namebuf; RL(ioctl(kq, KFILTER_BYNAME, &km)); (void)printf("got %d as filter number for `%s'.\n", km.filter, km.name); +#endif /* ignore the signal to avoid taking it for real */ REQUIRE_LIBC(signal(SIGUSR1, SIG_IGN), SIG_ERR); event[0].ident = SIGUSR1; +#ifdef __NetBSD__ event[0].filter = km.filter; +#else + event[0].filter = EVFILT_SIGNAL; +#endif event[0].flags = EV_ADD | EV_ENABLE; RL(kevent(kq, event, 1, NULL, 0, NULL)); @@ -117,7 +130,11 @@ ATF_TC_BODY(sig, tc) if (n == 0) continue; +#ifdef __FreeBSD__ + (void)printf("sig: kevent flags: 0x%x, data: %" PRIdPTR " (# " +#else (void)printf("sig: kevent flags: 0x%x, data: %" PRId64 " (# " +#endif "times signal posted)\n", event[0].flags, event[0].data); } Modified: stable/11/contrib/netbsd-tests/kernel/kqueue/t_vnode.c ============================================================================== --- stable/11/contrib/netbsd-tests/kernel/kqueue/t_vnode.c Sat Dec 3 02:48:55 2016 (r309468) +++ stable/11/contrib/netbsd-tests/kernel/kqueue/t_vnode.c Sat Dec 3 02:55:19 2016 (r309469) @@ -1,3 +1,6 @@ +#ifdef __FreeBSD__ +#include +#endif #include #include #include Modified: stable/11/etc/mtree/BSD.tests.dist ============================================================================== --- stable/11/etc/mtree/BSD.tests.dist Sat Dec 3 02:48:55 2016 (r309468) +++ stable/11/etc/mtree/BSD.tests.dist Sat Dec 3 02:55:19 2016 (r309469) @@ -419,6 +419,8 @@ .. .. kqueue + libkqueue + .. .. mac bsdextended Copied and modified: stable/11/tests/sys/kqueue/Makefile (from r305467, head/tests/sys/kqueue/Makefile) ============================================================================== --- head/tests/sys/kqueue/Makefile Tue Sep 6 08:45:29 2016 (r305467, copy source) +++ stable/11/tests/sys/kqueue/Makefile Sat Dec 3 02:55:19 2016 (r309469) @@ -1,8 +1,20 @@ # $FreeBSD$ +TESTSRC= ${SRCTOP}/contrib/netbsd-tests/kernel/kqueue + TESTSDIR= ${TESTSBASE}/sys/kqueue BINDIR= ${TESTSDIR} +NETBSD_ATF_TESTS_C= proc1_test +# XXX: fails `ke.fflags & NOTE_TRACKERR` invariant +#NETBSD_ATF_TESTS_C+= proc2_test +NETBSD_ATF_TESTS_C+= proc3_test +NETBSD_ATF_TESTS_C+= sig_test +NETBSD_ATF_TESTS_C+= vnode_test + +WARNS?= 3 + TESTS_SUBDIRS+= libkqueue +.include .include From owner-svn-src-all@freebsd.org Sat Dec 3 03:04:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45AFDC60019; Sat, 3 Dec 2016 03:04:22 +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 F08F51A15; Sat, 3 Dec 2016 03:04:21 +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 uB334Lqf068371; Sat, 3 Dec 2016 03:04:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB334Lhh068370; Sat, 3 Dec 2016 03:04:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612030304.uB334Lhh068370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 03:04:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309470 - stable/11/contrib/netbsd-tests/lib/libc/rpc X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 03:04:22 -0000 Author: ngie Date: Sat Dec 3 03:04:20 2016 New Revision: 309470 URL: https://svnweb.freebsd.org/changeset/base/309470 Log: MFC r305451: Fix lib/libc/rpc test assumptions added in r305358 - Require root in the tcp/udp subtests (it's needed on FreeBSD when registering services). - Skip the tests if service registration fails. Modified: stable/11/contrib/netbsd-tests/lib/libc/rpc/t_rpc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/netbsd-tests/lib/libc/rpc/t_rpc.c ============================================================================== --- stable/11/contrib/netbsd-tests/lib/libc/rpc/t_rpc.c Sat Dec 3 02:55:19 2016 (r309469) +++ stable/11/contrib/netbsd-tests/lib/libc/rpc/t_rpc.c Sat Dec 3 03:04:20 2016 (r309470) @@ -24,6 +24,13 @@ __RCSID("$NetBSD: t_rpc.c,v 1.9 2015/11/ return; \ } while(/*CONSTCOND*/0) +#ifdef __FreeBSD__ +#define SKIPXI(ev, msg, ...) do { \ + atf_tc_skip(msg, __VA_ARGS__); \ + return ev; \ +} while(/*CONSTCOND*/0) +#endif + #else #define ERRX(ev, msg, ...) errx(ev, msg, __VA_ARGS__) #define SKIPX(ev, msg, ...) errx(ev, msg, __VA_ARGS__) @@ -188,7 +195,13 @@ regtest(const char *hostname, const char svc_fdset_init(p ? SVC_FDSET_POLL : 0); #endif if (!svc_create(server, PROGNUM, VERSNUM, transp)) +#ifdef __NetBSD__ ERRX(EXIT_FAILURE, "Cannot create server %d", num); +#else + { + SKIPXI(EXIT_FAILURE, "Cannot create server %d", num); + } +#endif switch ((pid = fork())) { case 0: @@ -335,6 +348,9 @@ ATF_TC(tcp); ATF_TC_HEAD(tcp, tc) { atf_tc_set_md_var(tc, "descr", "Checks svc tcp (select)"); +#ifdef __FreeBSD__ + atf_tc_set_md_var(tc, "require.user", "root"); +#endif } ATF_TC_BODY(tcp, tc) @@ -347,6 +363,9 @@ ATF_TC(udp); ATF_TC_HEAD(udp, tc) { atf_tc_set_md_var(tc, "descr", "Checks svc udp (select)"); +#ifdef __FreeBSD__ + atf_tc_set_md_var(tc, "require.user", "root"); +#endif } ATF_TC_BODY(udp, tc) @@ -359,6 +378,9 @@ ATF_TC(tcp_poll); ATF_TC_HEAD(tcp_poll, tc) { atf_tc_set_md_var(tc, "descr", "Checks svc tcp (poll)"); +#ifdef __FreeBSD__ + atf_tc_set_md_var(tc, "require.user", "root"); +#endif } ATF_TC_BODY(tcp_poll, tc) @@ -371,6 +393,9 @@ ATF_TC(udp_poll); ATF_TC_HEAD(udp_poll, tc) { atf_tc_set_md_var(tc, "descr", "Checks svc udp (poll)"); +#ifdef __FreeBSD__ + atf_tc_set_md_var(tc, "require.user", "root"); +#endif } ATF_TC_BODY(udp_poll, tc) From owner-svn-src-all@freebsd.org Sat Dec 3 03:05:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB2AEC600CB; Sat, 3 Dec 2016 03:05:45 +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 AA74C1C65; Sat, 3 Dec 2016 03:05:45 +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 uB335ibl068481; Sat, 3 Dec 2016 03:05:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB335ijk068480; Sat, 3 Dec 2016 03:05:44 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612030305.uB335ijk068480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 03:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309471 - stable/11/lib/libc/tests/db X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 03:05:46 -0000 Author: ngie Date: Sat Dec 3 03:05:44 2016 New Revision: 309471 URL: https://svnweb.freebsd.org/changeset/base/309471 Log: MFC r305449: Install h_db to unbreak some of the lib/libc/db testcases after r305358 Modified: stable/11/lib/libc/tests/db/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/tests/db/Makefile ============================================================================== --- stable/11/lib/libc/tests/db/Makefile Sat Dec 3 03:04:20 2016 (r309470) +++ stable/11/lib/libc/tests/db/Makefile Sat Dec 3 03:05:44 2016 (r309471) @@ -5,7 +5,7 @@ PACKAGE= tests BINDIR= ${TESTSDIR} PROGS= h_db -PROGS= h_lfsr +PROGS+= h_lfsr ${PACKAGE}FILES+= README From owner-svn-src-all@freebsd.org Sat Dec 3 03:13:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4B54C605F9; Sat, 3 Dec 2016 03:13:33 +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 745F5237; Sat, 3 Dec 2016 03:13:33 +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 uB33DWZC072303; Sat, 3 Dec 2016 03:13:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB33DWtl072302; Sat, 3 Dec 2016 03:13:32 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612030313.uB33DWtl072302@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 03:13:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309472 - head/contrib/netbsd-tests/games X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 03:13:33 -0000 Author: ngie Date: Sat Dec 3 03:13:32 2016 New Revision: 309472 URL: https://svnweb.freebsd.org/changeset/base/309472 Log: Restore pathing for factor(1), which unnecessarily diverged in r278616 factor lives in /usr/games/, not /usr/bin, in NetBSD. The correct way to handle this is do on-the-fly manipulation of the test script via ATF_TESTS_SH_SED_, not by modify the pathing directly in the test script. This is being done to resolve an unnecessary conflict made when pulling back ^/head@r309469 (contrib/netbsd-tests update) to ^/stable/10. No functional change MFC after: now Modified: head/contrib/netbsd-tests/games/t_factor.sh Modified: head/contrib/netbsd-tests/games/t_factor.sh ============================================================================== --- head/contrib/netbsd-tests/games/t_factor.sh Sat Dec 3 03:05:44 2016 (r309471) +++ head/contrib/netbsd-tests/games/t_factor.sh Sat Dec 3 03:13:32 2016 (r309472) @@ -37,7 +37,7 @@ expect() { atf_test_case overflow1 overflow1_head() { atf_set "descr" "Tests for overflow conditions" - atf_set "require.progs" "/usr/bin/factor" + atf_set "require.progs" "/usr/games/factor" } overflow1_body() { expect '8675309' '8675309: 8675309' @@ -56,7 +56,7 @@ atf_test_case loop1 loop1_head() { atf_set "descr" "Tests some cases that once locked the program" \ "in an infinite loop" - atf_set "require.progs" "/usr/bin/factor" + atf_set "require.progs" "/usr/games/factor" } loop1_body() { expect '2147483647111311' '2147483647111311: 3 3 3 131 607148331103' From owner-svn-src-all@freebsd.org Sat Dec 3 03:15:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6B5AC60700; Sat, 3 Dec 2016 03:15:10 +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 95CD0669; Sat, 3 Dec 2016 03:15:10 +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 uB33F9Fb072429; Sat, 3 Dec 2016 03:15:09 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB33F99u072428; Sat, 3 Dec 2016 03:15:09 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612030315.uB33F99u072428@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 03:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309473 - stable/11/contrib/netbsd-tests/games X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 03:15:10 -0000 Author: ngie Date: Sat Dec 3 03:15:09 2016 New Revision: 309473 URL: https://svnweb.freebsd.org/changeset/base/309473 Log: MFC r309472: Restore pathing for factor(1), which unnecessarily diverged in r278616 factor lives in /usr/games/, not /usr/bin, in NetBSD. The correct way to handle this is do on-the-fly manipulation of the test script via ATF_TESTS_SH_SED_, not by modify the pathing directly in the test script. This is being done to resolve an unnecessary conflict made when pulling back ^/head@r309469 (contrib/netbsd-tests update) to ^/stable/10. No functional change Modified: stable/11/contrib/netbsd-tests/games/t_factor.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/netbsd-tests/games/t_factor.sh ============================================================================== --- stable/11/contrib/netbsd-tests/games/t_factor.sh Sat Dec 3 03:13:32 2016 (r309472) +++ stable/11/contrib/netbsd-tests/games/t_factor.sh Sat Dec 3 03:15:09 2016 (r309473) @@ -37,7 +37,7 @@ expect() { atf_test_case overflow1 overflow1_head() { atf_set "descr" "Tests for overflow conditions" - atf_set "require.progs" "/usr/bin/factor" + atf_set "require.progs" "/usr/games/factor" } overflow1_body() { expect '8675309' '8675309: 8675309' @@ -56,7 +56,7 @@ atf_test_case loop1 loop1_head() { atf_set "descr" "Tests some cases that once locked the program" \ "in an infinite loop" - atf_set "require.progs" "/usr/bin/factor" + atf_set "require.progs" "/usr/games/factor" } loop1_body() { expect '2147483647111311' '2147483647111311: 3 3 3 131 607148331103' From owner-svn-src-all@freebsd.org Sat Dec 3 03:37:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA124C60FD5; Sat, 3 Dec 2016 03:37:46 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com [IPv6:2607:f8b0:400e:c00::244]) (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 80AD11036; Sat, 3 Dec 2016 03:37:46 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x244.google.com with SMTP id y68so14388309pfb.1; Fri, 02 Dec 2016 19:37:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=dugknfYbYrrWUhrBKfXCWzaNev17cF3DRGR6yfiXsOU=; b=Ke+c5tc8GG+73FY3U2X9dlpCNHuspPtlXvdZNVO+vBtj718Nfyy34K/gx5RWRLM1h8 feJQ29vqIPNKbQGtRwWVuyEIhipBP7SAnmpVJSmnm7dxYH7qSE8tb814Xd3Jv8M03UkU kz7CM0SoTjyhsSgGDQEPC5Bq0Dsg96Bfm2qPIaQcKBrTC+olcQbjokqQUWbk5mZD7wZ5 i1Q1E5IcEVf7Nt1v03FUt+M6I0OeeBlws31LAw+9/kbUeam1pVC1IcUJYBcQKMFMvWxE gtC085cUnN7fRvy0wfBVeB0vSJRfd//nNnKElUOVOAg1wwWVuR5bImTVYY/mAgI5NZQ6 V1Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=dugknfYbYrrWUhrBKfXCWzaNev17cF3DRGR6yfiXsOU=; b=IFE37hvT/F0GLu28QuaUp5dpOT04U+d+B1QKvzhBVRSTNdcd20+OJd08IAFbmHXBMi YB/RaHtLCeyWebfI7mHePwfVID7ESspJuk0r2V9cHXe7Ian2iMRJR9Z8EzMCHSwj4Hkg aPmdrSXytMt7geKCTkJi7FFbIihIk8UEoIi8P53cf13l13nNLOeRRo/phNQd5Gv3nhEe QeXytVW4INQNLQYIP7iNNMrSqlVQ/5S+9UL9i15wf2P19VLfPKamAZ2arec+51Y71ICT kDsa89qp2JW+4uBMnD7kDIxhPsQtdXMWS4//WEtkIfL0WISnb2vo23tb+RZ92BVl0Kqd yxMQ== X-Gm-Message-State: AKaTC02iUJNJSh10NnOEBI2hbBUgkbAyuuOmwT6vRN/sqiCGgQ6h4iOcETpXlp/86V4JDg== X-Received: by 10.99.158.18 with SMTP id s18mr26759502pgd.88.1480736265740; Fri, 02 Dec 2016 19:37:45 -0800 (PST) Received: from [192.168.20.12] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id v1sm10766685pgv.33.2016.12.02.19.37.44 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 02 Dec 2016 19:37:44 -0800 (PST) Subject: Re: svn commit: r309454 - stable/10/lib/libc/tests Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_1477694A-F5A9-4890-9FEB-D7B46C47AC22"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201612030040.uB30e8Qc006710@repo.freebsd.org> Date: Fri, 2 Dec 2016 19:37:43 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Message-Id: <4CEA04AC-4AB7-4818-AF9C-E646E42A13DD@gmail.com> References: <201612030040.uB30e8Qc006710@repo.freebsd.org> To: Ngie Cooper X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 03:37:46 -0000 --Apple-Mail=_1477694A-F5A9-4890-9FEB-D7B46C47AC22 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Dec 2, 2016, at 16:40, Ngie Cooper wrote: >=20 > Author: ngie > Date: Sat Dec 3 00:40:08 2016 > New Revision: 309454 > URL: https://svnweb.freebsd.org/changeset/base/309454 >=20 > Log: > MFstable/11 r309453: >=20 > MFC r307700: >=20 > Only build lib/libc/tests/iconv if MK_ICONV !=3D no >=20 > Modified: > stable/10/lib/libc/tests/Makefile > Directory Properties: > stable/10/ (props changed) >=20 > Modified: stable/10/lib/libc/tests/Makefile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- stable/10/lib/libc/tests/Makefile Sat Dec 3 00:38:35 2016 = (r309453) > +++ stable/10/lib/libc/tests/Makefile Sat Dec 3 00:40:08 2016 = (r309454) > @@ -24,6 +24,10 @@ TESTS_SUBDIRS+=3D termios > TESTS_SUBDIRS+=3D tls > TESTS_SUBDIRS+=3D ttyio >=20 > +.if ${MK_ICONV} !=3D "no" > +TESTS_SUBDIRS+=3D iconv > +.endif > + > .if ${MK_LOCALES} !=3D "no" > TESTS_SUBDIRS+=3D locale > .endif I=E2=80=99m aware of the fact that this causes a build failure = (I missed the fact that it added the directory instead of shifting it = from the existing TESTS_SUBDIRS definition). I=E2=80=99ll either revert = this commit or bring in the missing MFC (r299704). Thanks, -Ngie --Apple-Mail=_1477694A-F5A9-4890-9FEB-D7B46C47AC22 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 iQIcBAEBCgAGBQJYQj4IAAoJEPWDqSZpMIYV/J0P/33bNgX1fAXONFYjbKy+73CO eiVFJOF5ykZnXOtQdGDLuRZ03gUhUscO1wloJywFpPcqmzfb/E1JDRcnoryy0EBS INz8NQxJzJQ4sOhv/VoYAKn95+R20IyVLY2PRwvLR1Y6MCgWUHeLFg8QnEcvgRk+ q4HA9xDdEl6eXZnyS5Jl8Ndf+F/9nJoId+KJgN7ERZVRAbn5X4BfU3yevD1sX5ob Hc560an6qJRKqq1IrzQDTIVO9s4myBKd1dusm++djUt129zJn2L7ypmOFPBFQDg0 tNI7a4z6WtnszkqnNnJ0MqV/YdA3FRboFRSOJkAavJhN4Kk3YzMp872OW+x/ufUW 6Jgt2qRl3BiOUXGpGPyNK0fPen+PosViIa4koaIOupE1qoEQ0XY9l+UuSI8tHH8z PSdS+iTRKKGYyu5JgpeCHZXzjzJ1P9xEY507BnEtcIpkmHPAXlTMjAnxcg13lVuY wyc/MBKHgyQ6vlCbwbjF/w4dJnsiA3Jix+Sbssi8RBIszr1pBQQ6Ak3SdDEr/ca6 IfBm7CMdogfk41dJHyMIh0padi9U2vSQRL+XVij4pvPYgwmoe7yx/M6S0KPR42/G ntzBf5kH0RSUzdyWi2TD5gDE/6FdNaIhGFWPunMGEoWB8/ratxH/LKyXv+29ucRc N5Uqm4h0r1h+Mhfbv/1C =rJaS -----END PGP SIGNATURE----- --Apple-Mail=_1477694A-F5A9-4890-9FEB-D7B46C47AC22-- From owner-svn-src-all@freebsd.org Sat Dec 3 03:56:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0542C63768; Sat, 3 Dec 2016 03:56:21 +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 BFD3F1A28; Sat, 3 Dec 2016 03:56:21 +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 uB33uKLk088463; Sat, 3 Dec 2016 03:56:20 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB33uKWx088462; Sat, 3 Dec 2016 03:56:20 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612030356.uB33uKWx088462@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 03:56:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309474 - head/contrib/netbsd-tests/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 03:56:22 -0000 Author: ngie Date: Sat Dec 3 03:56:20 2016 New Revision: 309474 URL: https://svnweb.freebsd.org/changeset/base/309474 Log: Don't build :strvis_locale if VIS_NOLOCALE is undefined The copy of contrib/libc-vis on ^/stable/10 doesn't contain all of the features in the ^/stable/11 // ^/head version, including VIS_NOLOCALE. The risk is lower in conditionally running the test instead of backporting the newer version of libc-vis MFC after: now Modified: head/contrib/netbsd-tests/lib/libc/gen/t_vis.c Modified: head/contrib/netbsd-tests/lib/libc/gen/t_vis.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_vis.c Sat Dec 3 03:15:09 2016 (r309473) +++ head/contrib/netbsd-tests/lib/libc/gen/t_vis.c Sat Dec 3 03:56:20 2016 (r309474) @@ -144,6 +144,9 @@ ATF_TC_BODY(strunvis_hex, tc) } } +/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ +#ifdef VIS_NOLOCALE +/* End FreeBSD */ ATF_TC(strvis_locale); ATF_TC_HEAD(strvis_locale, tc) { @@ -172,6 +175,9 @@ ATF_TC_BODY(strvis_locale, tc) setlocale(LC_CTYPE, ol); free(ol); } +/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ +#endif /* VIS_NOLOCALE */ +/* End FreeBSD */ ATF_TP_ADD_TCS(tp) { @@ -180,7 +186,13 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, strvis_null); ATF_TP_ADD_TC(tp, strvis_empty); ATF_TP_ADD_TC(tp, strunvis_hex); +/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ +#ifdef VIS_NOLOCALE +/* End FreeBSD */ ATF_TP_ADD_TC(tp, strvis_locale); +/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ +#endif /* VIS_NOLOCALE */ +/* End FreeBSD */ return atf_no_error(); } From owner-svn-src-all@freebsd.org Sat Dec 3 03:59:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D04A1C6392A; Sat, 3 Dec 2016 03:59:25 +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 9F6881C32; Sat, 3 Dec 2016 03:59:25 +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 uB33xO4T088623; Sat, 3 Dec 2016 03:59:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB33xOK7088622; Sat, 3 Dec 2016 03:59:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612030359.uB33xOK7088622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 03:59:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309475 - stable/11/contrib/netbsd-tests/lib/libc/gen X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 03:59:25 -0000 Author: ngie Date: Sat Dec 3 03:59:24 2016 New Revision: 309475 URL: https://svnweb.freebsd.org/changeset/base/309475 Log: MFC r309474: Don't build :strvis_locale if VIS_NOLOCALE is undefined The copy of contrib/libc-vis on ^/stable/10 doesn't contain all of the features in the ^/stable/11 // ^/head version, including VIS_NOLOCALE. The risk is lower in conditionally running the test instead of backporting the newer version of libc-vis Modified: stable/11/contrib/netbsd-tests/lib/libc/gen/t_vis.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/netbsd-tests/lib/libc/gen/t_vis.c ============================================================================== --- stable/11/contrib/netbsd-tests/lib/libc/gen/t_vis.c Sat Dec 3 03:56:20 2016 (r309474) +++ stable/11/contrib/netbsd-tests/lib/libc/gen/t_vis.c Sat Dec 3 03:59:24 2016 (r309475) @@ -144,6 +144,9 @@ ATF_TC_BODY(strunvis_hex, tc) } } +/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ +#ifdef VIS_NOLOCALE +/* End FreeBSD */ ATF_TC(strvis_locale); ATF_TC_HEAD(strvis_locale, tc) { @@ -172,6 +175,9 @@ ATF_TC_BODY(strvis_locale, tc) setlocale(LC_CTYPE, ol); free(ol); } +/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ +#endif /* VIS_NOLOCALE */ +/* End FreeBSD */ ATF_TP_ADD_TCS(tp) { @@ -180,7 +186,13 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, strvis_null); ATF_TP_ADD_TC(tp, strvis_empty); ATF_TP_ADD_TC(tp, strunvis_hex); +/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ +#ifdef VIS_NOLOCALE +/* End FreeBSD */ ATF_TP_ADD_TC(tp, strvis_locale); +/* Begin FreeBSD: ^/stable/10 doesn't have VIS_NOLOCALE */ +#endif /* VIS_NOLOCALE */ +/* End FreeBSD */ return atf_no_error(); } From owner-svn-src-all@freebsd.org Sat Dec 3 05:00:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 336EAC4AA37; Sat, 3 Dec 2016 05:00:31 +0000 (UTC) (envelope-from kevans91@ksu.edu) Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0043.outbound.protection.outlook.com [104.47.40.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A79131089; Sat, 3 Dec 2016 05:00:29 +0000 (UTC) (envelope-from kevans91@ksu.edu) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ksu.edu; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=7iXOC88RAQE3aeLhYCGKsvwhN2U2Akn5hqHnxeB1+aY=; b=qU97gb7TTZ/4SvD5Beaq9xybGC6jqc1FRyEoRCc/GmHaQSFxGNAtPvRehghuSE6TXM4HOMs4yFVtPDCX8jHhkNsLS+8obMS1Wa3TYiFk7a/bD0EuAjwFhdA7ZO+7LdOBPEhRfCLPg9UnjCXEcKfh6ai+6xKcFUzVXpANrR+kDuM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=kevans91@ksu.edu; Received: from mail-yw0-f174.google.com (209.85.161.174) by CY1PR0501MB1324.namprd05.prod.outlook.com (10.160.226.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.761.5; Sat, 3 Dec 2016 04:45:09 +0000 Received: by mail-yw0-f174.google.com with SMTP id a10so228332472ywa.3; Fri, 02 Dec 2016 20:45:09 -0800 (PST) X-Gm-Message-State: AKaTC02tVK8Reyu+YeF+fMDoUaB15hmiYBrrodIieWpWKteuTrghCI7q06FQLx8CuK2EhxDjKC+wzodzT5zb6Q== X-Received: by 10.13.247.65 with SMTP id h62mr49054579ywf.56.1480740303642; Fri, 02 Dec 2016 20:45:03 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.5.12 with HTTP; Fri, 2 Dec 2016 20:44:43 -0800 (PST) In-Reply-To: <201612012220.uB1MKSbR054941@repo.freebsd.org> References: <201612012220.uB1MKSbR054941@repo.freebsd.org> From: Kyle Evans Date: Fri, 2 Dec 2016 22:44:43 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r309374 - in head: sbin/camcontrol sys/cam/scsi To: "Kenneth D. Merry" CC: , , Content-Type: text/plain; charset="UTF-8" X-Originating-IP: [209.85.161.174] X-ClientProxiedBy: BN3PR16CA0006.namprd16.prod.outlook.com (10.165.112.144) To CY1PR0501MB1324.namprd05.prod.outlook.com (10.160.226.141) X-MS-Office365-Filtering-Correlation-Id: 7cf0b403-6735-430e-a8d2-08d41b372969 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:CY1PR0501MB1324; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0501MB1324; 3:Y1ik/7L7Rk/7BEGBPSavMJAAys7pU22+XkVyvR5SB/G1BoBHddDNvqydDhpAjKHTk/+OW7FNlalpq4oDkup4Z9xtB7RranlzXA+1RHD3sz4dDfKJBQjAD/+A3IZH59kC7t5SDuyxBaiQuX+/ssTPZ8AGB5DohvRl/AFIzhXJdeYBSr7jzAShAwQrqxVMc5yFVYvJbytKfbf4wH3HvBK3ExMGNPrsJl+/OE+41K/DLMDeGs2vzK7bV4utXSi4HbiWN+8EEzlU9ahjyuCmRPoDTA== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0501MB1324; 25:EDi8nsmejSesKBsmber8amS8XD82hQJKDjWp6bHkvRZRgpwIZiSfzOdF5/3C77VceYUkCBInFCKcuQt8xqX65GszBaRGwxwmLMpMapbJUsKJncqaBOCyftEt+kTD44KqTW4VUbCu36seniuJ3D/DtFUqsrAftaOt/F9ex8I6ueF3V/dTj7hTMBbsb2i92F/5jVUOaQBIAs+ThUbbHyRT74Cwm+mu9g6GfSdXIHH1BpetUEOB7WzNaWutzMKnpLHYbBNHOfie8RjpYp1IPtL1ZIQALicheb0lSzLf15lknJa47ZFjRsdAoMR2t6b0bAUgLw3nOFEfDvxdwhqPT/4qhb1BYOoc/Wlvm/c4TTTAC4foSiutJOCrUk+IDrP8G1L/vfFB3lU7nLMM/2jGET8N3hxfqL/1l9Ktt8ThsBKH2yvnHiQmkD4GyyY5DgHQ8oHdFPG3spkdrY/Ywtn2qZjizoViFBZzkMdObtDHUptWpZ5acUBPoQjvHiNcDQKF8UhI2khRk0dH0l30GCUoZkU/8AEoOZl+APYpkYCrTZlIuRznURKF5zVRdt01tt+2QsesBtWIUYCaZTgVY3ugJdJ5GT5hPEQHf/DbcuqqyExoBjgjP7OYnB9z2Mu8OLIJtkJq7amRI4z62pCavuCTh3YU8MLQ1nHEOBMAAmHNX0Cl7FwLNGWGqfSBz9RBd2FD2MB0mPomvCaTInU8RWBxBGGl0AemLGmRI6Alz2bdAtD+MZQYxGjd9F5jZSKmE0LlOkjAKW5mpzQVOOakZP1jcUqBnA3eKP0IfK9KhANTyYqr4epW/ohdtnPynluZtk2tigyhIuof5VRHbo5Z3q0DcoK6a77wMMcCQcWNixLSyNiGk5qUn1hPsBrPadyVqTgv0CTH X-Microsoft-Exchange-Diagnostics: 1; CY1PR0501MB1324; 31:On66lkMUpe5i3zB4XuZXwiVtTtj42puOXSBW9N4m+wCQMqFq9u9pY1xwqXOnB064c8EMp4HrZU1XB77zykBPDi04u3H012vRYJnjVLJGTuEFWVigpJwr9kv+ZavlNfo0EwjCEeMyprQ6Ou9MCJkff1ksgsD4/umLpNe2GDBaz/0Z908ThS7pIJ1HQ8+UDCxl3ISvtFBpN4VrohoDKtAhKaj36HaBoqkM+C4dzT9wLGQkJvMhEQg1xtWaSOgh1sdqN+4M0z2yjGTX3H36YdqJzQ==; 20:2Ybv8gfUyF7DsIu768jHpox/wSCiaL9LJn0ijwBEF/DoR2LWrFxT8HcPn76d6iHOYAmD0+bAsOib6JjgfSmqWaIwReN9GTfBPNNe1CHVQNLQIye6BIBtlgnp08t9+6ekLF8FRVmTuNzAeqo7mmnIBqRY9XvuYFx70aCJYl2Aduj8ECrLyhbaue05WhcufvgA4fj1PwJLkOvYiTY8d3LZQV3eJAF9vY1Ta2jGxvQeofqruuCSOyc++V27UB2vubWZ0g+QPT0EqkQZROjL8Ko4FaOHbWY6S6VJDI2hPz5tz5mXMfz/k/Oj2YOZ+LCAt61oWaMsVUJ/wiyLDFdx/FkdN+xmVAEt5mGmWYzrsvbSSVtxDWb5hAYvIOpbwshLJJgXALAxjiCHBOFPU6Ni2Y60ilzsTOlaMfJbbKwKsdbJ/rB+QkNl/ipnJgOWS1edFDHYbXQtSX7lk7lErJwIosB86ziZ8YP5meRH2pW3qPSEZKiay2kZm09uC6xS8dGCjrJH X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(56005881305849)(211171220733660); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(20161123555025)(20161123562025)(20161123564025)(20161123560025)(6072148); SRVR:CY1PR0501MB1324; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0501MB1324; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0501MB1324; 4:YhB2alo8Y+ZMQM2udDBN4rdUfSQ5ikyTndXJZWz8DR07YgBjuuQQBwirDWlShSTbzcOA3/tby5gpRjuqjjITK+d74WZvgSZ3tTEnb1NCL8BELSOnBS8sMUTr1f1CAXhODsxXAaqmKed/nQmydXzaI6L5wuhJZfBBRmfrp0JkWa7XlyVdIILcKpLZkQ+8ZVO6oQajxFfGUhTHpuG2ZLJBx+fJuPT6wfxglP0ed2valQoz5EeXcgpHcEQE8DVFsw2RttaJeHkn+o4RQJC0AiSFcKDm8pT2FQV6JAw7V4Ik6l+tXDjB8/nDKPp0QwtIbYdSULF8s9nbruBgKNHZgDCOUpQ7356pAtNGVb44zf94sl/vpY7dA29nWc+Ie+pfzT3JMtljLyC0qwKS/RU2meYU7949THp+ucM3WTdx5W5abrBzz2OlytW0KhVaPwc10M9xNAVOD3P4XaMhS0FvnZwXqyajUi3/CAhtraXjtBUtURzi5cWs5vBgxsmlB0UM7Wi3zrACb1Gz4xTOKpKhRzbTQqaPbP5/7Frh4xhkM2enw7hd+sLLz0M+UMoP2E+TuNqOH4WsumoWZS8GYqnRjNM9qFILAlo/db5eDNR3z013Dzk+iu/y6OrG/v/XfvalD+OM2jeYqG8ykCzLRRWINaVabg== X-Forefront-PRVS: 0145758B1D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(189002)(199003)(13624006)(24454002)(377454003)(38730400001)(9896002)(68736007)(450100001)(122856001)(5820100001)(9686002)(69596002)(4326007)(90282001)(106356001)(105586002)(229853002)(97736004)(42186005)(8676002)(66066001)(92566002)(81156014)(86362001)(81166006)(50466002)(47776003)(61266001)(59536001)(55446002)(23676002)(305945005)(189998001)(89122001)(88552002)(39450400002)(63696999)(7736002)(2950100002)(3846002)(7846002)(54356999)(6116002)(50986999)(101416001)(6916009)(76176999)(75432002)(110136003)(2906002)(93516999)(61726006)(5660300001)(55456009); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0501MB1324; H:mail-yw0-f174.google.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: ksu.edu does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtDWTFQUjA1MDFNQjEzMjQ7MjM6Q0RDeGZmMHQ1VytJQUR6cVplalo0VWlG?= =?utf-8?B?ZndObzE4Q1RJSDZVMVBGd001dG5GV2xoZUErSytMRWUxY2oyMDlMZTZmd2Fv?= =?utf-8?B?em9iclhtYmJ0REVQUjc1QmdtblE3ckZJUm1McHdFZnJ2MjE0ME9laFo5QVVn?= =?utf-8?B?bnlPakRMVE91RDFManIzT0hZbE94akFmRWsrazRlem9IeG42MFYxZ0VvUmVC?= =?utf-8?B?VkZVVnRsQmJoeDVJY1M0eXphVkZxc2xUZUhRclJGY21hbWNFOWZiUzI3Yy83?= =?utf-8?B?U1ZmSms2QllNU0RaRFR4bXhnOTFtR0k0c3F4WW9uejhqUFJuQ3hVdzNmUWxu?= =?utf-8?B?c2piODBHWDJlMUVVU0JteWZQYUZ5aXN1ZjhUbWZMeTRrZHpweXJlSjNEcEFr?= =?utf-8?B?NUJwN3hnUlZuOSs5VDcrZStYQVc5dU8yUDBCcXg0RlJTK0sxSUZXeG4vNkJt?= =?utf-8?B?TUpGd24yM1lsWWtXOSs4dnF2N05IOEFJS0d2OThERnlYSm9SanVUcnp0TFIz?= =?utf-8?B?QWxZQ25USlFTdUp5OStteWpkQnA2VXFsWjZ6VWVJZEVaZGYvam5EcTJyVkxk?= =?utf-8?B?V1BKUHY2WmhwbjVBTnRSb0NtVlhacXJiQW5HbXdSZUlFMFpNZm9iZlNJQXlr?= =?utf-8?B?V0tldi8ra0hLOVFyRXVQK0UxeENDaCtKQnpKWDFoMXA0QzhIYVJ0OHJtcW1N?= =?utf-8?B?VDlydXlKUDAwTERHdUJUVWVJRHRjc2VXNEhKR2NzSXIyRmJYRncwVXFXVTVY?= =?utf-8?B?QjlNU2MweXd3d2lxaXFucllnSkhma2N6OVBGM3FRbDNCK1R1aURLZk5DVlhY?= =?utf-8?B?Z24ybGNSYjlrZnVzOEhLZE9xS3A5Q1JmWkg2QzRwNXFaVWovQm1ES243YXFp?= =?utf-8?B?MW1FZG1wUnYyN2lNUHZRYnM1MlNJdkVUcWp6VFFmTE01eEI1b29WQU1Eanp2?= =?utf-8?B?RmJZZGNVVkpjVEtxYUVOb1pQL0RBMmdIYkdaNnN0dHgvK1E3UDNzcXNJTW1o?= =?utf-8?B?aTZFVStoSFNGem5JeTZPb2w0d3h0MjJQK3A4NDZiaWNONDVuV1hpb3ZnSHpq?= =?utf-8?B?cHd0aE9OU1ZiZlBheVJiQjY3MDNnMll5WldQSEJkajdnNG5LeDVNV09haUJF?= =?utf-8?B?ODJSOWh2clVQZTdQQjRTdWxCNkx5K0ZidWVETE1CUElpZGVqbFNmZWRuYm1K?= =?utf-8?B?WXZBY2hHaXhBZ3kwUXNFd1RNdFdCZTUwNjRlcDNKMWNEUkRhbFZlUXI2WEsr?= =?utf-8?B?Y2gxTmxQS0dYcDFtZktvV0dkajcvMzc2MHRTQUxTbndraVRRa25Gbk5veWhy?= =?utf-8?B?L0VaYWgzcXc4b3FUT2tRb3pvb0VIMlhHdU5RUFNvcjhPTWxiMjFzckRaVWxG?= =?utf-8?B?eVNzaHpoSFhtL2RjOVJ1dHJxVG9hcWFUdFJzVHRsSHFOcEREcDB4K0thYm03?= =?utf-8?B?YmdzSWhhSHpWcHlrVVZBcFpXMjBZS3dRUW12VlVWNS92L3YyUVFic1JDNEkw?= =?utf-8?B?ZEt4Sm81emM4ZTlTaFArU2sxamN6ZHBpZU84Y09xTVNwcHpQbHhkdWcrSG84?= =?utf-8?B?K1ZDMnUxMzB2dkw1UU85TVpuRjhWQmlXTUxHcG1rVDdVZ01jamFPU3ZrcGRW?= =?utf-8?B?YU8zcnhRVUE2eC96YUdqRDh0ZGp5K284MFM3WTlwVzg1ZGE1d1cwK2JUSVBy?= =?utf-8?B?Vlh1eWhKcCt3SXdPclRxRmVqSEsya3JKTlMxZVphcnA1a3dJRDBCM0F3alB4?= =?utf-8?B?SWoyMjBEOVZBQ0hCTDFVRk5BV0FOVm1UaTRORGoySDR2OHY4c0ZSV1pqTnMy?= =?utf-8?B?NUhML0U0WlRwbE5UZFZEdHVkcGpBVkd3Mm9hUTVKdnFPanhiZndjbWVzc3ZK?= =?utf-8?Q?9H3xhQmZfG8bc=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0501MB1324; 6:E6ASrq26vNz+H6Ogjg2bz+48gTsA0BitRyAG1glk/AdVbwtsrzFCt2NSupqZEmrpRgFY+65H1jbsmZVAgLtnf+hyf7L/YZbOGHrIm9Xa+AduxvL93EOH5MtGm4b3Rlw39YiMOgvDv+yeUZ8wWF8Al/VmVGYAorf1rgS1Y5ehpfqn/k6xH6lHErur5k4hHSuVfKjoP0h96pVe/22bH2tzMViyQaHyCaiYKCF5l0RDXEmM3CfSHsTakzOzhwBiId08/enth2FAKlgm/FybS1hcG2tL56fhsp+LQQH7oe9xJxVFU8DGX3x7mUCIdFplFckvWGR/QTMmCZfx43ny1BH9uoY0aT9R061LaY71sH9ziAczl47kYf7TBJob/7pG9h++uz2xKfQh262gXWbD2eCnWgpQd42zP4AT0gwC2M9OvW87qUlRe8QxX/kUOPpesEX93gD64yx+UiKCNnmpcLvoVA==; 5:2HQnJB4mRgNp0zSopWFlkQCzaEJ6baGKmKHR5eX6VYaGiWmZUCAEUUkRX/x2LAdVoAgdQx0eAne3PfHp3QuKPh7XKtOHs3MIiSDJMH4DBo47BNKlMGP/HHTG5Yb90iYXM4l12Cghq8OUTVYoq1dRGXfKZ3BUeOg9FIq1tbdePkw=; 24:AXLcKAHbnlO0/lY/SG9ZyP2GilpJR2hHw2ruUHYx21DIj1C12uflBJFfSBcavTRfC8J7xSN6ld/aYx/Tv5VoTcIQBdez016UK/ohwbDSeBc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0501MB1324; 7:jj6RNO4WJMme3IIbS4AvV39CU4mNdahDjXONMAW4AsQ6rjcIh1/jTp4fFX90c3jINQFB3WmrXApE811jBeAvPASBqON5u5kIiFCHFGDtfHyEDozUSZpuM+BiLKMWTIiWCl7poL9YSSuAcCymvga+hLS2/ELeXoyRaGDaWfGJX0zwg6ivMpSBO8B742UPrWE2jsJVvqG69ubcbfLMNoH6C+SqTCMU/Ybe010XBJD5J8/+j8vDxntux6E+OODnxYBs/iG6voRNGiZa5ZFzOuMcOmfnLIksfSWDfD2buj1JZwflqhbZtgbc8HhXgUCi4qLZ4EBSMqIln12gDuqZAqVoD3nzgRGhyzPv1tFqXCETq3gGqyNIA9mg8F23f5F8yxSTFUEmFnl19x2689kxPbYtk2nWIsz0CnjLF3DmIPuZL01FmtFxjFC8v+qkIvI+ccnvixl73F6yhj3dE5XCr4IHxg==; 20:W8eynyrhVGjdD4iZDKNYTytJk/8lW4XI68PTt8n/NwC+lXDUe2G+Dfv1wmrgbXYi9ZujAD4f/2Ym/TNNTP9F0y70BlCAVySF6a9xGDHaGJlqKCAcMJcUAPA+p0IHteDXqBvjkqKAsUMtNhHXHdmKJ9aBOMc0g4C7xB2FRArDmC8= X-OriginatorOrg: ksu.edu X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Dec 2016 04:45:09.7994 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0501MB1324 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 05:00:31 -0000 On Thu, Dec 1, 2016 at 4:20 PM, Kenneth D. Merry wrote: > Author: ken > Date: Thu Dec 1 22:20:27 2016 > New Revision: 309374 > URL: https://svnweb.freebsd.org/changeset/base/309374 > > Log: > Add SCSI REPORT TIMESTAMP and SET TIMESTAMP support. > > This adds support to camcontrol(8) and libcam(3) for getting and setting > the time on SCSI protocol drives. This is more commonly found on tape > drives, but is a SPC (SCSI Primary Commands) command, and may be found > on any device that speaks SCSI. > > The new camcontrol timestamp subcommand allows getting the current device > time or setting the time to the current system time or any arbitrary time. > > sbin/camcontrol/Makefile: > Add timestamp.c. > > sbin/camcontrol/camcontrol.8: > Document the new timestamp subcommand. > > sbin/camcontrol/camcontrol.c: > Add the timestamp subcommand to camcontrol. > > sbin/camcontrol/camcontrol.h: > Add the timestamp() function prototype. > > sbin/camcontrol/timestamp.c: > Timestamp setting and reporting functionality. > > sys/cam/scsi/scsi_all.c: > Add two new CCB building functions, scsi_set_timestamp() and > scsi_report_timestamp(). Also, add a new helper function, > scsi_create_timestamp(). > > sys/cam/scsi/scsi_all.h: > Add CDB and parameter data for the the set and report timestamp > commands. > > Add function declarations for the new CCB building and helper > functions. > > Submitted by: Sam Klopsch > Sponsored by: Spectra Logic > MFC After: 2 weeks > > Added: > head/sbin/camcontrol/timestamp.c (contents, props changed) > Modified: > head/sbin/camcontrol/Makefile > head/sbin/camcontrol/camcontrol.8 > head/sbin/camcontrol/camcontrol.c > head/sbin/camcontrol/camcontrol.h > head/sys/cam/scsi/scsi_all.c > head/sys/cam/scsi/scsi_all.h > > Modified: head/sbin/camcontrol/Makefile > ... > +timestamp(struct cam_device *device, int argc, char **argv, char *combinedopt, > + int retry_count, int timeout, int verbosemode __unused) > +{ > + int c; > + uint64_t ts; > + char *format_string = NULL; > + char *timestamp_string = NULL; > + int action = -1; > + int error = 0; > + int single_arg = 0; > + int do_utc = 0; > + > + if (action == TIMESTAMP_REPORT) { > + error = report_timestamp(device, &ts, retry_count, > + timeout); > + if (error != 0) { > + goto bailout; > + } else if (strcmp(format_string, MIL) == 0) { > + printf("Timestamp in milliseconds: %ju\n", > + (uintmax_t)ts); > + } else { > + char temp_timestamp_string[100]; > + time_t time_var = ts / 1000; Hi, FWIW: Building -CURRENT on mips.mips (w/ freebsd-wifi-build), mips-gcc gets upset at the above line with the following error: /wifi-build/src/sbin/camcontrol/timestamp.c: In function 'timestamp': /wifi-build/src/sbin/camcontrol/timestamp.c:459:25: error: 'ts' may be used uninitialized in this function [-Werror=maybe-uninitialized] time_t time_var = ts / 1000; I understand that this is a bogus error because at this point it pretty much *has* to be set by the report_timestamp call just prior, but is there a clean way to trick GCC into agreeing, or is it just a matter of explicitly initializing it to 0 before the report_timestamp call? Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Sat Dec 3 05:29:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06225C64544; Sat, 3 Dec 2016 05:29:14 +0000 (UTC) (envelope-from bdrewery@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 C9C921FD3; Sat, 3 Dec 2016 05:29:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB35TC7e025017; Sat, 3 Dec 2016 05:29:12 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB35TCal025016; Sat, 3 Dec 2016 05:29:12 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201612030529.uB35TCal025016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 3 Dec 2016 05:29:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309476 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 05:29:14 -0000 Author: bdrewery Date: Sat Dec 3 05:29:12 2016 New Revision: 309476 URL: https://svnweb.freebsd.org/changeset/base/309476 Log: Create the /usr/lib/include symlink as relative. This ugly code is done to avoid assuming LIBDIR is 2 components deep. Reported by: jhb Modified: head/include/Makefile Modified: head/include/Makefile ============================================================================== --- head/include/Makefile Sat Dec 3 03:59:24 2016 (r309475) +++ head/include/Makefile Sat Dec 3 05:29:12 2016 (r309476) @@ -108,7 +108,7 @@ NEWVERS_SH= ${SYSDIR}/conf/newvers.sh PARAM_H= ${SYSDIR}/sys/param.h MK_OSRELDATE_SH= ${.CURDIR}/mk-osreldate.sh -SYMLINKS+= ${INCLUDEDIR} ${LIBDIR}/include +SYMLINKS+= ${LIBDIR:C,[^/]+,..,g:C,^/,,}${INCLUDEDIR} ${LIBDIR}/include osreldate.h: ${NEWVERS_SH} ${PARAM_H} ${MK_OSRELDATE_SH} env NEWVERS_SH=${NEWVERS_SH} PARAMFILE=${PARAM_H} SYSDIR=${SYSDIR} \ From owner-svn-src-all@freebsd.org Sat Dec 3 05:29:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20EF8C64617; Sat, 3 Dec 2016 05:29:33 +0000 (UTC) (envelope-from bdrewery@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 C79051EE; Sat, 3 Dec 2016 05:29:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB35TVx3025070; Sat, 3 Dec 2016 05:29:31 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB35TVDQ025067; Sat, 3 Dec 2016 05:29:31 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201612030529.uB35TVDQ025067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 3 Dec 2016 05:29:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309477 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 05:29:33 -0000 Author: bdrewery Date: Sat Dec 3 05:29:31 2016 New Revision: 309477 URL: https://svnweb.freebsd.org/changeset/base/309477 Log: Revert r296585. This broke installing dtrace test files. It was poorly tested. Reported by: markj Pointyhat to: bdrewery MFC after: 1 week Modified: head/share/mk/bsd.confs.mk head/share/mk/bsd.files.mk head/share/mk/bsd.incs.mk Modified: head/share/mk/bsd.confs.mk ============================================================================== --- head/share/mk/bsd.confs.mk Sat Dec 3 05:29:12 2016 (r309476) +++ head/share/mk/bsd.confs.mk Sat Dec 3 05:29:31 2016 (r309477) @@ -6,10 +6,8 @@ CONFGROUPS?= CONFS -_CONFGROUPS= ${CONFGROUPS:C,[/*],_,g} - .if !target(buildconfig) -.for group in ${_CONFGROUPS} +.for group in ${CONFGROUPS} buildconfig: ${${group}} .endfor .endif @@ -19,7 +17,7 @@ all: buildconfig .endif .if !target(installconfig) -.for group in ${_CONFGROUPS} +.for group in ${CONFGROUPS} .if defined(${group}) && !empty(${group}) ${group}OWN?= ${SHAREOWN} Modified: head/share/mk/bsd.files.mk ============================================================================== --- head/share/mk/bsd.files.mk Sat Dec 3 05:29:12 2016 (r309476) +++ head/share/mk/bsd.files.mk Sat Dec 3 05:29:31 2016 (r309477) @@ -9,9 +9,7 @@ ____: FILESGROUPS?= FILES -_FILESGROUPS= ${FILESGROUPS:C,[/*],_,g:u} - -.for group in ${_FILESGROUPS} +.for group in ${FILESGROUPS} # Add in foo.yes and remove duplicates from all the groups ${${group}}:= ${${group}} ${${group}.yes} ${${group}}:= ${${group}:O:u} @@ -22,7 +20,7 @@ buildfiles: ${${group}} all: buildfiles .endif -.for group in ${_FILESGROUPS} +.for group in ${FILESGROUPS} .if defined(${group}) && !empty(${group}) installfiles: installfiles-${group} Modified: head/share/mk/bsd.incs.mk ============================================================================== --- head/share/mk/bsd.incs.mk Sat Dec 3 05:29:12 2016 (r309476) +++ head/share/mk/bsd.incs.mk Sat Dec 3 05:29:31 2016 (r309477) @@ -8,8 +8,6 @@ INCSGROUPS?= INCS -_INCSGROUPS= ${INCSGROUPS:C,[/*],_,g} - .if defined(NO_ROOT) .if !defined(TAGS) || ! ${TAGS:Mpackage=*} TAGS+= package=${PACKAGE:Uruntime} @@ -18,7 +16,7 @@ TAG_ARGS= -T ${TAGS:[*]:S/ /,/g} .endif .if !target(buildincludes) -.for group in ${_INCSGROUPS} +.for group in ${INCSGROUPS} buildincludes: ${${group}} .endfor .endif @@ -28,7 +26,7 @@ all: buildincludes .endif .if !target(installincludes) -.for group in ${_INCSGROUPS} +.for group in ${INCSGROUPS} .if defined(${group}) && !empty(${group}) ${group}OWN?= ${BINOWN} From owner-svn-src-all@freebsd.org Sat Dec 3 05:29:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99EF1C64622; Sat, 3 Dec 2016 05:29:36 +0000 (UTC) (envelope-from bdrewery@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 4F6FE210; Sat, 3 Dec 2016 05:29:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB35TZ5Q025120; Sat, 3 Dec 2016 05:29:35 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB35TZOe025117; Sat, 3 Dec 2016 05:29:35 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201612030529.uB35TZOe025117@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 3 Dec 2016 05:29:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309478 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 05:29:36 -0000 Author: bdrewery Date: Sat Dec 3 05:29:35 2016 New Revision: 309478 URL: https://svnweb.freebsd.org/changeset/base/309478 Log: DIRDEPS_BUILD: Fix '/' in group names creating a bad cookie. This is reworking the change in r296585 but to still properly install the files. This limits the change to only the DIRDEPS_BUILD logic for what it considers the name of the staging set, which is what the cookie name is based off of. Sponsored by: Dell EMC Isilon MFC after: 1 week Modified: head/share/mk/bsd.confs.mk head/share/mk/bsd.files.mk head/share/mk/bsd.incs.mk Modified: head/share/mk/bsd.confs.mk ============================================================================== --- head/share/mk/bsd.confs.mk Sat Dec 3 05:29:31 2016 (r309477) +++ head/share/mk/bsd.confs.mk Sat Dec 3 05:29:35 2016 (r309478) @@ -24,8 +24,8 @@ ${group}OWN?= ${SHAREOWN} ${group}GRP?= ${SHAREGRP} ${group}MODE?= ${CONFMODE} ${group}DIR?= ${CONFDIR} -STAGE_SETS+= ${group} -STAGE_DIR.${group}= ${STAGE_OBJTOP}${${group}DIR} +STAGE_SETS+= ${group:C,[/*],_,g} +STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${group}DIR} _${group}CONFS= .for cnf in ${${group}} Modified: head/share/mk/bsd.files.mk ============================================================================== --- head/share/mk/bsd.files.mk Sat Dec 3 05:29:31 2016 (r309477) +++ head/share/mk/bsd.files.mk Sat Dec 3 05:29:35 2016 (r309478) @@ -28,8 +28,8 @@ ${group}OWN?= ${SHAREOWN} ${group}GRP?= ${SHAREGRP} ${group}MODE?= ${SHAREMODE} ${group}DIR?= ${BINDIR} -STAGE_SETS+= ${group} -STAGE_DIR.${group}= ${STAGE_OBJTOP}${${group}DIR} +STAGE_SETS+= ${group:C,[/*],_,g} +STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${group}DIR} .if defined(NO_ROOT) .if !defined(${group}TAGS) || ! ${${group}TAGS:Mpackage=*} Modified: head/share/mk/bsd.incs.mk ============================================================================== --- head/share/mk/bsd.incs.mk Sat Dec 3 05:29:31 2016 (r309477) +++ head/share/mk/bsd.incs.mk Sat Dec 3 05:29:35 2016 (r309478) @@ -33,9 +33,9 @@ ${group}OWN?= ${BINOWN} ${group}GRP?= ${BINGRP} ${group}MODE?= ${NOBINMODE} ${group}DIR?= ${INCLUDEDIR}${PRIVATELIB:D/private/${LIB}} -STAGE_SETS+= ${group} -STAGE_DIR.${group}= ${STAGE_OBJTOP}${${group}DIR} -STAGE_SYMLINKS_DIR.${group}= ${STAGE_OBJTOP} +STAGE_SETS+= ${group:C,[/*],_,g} +STAGE_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP}${${group}DIR} +STAGE_SYMLINKS_DIR.${group:C,[/*],_,g}= ${STAGE_OBJTOP} _${group}INCS= .for header in ${${group}} From owner-svn-src-all@freebsd.org Sat Dec 3 05:38:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2A87C648EF; Sat, 3 Dec 2016 05:38:45 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp004.me.com (mr11p00im-asmtp004.me.com [17.110.69.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86F35AB1; Sat, 3 Dec 2016 05:38:45 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp004.me.com by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OHL00A00GVXHA00@mr11p00im-asmtp004.me.com>; Sat, 03 Dec 2016 05:38:23 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=4d515a; t=1480743503; bh=3Ob/M+uh5pIJ/jfWk1Ttzkuu1cFkPcBZvWK1Za5sk4E=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=uugDXZ983mPgfv2Hu3AgKOiuW3fY03k4zeBhzjfRhm1TL222tdMaYOAkr9dN7sH1h O4dvEv8+JJJsxp/2jtdTZpuW/gAIglFtv9BQmTuY/Vmncc31ALHXOoHnrH6/EhZ7Ws /FckjL4jwGRab8B4GraxVQcL3UmdI26dRuJwFvMjyTrfKYCuZDzojnYX9QZiO2MzF1 QbtO7DKHbW8HA7m6lxh5DJGJjzjZ5Kh3A0/yRlsWxefQsdePool2g5ddqNqJaKk8t9 d0IbMxY0rq3F40kzNoOUR1oVJC32VVf+sLOQWm3LTl8xKSOjTXqlAFsPc5dY6sUjHq jlGFn6Pn0/p2Q== Received: from [192.168.1.4] (c-67-188-225-23.hsd1.ca.comcast.net [67.188.225.23]) by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OHL00EKOGZXBB30@mr11p00im-asmtp004.me.com>; Sat, 03 Dec 2016 05:38:23 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-12-03_04:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1034 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1612030099 User-Agent: Microsoft-MacOutlook/f.1c.1.161117 Date: Fri, 02 Dec 2016 21:38:19 -0800 Subject: Re: svn commit: r309374 - in head: sbin/camcontrol sys/cam/scsi From: Ravi Pokala Sender: "Pokala, Ravi" To: Kyle Evans , "Kenneth D. Merry" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: Thread-topic: svn commit: r309374 - in head: sbin/camcontrol sys/cam/scsi References: <201612012220.uB1MKSbR054941@repo.freebsd.org> In-reply-to: MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 05:38:45 -0000 -----Original Message----- > From: on behalf of Kyle Evans > Date: 2016-12-02, Friday at 20:44 > To: "Kenneth D. Merry" > Cc: , , > Subject: Re: svn commit: r309374 - in head: sbin/camcontrol sys/cam/scsi > >> [...] >> + >> + if (action == TIMESTAMP_REPORT) { >> + error = report_timestamp(device, &ts, retry_count, >> + timeout); >> + if (error != 0) { >> + goto bailout; >> + } else if (strcmp(format_string, MIL) == 0) { >> + printf("Timestamp in milliseconds: %ju\n", >> + (uintmax_t)ts); >> + } else { >> + char temp_timestamp_string[100]; >> + time_t time_var = ts / 1000; > > Hi, > > FWIW: Building -CURRENT on mips.mips (w/ freebsd-wifi-build), > mips-gcc gets upset at the above line with the following error: > > /wifi-build/src/sbin/camcontrol/timestamp.c: In function 'timestamp': > /wifi-build/src/sbin/camcontrol/timestamp.c:459:25: error: 'ts' may be > used uninitialized in this function [-Werror=maybe-uninitialized] > time_t time_var = ts / 1000; Interesting. I just did a tinderbox build earlier this evening, and this wasn't reported. > I understand that this is a bogus error because at this point it > pretty much *has* to be set by the report_timestamp call just prior, > but is there a clean way to trick GCC into agreeing, or is it just a > matter of explicitly initializing it to 0 before the report_timestamp > call? Actually, it's a valid warning. While all paths to that point in timestamp() go through report_timestamp(), not all paths through report_timestamp() set *ts. Specifically, if cam_getccb() or cam_send_ccb() fail, or the request was not completed, report_timestamp() does 'goto bailout' without setting *ts. I'm disappointed that `clang' (on i386 and amd64) didn't notice this; I was under the impression `clang' did more of that type of deep path analysis than `gcc'. -Ravi (rpokala@) > Thanks, > > Kyle Evans From owner-svn-src-all@freebsd.org Sat Dec 3 14:26:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D83B0C64C15; Sat, 3 Dec 2016 14:26:59 +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 8DF0116B5; Sat, 3 Dec 2016 14:26:59 +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 uB3EQwiC041564; Sat, 3 Dec 2016 14:26:58 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3EQwTk041562; Sat, 3 Dec 2016 14:26:58 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201612031426.uB3EQwTk041562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 3 Dec 2016 14:26:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309479 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 14:26:59 -0000 Author: avos Date: Sat Dec 3 14:26:58 2016 New Revision: 309479 URL: https://svnweb.freebsd.org/changeset/base/309479 Log: rsu: remove unused structures / variables. Modified: head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rsureg.h Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Sat Dec 3 05:29:35 2016 (r309478) +++ head/sys/dev/usb/wlan/if_rsu.c Sat Dec 3 14:26:58 2016 (r309479) @@ -2937,9 +2937,6 @@ rsu_init(struct rsu_softc *sc) /* Ensure the mbuf queue is drained */ rsu_drain_mbufq(sc); - /* Init host async commands ring. */ - sc->cmdq.cur = sc->cmdq.next = sc->cmdq.queued = 0; - /* Reset power management state. */ rsu_write_1(sc, R92S_USB_HRPWM, 0); Modified: head/sys/dev/usb/wlan/if_rsureg.h ============================================================================== --- head/sys/dev/usb/wlan/if_rsureg.h Sat Dec 3 05:29:35 2016 (r309478) +++ head/sys/dev/usb/wlan/if_rsureg.h Sat Dec 3 14:26:58 2016 (r309479) @@ -625,8 +625,6 @@ struct r92s_add_ba_req { #define RSU_RX_LIST_COUNT 100 #define RSU_TX_LIST_COUNT 32 -#define RSU_HOST_CMD_RING_COUNT 32 - #define RSU_RXBUFSZ (8 * 1024) #define RSU_TXBUFSZ \ ((sizeof(struct r92s_tx_desc) + IEEE80211_MAX_LEN + 3) & ~3) @@ -700,27 +698,6 @@ struct rsu_tx_radiotap_header { struct rsu_softc; -struct rsu_host_cmd { - void (*cb)(struct rsu_softc *, void *); - uint8_t data[256]; -}; - -struct rsu_cmd_newstate { - enum ieee80211_state state; - int arg; -}; - -struct rsu_cmd_key { - struct ieee80211_key key; -}; - -struct rsu_host_cmd_ring { - struct rsu_host_cmd cmd[RSU_HOST_CMD_RING_COUNT]; - int cur; - int next; - int queued; -}; - enum { RSU_BULK_RX, RSU_BULK_TX_BE_BK, /* = WME_AC_BE/BK */ @@ -755,12 +732,9 @@ struct rsu_softc { struct mbufq sc_snd; device_t sc_dev; struct usb_device *sc_udev; - int (*sc_newstate)(struct ieee80211com *, - enum ieee80211_state, int); - struct usbd_interface *sc_iface; + struct timeout_task calib_task; struct task tx_task; - const uint8_t *qid2idx; struct mtx sc_mtx; int sc_ht; int sc_nendpoints; @@ -775,10 +749,8 @@ struct rsu_softc { uint8_t sc_rftype; int8_t sc_nrxstream; int8_t sc_ntxstream; - struct rsu_host_cmd_ring cmdq; struct rsu_data sc_rx[RSU_RX_LIST_COUNT]; struct rsu_data sc_tx[RSU_TX_LIST_COUNT]; - struct rsu_data *fwcmd_data; uint8_t cmd_seq; uint8_t rom[128]; struct usb_xfer *sc_xfer[RSU_N_TRANSFER]; From owner-svn-src-all@freebsd.org Sat Dec 3 14:41:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E4D5C6438A; Sat, 3 Dec 2016 14:41:55 +0000 (UTC) (envelope-from kevlo@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 F21051FFE; Sat, 3 Dec 2016 14:41:54 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB3EfspB046548; Sat, 3 Dec 2016 14:41:54 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3EfsHZ046547; Sat, 3 Dec 2016 14:41:54 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201612031441.uB3EfsHZ046547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Sat, 3 Dec 2016 14:41:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309480 - head/sys/dev/rtwn/rtl8192c/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 14:41:55 -0000 Author: kevlo Date: Sat Dec 3 14:41:53 2016 New Revision: 309480 URL: https://svnweb.freebsd.org/changeset/base/309480 Log: Fix logic error so the R92C_TDECTRL register value is updated correctly. Reviewed by: avos Modified: head/sys/dev/rtwn/rtl8192c/usb/r92cu_init.c Modified: head/sys/dev/rtwn/rtl8192c/usb/r92cu_init.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/usb/r92cu_init.c Sat Dec 3 14:26:58 2016 (r309479) +++ head/sys/dev/rtwn/rtl8192c/usb/r92cu_init.c Sat Dec 3 14:41:53 2016 (r309480) @@ -333,9 +333,11 @@ void r92cu_init_tx_agg(struct rtwn_softc *sc) { struct rtwn_usb_softc *uc = RTWN_USB_SOFTC(sc); + uint32_t reg; - rtwn_setbits_4(sc, R92C_TDECTRL, - R92C_TDECTRL_BLK_DESC_NUM_M, uc->tx_agg_desc_num); + reg = rtwn_read_4(sc, R92C_TDECTRL); + reg = RW(reg, R92C_TDECTRL_BLK_DESC_NUM, uc->tx_agg_desc_num); + rtwn_write_4(sc, R92C_TDECTRL, reg); } void From owner-svn-src-all@freebsd.org Sat Dec 3 16:02:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7740EC65352; Sat, 3 Dec 2016 16:02:54 +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 381BB114A; Sat, 3 Dec 2016 16:02:54 +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 uB3G2r6o082339; Sat, 3 Dec 2016 16:02:53 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3G2r4e082338; Sat, 3 Dec 2016 16:02:53 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201612031602.uB3G2r4e082338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 3 Dec 2016 16:02:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309481 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 16:02:54 -0000 Author: avos Date: Sat Dec 3 16:02:53 2016 New Revision: 309481 URL: https://svnweb.freebsd.org/changeset/base/309481 Log: rsu: fix frame processing in the Rx path (similar to r292207). - Fill in Rx radiotap header correctly (for every packet in a chain; not once per chain). - Fix rate / flags fields in Rx radiotap. - Add debug messages for discarded frames. - Pass received control (< sizeof(struct ieee80211_frame)) frames to net80211 (if allowed by device filter; cannot happen yet). Tested with Asus USB-N10. Differential Revision: https://reviews.freebsd.org/D5723 Modified: head/sys/dev/usb/wlan/if_rsu.c Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Sat Dec 3 14:41:53 2016 (r309480) +++ head/sys/dev/usb/wlan/if_rsu.c Sat Dec 3 16:02:53 2016 (r309481) @@ -219,7 +219,10 @@ static void rsu_rx_multi_event(struct rs #if 0 static int8_t rsu_get_rssi(struct rsu_softc *, int, void *); #endif -static struct mbuf * rsu_rx_frame(struct rsu_softc *, uint8_t *, int); +static struct mbuf * rsu_rx_copy_to_mbuf(struct rsu_softc *, + struct r92s_rx_stat *, int); +static struct ieee80211_node * rsu_rx_frame(struct rsu_softc *, struct mbuf *, + int8_t *); static struct mbuf * rsu_rx_multi_frame(struct rsu_softc *, uint8_t *, int); static struct mbuf * rsu_rxeof(struct usb_xfer *, struct rsu_data *); @@ -1827,64 +1830,76 @@ rsu_get_rssi(struct rsu_softc *sc, int r #endif static struct mbuf * -rsu_rx_frame(struct rsu_softc *sc, uint8_t *buf, int pktlen) +rsu_rx_copy_to_mbuf(struct rsu_softc *sc, struct r92s_rx_stat *stat, + int totlen) { struct ieee80211com *ic = &sc->sc_ic; - struct ieee80211_frame *wh; + struct mbuf *m; + uint32_t rxdw0; + int pktlen; + + rxdw0 = le32toh(stat->rxdw0); + if (__predict_false(rxdw0 & R92S_RXDW0_CRCERR)) { + RSU_DPRINTF(sc, RSU_DEBUG_RX, + "%s: RX flags error (CRC)\n", __func__); + goto fail; + } + + pktlen = MS(rxdw0, R92S_RXDW0_PKTLEN); + if (__predict_false(pktlen < sizeof (struct ieee80211_frame_ack))) { + RSU_DPRINTF(sc, RSU_DEBUG_RX, + "%s: frame is too short: %d\n", __func__, pktlen); + goto fail; + } + + m = m_get2(totlen, M_NOWAIT, MT_DATA, M_PKTHDR); + if (__predict_false(m == NULL)) { + device_printf(sc->sc_dev, "%s: could not allocate RX mbuf\n", + __func__); + goto fail; + } + + /* Finalize mbuf. */ + memcpy(mtod(m, uint8_t *), (uint8_t *)stat, totlen); + m->m_pkthdr.len = m->m_len = totlen; + + return (m); +fail: + counter_u64_add(ic->ic_ierrors, 1); + return (NULL); +} + +static struct ieee80211_node * +rsu_rx_frame(struct rsu_softc *sc, struct mbuf *m, int8_t *rssi_p) +{ + struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211_frame_min *wh; struct r92s_rx_stat *stat; uint32_t rxdw0, rxdw3; - struct mbuf *m; uint8_t rate; int infosz; - stat = (struct r92s_rx_stat *)buf; + stat = mtod(m, struct r92s_rx_stat *); rxdw0 = le32toh(stat->rxdw0); rxdw3 = le32toh(stat->rxdw3); - if (__predict_false(rxdw0 & R92S_RXDW0_CRCERR)) { - counter_u64_add(ic->ic_ierrors, 1); - return NULL; - } - if (__predict_false(pktlen < sizeof(*wh) || pktlen > MCLBYTES)) { - counter_u64_add(ic->ic_ierrors, 1); - return NULL; - } - rate = MS(rxdw3, R92S_RXDW3_RATE); infosz = MS(rxdw0, R92S_RXDW0_INFOSZ) * 8; #if 0 /* Get RSSI from PHY status descriptor if present. */ if (infosz != 0) - *rssi = rsu_get_rssi(sc, rate, &stat[1]); + *rssi_p = rsu_get_rssi(sc, rate, &stat[1]); else - *rssi = 0; #endif - - RSU_DPRINTF(sc, RSU_DEBUG_RX, - "%s: Rx frame len=%d rate=%d infosz=%d\n", - __func__, pktlen, rate, infosz); - - m = m_get2(pktlen, M_NOWAIT, MT_DATA, M_PKTHDR); - if (__predict_false(m == NULL)) { - counter_u64_add(ic->ic_ierrors, 1); - return NULL; - } - /* Hardware does Rx TCP checksum offload. */ - if (rxdw3 & R92S_RXDW3_TCPCHKVALID) { - if (__predict_true(rxdw3 & R92S_RXDW3_TCPCHKRPT)) - m->m_pkthdr.csum_flags |= CSUM_DATA_VALID; - } - wh = (struct ieee80211_frame *)((uint8_t *)&stat[1] + infosz); - memcpy(mtod(m, uint8_t *), wh, pktlen); - m->m_pkthdr.len = m->m_len = pktlen; + *rssi_p = 0; if (ieee80211_radiotap_active(ic)) { struct rsu_rx_radiotap_header *tap = &sc->sc_rxtap; /* Map HW rate index to 802.11 rate. */ - tap->wr_flags = 2; - if (!(rxdw3 & R92S_RXDW3_HTC)) { + tap->wr_flags = 0; /* TODO */ + if (rate < 12) { switch (rate) { /* CCK. */ case 0: tap->wr_rate = 2; break; @@ -1901,7 +1916,7 @@ rsu_rx_frame(struct rsu_softc *sc, uint8 case 10: tap->wr_rate = 96; break; case 11: tap->wr_rate = 108; break; } - } else if (rate >= 12) { /* MCS0~15. */ + } else { /* MCS0~15. */ /* Bit 7 set means HT MCS instead of rate. */ tap->wr_rate = 0x80 | (rate - 12); } @@ -1912,9 +1927,26 @@ rsu_rx_frame(struct rsu_softc *sc, uint8 tap->wr_dbm_antsignal = rsu_hwrssi_to_rssi(sc, sc->sc_currssi); tap->wr_chan_freq = htole16(ic->ic_curchan->ic_freq); tap->wr_chan_flags = htole16(ic->ic_curchan->ic_flags); + }; + + /* Hardware does Rx TCP checksum offload. */ + if (rxdw3 & R92S_RXDW3_TCPCHKVALID) { + if (__predict_true(rxdw3 & R92S_RXDW3_TCPCHKRPT)) + m->m_pkthdr.csum_flags |= CSUM_DATA_VALID; } - return (m); + /* Drop descriptor. */ + m_adj(m, sizeof(*stat) + infosz); + wh = mtod(m, struct ieee80211_frame_min *); + + RSU_DPRINTF(sc, RSU_DEBUG_RX, + "%s: Rx frame len %d, rate %d, infosz %d\n", + __func__, m->m_len, rate, infosz); + + if (m->m_len >= sizeof(*wh)) + return (ieee80211_find_rxnode(ic, wh)); + + return (NULL); } static struct mbuf * @@ -1925,6 +1957,13 @@ rsu_rx_multi_frame(struct rsu_softc *sc, int totlen, pktlen, infosz, npkts; struct mbuf *m, *m0 = NULL, *prevm = NULL; + /* + * don't pass packets to the ieee80211 framework if the driver isn't + * RUNNING. + */ + if (!sc->sc_running) + return (NULL); + /* Get the number of encapsulated frames. */ stat = (struct r92s_rx_stat *)buf; npkts = MS(le32toh(stat->rxdw2), R92S_RXDW2_PKTCNT); @@ -1950,7 +1989,7 @@ rsu_rx_multi_frame(struct rsu_softc *sc, break; /* Process 802.11 frame. */ - m = rsu_rx_frame(sc, buf, pktlen); + m = rsu_rx_copy_to_mbuf(sc, stat, totlen); if (m0 == NULL) m0 = m; if (prevm == NULL) @@ -1998,10 +2037,10 @@ rsu_bulk_rx_callback(struct usb_xfer *xf { struct rsu_softc *sc = usbd_xfer_softc(xfer); struct ieee80211com *ic = &sc->sc_ic; - struct ieee80211_frame *wh; struct ieee80211_node *ni; struct mbuf *m = NULL, *next; struct rsu_data *data; + int8_t rssi; RSU_ASSERT_LOCKED(sc); @@ -2016,10 +2055,6 @@ rsu_bulk_rx_callback(struct usb_xfer *xf /* FALLTHROUGH */ case USB_ST_SETUP: tr_setup: - /* - * XXX TODO: if we have an mbuf list, but then - * we hit data == NULL, what now? - */ data = STAILQ_FIRST(&sc->sc_rx_inactive); if (data == NULL) { KASSERT(m == NULL, ("mbuf isn't NULL")); @@ -2035,18 +2070,16 @@ tr_setup: * ieee80211_input() because here is at the end of a USB * callback and safe to unlock. */ - RSU_UNLOCK(sc); while (m != NULL) { - int rssi; + next = m->m_next; + m->m_next = NULL; + + ni = rsu_rx_frame(sc, m, &rssi); /* Cheat and get the last calibrated RSSI */ rssi = rsu_hwrssi_to_rssi(sc, sc->sc_currssi); + RSU_UNLOCK(sc); - next = m->m_next; - m->m_next = NULL; - wh = mtod(m, struct ieee80211_frame *); - ni = ieee80211_find_rxnode(ic, - (struct ieee80211_frame_min *)wh); if (ni != NULL) { if (ni->ni_flags & IEEE80211_NODE_HT) m->m_flags |= M_AMPDU; @@ -2054,9 +2087,10 @@ tr_setup: ieee80211_free_node(ni); } else (void)ieee80211_input_all(ic, m, rssi, -96); + + RSU_LOCK(sc); m = next; } - RSU_LOCK(sc); break; default: /* needs it to the inactive queue due to a error. */ From owner-svn-src-all@freebsd.org Sat Dec 3 16:52:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADD2BC651DB; Sat, 3 Dec 2016 16:52:41 +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 6E8AFBBC; Sat, 3 Dec 2016 16:52:41 +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 uB3GqevX002705; Sat, 3 Dec 2016 16:52:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3Gqen1002702; Sat, 3 Dec 2016 16:52:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612031652.uB3Gqen1002702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 16:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309482 - in stable/10: etc/mtree lib/libc/iconv lib/libc/tests lib/libc/tests/iconv X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 16:52:41 -0000 Author: ngie Date: Sat Dec 3 16:52:40 2016 New Revision: 309482 URL: https://svnweb.freebsd.org/changeset/base/309482 Log: MFC r299704: r299704 (by vangyzen): iconvctl(3): remove superfluous NULL pointer tests convname and dst are guaranteed to be non-NULL by iconv_open(3). src is an array. Remove these tests for NULL pointers. While I'm here, eliminate a strlcpy with a correct but suspicious-looking calculation for the third parameter (i.e. not a simple sizeof). Compare the strings in-place instead of copying. Found by: bdrewery Found by: Coverity CID: 1130050, 1130056 Added: stable/10/lib/libc/tests/iconv/ - copied from r299704, head/lib/libc/tests/iconv/ Modified: stable/10/etc/mtree/BSD.tests.dist stable/10/lib/libc/iconv/bsd_iconv.c stable/10/lib/libc/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Sat Dec 3 16:02:53 2016 (r309481) +++ stable/10/etc/mtree/BSD.tests.dist Sat Dec 3 16:52:40 2016 (r309482) @@ -99,6 +99,8 @@ data .. .. + iconv + .. inet .. locale Modified: stable/10/lib/libc/iconv/bsd_iconv.c ============================================================================== --- stable/10/lib/libc/iconv/bsd_iconv.c Sat Dec 3 16:02:53 2016 (r309481) +++ stable/10/lib/libc/iconv/bsd_iconv.c Sat Dec 3 16:52:40 2016 (r309482) @@ -259,8 +259,9 @@ __bsd_iconvctl(iconv_t cd, int request, struct _citrus_iconv *cv; struct iconv_hooks *hooks; const char *convname; - char src[PATH_MAX], *dst; + char *dst; int *i; + size_t srclen; cv = (struct _citrus_iconv *)(void *)cd; hooks = (struct iconv_hooks *)argument; @@ -275,12 +276,9 @@ __bsd_iconvctl(iconv_t cd, int request, case ICONV_TRIVIALP: convname = cv->cv_shared->ci_convname; dst = strchr(convname, '/'); - - strlcpy(src, convname, dst - convname + 1); + srclen = dst - convname; dst++; - if ((convname == NULL) || (src == NULL) || (dst == NULL)) - return (-1); - *i = strcmp(src, dst) == 0 ? 1 : 0; + *i = (srclen == strlen(dst)) && !memcmp(convname, dst, srclen); return (0); case ICONV_GET_TRANSLITERATE: *i = 1; Modified: stable/10/lib/libc/tests/Makefile ============================================================================== --- stable/10/lib/libc/tests/Makefile Sat Dec 3 16:02:53 2016 (r309481) +++ stable/10/lib/libc/tests/Makefile Sat Dec 3 16:52:40 2016 (r309482) @@ -10,6 +10,7 @@ TESTS_SUBDIRS= c063 TESTS_SUBDIRS+= db TESTS_SUBDIRS+= gen TESTS_SUBDIRS+= hash +TESTS_SUBDIRS+= iconv TESTS_SUBDIRS+= inet TESTS_SUBDIRS+= net TESTS_SUBDIRS+= nss From owner-svn-src-all@freebsd.org Sat Dec 3 16:53:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9D31C65270; Sat, 3 Dec 2016 16:53:54 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x244.google.com (mail-pg0-x244.google.com [IPv6:2607:f8b0:400e:c05::244]) (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 7665AE0F; Sat, 3 Dec 2016 16:53:54 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x244.google.com with SMTP id 3so11238435pgd.0; Sat, 03 Dec 2016 08:53:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=p48tUVw9sc0YGKHA9EfJuIObn61YRViA61n8RDpQWto=; b=xxJk5eyB+V/LTJVcHoDY04M5O/bi5PzN2teJDae1LunaLpwVgDRPeXq4B6MxbfsgPB 3GbtgpioGKJRxsHgH3arT1us77DH4nARdx5Dd1ffB/346K4EBgDq1kkW2Fq+i17xYFD5 j6g2yn/SeLZ/uks4TViqLxzl0bNqmr5SQqOSRO/949r6kiv47kzK5FjcP21Nun41SQZp 3D1JjHCQlaTGUOLcxVj1+G+FcNofF4BN1BrwO1huQOKmTRK9ZJlRxeGOxx0n5gFrftN/ Tw5bWDYoS7tJ8f0yjgkffQXwdz0cwMAdJJfXUJNX5p5ZhPPF67dowh/ZJoKAvUoYMhcw OT6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=p48tUVw9sc0YGKHA9EfJuIObn61YRViA61n8RDpQWto=; b=W2I1pJh2SzfrCSheuuhkP1T09nWqrLtMpbsS3FIfMqW83ZZ/+E0aeDgMRlurxepchR jKMpvhRGmcbkxli/AWbEpfo/2KRbORM9kpCybWevvzjowcnOctd0/XuKu3KWbgKxff4S xMKAs/jJNKqIYbX+jR0puL/l9TPfSBqoTjAI+IDJGoT717UwlMtWLviiJv/uE1trH6oO sxHNcjmpPXsBDkMa/UNiQVYW+Ff1z5dhKAPyEBLPD80WNJWEg1SKuDrQ6qbFsviL2rVF 9fWcnEnVqPQKCFnloJ3e1nHx0g3xIsUpWlT5XWZn+qU2usYmgbodIATRK0ySP2qEcL3e 9S/Q== X-Gm-Message-State: AKaTC01Dji609ez5T1ydFwts6gr+UEVsPYeqiTePiXqEGkkNBvEl7BE1kIT6CEMCHJn3nw== X-Received: by 10.84.142.1 with SMTP id 1mr106207491plw.87.1480784033951; Sat, 03 Dec 2016 08:53:53 -0800 (PST) Received: from [192.168.20.12] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id 1sm16220536pgp.1.2016.12.03.08.53.53 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 03 Dec 2016 08:53:53 -0800 (PST) Subject: Re: svn commit: r309454 - stable/10/lib/libc/tests Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_0E6F97F8-9DA5-49E1-A91D-E1B134F0BC6D"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <4CEA04AC-4AB7-4818-AF9C-E646E42A13DD@gmail.com> Date: Sat, 3 Dec 2016 08:53:51 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Message-Id: <5B28EC92-6DC8-4CBE-96F8-17C50EFC348F@gmail.com> References: <201612030040.uB30e8Qc006710@repo.freebsd.org> <4CEA04AC-4AB7-4818-AF9C-E646E42A13DD@gmail.com> To: Ngie Cooper X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 16:53:54 -0000 --Apple-Mail=_0E6F97F8-9DA5-49E1-A91D-E1B134F0BC6D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Dec 2, 2016, at 19:37, Ngie Cooper (yaneurabeya) = wrote: =E2=80=A6 > I=E2=80=99m aware of the fact that this causes a build failure = (I missed the fact that it added the directory instead of shifting it = from the existing TESTS_SUBDIRS definition). I=E2=80=99ll either revert = this commit or bring in the missing MFC (r299704). > Thanks, Fixed in 309482. Thanks, -Ngie --Apple-Mail=_0E6F97F8-9DA5-49E1-A91D-E1B134F0BC6D 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 iQIcBAEBCgAGBQJYQvigAAoJEPWDqSZpMIYVAXYQAMpZNpK8hQeV7zoIu73AlHuE i12umvpGKaNq3yJBRgvN6eKGIYPz0rFv06P11nqpyuis7Zstw8/4SQKrk2UEHewn 5egdclbgM54JR1oZSTCcCh2fZQdoFpK878xpVPBAGRxEzRUJhAcdUoy38T7RYu0V LeKimjcvrecaeLIOU1MkLGUTRf2T1eKJpWoRo3mHV9GoAPXMSlCRdYn/KilCUEKU NxI+BeMxLY5MPbj7gBFc79rXfiulVqcpZvoWr0NNMFNKIxWBQbU90k2UaNNiJgj2 aM96+LOkgFM6lL+ESvcIv4yTgg6uhrgMvyOIR/wg7TLo8Ad2ldrr9PrjhyLjwr7O ZdBWOhA2FUCc41pnQpmN4TA7kW5CYCIfAJm7jGSws15ozLvb55WKcNoun0JL2Uks RwVxCoQIEUgAyLzhp7iXBfKtXIm0AJWArSLvjUNgrsZRTXF7fsduiFzVLwyJZEj2 VUQA9t96Cri1R5SuAczVJtgtjxL5oPrOKS7b3VrSUVLrX/O4f3mPLI3L568Lb6ft dwZ8Ru4H97vlJqo7NMVtiKPaCTJW2FGORTwY3UCkgfXg9TsGS0C7fYT1LWaPEUaP sfJwe2OMsg92AdkizwCy/sw2tohjQP4Dw8Juwrket02XTeQnN7ZRXBo/5mtpKxlR lYnCxB6XI22McKY5Hv7M =73VJ -----END PGP SIGNATURE----- --Apple-Mail=_0E6F97F8-9DA5-49E1-A91D-E1B134F0BC6D-- From owner-svn-src-all@freebsd.org Sat Dec 3 17:10:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D74F2C658E2; Sat, 3 Dec 2016 17:10:05 +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 A4F42168A; Sat, 3 Dec 2016 17:10:05 +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 uB3HA4fG007144; Sat, 3 Dec 2016 17:10:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3HA47A007143; Sat, 3 Dec 2016 17:10:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201612031710.uB3HA47A007143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 3 Dec 2016 17:10:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309483 - stable/11/sys/x86/x86 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 17:10:06 -0000 Author: kib Date: Sat Dec 3 17:10:04 2016 New Revision: 309483 URL: https://svnweb.freebsd.org/changeset/base/309483 Log: MFC r309189: Fix automatic eventtimer hardware selection when ARAT is not implemented, and do not ignore TSCDLT. Modified: stable/11/sys/x86/x86/local_apic.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/x86/local_apic.c ============================================================================== --- stable/11/sys/x86/x86/local_apic.c Sat Dec 3 16:52:40 2016 (r309482) +++ stable/11/sys/x86/x86/local_apic.c Sat Dec 3 17:10:04 2016 (r309483) @@ -478,8 +478,9 @@ native_lapic_init(vm_paddr_t addr) lapic_et.et_quality = 600; if (!arat) { lapic_et.et_flags |= ET_FLAGS_C3STOP; - lapic_et.et_quality -= 200; - } else if ((cpu_feature & CPUID_TSC) != 0 && + lapic_et.et_quality = 100; + } + if ((cpu_feature & CPUID_TSC) != 0 && (cpu_feature2 & CPUID2_TSCDLT) != 0 && tsc_is_invariant && tsc_freq != 0) { lapic_timer_tsc_deadline = 1; From owner-svn-src-all@freebsd.org Sat Dec 3 17:10:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FF58C6594C; Sat, 3 Dec 2016 17:10: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 5AA771805; Sat, 3 Dec 2016 17:10:39 +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 uB3HAcD2007213; Sat, 3 Dec 2016 17:10:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3HAc5b007208; Sat, 3 Dec 2016 17:10:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612031710.uB3HAc5b007208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 17:10:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309484 - stable/10/lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 17:10:39 -0000 Author: ngie Date: Sat Dec 3 17:10:37 2016 New Revision: 309484 URL: https://svnweb.freebsd.org/changeset/base/309484 Log: MFC r287350: r287350 (by rodrigc): Use ANSI C prototypes. Eliminates gcc 4.9 warnings. Modified: stable/10/lib/libc/rpc/auth_des.c stable/10/lib/libc/rpc/auth_none.c stable/10/lib/libc/rpc/rpcb_clnt.c stable/10/lib/libc/rpc/rpcdname.c stable/10/lib/libc/rpc/svc_auth_des.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/auth_des.c ============================================================================== --- stable/10/lib/libc/rpc/auth_des.c Sat Dec 3 17:10:04 2016 (r309483) +++ stable/10/lib/libc/rpc/auth_des.c Sat Dec 3 17:10:37 2016 (r309484) @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); extern bool_t xdr_authdes_cred( XDR *, struct authdes_cred *); extern bool_t xdr_authdes_verf( XDR *, struct authdes_verf *); -extern int key_encryptsession_pk(); +extern int key_encryptsession_pk(char *, netobj *, des_block *); extern bool_t __rpc_get_time_offset(struct timeval *, nis_server *, char *, char **, char **); Modified: stable/10/lib/libc/rpc/auth_none.c ============================================================================== --- stable/10/lib/libc/rpc/auth_none.c Sat Dec 3 17:10:04 2016 (r309483) +++ stable/10/lib/libc/rpc/auth_none.c Sat Dec 3 17:10:37 2016 (r309484) @@ -65,9 +65,9 @@ static bool_t authnone_validate (AUTH *, static bool_t authnone_refresh (AUTH *, void *); static void authnone_destroy (AUTH *); -extern bool_t xdr_opaque_auth(); +extern bool_t xdr_opaque_auth(XDR *, struct opaque_auth *); -static struct auth_ops *authnone_ops(); +static struct auth_ops *authnone_ops(void); static struct authnone_private { AUTH no_client; @@ -76,7 +76,7 @@ static struct authnone_private { } *authnone_private; AUTH * -authnone_create() +authnone_create(void) { struct authnone_private *ap = authnone_private; XDR xdr_stream; @@ -156,7 +156,7 @@ authnone_destroy(AUTH *client) } static struct auth_ops * -authnone_ops() +authnone_ops(void) { static struct auth_ops ops; Modified: stable/10/lib/libc/rpc/rpcb_clnt.c ============================================================================== --- stable/10/lib/libc/rpc/rpcb_clnt.c Sat Dec 3 17:10:04 2016 (r309483) +++ stable/10/lib/libc/rpc/rpcb_clnt.c Sat Dec 3 17:10:37 2016 (r309484) @@ -661,7 +661,7 @@ got_entry(relp, nconf) * local transport. */ static bool_t -__rpcbind_is_up() +__rpcbind_is_up(void) { struct netconfig *nconf; struct sockaddr_un sun; Modified: stable/10/lib/libc/rpc/rpcdname.c ============================================================================== --- stable/10/lib/libc/rpc/rpcdname.c Sat Dec 3 17:10:04 2016 (r309483) +++ stable/10/lib/libc/rpc/rpcdname.c Sat Dec 3 17:10:37 2016 (r309484) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); static char *default_domain = 0; static char * -get_default_domain() +get_default_domain(void) { char temp[256]; Modified: stable/10/lib/libc/rpc/svc_auth_des.c ============================================================================== --- stable/10/lib/libc/rpc/svc_auth_des.c Sat Dec 3 17:10:04 2016 (r309483) +++ stable/10/lib/libc/rpc/svc_auth_des.c Sat Dec 3 17:10:37 2016 (r309484) @@ -90,11 +90,11 @@ struct cache_entry { static struct cache_entry *authdes_cache/* [AUTHDES_CACHESZ] */; static short *authdes_lru/* [AUTHDES_CACHESZ] */; -static void cache_init(); /* initialize the cache */ -static short cache_spot(); /* find an entry in the cache */ +static void cache_init(void); /* initialize the cache */ +static short cache_spot(des_block *, char *, struct timeval *); /* find an entry in the cache */ static void cache_ref(/*short sid*/); /* note that sid was ref'd */ -static void invalidate(); /* invalidate entry in cache */ +static void invalidate(char *); /* invalidate entry in cache */ /* * cache statistics @@ -355,7 +355,7 @@ _svcauth_des(rqst, msg) * Initialize the cache */ static void -cache_init() +cache_init(void) { int i; @@ -378,7 +378,7 @@ cache_init() * Find the lru victim */ static short -cache_victim() +cache_victim(void) { return (authdes_lru[AUTHDES_CACHESZ-1]); } From owner-svn-src-all@freebsd.org Sat Dec 3 17:17:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77436C65C05; Sat, 3 Dec 2016 17:17:45 +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 3FC361CF4; Sat, 3 Dec 2016 17:17:45 +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 uB3HHiqR010997; Sat, 3 Dec 2016 17:17:44 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3HHgDV010974; Sat, 3 Dec 2016 17:17:42 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612031717.uB3HHgDV010974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 17:17:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309485 - in stable/10/lib/libc: db/hash gen locale net posix1e resolv rpc softfloat uuid xdr X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 17:17:45 -0000 Author: ngie Date: Sat Dec 3 17:17:42 2016 New Revision: 309485 URL: https://svnweb.freebsd.org/changeset/base/309485 Log: MFC r297790: r297790 (by pfg): libc: replace 0 with NULL for pointers. While here also cleanup some surrounding code; particularly drop some malloc() casts. Found with devel/coccinelle. Modified: stable/10/lib/libc/db/hash/hash.c stable/10/lib/libc/db/hash/hash_buf.c stable/10/lib/libc/gen/err.c stable/10/lib/libc/gen/getmntinfo.c stable/10/lib/libc/gen/opendir.c stable/10/lib/libc/gen/tls.c stable/10/lib/libc/locale/xlocale_private.h stable/10/lib/libc/net/base64.c stable/10/lib/libc/net/getifaddrs.c stable/10/lib/libc/net/getservent.c stable/10/lib/libc/net/rcmd.c stable/10/lib/libc/posix1e/acl_support_nfs4.c stable/10/lib/libc/resolv/mtctxres.c stable/10/lib/libc/resolv/res_init.c stable/10/lib/libc/resolv/res_mkupdate.c stable/10/lib/libc/rpc/auth_none.c stable/10/lib/libc/rpc/clnt_perror.c stable/10/lib/libc/rpc/mt_misc.c stable/10/lib/libc/rpc/rpcdname.c stable/10/lib/libc/softfloat/timesoftfloat.c stable/10/lib/libc/uuid/uuid_to_string.c stable/10/lib/libc/xdr/xdr_mem.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/db/hash/hash.c ============================================================================== --- stable/10/lib/libc/db/hash/hash.c Sat Dec 3 17:10:37 2016 (r309484) +++ stable/10/lib/libc/db/hash/hash.c Sat Dec 3 17:17:42 2016 (r309485) @@ -771,7 +771,7 @@ next_bucket: if (__big_keydata(hashp, bufp, key, data, 1)) return (ERROR); } else { - if (hashp->cpage == 0) + if (hashp->cpage == NULL) return (ERROR); key->data = (u_char *)hashp->cpage->page + bp[ndx]; key->size = (ndx > 1 ? bp[ndx - 1] : hashp->BSIZE) - bp[ndx]; Modified: stable/10/lib/libc/db/hash/hash_buf.c ============================================================================== --- stable/10/lib/libc/db/hash/hash_buf.c Sat Dec 3 17:10:37 2016 (r309484) +++ stable/10/lib/libc/db/hash/hash_buf.c Sat Dec 3 17:17:42 2016 (r309485) @@ -245,7 +245,7 @@ newbuf(HTAB *hashp, u_int32_t addr, BUFH */ for (xbp = bp; xbp->ovfl;) { next_xbp = xbp->ovfl; - xbp->ovfl = 0; + xbp->ovfl = NULL; xbp = next_xbp; /* Check that ovfl pointer is up date. */ @@ -350,7 +350,7 @@ __buf_free(HTAB *hashp, int do_free, int void __reclaim_buf(HTAB *hashp, BUFHEAD *bp) { - bp->ovfl = 0; + bp->ovfl = NULL; bp->addr = 0; bp->flags = 0; BUF_REMOVE(bp); Modified: stable/10/lib/libc/gen/err.c ============================================================================== --- stable/10/lib/libc/gen/err.c Sat Dec 3 17:10:37 2016 (r309484) +++ stable/10/lib/libc/gen/err.c Sat Dec 3 17:17:42 2016 (r309485) @@ -99,7 +99,7 @@ errc(int eval, int code, const char *fmt void verrc(int eval, int code, const char *fmt, va_list ap) { - if (err_file == 0) + if (err_file == NULL) err_set_file((FILE *)0); fprintf(err_file, "%s: ", _getprogname()); if (fmt != NULL) { @@ -124,7 +124,7 @@ errx(int eval, const char *fmt, ...) void verrx(int eval, const char *fmt, va_list ap) { - if (err_file == 0) + if (err_file == NULL) err_set_file((FILE *)0); fprintf(err_file, "%s: ", _getprogname()); if (fmt != NULL) @@ -164,7 +164,7 @@ warnc(int code, const char *fmt, ...) void vwarnc(int code, const char *fmt, va_list ap) { - if (err_file == 0) + if (err_file == NULL) err_set_file((FILE *)0); fprintf(err_file, "%s: ", _getprogname()); if (fmt != NULL) { @@ -186,7 +186,7 @@ warnx(const char *fmt, ...) void vwarnx(const char *fmt, va_list ap) { - if (err_file == 0) + if (err_file == NULL) err_set_file((FILE *)0); fprintf(err_file, "%s: ", _getprogname()); if (fmt != NULL) Modified: stable/10/lib/libc/gen/getmntinfo.c ============================================================================== --- stable/10/lib/libc/gen/getmntinfo.c Sat Dec 3 17:10:37 2016 (r309484) +++ stable/10/lib/libc/gen/getmntinfo.c Sat Dec 3 17:17:42 2016 (r309485) @@ -58,7 +58,7 @@ getmntinfo(mntbufp, flags) if (mntbuf) free(mntbuf); bufsize = (mntsize + 1) * sizeof(struct statfs); - if ((mntbuf = (struct statfs *)malloc(bufsize)) == 0) + if ((mntbuf = malloc(bufsize)) == NULL) return (0); if ((mntsize = getfsstat(mntbuf, bufsize, flags)) < 0) return (0); Modified: stable/10/lib/libc/gen/opendir.c ============================================================================== --- stable/10/lib/libc/gen/opendir.c Sat Dec 3 17:10:37 2016 (r309484) +++ stable/10/lib/libc/gen/opendir.c Sat Dec 3 17:17:42 2016 (r309485) @@ -209,7 +209,7 @@ _filldir(DIR *dirp, bool use_current_pos * On the second pass, save pointers to each one. * Then sort the pointers and remove duplicate names. */ - for (dpv = 0;;) { + for (dpv = NULL;;) { n = 0; ddptr = buf; while (ddptr < ddeptr) { Modified: stable/10/lib/libc/gen/tls.c ============================================================================== --- stable/10/lib/libc/gen/tls.c Sat Dec 3 17:10:37 2016 (r309484) +++ stable/10/lib/libc/gen/tls.c Sat Dec 3 17:17:42 2016 (r309485) @@ -284,7 +284,7 @@ _init_tls() while (*sp++ != 0) ; aux = (Elf_Auxinfo *) sp; - phdr = 0; + phdr = NULL; phent = phnum = 0; for (auxp = aux; auxp->a_type != AT_NULL; auxp++) { switch (auxp->a_type) { @@ -301,7 +301,7 @@ _init_tls() break; } } - if (phdr == 0 || phent != sizeof(Elf_Phdr) || phnum == 0) + if (phdr == NULL || phent != sizeof(Elf_Phdr) || phnum == 0) return; for (i = 0; (unsigned) i < phnum; i++) { Modified: stable/10/lib/libc/locale/xlocale_private.h ============================================================================== --- stable/10/lib/libc/locale/xlocale_private.h Sat Dec 3 17:10:37 2016 (r309484) +++ stable/10/lib/libc/locale/xlocale_private.h Sat Dec 3 17:17:42 2016 (r309485) @@ -155,12 +155,11 @@ __attribute__((unused)) static void xlocale_release(void *val) { struct xlocale_refcounted *obj = val; - long count = atomic_fetchadd_long(&(obj->retain_count), -1) - 1; - if (count < 0) { - if (0 != obj->destructor) { - obj->destructor(obj); - } - } + long count; + + count = atomic_fetchadd_long(&(obj->retain_count), -1) - 1; + if (count < 0 && obj->destructor != NULL) + obj->destructor(obj); } /** Modified: stable/10/lib/libc/net/base64.c ============================================================================== --- stable/10/lib/libc/net/base64.c Sat Dec 3 17:10:37 2016 (r309484) +++ stable/10/lib/libc/net/base64.c Sat Dec 3 17:17:42 2016 (r309485) @@ -210,7 +210,7 @@ b64_pton(const char *src, u_char *target break; pos = strchr(Base64, ch); - if (pos == 0) /* A non-base64 character. */ + if (pos == NULL) /* A non-base64 character. */ return (-1); switch (state) { Modified: stable/10/lib/libc/net/getifaddrs.c ============================================================================== --- stable/10/lib/libc/net/getifaddrs.c Sat Dec 3 17:10:37 2016 (r309484) +++ stable/10/lib/libc/net/getifaddrs.c Sat Dec 3 17:17:42 2016 (r309485) @@ -85,7 +85,7 @@ getifaddrs(struct ifaddrs **pif) size_t needed; char *buf; char *next; - struct ifaddrs *cif = 0; + struct ifaddrs *cif; char *p, *p0; struct rt_msghdr *rtm; struct if_msghdrl *ifm; @@ -214,6 +214,7 @@ getifaddrs(struct ifaddrs **pif) ift = ifa; idx = 0; + cif = NULL; for (next = buf; next < buf + needed; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)(void *)next; if (rtm->rtm_version != RTM_VERSION) Modified: stable/10/lib/libc/net/getservent.c ============================================================================== --- stable/10/lib/libc/net/getservent.c Sat Dec 3 17:10:37 2016 (r309484) +++ stable/10/lib/libc/net/getservent.c Sat Dec 3 17:17:42 2016 (r309485) @@ -406,14 +406,14 @@ files_servent(void *retval, void *mdata, continue; gotname: - if (proto == 0 || strcmp(serv->s_proto, proto) == 0) + if (proto == NULL || strcmp(serv->s_proto, proto) == 0) rv = NS_SUCCESS; break; case nss_lt_id: if (port != serv->s_port) continue; - if (proto == 0 || strcmp(serv->s_proto, proto) == 0) + if (proto == NULL || strcmp(serv->s_proto, proto) == 0) rv = NS_SUCCESS; break; case nss_lt_all: Modified: stable/10/lib/libc/net/rcmd.c ============================================================================== --- stable/10/lib/libc/net/rcmd.c Sat Dec 3 17:10:37 2016 (r309484) +++ stable/10/lib/libc/net/rcmd.c Sat Dec 3 17:17:42 2016 (r309485) @@ -214,7 +214,7 @@ rcmd_af(ahost, rport, locuser, remuser, } } lport--; - if (fd2p == 0) { + if (fd2p == NULL) { _write(s, "", 1); lport = 0; } else { Modified: stable/10/lib/libc/posix1e/acl_support_nfs4.c ============================================================================== --- stable/10/lib/libc/posix1e/acl_support_nfs4.c Sat Dec 3 17:10:37 2016 (r309484) +++ stable/10/lib/libc/posix1e/acl_support_nfs4.c Sat Dec 3 17:17:42 2016 (r309485) @@ -81,7 +81,7 @@ static const char * format_flag(uint32_t *var, const struct flagnames_struct *flags) { - for (; flags->name != 0; flags++) { + for (; flags->name != NULL; flags++) { if ((flags->flag & *var) == 0) continue; Modified: stable/10/lib/libc/resolv/mtctxres.c ============================================================================== --- stable/10/lib/libc/resolv/mtctxres.c Sat Dec 3 17:10:37 2016 (r309484) +++ stable/10/lib/libc/resolv/mtctxres.c Sat Dec 3 17:17:42 2016 (r309485) @@ -75,7 +75,7 @@ __res_init_ctx(void) { return (0); } - if ((mt = malloc(sizeof (mtctxres_t))) == 0) { + if ((mt = malloc(sizeof(mtctxres_t))) == NULL) { errno = ENOMEM; return (-1); } @@ -94,10 +94,7 @@ __res_init_ctx(void) { static void __res_destroy_ctx(void *value) { - mtctxres_t *mt = (mtctxres_t *)value; - - if (mt != 0) - free(mt); + free(value); } #endif @@ -130,9 +127,9 @@ ___mtctxres(void) { * that fails return a global context. */ if (mt_key_initialized) { - if (((mt = pthread_getspecific(key)) != 0) || + if (((mt = pthread_getspecific(key)) != NULL) || (__res_init_ctx() == 0 && - (mt = pthread_getspecific(key)) != 0)) { + (mt = pthread_getspecific(key)) != NULL)) { return (mt); } } Modified: stable/10/lib/libc/resolv/res_init.c ============================================================================== --- stable/10/lib/libc/resolv/res_init.c Sat Dec 3 17:10:37 2016 (r309484) +++ stable/10/lib/libc/resolv/res_init.c Sat Dec 3 17:17:42 2016 (r309485) @@ -315,7 +315,7 @@ __res_vinit(res_state statp, int preinit while (*cp != '\0' && *cp != ' ' && *cp != '\t' && *cp != '\n') cp++; *cp = '\0'; - *pp++ = 0; + *pp++ = NULL; } #define MATCH(line, name) \ @@ -391,7 +391,7 @@ __res_vinit(res_state statp, int preinit while (*cp != '\0' && *cp != ' ' && *cp != '\t') cp++; *cp = '\0'; - *pp++ = 0; + *pp++ = NULL; havesearch = 1; continue; } Modified: stable/10/lib/libc/resolv/res_mkupdate.c ============================================================================== --- stable/10/lib/libc/resolv/res_mkupdate.c Sat Dec 3 17:10:37 2016 (r309484) +++ stable/10/lib/libc/resolv/res_mkupdate.c Sat Dec 3 17:17:42 2016 (r309485) @@ -1175,7 +1175,7 @@ res_protocolname(int num) { if (protolist == (struct valuelist *)0) res_buildprotolist(); pp = cgetprotobynumber(num); - if (pp == 0) { + if (pp == NULL) { (void) sprintf(number, "%d", num); return (number); } @@ -1190,7 +1190,7 @@ res_servicename(u_int16_t port, const ch if (servicelist == (struct valuelist *)0) res_buildservicelist(); ss = cgetservbyport(htons(port), proto); - if (ss == 0) { + if (ss == NULL) { (void) sprintf(number, "%d", port); return (number); } Modified: stable/10/lib/libc/rpc/auth_none.c ============================================================================== --- stable/10/lib/libc/rpc/auth_none.c Sat Dec 3 17:10:37 2016 (r309484) +++ stable/10/lib/libc/rpc/auth_none.c Sat Dec 3 17:17:42 2016 (r309485) @@ -83,9 +83,9 @@ authnone_create(void) XDR *xdrs; mutex_lock(&authnone_lock); - if (ap == 0) { - ap = (struct authnone_private *)calloc(1, sizeof (*ap)); - if (ap == 0) { + if (ap == NULL) { + ap = calloc(1, sizeof (*ap)); + if (ap == NULL) { mutex_unlock(&authnone_lock); return (0); } Modified: stable/10/lib/libc/rpc/clnt_perror.c ============================================================================== --- stable/10/lib/libc/rpc/clnt_perror.c Sat Dec 3 17:10:37 2016 (r309484) +++ stable/10/lib/libc/rpc/clnt_perror.c Sat Dec 3 17:17:42 2016 (r309485) @@ -64,8 +64,8 @@ static char * _buf() { - if (buf == 0) - buf = (char *)malloc(CLNT_PERROR_BUFLEN); + if (buf == NULL) + buf = malloc(CLNT_PERROR_BUFLEN); return (buf); } @@ -87,7 +87,7 @@ clnt_sperror(rpch, s) assert(s != NULL); str = _buf(); /* side effect: sets CLNT_PERROR_BUFLEN */ - if (str == 0) + if (str == NULL) return (0); len = CLNT_PERROR_BUFLEN; strstart = str; @@ -247,7 +247,7 @@ clnt_spcreateerror(s) assert(s != NULL); str = _buf(); /* side effect: sets CLNT_PERROR_BUFLEN */ - if (str == 0) + if (str == NULL) return(0); len = CLNT_PERROR_BUFLEN; i = snprintf(str, len, "%s: ", s); Modified: stable/10/lib/libc/rpc/mt_misc.c ============================================================================== --- stable/10/lib/libc/rpc/mt_misc.c Sat Dec 3 17:10:37 2016 (r309484) +++ stable/10/lib/libc/rpc/mt_misc.c Sat Dec 3 17:17:42 2016 (r309485) @@ -95,7 +95,7 @@ rce_key_init(void) struct rpc_createerr * __rpc_createerr() { - struct rpc_createerr *rce_addr = 0; + struct rpc_createerr *rce_addr = NULL; if (thr_main()) return (&rpc_createerr); Modified: stable/10/lib/libc/rpc/rpcdname.c ============================================================================== --- stable/10/lib/libc/rpc/rpcdname.c Sat Dec 3 17:10:37 2016 (r309484) +++ stable/10/lib/libc/rpc/rpcdname.c Sat Dec 3 17:17:42 2016 (r309485) @@ -43,20 +43,20 @@ __FBSDID("$FreeBSD$"); #include #include "un-namespace.h" -static char *default_domain = 0; +static char *default_domain; static char * get_default_domain(void) { char temp[256]; - if (default_domain) + if (default_domain != NULL) return (default_domain); if (getdomainname(temp, sizeof(temp)) < 0) return (0); if ((int) strlen(temp) > 0) { - default_domain = (char *)malloc((strlen(temp)+(unsigned)1)); - if (default_domain == 0) + default_domain = malloc((strlen(temp) + (unsigned)1)); + if (default_domain == NULL) return (0); (void) strcpy(default_domain, temp); return (default_domain); @@ -74,7 +74,7 @@ int __rpc_get_default_domain(domain) char **domain; { - if ((*domain = get_default_domain()) != 0) + if ((*domain = get_default_domain()) != NULL) return (0); return (-1); } Modified: stable/10/lib/libc/softfloat/timesoftfloat.c ============================================================================== --- stable/10/lib/libc/softfloat/timesoftfloat.c Sat Dec 3 17:10:37 2016 (r309484) +++ stable/10/lib/libc/softfloat/timesoftfloat.c Sat Dec 3 17:17:42 2016 (r309485) @@ -2068,14 +2068,14 @@ static void roundingPrecisionName = "80"; } else { - roundingPrecisionName = 0; + roundingPrecisionName = NULL; } #ifdef FLOATX80 floatx80_rounding_precision = roundingPrecision; #endif switch ( roundingMode ) { case 0: - roundingModeName = 0; + roundingModeName = NULL; roundingCode = float_round_nearest_even; break; case ROUND_NEAREST_EVEN: @@ -2098,7 +2098,7 @@ static void float_rounding_mode = roundingCode; switch ( tininessMode ) { case 0: - tininessModeName = 0; + tininessModeName = NULL; tininessCode = float_tininess_after_rounding; break; case TININESS_BEFORE_ROUNDING: Modified: stable/10/lib/libc/uuid/uuid_to_string.c ============================================================================== --- stable/10/lib/libc/uuid/uuid_to_string.c Sat Dec 3 17:10:37 2016 (r309484) +++ stable/10/lib/libc/uuid/uuid_to_string.c Sat Dec 3 17:17:42 2016 (r309485) @@ -49,7 +49,7 @@ uuid_to_string(const uuid_t *u, char **s *status = uuid_s_ok; /* Why allow a NULL-pointer here? */ - if (s == 0) + if (s == NULL) return; if (u == NULL) { Modified: stable/10/lib/libc/xdr/xdr_mem.c ============================================================================== --- stable/10/lib/libc/xdr/xdr_mem.c Sat Dec 3 17:10:37 2016 (r309484) +++ stable/10/lib/libc/xdr/xdr_mem.c Sat Dec 3 17:17:42 2016 (r309485) @@ -239,7 +239,7 @@ xdrmem_inline_aligned(xdrs, len) XDR *xdrs; u_int len; { - int32_t *buf = 0; + int32_t *buf = NULL; if (xdrs->x_handy >= len) { xdrs->x_handy -= len; From owner-svn-src-all@freebsd.org Sat Dec 3 17:27:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 979F2C65EA5; Sat, 3 Dec 2016 17:27:11 +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 676832B5; Sat, 3 Dec 2016 17:27:11 +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 uB3HRA5Q015531; Sat, 3 Dec 2016 17:27:10 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3HRAak015530; Sat, 3 Dec 2016 17:27:10 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201612031727.uB3HRAak015530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sat, 3 Dec 2016 17:27:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309486 - head/sys/dev/rtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 17:27:11 -0000 Author: avos Date: Sat Dec 3 17:27:10 2016 New Revision: 309486 URL: https://svnweb.freebsd.org/changeset/base/309486 Log: rtwn: fix bitmap size calculation. Tested with RTL8188CE, STA mode. Modified: head/sys/dev/rtwn/if_rtwnvar.h Modified: head/sys/dev/rtwn/if_rtwnvar.h ============================================================================== --- head/sys/dev/rtwn/if_rtwnvar.h Sat Dec 3 17:17:42 2016 (r309485) +++ head/sys/dev/rtwn/if_rtwnvar.h Sat Dec 3 17:27:10 2016 (r309486) @@ -207,8 +207,8 @@ struct rtwn_softc { int vaps_running; int monvaps_running; - uint16_t next_rom_addr; - uint8_t keys_bmap[roundup2(RTWN_CAM_ENTRY_LIMIT, NBBY)]; + uint16_t next_rom_addr; + uint8_t keys_bmap[howmany(RTWN_CAM_ENTRY_LIMIT, NBBY)]; struct rtwn_vap *vaps[RTWN_PORT_COUNT]; struct ieee80211_node *node_list[RTWN_MACID_LIMIT]; From owner-svn-src-all@freebsd.org Sat Dec 3 17:27:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D3FBC65EE7; Sat, 3 Dec 2016 17:27:32 +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 ADEBB64C; Sat, 3 Dec 2016 17:27:31 +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 uB3HRUbb015611; Sat, 3 Dec 2016 17:27:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3HRSxh015587; Sat, 3 Dec 2016 17:27:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612031727.uB3HRSxh015587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 17:27:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309487 - stable/10/lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 17:27:32 -0000 Author: ngie Date: Sat Dec 3 17:27:28 2016 New Revision: 309487 URL: https://svnweb.freebsd.org/changeset/base/309487 Log: MFC r288113: r288113 (by rodrigc): Use ANSI C prototypes. Eliminates -Wold-style-definition warnings. Modified: stable/10/lib/libc/rpc/auth_unix.c stable/10/lib/libc/rpc/authdes_prot.c stable/10/lib/libc/rpc/authunix_prot.c stable/10/lib/libc/rpc/bindresvport.c stable/10/lib/libc/rpc/clnt_bcast.c stable/10/lib/libc/rpc/clnt_perror.c stable/10/lib/libc/rpc/clnt_raw.c stable/10/lib/libc/rpc/clnt_simple.c stable/10/lib/libc/rpc/clnt_vc.c stable/10/lib/libc/rpc/des_crypt.c stable/10/lib/libc/rpc/getnetconfig.c stable/10/lib/libc/rpc/getnetpath.c stable/10/lib/libc/rpc/getrpcent.c stable/10/lib/libc/rpc/getrpcport.c stable/10/lib/libc/rpc/mt_misc.c stable/10/lib/libc/rpc/netname.c stable/10/lib/libc/rpc/netnamer.c stable/10/lib/libc/rpc/pmap_getmaps.c stable/10/lib/libc/rpc/pmap_getport.c stable/10/lib/libc/rpc/pmap_prot.c stable/10/lib/libc/rpc/pmap_prot2.c stable/10/lib/libc/rpc/pmap_rmt.c stable/10/lib/libc/rpc/rpc_callmsg.c stable/10/lib/libc/rpc/rpc_generic.c stable/10/lib/libc/rpc/rpc_prot.c stable/10/lib/libc/rpc/rpc_soc.c stable/10/lib/libc/rpc/rpcb_clnt.c stable/10/lib/libc/rpc/rpcb_prot.c stable/10/lib/libc/rpc/rpcb_st_xdr.c stable/10/lib/libc/rpc/svc_auth.c stable/10/lib/libc/rpc/svc_auth_unix.c stable/10/lib/libc/rpc/svc_generic.c stable/10/lib/libc/rpc/svc_raw.c stable/10/lib/libc/rpc/svc_run.c stable/10/lib/libc/rpc/svc_simple.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/auth_unix.c ============================================================================== --- stable/10/lib/libc/rpc/auth_unix.c Sat Dec 3 17:27:10 2016 (r309486) +++ stable/10/lib/libc/rpc/auth_unix.c Sat Dec 3 17:27:28 2016 (r309487) @@ -91,12 +91,7 @@ struct audata { * Returns an auth handle with the given stuff in it. */ AUTH * -authunix_create(machname, uid, gid, len, aup_gids) - char *machname; - u_int uid; - u_int gid; - int len; - u_int *aup_gids; +authunix_create(char *machname, u_int uid, u_int gid, int len, u_int *aup_gids) { struct authunix_parms aup; char mymem[MAX_AUTH_BYTES]; @@ -182,7 +177,7 @@ authunix_create(machname, uid, gid, len, * syscalls. */ AUTH * -authunix_create_default() +authunix_create_default(void) { AUTH *auth; int ngids; @@ -218,16 +213,13 @@ authunix_create_default() /* ARGSUSED */ static void -authunix_nextverf(auth) - AUTH *auth; +authunix_nextverf(AUTH *auth) { /* no action necessary */ } static bool_t -authunix_marshal(auth, xdrs) - AUTH *auth; - XDR *xdrs; +authunix_marshal(AUTH *auth, XDR *xdrs) { struct audata *au; @@ -239,9 +231,7 @@ authunix_marshal(auth, xdrs) } static bool_t -authunix_validate(auth, verf) - AUTH *auth; - struct opaque_auth *verf; +authunix_validate(AUTH *auth, struct opaque_auth *verf) { struct audata *au; XDR xdrs; @@ -317,8 +307,7 @@ done: } static void -authunix_destroy(auth) - AUTH *auth; +authunix_destroy(AUTH *auth) { struct audata *au; @@ -343,8 +332,7 @@ authunix_destroy(auth) * sets private data, au_marshed and au_mpos */ static void -marshal_new_auth(auth) - AUTH *auth; +marshal_new_auth(AUTH *auth) { XDR xdr_stream; XDR *xdrs = &xdr_stream; @@ -363,7 +351,7 @@ marshal_new_auth(auth) } static struct auth_ops * -authunix_ops() +authunix_ops(void) { static struct auth_ops ops; Modified: stable/10/lib/libc/rpc/authdes_prot.c ============================================================================== --- stable/10/lib/libc/rpc/authdes_prot.c Sat Dec 3 17:27:10 2016 (r309486) +++ stable/10/lib/libc/rpc/authdes_prot.c Sat Dec 3 17:27:28 2016 (r309487) @@ -49,9 +49,7 @@ __FBSDID("$FreeBSD$"); #define ATTEMPT(xdr_op) if (!(xdr_op)) return (FALSE) bool_t -xdr_authdes_cred(xdrs, cred) - XDR *xdrs; - struct authdes_cred *cred; +xdr_authdes_cred(XDR *xdrs, struct authdes_cred *cred) { enum authdes_namekind *padc_namekind = &cred->adc_namekind; /* @@ -78,9 +76,7 @@ xdr_authdes_cred(xdrs, cred) bool_t -xdr_authdes_verf(xdrs, verf) - XDR *xdrs; - struct authdes_verf *verf; +xdr_authdes_verf(XDR *xdrs, struct authdes_verf *verf) { /* * Unrolled xdr Modified: stable/10/lib/libc/rpc/authunix_prot.c ============================================================================== --- stable/10/lib/libc/rpc/authunix_prot.c Sat Dec 3 17:27:10 2016 (r309486) +++ stable/10/lib/libc/rpc/authunix_prot.c Sat Dec 3 17:27:28 2016 (r309487) @@ -55,9 +55,7 @@ __FBSDID("$FreeBSD$"); * XDR for unix authentication parameters. */ bool_t -xdr_authunix_parms(xdrs, p) - XDR *xdrs; - struct authunix_parms *p; +xdr_authunix_parms(XDR *xdrs, struct authunix_parms *p) { u_int **paup_gids; Modified: stable/10/lib/libc/rpc/bindresvport.c ============================================================================== --- stable/10/lib/libc/rpc/bindresvport.c Sat Dec 3 17:27:10 2016 (r309486) +++ stable/10/lib/libc/rpc/bindresvport.c Sat Dec 3 17:27:28 2016 (r309487) @@ -61,9 +61,7 @@ __FBSDID("$FreeBSD$"); * Bind a socket to a privileged IP port */ int -bindresvport(sd, sin) - int sd; - struct sockaddr_in *sin; +bindresvport(int sd, struct sockaddr_in *sin) { return bindresvport_sa(sd, (struct sockaddr *)sin); } @@ -72,9 +70,7 @@ bindresvport(sd, sin) * Bind a socket to a privileged IP port */ int -bindresvport_sa(sd, sa) - int sd; - struct sockaddr *sa; +bindresvport_sa(int sd, struct sockaddr *sa) { int old, error, af; struct sockaddr_storage myaddr; Modified: stable/10/lib/libc/rpc/clnt_bcast.c ============================================================================== --- stable/10/lib/libc/rpc/clnt_bcast.c Sat Dec 3 17:27:10 2016 (r309486) +++ stable/10/lib/libc/rpc/clnt_bcast.c Sat Dec 3 17:27:28 2016 (r309487) @@ -225,21 +225,26 @@ __rpc_broadenable(int af, int s, struct return 0; } - +/* + * rpc_broadcast_exp() + * + * prog - program number + * vers - version number + * proc - procedure number + * xargs - xdr routine for args + * argsp - pointer to args + * xresults - xdr routine for results + * resultsp - pointer to results + * eachresult - call with each result obtained + * inittime - how long to wait initially + * waittime - maximum time to wait + * nettype - transport type + */ enum clnt_stat -rpc_broadcast_exp(prog, vers, proc, xargs, argsp, xresults, resultsp, - eachresult, inittime, waittime, nettype) - rpcprog_t prog; /* program number */ - rpcvers_t vers; /* version number */ - rpcproc_t proc; /* procedure number */ - xdrproc_t xargs; /* xdr routine for args */ - caddr_t argsp; /* pointer to args */ - xdrproc_t xresults; /* xdr routine for results */ - caddr_t resultsp; /* pointer to results */ - resultproc_t eachresult; /* call with each result obtained */ - int inittime; /* how long to wait initially */ - int waittime; /* maximum time to wait */ - const char *nettype; /* transport type */ +rpc_broadcast_exp(rpcprog_t prog, rpcvers_t vers, rpcproc_t proc, + xdrproc_t xargs, caddr_t argsp, xdrproc_t xresults, caddr_t resultsp, + resultproc_t eachresult, int inittime, int waittime, + const char *nettype) { enum clnt_stat stat = RPC_SUCCESS; /* Return status */ XDR xdr_stream; /* XDR stream */ @@ -647,19 +652,23 @@ done_broad: return (stat); } - +/* + * rpc_broadcast() + * + * prog - program number + * vers - version number + * proc - procedure number + * xargs - xdr routine for args + * argsp - pointer to args + * xresults - xdr routine for results + * resultsp - pointer to results + * eachresult - call with each result obtained + * nettype - transport type + */ enum clnt_stat -rpc_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, - eachresult, nettype) - rpcprog_t prog; /* program number */ - rpcvers_t vers; /* version number */ - rpcproc_t proc; /* procedure number */ - xdrproc_t xargs; /* xdr routine for args */ - caddr_t argsp; /* pointer to args */ - xdrproc_t xresults; /* xdr routine for results */ - caddr_t resultsp; /* pointer to results */ - resultproc_t eachresult; /* call with each result obtained */ - const char *nettype; /* transport type */ +rpc_broadcast(rpcprog_t prog, rpcvers_t vers, rpcproc_t proc, xdrproc_t xargs, + caddr_t argsp, xdrproc_t xresults, caddr_t resultsp, + resultproc_t eachresult, const char *nettype) { enum clnt_stat dummy; Modified: stable/10/lib/libc/rpc/clnt_perror.c ============================================================================== --- stable/10/lib/libc/rpc/clnt_perror.c Sat Dec 3 17:27:10 2016 (r309486) +++ stable/10/lib/libc/rpc/clnt_perror.c Sat Dec 3 17:27:28 2016 (r309487) @@ -61,7 +61,7 @@ static char *auth_errmsg(enum auth_stat) #define CLNT_PERROR_BUFLEN 256 static char * -_buf() +_buf(void) { if (buf == NULL) @@ -73,9 +73,7 @@ _buf() * Print reply error info */ char * -clnt_sperror(rpch, s) - CLIENT *rpch; - const char *s; +clnt_sperror(CLIENT *rpch, const char *s) { struct rpc_err e; char *err; @@ -180,9 +178,7 @@ clnt_sperror(rpch, s) } void -clnt_perror(rpch, s) - CLIENT *rpch; - const char *s; +clnt_perror(CLIENT *rpch, const char *s) { assert(rpch != NULL); @@ -217,8 +213,7 @@ static const char *const rpc_errlist[] = * This interface for use by clntrpc */ char * -clnt_sperrno(stat) - enum clnt_stat stat; +clnt_sperrno(enum clnt_stat stat) { unsigned int errnum = stat; @@ -230,16 +225,14 @@ clnt_sperrno(stat) } void -clnt_perrno(num) - enum clnt_stat num; +clnt_perrno(enum clnt_stat num) { (void) fprintf(stderr, "%s\n", clnt_sperrno(num)); } char * -clnt_spcreateerror(s) - const char *s; +clnt_spcreateerror(const char *s) { char *str; size_t len, i; @@ -291,8 +284,7 @@ clnt_spcreateerror(s) } void -clnt_pcreateerror(s) - const char *s; +clnt_pcreateerror(const char *s) { assert(s != NULL); @@ -319,8 +311,7 @@ static const char *const auth_errlist[] }; static char * -auth_errmsg(stat) - enum auth_stat stat; +auth_errmsg(enum auth_stat stat) { unsigned int errnum = stat; Modified: stable/10/lib/libc/rpc/clnt_raw.c ============================================================================== --- stable/10/lib/libc/rpc/clnt_raw.c Sat Dec 3 17:27:10 2016 (r309486) +++ stable/10/lib/libc/rpc/clnt_raw.c Sat Dec 3 17:27:28 2016 (r309487) @@ -87,9 +87,7 @@ static struct clnt_ops *clnt_raw_ops(voi * Create a client handle for memory based rpc. */ CLIENT * -clnt_raw_create(prog, vers) - rpcprog_t prog; - rpcvers_t vers; +clnt_raw_create(rpcprog_t prog, rpcvers_t vers) { struct clntraw_private *clp; struct rpc_msg call_msg; @@ -142,14 +140,8 @@ clnt_raw_create(prog, vers) /* ARGSUSED */ static enum clnt_stat -clnt_raw_call(h, proc, xargs, argsp, xresults, resultsp, timeout) - CLIENT *h; - rpcproc_t proc; - xdrproc_t xargs; - void *argsp; - xdrproc_t xresults; - void *resultsp; - struct timeval timeout; +clnt_raw_call(CLIENT *h, rpcproc_t proc, xdrproc_t xargs, void *argsp, + xdrproc_t xresults, void *resultsp, struct timeval timeout) { struct clntraw_private *clp = clntraw_private; XDR *xdrs = &clp->xdr_stream; @@ -240,19 +232,14 @@ call_again: /*ARGSUSED*/ static void -clnt_raw_geterr(cl, err) - CLIENT *cl; - struct rpc_err *err; +clnt_raw_geterr(CLIENT *cl, struct rpc_err *err) { } /* ARGSUSED */ static bool_t -clnt_raw_freeres(cl, xdr_res, res_ptr) - CLIENT *cl; - xdrproc_t xdr_res; - void *res_ptr; +clnt_raw_freeres(CLIENT *cl, xdrproc_t xdr_res, void *res_ptr) { struct clntraw_private *clp = clntraw_private; XDR *xdrs = &clp->xdr_stream; @@ -271,30 +258,25 @@ clnt_raw_freeres(cl, xdr_res, res_ptr) /*ARGSUSED*/ static void -clnt_raw_abort(cl) - CLIENT *cl; +clnt_raw_abort(CLIENT *cl) { } /*ARGSUSED*/ static bool_t -clnt_raw_control(cl, ui, str) - CLIENT *cl; - u_int ui; - void *str; +clnt_raw_control(CLIENT *cl, u_int ui, void *str) { return (FALSE); } /*ARGSUSED*/ static void -clnt_raw_destroy(cl) - CLIENT *cl; +clnt_raw_destroy(CLIENT *cl) { } static struct clnt_ops * -clnt_raw_ops() +clnt_raw_ops(void) { static struct clnt_ops ops; Modified: stable/10/lib/libc/rpc/clnt_simple.c ============================================================================== --- stable/10/lib/libc/rpc/clnt_simple.c Sat Dec 3 17:27:10 2016 (r309486) +++ stable/10/lib/libc/rpc/clnt_simple.c Sat Dec 3 17:27:28 2016 (r309487) @@ -107,17 +107,19 @@ rpc_call_key_init(void) * the future calls to same prog, vers, host and nettype combination. * * The total time available is 25 seconds. + * + * host - host name + * prognum - program number + * versnum - version number + * procnum - procedure number + * inproc, outproc - in/out XDR procedures + * in, out - recv/send data + * nettype - nettype */ enum clnt_stat -rpc_call(host, prognum, versnum, procnum, inproc, in, outproc, out, nettype) - const char *host; /* host name */ - rpcprog_t prognum; /* program number */ - rpcvers_t versnum; /* version number */ - rpcproc_t procnum; /* procedure number */ - xdrproc_t inproc, outproc; /* in/out XDR procedures */ - const char *in; - char *out; /* recv/send data */ - const char *nettype; /* nettype */ +rpc_call(const char *host, const rpcprog_t prognum, const rpcvers_t versnum, + const rpcproc_t procnum, const xdrproc_t inproc, const char *in, + const xdrproc_t outproc, char *out, const char *nettype) { struct rpc_call_private *rcp = (struct rpc_call_private *) 0; enum clnt_stat clnt_stat; Modified: stable/10/lib/libc/rpc/clnt_vc.c ============================================================================== --- stable/10/lib/libc/rpc/clnt_vc.c Sat Dec 3 17:27:10 2016 (r309486) +++ stable/10/lib/libc/rpc/clnt_vc.c Sat Dec 3 17:27:28 2016 (r309487) @@ -154,15 +154,17 @@ static const char __no_mem_str[] = "out * set this something more useful. * * fd should be an open socket + * + * fd - open file descriptor + * raddr - servers address + * prog - program number + * vers - version number + * sendsz - buffer send size + * recvsz - buffer recv size */ CLIENT * -clnt_vc_create(fd, raddr, prog, vers, sendsz, recvsz) - int fd; /* open file descriptor */ - const struct netbuf *raddr; /* servers address */ - const rpcprog_t prog; /* program number */ - const rpcvers_t vers; /* version number */ - u_int sendsz; /* buffer recv size */ - u_int recvsz; /* buffer send size */ +clnt_vc_create(int fd, const struct netbuf *raddr, const rpcprog_t prog, + const rpcvers_t vers, u_int sendsz, u_int recvsz) { CLIENT *cl; /* client handle */ struct ct_data *ct = NULL; /* client handle */ @@ -312,14 +314,8 @@ err: } static enum clnt_stat -clnt_vc_call(cl, proc, xdr_args, args_ptr, xdr_results, results_ptr, timeout) - CLIENT *cl; - rpcproc_t proc; - xdrproc_t xdr_args; - void *args_ptr; - xdrproc_t xdr_results; - void *results_ptr; - struct timeval timeout; +clnt_vc_call(CLIENT *cl, rpcproc_t proc, xdrproc_t xdr_args, void *args_ptr, + xdrproc_t xdr_results, void *results_ptr, struct timeval timeout) { struct ct_data *ct = (struct ct_data *) cl->cl_private; XDR *xdrs = &(ct->ct_xdrs); @@ -462,9 +458,7 @@ call_again: } static void -clnt_vc_geterr(cl, errp) - CLIENT *cl; - struct rpc_err *errp; +clnt_vc_geterr(CLIENT *cl, struct rpc_err *errp) { struct ct_data *ct; @@ -476,10 +470,7 @@ clnt_vc_geterr(cl, errp) } static bool_t -clnt_vc_freeres(cl, xdr_res, res_ptr) - CLIENT *cl; - xdrproc_t xdr_res; - void *res_ptr; +clnt_vc_freeres(CLIENT *cl, xdrproc_t xdr_res, void *res_ptr) { struct ct_data *ct; XDR *xdrs; @@ -508,16 +499,12 @@ clnt_vc_freeres(cl, xdr_res, res_ptr) /*ARGSUSED*/ static void -clnt_vc_abort(cl) - CLIENT *cl; +clnt_vc_abort(CLIENT *cl) { } static bool_t -clnt_vc_control(cl, request, info) - CLIENT *cl; - u_int request; - void *info; +clnt_vc_control(CLIENT *cl, u_int request, void *info) { struct ct_data *ct; void *infop = info; @@ -645,8 +632,7 @@ clnt_vc_control(cl, request, info) static void -clnt_vc_destroy(cl) - CLIENT *cl; +clnt_vc_destroy(CLIENT *cl) { struct ct_data *ct = (struct ct_data *) cl->cl_private; int ct_fd = ct->ct_fd; @@ -684,10 +670,7 @@ clnt_vc_destroy(cl) * around for the rpc level. */ static int -read_vc(ctp, buf, len) - void *ctp; - void *buf; - int len; +read_vc(void *ctp, void *buf, int len) { struct sockaddr sa; socklen_t sal; @@ -741,10 +724,7 @@ read_vc(ctp, buf, len) } static int -write_vc(ctp, buf, len) - void *ctp; - void *buf; - int len; +write_vc(void *ctp, void *buf, int len) { struct sockaddr sa; socklen_t sal; @@ -775,7 +755,7 @@ write_vc(ctp, buf, len) } static struct clnt_ops * -clnt_vc_ops() +clnt_vc_ops(void) { static struct clnt_ops ops; sigset_t mask, newmask; @@ -803,18 +783,14 @@ clnt_vc_ops() * Note this is different from time_not_ok in clnt_dg.c */ static bool_t -time_not_ok(t) - struct timeval *t; +time_not_ok(struct timeval *t) { return (t->tv_sec <= -1 || t->tv_sec > 100000000 || t->tv_usec <= -1 || t->tv_usec > 1000000); } static int -__msgread(sock, buf, cnt) - int sock; - void *buf; - size_t cnt; +__msgread(int sock, void *buf, size_t cnt) { struct iovec iov[1]; struct msghdr msg; @@ -839,10 +815,7 @@ __msgread(sock, buf, cnt) } static int -__msgwrite(sock, buf, cnt) - int sock; - void *buf; - size_t cnt; +__msgwrite(int sock, void *buf, size_t cnt) { struct iovec iov[1]; struct msghdr msg; Modified: stable/10/lib/libc/rpc/des_crypt.c ============================================================================== --- stable/10/lib/libc/rpc/des_crypt.c Sat Dec 3 17:27:10 2016 (r309486) +++ stable/10/lib/libc/rpc/des_crypt.c Sat Dec 3 17:27:28 2016 (r309487) @@ -41,7 +41,7 @@ static char sccsid[] = "@(#)des_crypt.c __FBSDID("$FreeBSD$"); static int common_crypt( char *, char *, unsigned, unsigned, struct desparams * ); -int (*__des_crypt_LOCAL)() = 0; +int (*__des_crypt_LOCAL)(char *, unsigned, struct desparams *) = 0; extern int _des_crypt_call(char *, int, struct desparams *); /* * Copy 8 bytes Modified: stable/10/lib/libc/rpc/getnetconfig.c ============================================================================== --- stable/10/lib/libc/rpc/getnetconfig.c Sat Dec 3 17:27:10 2016 (r309486) +++ stable/10/lib/libc/rpc/getnetconfig.c Sat Dec 3 17:27:28 2016 (r309487) @@ -147,7 +147,7 @@ nc_key_init(void) #define MAXNETCONFIGLINE 1000 static int * -__nc_error() +__nc_error(void) { static int nc_error = 0; int *nc_addr; @@ -193,7 +193,7 @@ __nc_error() * the netconfig database is not present). */ void * -setnetconfig() +setnetconfig(void) { struct netconfig_vars *nc_vars; @@ -239,8 +239,7 @@ setnetconfig() */ struct netconfig * -getnetconfig(handlep) -void *handlep; +getnetconfig(void *handlep) { struct netconfig_vars *ncp = (struct netconfig_vars *)handlep; char *stringp; /* tmp string pointer */ @@ -377,8 +376,7 @@ void *handlep; * previously). */ int -endnetconfig(handlep) -void *handlep; +endnetconfig(void *handlep) { struct netconfig_vars *nc_handlep = (struct netconfig_vars *)handlep; @@ -443,8 +441,7 @@ void *handlep; */ struct netconfig * -getnetconfigent(netid) - const char *netid; +getnetconfigent(const char *netid) { FILE *file; /* NETCONFIG db's file pointer */ char *linep; /* holds current netconfig line */ @@ -535,8 +532,7 @@ getnetconfigent(netid) */ void -freenetconfigent(netconfigp) - struct netconfig *netconfigp; +freenetconfigent(struct netconfig *netconfigp) { if (netconfigp != NULL) { free(netconfigp->nc_netid); /* holds all netconfigp's strings */ @@ -556,12 +552,13 @@ freenetconfigent(netconfigp) * Note that we modify stringp (putting NULLs after tokens) and * we set the ncp's string field pointers to point to these tokens within * stringp. + * + * stringp - string to parse + * ncp - where to put results */ static int -parse_ncp(stringp, ncp) -char *stringp; /* string to parse */ -struct netconfig *ncp; /* where to put results */ +parse_ncp(char *stringp, struct netconfig *ncp) { char *tokenp; /* for processing tokens */ char *lasts; @@ -652,7 +649,7 @@ struct netconfig *ncp; /* where to put r * Returns a string describing the reason for failure. */ char * -nc_sperror() +nc_sperror(void) { const char *message; @@ -683,8 +680,7 @@ nc_sperror() * Prints a message onto standard error describing the reason for failure. */ void -nc_perror(s) - const char *s; +nc_perror(const char *s) { fprintf(stderr, "%s: %s\n", s, nc_sperror()); } @@ -693,8 +689,7 @@ nc_perror(s) * Duplicates the matched netconfig buffer. */ static struct netconfig * -dup_ncp(ncp) -struct netconfig *ncp; +dup_ncp(struct netconfig *ncp) { struct netconfig *p; char *tmp, *tmp2; Modified: stable/10/lib/libc/rpc/getnetpath.c ============================================================================== --- stable/10/lib/libc/rpc/getnetpath.c Sat Dec 3 17:27:10 2016 (r309486) +++ stable/10/lib/libc/rpc/getnetpath.c Sat Dec 3 17:27:28 2016 (r309487) @@ -82,7 +82,7 @@ char *_get_next_token(char *, int); */ void * -setnetpath() +setnetpath(void) { struct netpath_vars *np_sessionp; /* this session's variables */ @@ -141,8 +141,7 @@ failed: */ struct netconfig * -getnetpath(handlep) - void *handlep; +getnetpath(void *handlep) { struct netpath_vars *np_sessionp = (struct netpath_vars *)handlep; struct netconfig *ncp = NULL; /* temp. holds a netconfig session */ @@ -197,8 +196,7 @@ getnetpath(handlep) * (e.g. if setnetpath() was not called previously. */ int -endnetpath(handlep) - void *handlep; +endnetpath(void *handlep) { struct netpath_vars *np_sessionp = (struct netpath_vars *)handlep; struct netpath_chain *chainp, *lastp; @@ -231,12 +229,12 @@ endnetpath(handlep) * Returns pointer to the rest-of-the-string after the current token. * The token itself starts at arg, and we null terminate it. We return NULL * if either the arg is empty, or if this is the last token. + * + * npp - string + * token - char to parse string for */ - char * -_get_next_token(npp, token) -char *npp; /* string */ -int token; /* char to parse string for */ +_get_next_token(char *npp, int token) { char *cp; /* char pointer */ char *np; /* netpath pointer */ Modified: stable/10/lib/libc/rpc/getrpcent.c ============================================================================== --- stable/10/lib/libc/rpc/getrpcent.c Sat Dec 3 17:27:10 2016 (r309486) +++ stable/10/lib/libc/rpc/getrpcent.c Sat Dec 3 17:27:28 2016 (r309487) @@ -991,7 +991,7 @@ getrpcbynumber(int number) } struct rpcent * -getrpcent() +getrpcent(void) { union key key; @@ -1025,7 +1025,7 @@ setrpcent(int stayopen) } void -endrpcent() +endrpcent(void) { #ifdef NS_CACHING static const nss_cache_info cache_info = NS_MP_CACHE_INFO_INITIALIZER( Modified: stable/10/lib/libc/rpc/getrpcport.c ============================================================================== --- stable/10/lib/libc/rpc/getrpcport.c Sat Dec 3 17:27:10 2016 (r309486) +++ stable/10/lib/libc/rpc/getrpcport.c Sat Dec 3 17:27:28 2016 (r309487) @@ -53,9 +53,7 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" int -getrpcport(host, prognum, versnum, proto) - char *host; - int prognum, versnum, proto; +getrpcport(char *host, int prognum, int versnum, int proto) { struct sockaddr_in addr; struct hostent *hp; Modified: stable/10/lib/libc/rpc/mt_misc.c ============================================================================== --- stable/10/lib/libc/rpc/mt_misc.c Sat Dec 3 17:27:10 2016 (r309486) +++ stable/10/lib/libc/rpc/mt_misc.c Sat Dec 3 17:27:28 2016 (r309487) @@ -93,7 +93,7 @@ rce_key_init(void) } struct rpc_createerr * -__rpc_createerr() +__rpc_createerr(void) { struct rpc_createerr *rce_addr = NULL; Modified: stable/10/lib/libc/rpc/netname.c ============================================================================== --- stable/10/lib/libc/rpc/netname.c Sat Dec 3 17:27:10 2016 (r309486) +++ stable/10/lib/libc/rpc/netname.c Sat Dec 3 17:27:28 2016 (r309487) @@ -79,8 +79,7 @@ static char *OPSYS = "unix"; * Figure out my fully qualified network name */ int -getnetname(name) - char name[MAXNETNAMELEN+1]; +getnetname(char name[MAXNETNAMELEN+1]) { uid_t uid; @@ -97,10 +96,7 @@ getnetname(name) * Convert unix cred to network-name */ int -user2netname(netname, uid, domain) - char netname[MAXNETNAMELEN + 1]; - const uid_t uid; - const char *domain; +user2netname(char netname[MAXNETNAMELEN + 1], const uid_t uid, const char *domain) { char *dfltdom; @@ -122,10 +118,7 @@ user2netname(netname, uid, domain) * Convert host to network-name */ int -host2netname(netname, host, domain) - char netname[MAXNETNAMELEN + 1]; - const char *host; - const char *domain; +host2netname(char netname[MAXNETNAMELEN + 1], const char *host, const char *domain) { char *dfltdom; char hostname[MAXHOSTNAMELEN+1]; Modified: stable/10/lib/libc/rpc/netnamer.c ============================================================================== --- stable/10/lib/libc/rpc/netnamer.c Sat Dec 3 17:27:10 2016 (r309486) +++ stable/10/lib/libc/rpc/netnamer.c Sat Dec 3 17:27:28 2016 (r309487) @@ -68,12 +68,8 @@ static int _getgroups( char *, gid_t * ) * Convert network-name into unix credential */ int -netname2user(netname, uidp, gidp, gidlenp, gidlist) - char netname[MAXNETNAMELEN + 1]; - uid_t *uidp; - gid_t *gidp; - int *gidlenp; - gid_t *gidlist; +netname2user(char netname[MAXNETNAMELEN + 1], uid_t *uidp, gid_t *gidp, + int *gidlenp, gid_t *gidlist) { char *p; int gidlen; @@ -149,9 +145,7 @@ netname2user(netname, uidp, gidp, gidlen */ static int -_getgroups(uname, groups) - char *uname; - gid_t groups[NGRPS]; +_getgroups(char *uname, gid_t groups[NGRPS]) { gid_t ngroups = 0; struct group *grp; @@ -190,10 +184,7 @@ toomany: * Convert network-name to hostname */ int -netname2host(netname, hostname, hostlen) - char netname[MAXNETNAMELEN + 1]; - char *hostname; - int hostlen; +netname2host(char netname[MAXNETNAMELEN + 1], char *hostname, int hostlen) { int err; char valbuf[1024]; @@ -239,8 +230,7 @@ netname2host(netname, hostname, hostlen) * network information service. */ int -getnetid(key, ret) - char *key, *ret; +getnetid(char *key, char *ret) { char buf[1024]; /* big enough */ char *res; Modified: stable/10/lib/libc/rpc/pmap_getmaps.c ============================================================================== --- stable/10/lib/libc/rpc/pmap_getmaps.c Sat Dec 3 17:27:10 2016 (r309486) +++ stable/10/lib/libc/rpc/pmap_getmaps.c Sat Dec 3 17:27:28 2016 (r309487) @@ -70,8 +70,7 @@ __FBSDID("$FreeBSD$"); * Calls the pmap service remotely to do get the maps. */ struct pmaplist * -pmap_getmaps(address) - struct sockaddr_in *address; +pmap_getmaps(struct sockaddr_in *address) { struct pmaplist *head = NULL; int sock = -1; Modified: stable/10/lib/libc/rpc/pmap_getport.c ============================================================================== --- stable/10/lib/libc/rpc/pmap_getport.c Sat Dec 3 17:27:10 2016 (r309486) +++ stable/10/lib/libc/rpc/pmap_getport.c Sat Dec 3 17:27:28 2016 (r309487) @@ -66,11 +66,8 @@ static const struct timeval tottimeout = * Returns 0 if no map exists. */ u_short -pmap_getport(address, program, version, protocol) - struct sockaddr_in *address; - u_long program; - u_long version; - u_int protocol; +pmap_getport(struct sockaddr_in *address, u_long program, u_long version, + u_int protocol) { u_short port = 0; int sock = -1; Modified: stable/10/lib/libc/rpc/pmap_prot.c ============================================================================== --- stable/10/lib/libc/rpc/pmap_prot.c Sat Dec 3 17:27:10 2016 (r309486) +++ stable/10/lib/libc/rpc/pmap_prot.c Sat Dec 3 17:27:28 2016 (r309487) @@ -52,9 +52,7 @@ __FBSDID("$FreeBSD$"); bool_t -xdr_pmap(xdrs, regs) - XDR *xdrs; - struct pmap *regs; +xdr_pmap(XDR *xdrs, struct pmap *regs) { assert(xdrs != NULL); Modified: stable/10/lib/libc/rpc/pmap_prot2.c ============================================================================== --- stable/10/lib/libc/rpc/pmap_prot2.c Sat Dec 3 17:27:10 2016 (r309486) +++ stable/10/lib/libc/rpc/pmap_prot2.c Sat Dec 3 17:27:28 2016 (r309487) @@ -90,9 +90,7 @@ __FBSDID("$FreeBSD$"); * this sounds like a job for xdr_reference! */ bool_t -xdr_pmaplist(xdrs, rp) - XDR *xdrs; - struct pmaplist **rp; +xdr_pmaplist(XDR *xdrs, struct pmaplist **rp) { /* * more_elements is pre-computed in case the direction is @@ -134,9 +132,7 @@ xdr_pmaplist(xdrs, rp) * functionality to xdr_pmaplist(). */ bool_t -xdr_pmaplist_ptr(xdrs, rp) - XDR *xdrs; - struct pmaplist *rp; +xdr_pmaplist_ptr(XDR *xdrs, struct pmaplist *rp) { return xdr_pmaplist(xdrs, (struct pmaplist **)(void *)rp); } Modified: stable/10/lib/libc/rpc/pmap_rmt.c ============================================================================== --- stable/10/lib/libc/rpc/pmap_rmt.c Sat Dec 3 17:27:10 2016 (r309486) +++ stable/10/lib/libc/rpc/pmap_rmt.c Sat Dec 3 17:27:28 2016 (r309487) @@ -76,14 +76,9 @@ static const struct timeval timeout = { * programs to do a lookup and call in one step. */ enum clnt_stat -pmap_rmtcall(addr, prog, vers, proc, xdrargs, argsp, xdrres, resp, tout, - port_ptr) - struct sockaddr_in *addr; - u_long prog, vers, proc; - xdrproc_t xdrargs, xdrres; - caddr_t argsp, resp; - struct timeval tout; - u_long *port_ptr; +pmap_rmtcall(struct sockaddr_in *addr, u_long prog, u_long vers, u_long proc, + xdrproc_t xdrargs, caddr_t argsp, xdrproc_t xdrres, caddr_t resp, + struct timeval tout, u_long *port_ptr) { int sock = -1; CLIENT *client; @@ -122,9 +117,7 @@ pmap_rmtcall(addr, prog, vers, proc, xdr * written for XDR_ENCODE direction only */ bool_t -xdr_rmtcall_args(xdrs, cap) - XDR *xdrs; - struct rmtcallargs *cap; +xdr_rmtcall_args(XDR *xdrs, struct rmtcallargs *cap) { u_int lenposition, argposition, position; @@ -156,9 +149,7 @@ xdr_rmtcall_args(xdrs, cap) * written for XDR_DECODE direction only */ bool_t -xdr_rmtcallres(xdrs, crp) - XDR *xdrs; - struct rmtcallres *crp; +xdr_rmtcallres(XDR *xdrs, struct rmtcallres *crp) { caddr_t port_ptr; Modified: stable/10/lib/libc/rpc/rpc_callmsg.c ============================================================================== --- stable/10/lib/libc/rpc/rpc_callmsg.c Sat Dec 3 17:27:10 2016 (r309486) +++ stable/10/lib/libc/rpc/rpc_callmsg.c Sat Dec 3 17:27:28 2016 (r309487) @@ -54,9 +54,7 @@ __FBSDID("$FreeBSD$"); * XDR a call message */ bool_t -xdr_callmsg(xdrs, cmsg) - XDR *xdrs; - struct rpc_msg *cmsg; +xdr_callmsg(XDR *xdrs, struct rpc_msg *cmsg) { enum msg_type *prm_direction; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Dec 3 17:40:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D377BC65266; Sat, 3 Dec 2016 17:40:27 +0000 (UTC) (envelope-from gonzo@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 946D9D5E; Sat, 3 Dec 2016 17:40:27 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB3HeQVa020085; Sat, 3 Dec 2016 17:40:26 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3HeQGX020083; Sat, 3 Dec 2016 17:40:26 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201612031740.uB3HeQGX020083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 3 Dec 2016 17:40:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309488 - in stable/11/sys: dev/kbdmux modules/kbdmux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 17:40:27 -0000 Author: gonzo Date: Sat Dec 3 17:40:26 2016 New Revision: 309488 URL: https://svnweb.freebsd.org/changeset/base/309488 Log: MFC r308668: [evdev] Add evdev support to kbdmux(4) driver To enable event sourcing from kbdmux(4) kern.evdev.rcpt_mask value should have bit 1 set (this is default) Submitted by: Vladimir Kondratiev Differential Revision: https://reviews.freebsd.org/D8437 Modified: stable/11/sys/dev/kbdmux/kbdmux.c stable/11/sys/modules/kbdmux/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/kbdmux/kbdmux.c ============================================================================== --- stable/11/sys/dev/kbdmux/kbdmux.c Sat Dec 3 17:27:28 2016 (r309487) +++ stable/11/sys/dev/kbdmux/kbdmux.c Sat Dec 3 17:40:26 2016 (r309488) @@ -32,6 +32,7 @@ */ #include "opt_compat.h" +#include "opt_evdev.h" #include "opt_kbd.h" #include "opt_kbdmux.h" @@ -64,6 +65,11 @@ #include +#ifdef EVDEV_SUPPORT +#include +#include +#endif + #define KEYBOARD_NAME "kbdmux" MALLOC_DECLARE(M_KBDMUX); @@ -159,6 +165,11 @@ struct kbdmux_state u_int ks_composed_char; /* composed char code */ u_char ks_prefix; /* AT scan code prefix */ +#ifdef EVDEV_SUPPORT + struct evdev_dev * ks_evdev; + int ks_evdev_state; +#endif + SLIST_HEAD(, kbdmux_kbd) ks_kbds; /* keyboards */ KBDMUX_LOCK_DECL_GLOBAL; @@ -371,6 +382,12 @@ static keyboard_switch_t kbdmuxsw = { .diag = genkbd_diag, }; +#ifdef EVDEV_SUPPORT +static const struct evdev_methods kbdmux_evdev_methods = { + .ev_event = evdev_ev_kbd_event, +}; +#endif + /* * Return the number of found keyboards */ @@ -404,6 +421,10 @@ kbdmux_init(int unit, keyboard_t **kbdp, accentmap_t *accmap = NULL; fkeytab_t *fkeymap = NULL; int error, needfree, fkeymap_size, delay[2]; +#ifdef EVDEV_SUPPORT + struct evdev_dev *evdev; + char phys_loc[NAMELEN]; +#endif if (*kbdp == NULL) { *kbdp = kbd = malloc(sizeof(*kbd), M_KBDMUX, M_NOWAIT | M_ZERO); @@ -464,6 +485,30 @@ kbdmux_init(int unit, keyboard_t **kbdp, delay[1] = kbd->kb_delay2; kbdmux_ioctl(kbd, KDSETREPEAT, (caddr_t)delay); +#ifdef EVDEV_SUPPORT + /* register as evdev provider */ + evdev = evdev_alloc(); + evdev_set_name(evdev, "System keyboard multiplexer"); + snprintf(phys_loc, NAMELEN, KEYBOARD_NAME"%d", unit); + evdev_set_phys(evdev, phys_loc); + evdev_set_id(evdev, BUS_VIRTUAL, 0, 0, 0); + evdev_set_methods(evdev, kbd, &kbdmux_evdev_methods); + evdev_support_event(evdev, EV_SYN); + evdev_support_event(evdev, EV_KEY); + evdev_support_event(evdev, EV_LED); + evdev_support_event(evdev, EV_REP); + evdev_support_all_known_keys(evdev); + evdev_support_led(evdev, LED_NUML); + evdev_support_led(evdev, LED_CAPSL); + evdev_support_led(evdev, LED_SCROLLL); + + if (evdev_register(evdev)) + evdev_free(evdev); + else + state->ks_evdev = evdev; + state->ks_evdev_state = 0; +#endif + KBD_INIT_DONE(kbd); } @@ -532,6 +577,10 @@ kbdmux_term(keyboard_t *kbd) kbd_unregister(kbd); +#ifdef EVDEV_SUPPORT + evdev_free(state->ks_evdev); +#endif + KBDMUX_LOCK_DESTROY(state); bzero(state, sizeof(*state)); free(state, M_KBDMUX); @@ -694,6 +743,20 @@ next_code: kbd->kb_count ++; +#ifdef EVDEV_SUPPORT + /* push evdev event */ + if (evdev_rcpt_mask & EVDEV_RCPT_KBDMUX && state->ks_evdev != NULL) { + uint16_t key = evdev_scancode2key(&state->ks_evdev_state, + scancode); + + if (key != KEY_RESERVED) { + evdev_push_event(state->ks_evdev, EV_KEY, + key, scancode & 0x80 ? 0 : 1); + evdev_sync(state->ks_evdev); + } + } +#endif + /* return the byte as is for the K_RAW mode */ if (state->ks_mode == K_RAW) { KBDMUX_UNLOCK(state); @@ -1120,7 +1183,11 @@ kbdmux_ioctl(keyboard_t *kbd, u_long cmd } KBD_LED_VAL(kbd) = *(int *)arg; - +#ifdef EVDEV_SUPPORT + if (state->ks_evdev != NULL && + evdev_rcpt_mask & EVDEV_RCPT_KBDMUX) + evdev_push_leds(state->ks_evdev, *(int *)arg); +#endif /* KDSETLED on all slave keyboards */ SLIST_FOREACH(k, &state->ks_kbds, next) (void)kbdd_ioctl(k->kbd, KDSETLED, arg); @@ -1197,7 +1264,11 @@ kbdmux_ioctl(keyboard_t *kbd, u_long cmd kbd->kb_delay1 = delays[(mode >> 5) & 3]; kbd->kb_delay2 = rates[mode & 0x1f]; - +#ifdef EVDEV_SUPPORT + if (state->ks_evdev != NULL && + evdev_rcpt_mask & EVDEV_RCPT_KBDMUX) + evdev_push_repeats(state->ks_evdev, kbd); +#endif /* perform command on all slave keyboards */ SLIST_FOREACH(k, &state->ks_kbds, next) (void)kbdd_ioctl(k->kbd, cmd, arg); @@ -1395,4 +1466,6 @@ kbdmux_modevent(module_t mod, int type, } DEV_MODULE(kbdmux, kbdmux_modevent, NULL); - +#ifdef EVDEV_SUPPORT +MODULE_DEPEND(kbdmux, evdev, 1, 1, 1); +#endif Modified: stable/11/sys/modules/kbdmux/Makefile ============================================================================== --- stable/11/sys/modules/kbdmux/Makefile Sat Dec 3 17:27:28 2016 (r309487) +++ stable/11/sys/modules/kbdmux/Makefile Sat Dec 3 17:40:26 2016 (r309488) @@ -4,7 +4,8 @@ .PATH: ${.CURDIR}/../../dev/kbdmux KMOD= kbdmux -SRCS= kbdmux.c opt_compat.h opt_kbd.h opt_kbdmux.h bus_if.h device_if.h +SRCS= kbdmux.c opt_compat.h opt_evdev.h opt_kbd.h opt_kbdmux.h bus_if.h \ + device_if.h .if !defined(KERNBUILDDIR) opt_compat.h: From owner-svn-src-all@freebsd.org Sat Dec 3 17:41:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01D86C653EB; Sat, 3 Dec 2016 17:41:01 +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 94139F03; Sat, 3 Dec 2016 17:41:00 +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 uB3HexuD022233; Sat, 3 Dec 2016 17:40:59 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3Hewop022218; Sat, 3 Dec 2016 17:40:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612031740.uB3Hewop022218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 17:40:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309489 - stable/10/lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 17:41:01 -0000 Author: ngie Date: Sat Dec 3 17:40:58 2016 New Revision: 309489 URL: https://svnweb.freebsd.org/changeset/base/309489 Log: MFC r287341,r287342,r287348: r287341 (by rodrigc): Use ANSI C prototypes. Eliminates gcc 4.9 warnings. r287342 (by rodrigc): Mark unused parameters to reduce gcc 4.9 warnings. r287348 (by rodrigc): Use correct function prototype for signal handler. Eliminates gcc 4.9 warning. Modified: stable/10/lib/libc/rpc/auth_des.c stable/10/lib/libc/rpc/auth_time.c stable/10/lib/libc/rpc/clnt_dg.c stable/10/lib/libc/rpc/crypt_client.c stable/10/lib/libc/rpc/des_crypt.c stable/10/lib/libc/rpc/des_soft.c stable/10/lib/libc/rpc/getpublickey.c stable/10/lib/libc/rpc/key_call.c stable/10/lib/libc/rpc/rpc_soc.c stable/10/lib/libc/rpc/rpcb_clnt.c stable/10/lib/libc/rpc/rpcdname.c stable/10/lib/libc/rpc/rtime.c stable/10/lib/libc/rpc/svc_auth.c stable/10/lib/libc/rpc/svc_auth_des.c stable/10/lib/libc/rpc/svc_dg.c stable/10/lib/libc/rpc/svc_vc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/auth_des.c ============================================================================== --- stable/10/lib/libc/rpc/auth_des.c Sat Dec 3 17:40:26 2016 (r309488) +++ stable/10/lib/libc/rpc/auth_des.c Sat Dec 3 17:40:58 2016 (r309489) @@ -259,7 +259,7 @@ failed: */ /*ARGSUSED*/ static void -authdes_nextverf(AUTH *auth) +authdes_nextverf(AUTH *auth __unused) { /* what the heck am I supposed to do??? */ } @@ -420,7 +420,7 @@ authdes_validate(AUTH *auth, struct opaq */ /*ARGSUSED*/ static bool_t -authdes_refresh(AUTH *auth, void *dummy) +authdes_refresh(AUTH *auth, void *dummy __unused) { /* LINTED pointer alignment */ struct ad_private *ad = AUTH_PRIVATE(auth); Modified: stable/10/lib/libc/rpc/auth_time.c ============================================================================== --- stable/10/lib/libc/rpc/auth_time.c Sat Dec 3 17:40:26 2016 (r309488) +++ stable/10/lib/libc/rpc/auth_time.c Sat Dec 3 17:40:58 2016 (r309489) @@ -61,8 +61,7 @@ extern int _rpc_dtablesize( void ); static int saw_alarm = 0; static void -alarm_hndler(s) - int s; +alarm_hndler(int s) { saw_alarm = 1; return; @@ -83,12 +82,7 @@ alarm_hndler(s) * Turn a 'universal address' into a struct sockaddr_in. * Bletch. */ -static int uaddr_to_sockaddr(uaddr, sin) -#ifdef foo - endpoint *endpt; -#endif - char *uaddr; - struct sockaddr_in *sin; +static int uaddr_to_sockaddr(char *uaddr, struct sockaddr_in *sin) { unsigned char p_bytes[2]; int i; @@ -118,9 +112,7 @@ static int uaddr_to_sockaddr(uaddr, sin) * Free the strings that were strduped into the eps structure. */ static void -free_eps(eps, num) - endpoint eps[]; - int num; +free_eps(endpoint eps[], int num) { int i; @@ -142,14 +134,15 @@ free_eps(eps, num) * fact that gethostbyname() could do an NIS search. Ideally, the * NIS+ server will call __rpc_get_time_offset() with the nis_server * structure already populated. + * + * host - name of the time host + * srv - nis_server struct to use. + * eps[] - array of endpoints + * maxep - max array size */ static nis_server * -get_server(sin, host, srv, eps, maxep) - struct sockaddr_in *sin; - char *host; /* name of the time host */ - nis_server *srv; /* nis_server struct to use. */ - endpoint eps[]; /* array of endpoints */ - int maxep; /* max array size */ +get_server(struct sockaddr_in *sin, char *host, nis_server *srv, + endpoint eps[], int maxep) { char hname[256]; int num_ep = 0, i; @@ -236,14 +229,16 @@ get_server(sin, host, srv, eps, maxep) * structure and to then contact the machine for the time. * * td = "server" - "client" + * + * td - Time difference + * srv - NIS Server description + * thost - if no server, this is the timehost + * uaddr - known universal address + * netid - known network identifier */ int -__rpc_get_time_offset(td, srv, thost, uaddr, netid) - struct timeval *td; /* Time difference */ - nis_server *srv; /* NIS Server description */ - char *thost; /* if no server, this is the timehost */ - char **uaddr; /* known universal address */ - struct sockaddr_in *netid; /* known network identifier */ +__rpc_get_time_offset(struct timeval *td, nis_server *srv, char *thost, + char **uaddr, struct sockaddr_in *netid) { CLIENT *clnt; /* Client handle */ endpoint *ep, /* useful endpoints */ @@ -260,7 +255,7 @@ __rpc_get_time_offset(td, srv, thost, ua char ut[64], ipuaddr[64]; endpoint teps[32]; nis_server tsrv; - void (*oldsig)() = NULL; /* old alarm handler */ + void (*oldsig)(int) = NULL; /* old alarm handler */ struct sockaddr_in sin; socklen_t len; int s = RPC_ANYSOCK; @@ -429,7 +424,7 @@ __rpc_get_time_offset(td, srv, thost, ua } else { int res; - oldsig = (void (*)())signal(SIGALRM, alarm_hndler); + oldsig = (void (*)(int))signal(SIGALRM, alarm_hndler); saw_alarm = 0; /* global tracking the alarm */ alarm(20); /* only wait 20 seconds */ res = _connect(s, (struct sockaddr *)&sin, sizeof(sin)); Modified: stable/10/lib/libc/rpc/clnt_dg.c ============================================================================== --- stable/10/lib/libc/rpc/clnt_dg.c Sat Dec 3 17:40:26 2016 (r309488) +++ stable/10/lib/libc/rpc/clnt_dg.c Sat Dec 3 17:40:58 2016 (r309489) @@ -153,15 +153,17 @@ struct cu_data { * If they are 0, use the transport default. * * If svcaddr is NULL, returns NULL. + * + * fd - open file descriptor + * svcaddr - servers address + * program - program number + * version - version number + * sendsz - buffer recv size + * recvsz - buffer send size */ CLIENT * -clnt_dg_create(fd, svcaddr, program, version, sendsz, recvsz) - int fd; /* open file descriptor */ - const struct netbuf *svcaddr; /* servers address */ - rpcprog_t program; /* program number */ - rpcvers_t version; /* version number */ - u_int sendsz; /* buffer recv size */ - u_int recvsz; /* buffer send size */ +clnt_dg_create(int fd, const struct netbuf *svcaddr, rpcprog_t program, + rpcvers_t version, u_int sendsz, u_int recvsz) { CLIENT *cl = NULL; /* client handle */ struct cu_data *cu = NULL; /* private data */ @@ -301,15 +303,18 @@ err2: return (NULL); } +/* + * cl - client handle + * proc - procedure number + * xargs - xdr routine for args + * argsp - pointer to args + * xresults - xdr routine for results + * resultsp - pointer to results + * utimeout - seconds to wait before giving up + */ static enum clnt_stat -clnt_dg_call(cl, proc, xargs, argsp, xresults, resultsp, utimeout) - CLIENT *cl; /* client handle */ - rpcproc_t proc; /* procedure number */ - xdrproc_t xargs; /* xdr routine for args */ - void *argsp; /* pointer to args */ - xdrproc_t xresults; /* xdr routine for results */ - void *resultsp; /* pointer to results */ - struct timeval utimeout; /* seconds to wait before giving up */ +clnt_dg_call(CLIENT *cl, rpcproc_t proc, xdrproc_t xargs, void *argsp, + xdrproc_t xresults, void *resultsp, struct timeval utimeout) { struct cu_data *cu = (struct cu_data *)cl->cl_private; XDR *xdrs; @@ -602,9 +607,7 @@ out: } static void -clnt_dg_geterr(cl, errp) - CLIENT *cl; - struct rpc_err *errp; +clnt_dg_geterr(CLIENT *cl, struct rpc_err *errp) { struct cu_data *cu = (struct cu_data *)cl->cl_private; @@ -612,10 +615,7 @@ clnt_dg_geterr(cl, errp) } static bool_t -clnt_dg_freeres(cl, xdr_res, res_ptr) - CLIENT *cl; - xdrproc_t xdr_res; - void *res_ptr; +clnt_dg_freeres(CLIENT *cl, xdrproc_t xdr_res, void *res_ptr) { struct cu_data *cu = (struct cu_data *)cl->cl_private; XDR *xdrs = &(cu->cu_outxdrs); @@ -638,16 +638,12 @@ clnt_dg_freeres(cl, xdr_res, res_ptr) /*ARGSUSED*/ static void -clnt_dg_abort(h) - CLIENT *h; +clnt_dg_abort(CLIENT *h) { } static bool_t -clnt_dg_control(cl, request, info) - CLIENT *cl; - u_int request; - void *info; +clnt_dg_control(CLIENT *cl, u_int request, void *info) { struct cu_data *cu = (struct cu_data *)cl->cl_private; struct netbuf *addr; @@ -790,8 +786,7 @@ clnt_dg_control(cl, request, info) } static void -clnt_dg_destroy(cl) - CLIENT *cl; +clnt_dg_destroy(CLIENT *cl) { struct cu_data *cu = (struct cu_data *)cl->cl_private; int cu_fd = cu->cu_fd; @@ -820,7 +815,7 @@ clnt_dg_destroy(cl) } static struct clnt_ops * -clnt_dg_ops() +clnt_dg_ops(void) { static struct clnt_ops ops; sigset_t mask; @@ -848,8 +843,7 @@ clnt_dg_ops() * Make sure that the time is not garbage. -1 value is allowed. */ static bool_t -time_not_ok(t) - struct timeval *t; +time_not_ok(struct timeval *t) { return (t->tv_sec < -1 || t->tv_sec > 100000000 || t->tv_usec < -1 || t->tv_usec > 1000000); Modified: stable/10/lib/libc/rpc/crypt_client.c ============================================================================== --- stable/10/lib/libc/rpc/crypt_client.c Sat Dec 3 17:40:26 2016 (r309488) +++ stable/10/lib/libc/rpc/crypt_client.c Sat Dec 3 17:40:58 2016 (r309489) @@ -43,10 +43,7 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" int -_des_crypt_call(buf, len, dparms) - char *buf; - int len; - struct desparams *dparms; +_des_crypt_call(char *buf, int len, struct desparams *dparms) { CLIENT *clnt; desresp *result_1; Modified: stable/10/lib/libc/rpc/des_crypt.c ============================================================================== --- stable/10/lib/libc/rpc/des_crypt.c Sat Dec 3 17:40:26 2016 (r309488) +++ stable/10/lib/libc/rpc/des_crypt.c Sat Dec 3 17:40:58 2016 (r309489) @@ -70,12 +70,7 @@ extern int _des_crypt_call(char *, int, * CBC mode encryption */ int -cbc_crypt(key, buf, len, mode, ivec) - char *key; - char *buf; - unsigned len; - unsigned mode; - char *ivec; +cbc_crypt(char *key, char *buf, unsigned len, unsigned mode, char *ivec) { int err; struct desparams dp; @@ -97,11 +92,7 @@ cbc_crypt(key, buf, len, mode, ivec) * ECB mode encryption */ int -ecb_crypt(key, buf, len, mode) - char *key; - char *buf; - unsigned len; - unsigned mode; +ecb_crypt(char *key, char *buf, unsigned len, unsigned mode) { struct desparams dp; @@ -120,12 +111,8 @@ ecb_crypt(key, buf, len, mode) * Common code to cbc_crypt() & ecb_crypt() */ static int -common_crypt(key, buf, len, mode, desp) - char *key; - char *buf; - unsigned len; - unsigned mode; - struct desparams *desp; +common_crypt(char *key, char *buf, unsigned len, unsigned mode, + struct desparams *desp) { int desdev; Modified: stable/10/lib/libc/rpc/des_soft.c ============================================================================== --- stable/10/lib/libc/rpc/des_soft.c Sat Dec 3 17:40:26 2016 (r309488) +++ stable/10/lib/libc/rpc/des_soft.c Sat Dec 3 17:40:58 2016 (r309489) @@ -58,8 +58,7 @@ static char partab[128] = { * Add odd parity to low bit of 8 byte key */ void -des_setparity(p) - char *p; +des_setparity(char *p) { int i; Modified: stable/10/lib/libc/rpc/getpublickey.c ============================================================================== --- stable/10/lib/libc/rpc/getpublickey.c Sat Dec 3 17:40:26 2016 (r309488) +++ stable/10/lib/libc/rpc/getpublickey.c Sat Dec 3 17:40:58 2016 (r309489) @@ -62,9 +62,7 @@ int (*__getpublickey_LOCAL)() = 0; * Get somebody's public key */ static int -__getpublickey_real(netname, publickey) - const char *netname; - char *publickey; +__getpublickey_real(const char *netname, char *publickey) { char lookup[3 * HEXKEYBYTES]; char *p; @@ -89,9 +87,7 @@ __getpublickey_real(netname, publickey) */ int -getpublicandprivatekey(key, ret) - const char *key; - char *ret; +getpublicandprivatekey(const char *key, char *ret) { char buf[1024]; /* big enough */ char *res; @@ -166,9 +162,7 @@ getpublicandprivatekey(key, ret) } } -int getpublickey(netname, publickey) - const char *netname; - char *publickey; +int getpublickey(const char *netname, char *publickey) { if (__getpublickey_LOCAL != NULL) return(__getpublickey_LOCAL(netname, publickey)); Modified: stable/10/lib/libc/rpc/key_call.c ============================================================================== --- stable/10/lib/libc/rpc/key_call.c Sat Dec 3 17:40:26 2016 (r309488) +++ stable/10/lib/libc/rpc/key_call.c Sat Dec 3 17:40:58 2016 (r309489) @@ -88,8 +88,7 @@ des_block *(*__key_gendes_LOCAL)() = 0; static int key_call( u_long, xdrproc_t, void *, xdrproc_t, void *); int -key_setsecret(secretkey) - const char *secretkey; +key_setsecret(const char *secretkey) { keystatus status; @@ -131,10 +130,7 @@ key_secretkey_is_set(void) } int -key_encryptsession_pk(remotename, remotekey, deskey) - char *remotename; - netobj *remotekey; - des_block *deskey; +key_encryptsession_pk(char *remotename, netobj *remotekey, des_block *deskey) { cryptkeyarg2 arg; cryptkeyres res; @@ -155,10 +151,7 @@ key_encryptsession_pk(remotename, remote } int -key_decryptsession_pk(remotename, remotekey, deskey) - char *remotename; - netobj *remotekey; - des_block *deskey; +key_decryptsession_pk(char *remotename, netobj *remotekey, des_block *deskey) { cryptkeyarg2 arg; cryptkeyres res; @@ -179,9 +172,7 @@ key_decryptsession_pk(remotename, remote } int -key_encryptsession(remotename, deskey) - const char *remotename; - des_block *deskey; +key_encryptsession(const char *remotename, des_block *deskey) { cryptkeyarg arg; cryptkeyres res; @@ -201,9 +192,7 @@ key_encryptsession(remotename, deskey) } int -key_decryptsession(remotename, deskey) - const char *remotename; - des_block *deskey; +key_decryptsession(const char *remotename, des_block *deskey) { cryptkeyarg arg; cryptkeyres res; @@ -223,8 +212,7 @@ key_decryptsession(remotename, deskey) } int -key_gendes(key) - des_block *key; +key_gendes(des_block *key) { if (!key_call((u_long)KEY_GEN, (xdrproc_t)xdr_void, NULL, (xdrproc_t)xdr_des_block, key)) { @@ -234,8 +222,7 @@ key_gendes(key) } int -key_setnet(arg) -struct key_netstarg *arg; +key_setnet(struct key_netstarg *arg) { keystatus status; @@ -254,9 +241,7 @@ struct key_netstarg *arg; int -key_get_conv(pkey, deskey) - char *pkey; - des_block *deskey; +key_get_conv(char *pkey, des_block *deskey) { cryptkeyres res; @@ -305,8 +290,7 @@ key_call_init(void) * Keep the handle cached. This call may be made quite often. */ static CLIENT * -getkeyserv_handle(vers) -int vers; +getkeyserv_handle(int vers) { void *localhandle; struct netconfig *nconf; @@ -429,12 +413,8 @@ int vers; /* returns 0 on failure, 1 on success */ static int -key_call(proc, xdr_arg, arg, xdr_rslt, rslt) - u_long proc; - xdrproc_t xdr_arg; - void *arg; - xdrproc_t xdr_rslt; - void *rslt; +key_call(u_long proc, xdrproc_t xdr_arg, void *arg, xdrproc_t xdr_rslt, + void *rslt) { CLIENT *clnt; struct timeval wait_time; Modified: stable/10/lib/libc/rpc/rpc_soc.c ============================================================================== --- stable/10/lib/libc/rpc/rpc_soc.c Sat Dec 3 17:40:26 2016 (r309488) +++ stable/10/lib/libc/rpc/rpc_soc.c Sat Dec 3 17:40:58 2016 (r309489) @@ -88,14 +88,8 @@ static bool_t rpc_wrap_bcast(char *, str * A common clnt create routine */ static CLIENT * -clnt_com_create(raddr, prog, vers, sockp, sendsz, recvsz, tp) - struct sockaddr_in *raddr; - rpcprog_t prog; - rpcvers_t vers; - int *sockp; - u_int sendsz; - u_int recvsz; - char *tp; +clnt_com_create(struct sockaddr_in *raddr, rpcprog_t prog, rpcvers_t vers, int *sockp, + u_int sendsz, u_int recvsz, char *tp) { CLIENT *cl; int madefd = FALSE; @@ -164,14 +158,8 @@ err: if (madefd == TRUE) } CLIENT * -clntudp_bufcreate(raddr, prog, vers, wait, sockp, sendsz, recvsz) - struct sockaddr_in *raddr; - u_long prog; - u_long vers; - struct timeval wait; - int *sockp; - u_int sendsz; - u_int recvsz; +clntudp_bufcreate(struct sockaddr_in *raddr, u_long prog, u_long vers, + struct timeval wait, int *sockp, u_int sendsz, u_int recvsz) { CLIENT *cl; @@ -185,12 +173,8 @@ clntudp_bufcreate(raddr, prog, vers, wai } CLIENT * -clntudp_create(raddr, program, version, wait, sockp) - struct sockaddr_in *raddr; - u_long program; - u_long version; - struct timeval wait; - int *sockp; +clntudp_create(struct sockaddr_in *raddr, u_long program, u_long version, + struct timeval wait, int *sockp) { return clntudp_bufcreate(raddr, program, version, wait, sockp, @@ -198,13 +182,8 @@ clntudp_create(raddr, program, version, } CLIENT * -clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz) - struct sockaddr_in *raddr; - u_long prog; - u_long vers; - int *sockp; - u_int sendsz; - u_int recvsz; +clnttcp_create(struct sockaddr_in *raddr, u_long prog, u_long vers, int *sockp, + u_int sendsz, u_int recvsz) { return clnt_com_create(raddr, (rpcprog_t)prog, (rpcvers_t)vers, sockp, @@ -212,9 +191,7 @@ clnttcp_create(raddr, prog, vers, sockp, } CLIENT * -clntraw_create(prog, vers) - u_long prog; - u_long vers; +clntraw_create(u_long prog, u_long vers) { return clnt_raw_create((rpcprog_t)prog, (rpcvers_t)vers); @@ -224,11 +201,7 @@ clntraw_create(prog, vers) * A common server create routine */ static SVCXPRT * -svc_com_create(fd, sendsize, recvsize, netid) - int fd; - u_int sendsize; - u_int recvsize; - char *netid; +svc_com_create(int fd, u_int sendsize, u_int recvsize, char *netid) { struct netconfig *nconf; SVCXPRT *svc; @@ -268,29 +241,21 @@ svc_com_create(fd, sendsize, recvsize, n } SVCXPRT * -svctcp_create(fd, sendsize, recvsize) - int fd; - u_int sendsize; - u_int recvsize; +svctcp_create(int fd, u_int sendsize, u_int recvsize) { return svc_com_create(fd, sendsize, recvsize, "tcp"); } SVCXPRT * -svcudp_bufcreate(fd, sendsz, recvsz) - int fd; - u_int sendsz, recvsz; +svcudp_bufcreate(int fd, u_int sendsz, u_int recvsz) { return svc_com_create(fd, sendsz, recvsz, "udp"); } SVCXPRT * -svcfd_create(fd, sendsize, recvsize) - int fd; - u_int sendsize; - u_int recvsize; +svcfd_create(int fd, u_int sendsize, u_int recvsize) { return svc_fd_create(fd, sendsize, recvsize); @@ -298,8 +263,7 @@ svcfd_create(fd, sendsize, recvsize) SVCXPRT * -svcudp_create(fd) - int fd; +svcudp_create(int fd) { return svc_com_create(fd, UDPMSGSIZE, UDPMSGSIZE, "udp"); @@ -313,8 +277,7 @@ svcraw_create(void) } int -get_myaddress(addr) - struct sockaddr_in *addr; +get_myaddress(struct sockaddr_in *addr) { memset((void *) addr, 0, sizeof(*addr)); @@ -328,11 +291,8 @@ get_myaddress(addr) * For connectionless "udp" transport. Obsoleted by rpc_call(). */ int -callrpc(host, prognum, versnum, procnum, inproc, in, outproc, out) - const char *host; - int prognum, versnum, procnum; - xdrproc_t inproc, outproc; - void *in, *out; +callrpc(const char *host, int prognum, int versnum, int procnum, + xdrproc_t inproc, void *in, xdrproc_t outproc, void *out) { return (int)rpc_call(host, (rpcprog_t)prognum, (rpcvers_t)versnum, @@ -343,10 +303,9 @@ callrpc(host, prognum, versnum, procnum, * For connectionless kind of transport. Obsoleted by rpc_reg() */ int -registerrpc(prognum, versnum, procnum, progname, inproc, outproc) - int prognum, versnum, procnum; - char *(*progname)(char [UDPMSGSIZE]); - xdrproc_t inproc, outproc; +registerrpc(int prognum, int versnum, int procnum, + char *(*progname)(char [UDPMSGSIZE]), + xdrproc_t inproc, xdrproc_t outproc) { return rpc_reg((rpcprog_t)prognum, (rpcvers_t)versnum, @@ -374,10 +333,12 @@ clnt_broadcast_key_init(void) */ /* ARGSUSED */ static bool_t -rpc_wrap_bcast(resultp, addr, nconf) - char *resultp; /* results of the call */ - struct netbuf *addr; /* address of the guy who responded */ - struct netconfig *nconf; /* Netconf of the transport */ +rpc_wrap_bcast(char *resultp, struct netbuf *addr, struct netconfig *nconf) +/* + * char *resultp; // results of the call + * struct netbuf *addr; // address of the guy who responded + * struct netconfig *nconf; // Netconf of the transport + */ { resultproc_t clnt_broadcast_result; @@ -395,15 +356,18 @@ rpc_wrap_bcast(resultp, addr, nconf) * Broadcasts on UDP transport. Obsoleted by rpc_broadcast(). */ enum clnt_stat -clnt_broadcast(prog, vers, proc, xargs, argsp, xresults, resultsp, eachresult) - u_long prog; /* program number */ - u_long vers; /* version number */ - u_long proc; /* procedure number */ - xdrproc_t xargs; /* xdr routine for args */ - void *argsp; /* pointer to args */ - xdrproc_t xresults; /* xdr routine for results */ - void *resultsp; /* pointer to results */ - resultproc_t eachresult; /* call with each result obtained */ +clnt_broadcast(u_long prog, u_long vers, u_long proc, xdrproc_t xargs, + void *argsp, xdrproc_t xresults, void *resultsp, resultproc_t eachresult) +/* + * u_long prog; // program number + * u_long vers; // version number + * u_long proc; // procedure number + * xdrproc_t xargs; // xdr routine for args + * void *argsp; // pointer to args + * xdrproc_t xresults; // xdr routine for results + * void *resultsp; // pointer to results + * resultproc_t eachresult; // call with each result obtained + */ { if (thr_main()) @@ -422,11 +386,14 @@ clnt_broadcast(prog, vers, proc, xargs, * authdes_seccreate(). */ AUTH * -authdes_create(servername, window, syncaddr, ckey) - char *servername; /* network name of server */ - u_int window; /* time to live */ - struct sockaddr *syncaddr; /* optional hostaddr to sync with */ - des_block *ckey; /* optional conversation key to use */ +authdes_create(char *servername, u_int window, struct sockaddr *syncaddr, + des_block *ckey) +/* + * char *servername; // network name of server + * u_int window; // time to live + * struct sockaddr *syncaddr; // optional hostaddr to sync with + * des_block *ckey; // optional conversation key to use + */ { AUTH *dummy; AUTH *nauth; @@ -453,13 +420,8 @@ fallback: * Create a client handle for a unix connection. Obsoleted by clnt_vc_create() */ CLIENT * -clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz) - struct sockaddr_un *raddr; - u_long prog; - u_long vers; - int *sockp; - u_int sendsz; - u_int recvsz; +clntunix_create(struct sockaddr_un *raddr, u_long prog, u_long vers, int *sockp, + u_int sendsz, u_int recvsz) { struct netbuf *svcaddr; CLIENT *cl; @@ -503,11 +465,7 @@ done: * Obsoleted by svc_vc_create(). */ SVCXPRT * -svcunix_create(sock, sendsize, recvsize, path) - int sock; - u_int sendsize; - u_int recvsize; - char *path; +svcunix_create(int sock, u_int sendsize, u_int recvsize, char *path) { struct netconfig *nconf; void *localhandle; @@ -567,10 +525,7 @@ done: * descriptor as its first input. Obsoleted by svc_fd_create(); */ SVCXPRT * -svcunixfd_create(fd, sendsize, recvsize) - int fd; - u_int sendsize; - u_int recvsize; +svcunixfd_create(int fd, u_int sendsize, u_int recvsize) { return (svc_fd_create(fd, sendsize, recvsize)); } Modified: stable/10/lib/libc/rpc/rpcb_clnt.c ============================================================================== --- stable/10/lib/libc/rpc/rpcb_clnt.c Sat Dec 3 17:40:26 2016 (r309488) +++ stable/10/lib/libc/rpc/rpcb_clnt.c Sat Dec 3 17:40:58 2016 (r309489) @@ -109,9 +109,7 @@ static struct netbuf *got_entry(rpcb_ent * These are private routines that may not be provided in future releases. */ bool_t -__rpc_control(request, info) - int request; - void *info; +__rpc_control(int request, void *info) { switch (request) { case CLCR_GET_RPCB_TIMEOUT: @@ -150,8 +148,7 @@ __rpc_control(request, info) */ static struct address_cache * -check_cache(host, netid) - const char *host, *netid; +check_cache(const char *host, const char *netid) { struct address_cache *cptr; @@ -171,8 +168,7 @@ check_cache(host, netid) } static void -delete_cache(addr) - struct netbuf *addr; +delete_cache(struct netbuf *addr) { struct address_cache *cptr, *prevptr = NULL; @@ -278,10 +274,7 @@ out: * On error, returns NULL and free's everything. */ static CLIENT * -getclnthandle(host, nconf, targaddr) - const char *host; - const struct netconfig *nconf; - char **targaddr; +getclnthandle(const char *host, const struct netconfig *nconf, char **targaddr) { CLIENT *client; struct netbuf *addr, taddr; @@ -523,13 +516,13 @@ try_nconf: /* * Set a mapping between program, version and address. * Calls the rpcbind service to do the mapping. + * + * nconf - Network structure of transport + * address - Services netconfig address */ bool_t -rpcb_set(program, version, nconf, address) - rpcprog_t program; - rpcvers_t version; - const struct netconfig *nconf; /* Network structure of transport */ - const struct netbuf *address; /* Services netconfig address */ +rpcb_set(rpcprog_t program, rpcvers_t version, const struct netconfig *nconf, + const struct netbuf *address) { CLIENT *client; bool_t rslt = FALSE; @@ -586,10 +579,7 @@ rpcb_set(program, version, nconf, addres * only for the given transport. */ bool_t -rpcb_unset(program, version, nconf) - rpcprog_t program; - rpcvers_t version; - const struct netconfig *nconf; +rpcb_unset(rpcprog_t program, rpcvers_t version, const struct netconfig *nconf) { CLIENT *client; bool_t rslt = FALSE; @@ -626,9 +616,7 @@ rpcb_unset(program, version, nconf) * From the merged list, find the appropriate entry */ static struct netbuf * -got_entry(relp, nconf) - rpcb_entry_list_ptr relp; - const struct netconfig *nconf; +got_entry(rpcb_entry_list_ptr relp, const struct netconfig *nconf) { struct netbuf *na = NULL; rpcb_entry_list_ptr sp; @@ -714,13 +702,9 @@ __rpcbind_is_up(void) * starts working properly. Also look under clnt_vc.c. */ struct netbuf * -__rpcb_findaddr_timed(program, version, nconf, host, clpp, tp) - rpcprog_t program; - rpcvers_t version; - const struct netconfig *nconf; - const char *host; - CLIENT **clpp; - struct timeval *tp; +__rpcb_findaddr_timed(rpcprog_t program, rpcvers_t version, + const struct netconfig *nconf, const char *host, + CLIENT **clpp, struct timeval *tp) { static bool_t check_rpcbind = TRUE; CLIENT *client = NULL; @@ -1027,12 +1011,8 @@ done: * Assuming that the address is all properly allocated */ int -rpcb_getaddr(program, version, nconf, address, host) - rpcprog_t program; - rpcvers_t version; - const struct netconfig *nconf; - struct netbuf *address; - const char *host; +rpcb_getaddr(rpcprog_t program, rpcvers_t version, const struct netconfig *nconf, + struct netbuf *address, const char *host) { struct netbuf *na; @@ -1063,9 +1043,7 @@ rpcb_getaddr(program, version, nconf, ad * It returns NULL on failure. */ rpcblist * -rpcb_getmaps(nconf, host) - const struct netconfig *nconf; - const char *host; +rpcb_getmaps(const struct netconfig *nconf, const char *host) { rpcblist_ptr head = NULL; CLIENT *client; @@ -1197,9 +1175,7 @@ error: * Returns 1 if succeeds else 0. */ bool_t -rpcb_gettime(host, timep) - const char *host; - time_t *timep; +rpcb_gettime(const char *host, time_t *timep) { CLIENT *client = NULL; void *handle; @@ -1258,9 +1234,7 @@ rpcb_gettime(host, timep) * really be called because local n2a libraries are always provided. */ char * -rpcb_taddr2uaddr(nconf, taddr) - struct netconfig *nconf; - struct netbuf *taddr; +rpcb_taddr2uaddr(struct netconfig *nconf, struct netbuf *taddr) { CLIENT *client; char *uaddr = NULL; @@ -1292,9 +1266,7 @@ rpcb_taddr2uaddr(nconf, taddr) * really be called because local n2a libraries are always provided. */ struct netbuf * -rpcb_uaddr2taddr(nconf, uaddr) - struct netconfig *nconf; - char *uaddr; +rpcb_uaddr2taddr(struct netconfig *nconf, char *uaddr) { CLIENT *client; struct netbuf *taddr; Modified: stable/10/lib/libc/rpc/rpcdname.c ============================================================================== --- stable/10/lib/libc/rpc/rpcdname.c Sat Dec 3 17:40:26 2016 (r309488) +++ stable/10/lib/libc/rpc/rpcdname.c Sat Dec 3 17:40:58 2016 (r309489) @@ -71,8 +71,7 @@ get_default_domain(void) * get rejected elsewhere in the NIS client package. */ int -__rpc_get_default_domain(domain) - char **domain; +__rpc_get_default_domain(char **domain) { if ((*domain = get_default_domain()) != NULL) return (0); Modified: stable/10/lib/libc/rpc/rtime.c ============================================================================== --- stable/10/lib/libc/rpc/rtime.c Sat Dec 3 17:40:26 2016 (r309488) +++ stable/10/lib/libc/rpc/rtime.c Sat Dec 3 17:40:58 2016 (r309489) @@ -67,10 +67,8 @@ extern int _rpc_dtablesize( void ); static void do_close( int ); int -rtime(addrp, timep, timeout) - struct sockaddr_in *addrp; - struct timeval *timep; - struct timeval *timeout; +rtime(struct sockaddr_in *addrp, struct timeval *timep, + struct timeval *timeout) { int s; fd_set readfds; @@ -148,8 +146,7 @@ rtime(addrp, timep, timeout) } static void -do_close(s) - int s; +do_close(int s) { int save; Modified: stable/10/lib/libc/rpc/svc_auth.c ============================================================================== --- stable/10/lib/libc/rpc/svc_auth.c Sat Dec 3 17:40:26 2016 (r309488) +++ stable/10/lib/libc/rpc/svc_auth.c Sat Dec 3 17:40:58 2016 (r309489) @@ -149,11 +149,7 @@ _authenticate(struct svc_req *rqst, stru * that don't need to inspect or modify the message body. */ static bool_t -svcauth_null_wrap(auth, xdrs, xdr_func, xdr_ptr) - SVCAUTH *auth; - XDR *xdrs; - xdrproc_t xdr_func; - caddr_t xdr_ptr; +svcauth_null_wrap(SVCAUTH *auth, XDR *xdrs, xdrproc_t xdr_func, caddr_t xdr_ptr) { return (xdr_func(xdrs, xdr_ptr)); @@ -166,9 +162,7 @@ struct svc_auth_ops svc_auth_null_ops = /*ARGSUSED*/ enum auth_stat -_svcauth_null(rqst, msg) - struct svc_req *rqst; - struct rpc_msg *msg; +_svcauth_null(struct svc_req *rqst, struct rpc_msg *msg) { return (AUTH_OK); } @@ -188,9 +182,8 @@ _svcauth_null(rqst, msg) */ int -svc_auth_reg(cred_flavor, handler) - int cred_flavor; - enum auth_stat (*handler)(struct svc_req *, struct rpc_msg *); +svc_auth_reg(int cred_flavor, + enum auth_stat (*handler)(struct svc_req *, struct rpc_msg *)) { struct authsvc *asp; Modified: stable/10/lib/libc/rpc/svc_auth_des.c ============================================================================== --- stable/10/lib/libc/rpc/svc_auth_des.c Sat Dec 3 17:40:26 2016 (r309488) +++ stable/10/lib/libc/rpc/svc_auth_des.c Sat Dec 3 17:40:58 2016 (r309489) @@ -92,7 +92,7 @@ static short *authdes_lru/* [AUTHDES_CAC static void cache_init(void); /* initialize the cache */ static short cache_spot(des_block *, char *, struct timeval *); /* find an entry in the cache */ -static void cache_ref(/*short sid*/); /* note that sid was ref'd */ +static void cache_ref(short sid); /* note that sid was ref'd */ static void invalidate(char *); /* invalidate entry in cache */ @@ -109,9 +109,7 @@ static struct { * Service side authenticator for AUTH_DES */ enum auth_stat -_svcauth_des(rqst, msg) - struct svc_req *rqst; - struct rpc_msg *msg; +_svcauth_des(struct svc_req *rqst, struct rpc_msg *msg) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Dec 3 17:44:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 019B8C654EC; Sat, 3 Dec 2016 17:44:45 +0000 (UTC) (envelope-from pfg@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 D06981326; Sat, 3 Dec 2016 17:44:44 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB3Hiia0023850; Sat, 3 Dec 2016 17:44:44 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3HihuQ023838; Sat, 3 Dec 2016 17:44:43 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201612031744.uB3HihuQ023838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 3 Dec 2016 17:44:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309490 - head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 17:44:45 -0000 Author: pfg Date: Sat Dec 3 17:44:43 2016 New Revision: 309490 URL: https://svnweb.freebsd.org/changeset/base/309490 Log: Revert r253678, r253661: Fix a segfault in ctfmerge(1) due to a bug in GCC. The change was correct and the bug real, but upstream didn't adopt it and we want to remain in sync. When/if upstream does something about it we can bring their version. The bug in question was fixed in GCC 4.9 which is now the default in FreeBSD's ports. Our native gcc-4.2, which is still in use in some Tier-2 platforms also has a workaround so no end-user should be harmed by the revert. Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c head/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c Sat Dec 3 17:40:58 2016 (r309489) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/ctf.c Sat Dec 3 17:44:43 2016 (r309490) @@ -52,8 +52,6 @@ static char *curfile; #define CTF_BUF_CHUNK_SIZE (64 * 1024) #define RES_BUF_CHUNK_SIZE (64 * 1024) -static int ntypes = 0; /* The number of types. */ - struct ctf_buf { strtab_t ctb_strtab; /* string table */ caddr_t ctb_base; /* pointer to base of buffer */ @@ -1145,10 +1143,6 @@ resurrect_types(ctf_header_t *h, tdata_t (*mpp)->ml_type = tdarr[ctm->ctm_type]; (*mpp)->ml_offset = ctm->ctm_offset; (*mpp)->ml_size = 0; - if (ctm->ctm_type > ntypes) { - parseterminate("Invalid member type ctm_type=%d", - ctm->ctm_type); - } } } else { for (i = 0, mpp = &tdp->t_members; i < vlen; @@ -1165,10 +1159,6 @@ resurrect_types(ctf_header_t *h, tdata_t (*mpp)->ml_offset = (int)CTF_LMEM_OFFSET(ctlm); (*mpp)->ml_size = 0; - if (ctlm->ctlm_type > ntypes) { - parseterminate("Invalid lmember type ctlm_type=%d", - ctlm->ctlm_type); - } } } @@ -1282,10 +1272,9 @@ ctf_parse(ctf_header_t *h, caddr_t buf, { tdata_t *td = tdata_new(); tdesc_t **tdarr; + int ntypes = count_types(h, buf); int idx, i; - ntypes = count_types(h, buf); - /* shudder */ tdarr = xcalloc(sizeof (tdesc_t *) * (ntypes + 1)); tdarr[0] = NULL; Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h Sat Dec 3 17:40:58 2016 (r309489) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h Sat Dec 3 17:44:43 2016 (r309490) @@ -159,7 +159,7 @@ typedef struct ardef { /* Auxiliary structure for structure/union tdesc_t */ typedef struct mlist { int ml_offset; /* Offset from start of structure (in bits) */ - uint_t ml_size; /* Member size (in bits) */ + int ml_size; /* Member size (in bits) */ char *ml_name; /* Member name */ struct tdesc *ml_type; /* Member type */ struct mlist *ml_next; /* Next member */ Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sat Dec 3 17:40:58 2016 (r309489) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sat Dec 3 17:44:43 2016 (r309490) @@ -727,13 +727,6 @@ die_array_create(dwarf_t *dw, Dwarf_Die tdesc_t *dimtdp; int flags; - /* Check for bogus gcc DW_AT_byte_size attribute */ - if (uval == (unsigned)-1) { - printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n", - __func__); - uval = 0; - } - tdp->t_size = uval; /* @@ -826,12 +819,6 @@ die_enum_create(dwarf_t *dw, Dwarf_Die d tdp->t_type = ENUM; (void) die_unsigned(dw, die, DW_AT_byte_size, &uval, DW_ATTR_REQ); - /* Check for bogus gcc DW_AT_byte_size attribute */ - if (uval == (unsigned)-1) { - printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n", - __func__); - uval = 0; - } tdp->t_size = uval; if ((mem = die_child(dw, die)) != NULL) { @@ -945,7 +932,7 @@ static void die_sou_create(dwarf_t *dw, Dwarf_Die str, Dwarf_Off off, tdesc_t *tdp, int type, const char *typename) { - Dwarf_Unsigned sz, bitsz, bitoff, maxsz=0; + Dwarf_Unsigned sz, bitsz, bitoff; #if BYTE_ORDER == _LITTLE_ENDIAN Dwarf_Unsigned bysz; #endif @@ -1004,8 +991,6 @@ die_sou_create(dwarf_t *dw, Dwarf_Die st ml->ml_name = NULL; ml->ml_type = die_lookup_pass1(dw, mem, DW_AT_type); - debug(3, "die_sou_create(): ml_type = %p t_id = %d\n", - ml->ml_type, ml->ml_type->t_id); if (die_mem_offset(dw, mem, DW_AT_data_member_location, &mloff, 0)) { @@ -1051,24 +1036,8 @@ die_sou_create(dwarf_t *dw, Dwarf_Die st *mlastp = ml; mlastp = &ml->ml_next; - - /* Find the size of the largest member to work around a gcc - * bug. See GCC Bugzilla 35998. - */ - if (maxsz < ml->ml_size) - maxsz = ml->ml_size; - } while ((mem = die_sibling(dw, mem)) != NULL); - /* See if we got a bogus DW_AT_byte_size. GCC will sometimes - * emit this. - */ - if (sz == (unsigned)-1) { - printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n", - __func__); - tdp->t_size = maxsz / 8; /* maxsz is in bits, t_size is bytes */ - } - /* * GCC will attempt to eliminate unused types, thus decreasing the * size of the emitted dwarf. That is, if you declare a foo_t in your @@ -1170,7 +1139,7 @@ die_sou_resolve(tdesc_t *tdp, tdesc_t ** } if (ml->ml_size != 0 && mt->t_type == INTRINSIC && - mt->t_intr->intr_nbits != (int)ml->ml_size) { + mt->t_intr->intr_nbits != ml->ml_size) { /* * This member is a bitfield, and needs to reference * an intrinsic type with the same width. If the @@ -1486,13 +1455,6 @@ die_base_create(dwarf_t *dw, Dwarf_Die b */ (void) die_unsigned(dw, base, DW_AT_byte_size, &sz, DW_ATTR_REQ); - /* Check for bogus gcc DW_AT_byte_size attribute */ - if (sz == (unsigned)-1) { - printf("dwarf.c:%s() working around bogus -1 DW_AT_byte_size\n", - __func__); - sz = 0; - } - if (tdp->t_name == NULL) terminate("die %llu: base type without name\n", off); Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c Sat Dec 3 17:40:58 2016 (r309489) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c Sat Dec 3 17:44:43 2016 (r309490) @@ -952,7 +952,7 @@ soudef(char *cp, stabtype_t type, tdesc_ itdp = find_intrinsic(tdp); if (itdp->t_type == INTRINSIC) { - if ((int)mlp->ml_size != itdp->t_intr->intr_nbits) { + if (mlp->ml_size != itdp->t_intr->intr_nbits) { parse_debug(4, cp, "making %d bit intrinsic " "from %s", mlp->ml_size, tdesc_name(itdp)); mlp->ml_type = bitintrinsic(itdp, mlp->ml_size); @@ -1173,7 +1173,7 @@ resolve_typed_bitfields_cb(void *arg, vo while (tdp) { switch (tdp->t_type) { case INTRINSIC: - if ((int)ml->ml_size != tdp->t_intr->intr_nbits) { + if (ml->ml_size != tdp->t_intr->intr_nbits) { debug(3, "making %d bit intrinsic from %s", ml->ml_size, tdesc_name(tdp)); ml->ml_type = bitintrinsic(tdp, ml->ml_size); From owner-svn-src-all@freebsd.org Sat Dec 3 17:54:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3DA7C6573F; Sat, 3 Dec 2016 17:54:09 +0000 (UTC) (envelope-from rpokala@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 83542182B; Sat, 3 Dec 2016 17:54:09 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB3Hs85s027953; Sat, 3 Dec 2016 17:54:08 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3Hs8W2027951; Sat, 3 Dec 2016 17:54:08 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201612031754.uB3Hs8W2027951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Sat, 3 Dec 2016 17:54:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309491 - in head/sys/modules: . bios X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 17:54:09 -0000 Author: rpokala Date: Sat Dec 3 17:54:08 2016 New Revision: 309491 URL: https://svnweb.freebsd.org/changeset/base/309491 Log: Build smbios.ko as a module for amd64 and i386 For whatever reason, smapi, smbios, vpd are all under the "bios" directory. smapi is only for i386, so the entire "bios" directory is only built for i386. Break smapi out, and make only it i386-specific. Then, build the "bios" directory for both amd64 and i386. Reviewed by: imp MFC after: 1 week Sponsored by: Panasas Differential Revision: https://reviews.freebsd.org/D8609 Modified: head/sys/modules/Makefile head/sys/modules/bios/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sat Dec 3 17:44:43 2016 (r309490) +++ head/sys/modules/Makefile Sat Dec 3 17:54:08 2016 (r309491) @@ -550,6 +550,7 @@ _igb= igb _agp= agp _an= an _aout= aout +_bios= bios _bktr= bktr _bxe= bxe _cardbus= cardbus @@ -730,7 +731,6 @@ _svr4= svr4 .if ${MK_EISA} != "no" _ahb= ahb .endif -_bios= bios _cm= cm .if ${MK_SOURCELESS_UCODE} != "no" _ctau= ctau Modified: head/sys/modules/bios/Makefile ============================================================================== --- head/sys/modules/bios/Makefile Sat Dec 3 17:44:43 2016 (r309490) +++ head/sys/modules/bios/Makefile Sat Dec 3 17:54:08 2016 (r309491) @@ -1,6 +1,10 @@ # $FreeBSD$ # -SUBDIR= smapi smbios vpd +SUBDIR= smbios vpd + +.if ${MACHINE_ARCH} == "i386" +SUBDIR+= smapi +.endif .include From owner-svn-src-all@freebsd.org Sat Dec 3 18:08:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DAFBC65A63; Sat, 3 Dec 2016 18:08:51 +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 D13271F2E; Sat, 3 Dec 2016 18:08:50 +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 uB3I8oEV032641; Sat, 3 Dec 2016 18:08:50 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3I8osQ032640; Sat, 3 Dec 2016 18:08:50 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612031808.uB3I8osQ032640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 18:08:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309492 - stable/10/lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 18:08:51 -0000 Author: ngie Date: Sat Dec 3 18:08:49 2016 New Revision: 309492 URL: https://svnweb.freebsd.org/changeset/base/309492 Log: MFC r278041: r278041 (by pfg): rpc: Uninitialized pointer read Initialize *xprt to avoid exposing a random value in cleanup_svc_vc_create. CID: 1018723 Phabric: D1749 Modified: stable/10/lib/libc/rpc/svc_vc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/svc_vc.c ============================================================================== --- stable/10/lib/libc/rpc/svc_vc.c Sat Dec 3 17:54:08 2016 (r309491) +++ stable/10/lib/libc/rpc/svc_vc.c Sat Dec 3 18:08:49 2016 (r309492) @@ -125,7 +125,7 @@ struct cf_conn { /* kept in xprt->xp_p1 SVCXPRT * svc_vc_create(int fd, u_int sendsize, u_int recvsize) { - SVCXPRT *xprt; + SVCXPRT *xprt = NULL; struct cf_rendezvous *r = NULL; struct __rpc_sockinfo si; struct sockaddr_storage sslocal; From owner-svn-src-all@freebsd.org Sat Dec 3 18:14:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63DACC65C91; Sat, 3 Dec 2016 18:14:31 +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 3E61E65E; Sat, 3 Dec 2016 18:14:31 +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 uB3IEUdS036421; Sat, 3 Dec 2016 18:14:30 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3IEUXf036417; Sat, 3 Dec 2016 18:14:30 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612031814.uB3IEUXf036417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 18:14:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309493 - stable/10/lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 18:14:31 -0000 Author: ngie Date: Sat Dec 3 18:14:29 2016 New Revision: 309493 URL: https://svnweb.freebsd.org/changeset/base/309493 Log: MFC r301754,r301769: r301754 (by pfg): libc/rpc: Make use of some xdr_* macros. xdr_rpcprog and xdr_rpcvers were broken in older versions of FreeBSD but were fixed in r296394. Give them some use hoping they help make the code somewhat more readable. r301769 (by pfg): libc/rpc: Make use of some xdr_* macros. (part 2) xdr_rpcproc, xdr_rpcprog and xdr_rpcvers were broken in older versions of FreeBSD but fixed in r296394. Give them some use hoping they help make the code somewhat more readable. Modified: stable/10/lib/libc/rpc/rpc_callmsg.c stable/10/lib/libc/rpc/rpc_prot.c stable/10/lib/libc/rpc/rpcb_prot.c stable/10/lib/libc/rpc/rpcb_st_xdr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/rpc_callmsg.c ============================================================================== --- stable/10/lib/libc/rpc/rpc_callmsg.c Sat Dec 3 18:08:49 2016 (r309492) +++ stable/10/lib/libc/rpc/rpc_callmsg.c Sat Dec 3 18:14:29 2016 (r309493) @@ -193,11 +193,11 @@ xdr_callmsg(XDR *xdrs, struct rpc_msg *c xdr_u_int32_t(xdrs, &(cmsg->rm_xid)) && xdr_enum(xdrs, (enum_t *) prm_direction) && (cmsg->rm_direction == CALL) && - xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_rpcvers)) && + xdr_rpcvers(xdrs, &(cmsg->rm_call.cb_rpcvers)) && (cmsg->rm_call.cb_rpcvers == RPC_MSG_VERSION) && - xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_prog)) && - xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_vers)) && - xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_proc)) && + xdr_rpcprog(xdrs, &(cmsg->rm_call.cb_prog)) && + xdr_rpcvers(xdrs, &(cmsg->rm_call.cb_vers)) && + xdr_rpcproc(xdrs, &(cmsg->rm_call.cb_proc)) && xdr_opaque_auth(xdrs, &(cmsg->rm_call.cb_cred)) ) return (xdr_opaque_auth(xdrs, &(cmsg->rm_call.cb_verf))); return (FALSE); Modified: stable/10/lib/libc/rpc/rpc_prot.c ============================================================================== --- stable/10/lib/libc/rpc/rpc_prot.c Sat Dec 3 18:08:49 2016 (r309492) +++ stable/10/lib/libc/rpc/rpc_prot.c Sat Dec 3 18:14:29 2016 (r309493) @@ -125,9 +125,9 @@ xdr_accepted_reply(xdrs, ar) return ((*(ar->ar_results.proc))(xdrs, ar->ar_results.where)); case PROG_MISMATCH: - if (! xdr_u_int32_t(xdrs, &(ar->ar_vers.low))) + if (!xdr_rpcvers(xdrs, &(ar->ar_vers.low))) return (FALSE); - return (xdr_u_int32_t(xdrs, &(ar->ar_vers.high))); + return (xdr_rpcvers(xdrs, &(ar->ar_vers.high))); case GARBAGE_ARGS: case SYSTEM_ERR: @@ -160,9 +160,9 @@ xdr_rejected_reply(xdrs, rr) switch (rr->rj_stat) { case RPC_MISMATCH: - if (! xdr_u_int32_t(xdrs, &(rr->rj_vers.low))) + if (! xdr_rpcvers(xdrs, &(rr->rj_vers.low))) return (FALSE); - return (xdr_u_int32_t(xdrs, &(rr->rj_vers.high))); + return (xdr_rpcvers(xdrs, &(rr->rj_vers.high))); case AUTH_ERROR: prj_why = &rr->rj_why; @@ -229,8 +229,8 @@ xdr_callhdr(xdrs, cmsg) (xdrs->x_op == XDR_ENCODE) && xdr_u_int32_t(xdrs, &(cmsg->rm_xid)) && xdr_enum(xdrs, (enum_t *) prm_direction) && - xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_rpcvers)) && - xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_prog)) ) + xdr_rpcvers(xdrs, &(cmsg->rm_call.cb_rpcvers)) && + xdr_rpcprog(xdrs, &(cmsg->rm_call.cb_prog)) ) return (xdr_u_int32_t(xdrs, &(cmsg->rm_call.cb_vers))); return (FALSE); } Modified: stable/10/lib/libc/rpc/rpcb_prot.c ============================================================================== --- stable/10/lib/libc/rpc/rpcb_prot.c Sat Dec 3 18:08:49 2016 (r309492) +++ stable/10/lib/libc/rpc/rpcb_prot.c Sat Dec 3 18:14:29 2016 (r309493) @@ -56,10 +56,10 @@ __FBSDID("$FreeBSD$"); bool_t xdr_rpcb(XDR *xdrs, RPCB *objp) { - if (!xdr_u_int32_t(xdrs, &objp->r_prog)) { + if (!xdr_rpcprog(xdrs, &objp->r_prog)) { return (FALSE); } - if (!xdr_u_int32_t(xdrs, &objp->r_vers)) { + if (!xdr_rpcvers(xdrs, &objp->r_vers)) { return (FALSE); } if (!xdr_string(xdrs, &objp->r_netid, (u_int)~0)) { @@ -243,13 +243,13 @@ xdr_rpcb_rmtcallargs(XDR *xdrs, struct r buf = XDR_INLINE(xdrs, 3 * BYTES_PER_XDR_UNIT); if (buf == NULL) { - if (!xdr_u_int32_t(xdrs, &objp->prog)) { + if (!xdr_rpcprog(xdrs, &objp->prog)) { return (FALSE); } - if (!xdr_u_int32_t(xdrs, &objp->vers)) { + if (!xdr_rpcvers(xdrs, &objp->vers)) { return (FALSE); } - if (!xdr_u_int32_t(xdrs, &objp->proc)) { + if (!xdr_rpcproc(xdrs, &objp->proc)) { return (FALSE); } } else { Modified: stable/10/lib/libc/rpc/rpcb_st_xdr.c ============================================================================== --- stable/10/lib/libc/rpc/rpcb_st_xdr.c Sat Dec 3 18:08:49 2016 (r309492) +++ stable/10/lib/libc/rpc/rpcb_st_xdr.c Sat Dec 3 18:14:29 2016 (r309493) @@ -51,10 +51,10 @@ xdr_rpcbs_addrlist(XDR *xdrs, rpcbs_addr { struct rpcbs_addrlist **pnext; - if (!xdr_u_int32_t(xdrs, &objp->prog)) { + if (!xdr_rpcprog(xdrs, &objp->prog)) { return (FALSE); } - if (!xdr_u_int32_t(xdrs, &objp->vers)) { + if (!xdr_rpcvers(xdrs, &objp->vers)) { return (FALSE); } if (!xdr_int(xdrs, &objp->success)) { @@ -89,13 +89,13 @@ xdr_rpcbs_rmtcalllist(XDR *xdrs, rpcbs_r if (xdrs->x_op == XDR_ENCODE) { buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT); if (buf == NULL) { - if (!xdr_u_int32_t(xdrs, &objp->prog)) { + if (!xdr_rpcprog(xdrs, &objp->prog)) { return (FALSE); } - if (!xdr_u_int32_t(xdrs, &objp->vers)) { + if (!xdr_rpcvers(xdrs, &objp->vers)) { return (FALSE); } - if (!xdr_u_int32_t(xdrs, &objp->proc)) { + if (!xdr_rpcproc(xdrs, &objp->proc)) { return (FALSE); } if (!xdr_int(xdrs, &objp->success)) { @@ -128,13 +128,13 @@ xdr_rpcbs_rmtcalllist(XDR *xdrs, rpcbs_r } else if (xdrs->x_op == XDR_DECODE) { buf = XDR_INLINE(xdrs, 6 * BYTES_PER_XDR_UNIT); if (buf == NULL) { - if (!xdr_u_int32_t(xdrs, &objp->prog)) { + if (!xdr_rpcprog(xdrs, &objp->prog)) { return (FALSE); } - if (!xdr_u_int32_t(xdrs, &objp->vers)) { + if (!xdr_rpcvers(xdrs, &objp->vers)) { return (FALSE); } - if (!xdr_u_int32_t(xdrs, &objp->proc)) { + if (!xdr_rpcproc(xdrs, &objp->proc)) { return (FALSE); } if (!xdr_int(xdrs, &objp->success)) { @@ -164,13 +164,13 @@ xdr_rpcbs_rmtcalllist(XDR *xdrs, rpcbs_r } return (TRUE); } - if (!xdr_u_int32_t(xdrs, &objp->prog)) { + if (!xdr_rpcprog(xdrs, &objp->prog)) { return (FALSE); } - if (!xdr_u_int32_t(xdrs, &objp->vers)) { + if (!xdr_rpcvers(xdrs, &objp->vers)) { return (FALSE); } - if (!xdr_u_int32_t(xdrs, &objp->proc)) { + if (!xdr_rpcproc(xdrs, &objp->proc)) { return (FALSE); } if (!xdr_int(xdrs, &objp->success)) { From owner-svn-src-all@freebsd.org Sat Dec 3 18:17:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6AE3C65D6E; Sat, 3 Dec 2016 18:17:07 +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 7C47485D; Sat, 3 Dec 2016 18:17:07 +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 uB3IH6qA036576; Sat, 3 Dec 2016 18:17:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3IH6tr036575; Sat, 3 Dec 2016 18:17:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612031817.uB3IH6tr036575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 18:17:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309494 - stable/10/lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 18:17:07 -0000 Author: ngie Date: Sat Dec 3 18:17:06 2016 New Revision: 309494 URL: https://svnweb.freebsd.org/changeset/base/309494 Log: MFC r287347: r287347 (by rodrigc): Use ANSI C prototypes. Eliminates gcc 4.9 warnings. Modified: stable/10/lib/libc/rpc/rpc_prot.c Modified: stable/10/lib/libc/rpc/rpc_prot.c ============================================================================== --- stable/10/lib/libc/rpc/rpc_prot.c Sat Dec 3 18:14:29 2016 (r309493) +++ stable/10/lib/libc/rpc/rpc_prot.c Sat Dec 3 18:17:06 2016 (r309494) @@ -68,9 +68,7 @@ extern struct opaque_auth _null_auth; * (see auth.h) */ bool_t -xdr_opaque_auth(xdrs, ap) - XDR *xdrs; - struct opaque_auth *ap; +xdr_opaque_auth(XDR *xdrs, struct opaque_auth *ap) { assert(xdrs != NULL); @@ -86,9 +84,7 @@ xdr_opaque_auth(xdrs, ap) * XDR a DES block */ bool_t -xdr_des_block(xdrs, blkp) - XDR *xdrs; - des_block *blkp; +xdr_des_block(XDR *xdrs, des_block *blkp) { assert(xdrs != NULL); @@ -103,9 +99,7 @@ xdr_des_block(xdrs, blkp) * XDR the MSG_ACCEPTED part of a reply message union */ bool_t -xdr_accepted_reply(xdrs, ar) - XDR *xdrs; - struct accepted_reply *ar; +xdr_accepted_reply(XDR *xdrs, struct accepted_reply *ar) { enum accept_stat *par_stat; @@ -142,9 +136,7 @@ xdr_accepted_reply(xdrs, ar) * XDR the MSG_DENIED part of a reply message union */ bool_t -xdr_rejected_reply(xdrs, rr) - XDR *xdrs; - struct rejected_reply *rr; +xdr_rejected_reply(XDR *xdrs, struct rejected_reply *rr) { enum reject_stat *prj_stat; enum auth_stat *prj_why; @@ -182,9 +174,7 @@ static const struct xdr_discrim reply_ds * XDR a reply message */ bool_t -xdr_replymsg(xdrs, rmsg) - XDR *xdrs; - struct rpc_msg *rmsg; +xdr_replymsg(XDR *xdrs, struct rpc_msg *rmsg) { enum msg_type *prm_direction; enum reply_stat *prp_stat; @@ -212,9 +202,7 @@ xdr_replymsg(xdrs, rmsg) * The rm_xid is not really static, but the user can easily munge on the fly. */ bool_t -xdr_callhdr(xdrs, cmsg) - XDR *xdrs; - struct rpc_msg *cmsg; +xdr_callhdr(XDR *xdrs, struct rpc_msg *cmsg) { enum msg_type *prm_direction; @@ -238,9 +226,7 @@ xdr_callhdr(xdrs, cmsg) /* ************************** Client utility routine ************* */ static void -accepted(acpt_stat, error) - enum accept_stat acpt_stat; - struct rpc_err *error; +accepted(enum accept_stat acpt_stat, struct rpc_err *error) { assert(error != NULL); From owner-svn-src-all@freebsd.org Sat Dec 3 18:21:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81279C6410F; Sat, 3 Dec 2016 18:21:29 +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 50757C9A; Sat, 3 Dec 2016 18:21:29 +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 uB3ILSGn039606; Sat, 3 Dec 2016 18:21:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3ILSF9039604; Sat, 3 Dec 2016 18:21:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612031821.uB3ILSF9039604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 18:21:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309495 - stable/10/lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 18:21:29 -0000 Author: ngie Date: Sat Dec 3 18:21:28 2016 New Revision: 309495 URL: https://svnweb.freebsd.org/changeset/base/309495 Log: MFC r288995: r288995 (by rodrigc): Use proper function prototypes. Eliminates -Wstrict-prototypes warning Modified: stable/10/lib/libc/rpc/getpublickey.c stable/10/lib/libc/rpc/key_call.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/getpublickey.c ============================================================================== --- stable/10/lib/libc/rpc/getpublickey.c Sat Dec 3 18:17:06 2016 (r309494) +++ stable/10/lib/libc/rpc/getpublickey.c Sat Dec 3 18:21:28 2016 (r309495) @@ -56,7 +56,7 @@ __FBSDID("$FreeBSD$"); /* * Hack to let ypserv/rpc.nisd use AUTH_DES. */ -int (*__getpublickey_LOCAL)() = 0; +int (*__getpublickey_LOCAL)(const char *, char *) = 0; /* * Get somebody's public key Modified: stable/10/lib/libc/rpc/key_call.c ============================================================================== --- stable/10/lib/libc/rpc/key_call.c Sat Dec 3 18:17:06 2016 (r309494) +++ stable/10/lib/libc/rpc/key_call.c Sat Dec 3 18:21:28 2016 (r309495) @@ -81,9 +81,9 @@ __FBSDID("$FreeBSD$"); * implementations of these functions, and to call those in key_call(). */ -cryptkeyres *(*__key_encryptsession_pk_LOCAL)() = 0; -cryptkeyres *(*__key_decryptsession_pk_LOCAL)() = 0; -des_block *(*__key_gendes_LOCAL)() = 0; +cryptkeyres *(*__key_encryptsession_pk_LOCAL)(uid_t, void *arg) = 0; +cryptkeyres *(*__key_decryptsession_pk_LOCAL)(uid_t, void *arg) = 0; +des_block *(*__key_gendes_LOCAL)(uid_t, void *) = 0; static int key_call( u_long, xdrproc_t, void *, xdrproc_t, void *); From owner-svn-src-all@freebsd.org Sat Dec 3 18:25:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7590C64349; Sat, 3 Dec 2016 18:25:24 +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 81C43EE4; Sat, 3 Dec 2016 18:25:24 +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 uB3IPNE2040470; Sat, 3 Dec 2016 18:25:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3IPNZs040469; Sat, 3 Dec 2016 18:25:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612031825.uB3IPNZs040469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 18:25:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309496 - stable/10/lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 18:25:24 -0000 Author: ngie Date: Sat Dec 3 18:25:23 2016 New Revision: 309496 URL: https://svnweb.freebsd.org/changeset/base/309496 Log: MFC r288017: r288017 (by rodrigc): Use ANSI C prototypes. Eliminates gcc 4.9 warnings. Modified: stable/10/lib/libc/rpc/svc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/svc.c ============================================================================== --- stable/10/lib/libc/rpc/svc.c Sat Dec 3 18:21:28 2016 (r309495) +++ stable/10/lib/libc/rpc/svc.c Sat Dec 3 18:25:23 2016 (r309496) @@ -94,8 +94,7 @@ static void __xprt_do_unregister (SVCXPR * Activate a transport handle. */ void -xprt_register(xprt) - SVCXPRT *xprt; +xprt_register(SVCXPRT *xprt) { int sock; @@ -137,9 +136,7 @@ __xprt_unregister_unlocked(SVCXPRT *xprt * De-activate a transport handle. */ static void -__xprt_do_unregister(xprt, dolock) - SVCXPRT *xprt; - bool_t dolock; +__xprt_do_unregister(SVCXPRT *xprt, bool_t dolock) { int sock; @@ -168,12 +165,9 @@ __xprt_do_unregister(xprt, dolock) * program number comes in. */ bool_t -svc_reg(xprt, prog, vers, dispatch, nconf) - SVCXPRT *xprt; - const rpcprog_t prog; - const rpcvers_t vers; - void (*dispatch)(struct svc_req *, SVCXPRT *); - const struct netconfig *nconf; +svc_reg(SVCXPRT *xprt, const rpcprog_t prog, const rpcvers_t vers, + void (*dispatch)(struct svc_req *, SVCXPRT *), + const struct netconfig *nconf) { bool_t dummy; struct svc_callout *prev; @@ -240,9 +234,7 @@ rpcb_it: * Remove a service program from the callout list. */ void -svc_unreg(prog, vers) - const rpcprog_t prog; - const rpcvers_t vers; +svc_unreg(const rpcprog_t prog, const rpcvers_t vers) { struct svc_callout *prev; struct svc_callout *s; @@ -273,12 +265,9 @@ svc_unreg(prog, vers) * program number comes in. */ bool_t -svc_register(xprt, prog, vers, dispatch, protocol) - SVCXPRT *xprt; - u_long prog; - u_long vers; - void (*dispatch)(struct svc_req *, SVCXPRT *); - int protocol; +svc_register(SVCXPRT *xprt, u_long prog, u_long vers, + void (*dispatch)(struct svc_req *, SVCXPRT *), + int protocol) { struct svc_callout *prev; struct svc_callout *s; @@ -313,9 +302,7 @@ pmap_it: * Remove a service program from the callout list. */ void -svc_unregister(prog, vers) - u_long prog; - u_long vers; +svc_unregister(u_long prog, u_long vers) { struct svc_callout *prev; struct svc_callout *s; @@ -340,11 +327,8 @@ svc_unregister(prog, vers) * struct. */ static struct svc_callout * -svc_find(prog, vers, prev, netid) - rpcprog_t prog; - rpcvers_t vers; - struct svc_callout **prev; - char *netid; +svc_find(rpcprog_t prog, rpcvers_t vers, struct svc_callout **prev, + char *netid) { struct svc_callout *s, *p; @@ -368,10 +352,8 @@ svc_find(prog, vers, prev, netid) * Send a reply to an rpc request */ bool_t -svc_sendreply(xprt, xdr_results, xdr_location) - SVCXPRT *xprt; - xdrproc_t xdr_results; - void * xdr_location; +svc_sendreply(SVCXPRT *xprt, xdrproc_t xdr_results, + void * xdr_location) { struct rpc_msg rply; @@ -390,8 +372,7 @@ svc_sendreply(xprt, xdr_results, xdr_loc * No procedure error reply */ void -svcerr_noproc(xprt) - SVCXPRT *xprt; +svcerr_noproc(SVCXPRT *xprt) { struct rpc_msg rply; @@ -408,8 +389,7 @@ svcerr_noproc(xprt) * Can't decode args error reply */ void -svcerr_decode(xprt) - SVCXPRT *xprt; +svcerr_decode(SVCXPRT *xprt) { struct rpc_msg rply; @@ -426,8 +406,7 @@ svcerr_decode(xprt) * Some system error */ void -svcerr_systemerr(xprt) - SVCXPRT *xprt; +svcerr_systemerr(SVCXPRT *xprt) { struct rpc_msg rply; @@ -448,31 +427,27 @@ svcerr_systemerr(xprt) * protocol: the portmapper (or rpc binder). */ void -__svc_versquiet_on(xprt) - SVCXPRT *xprt; +__svc_versquiet_on(SVCXPRT *xprt) { SVC_EXT(xprt)->xp_flags |= SVC_VERSQUIET; } void -__svc_versquiet_off(xprt) - SVCXPRT *xprt; +__svc_versquiet_off(SVCXPRT *xprt) { SVC_EXT(xprt)->xp_flags &= ~SVC_VERSQUIET; } void -svc_versquiet(xprt) - SVCXPRT *xprt; +svc_versquiet(SVCXPRT *xprt) { __svc_versquiet_on(xprt); } int -__svc_versquiet_get(xprt) - SVCXPRT *xprt; +__svc_versquiet_get(SVCXPRT *xprt) { return (SVC_EXT(xprt)->xp_flags & SVC_VERSQUIET); @@ -483,9 +458,7 @@ __svc_versquiet_get(xprt) * Authentication error reply */ void -svcerr_auth(xprt, why) - SVCXPRT *xprt; - enum auth_stat why; +svcerr_auth(SVCXPRT *xprt, enum auth_stat why) { struct rpc_msg rply; @@ -502,8 +475,7 @@ svcerr_auth(xprt, why) * Auth too weak error reply */ void -svcerr_weakauth(xprt) - SVCXPRT *xprt; +svcerr_weakauth(SVCXPRT *xprt) { assert(xprt != NULL); @@ -515,8 +487,7 @@ svcerr_weakauth(xprt) * Program unavailable error reply */ void -svcerr_noprog(xprt) - SVCXPRT *xprt; +svcerr_noprog(SVCXPRT *xprt) { struct rpc_msg rply; @@ -533,10 +504,7 @@ svcerr_noprog(xprt) * Program version mismatch error reply */ void -svcerr_progvers(xprt, low_vers, high_vers) - SVCXPRT *xprt; - rpcvers_t low_vers; - rpcvers_t high_vers; +svcerr_progvers(SVCXPRT *xprt, rpcvers_t low_vers, rpcvers_t high_vers) { struct rpc_msg rply; @@ -558,7 +526,7 @@ svcerr_progvers(xprt, low_vers, high_ver * parameters. */ SVCXPRT * -svc_xprt_alloc() +svc_xprt_alloc(void) { SVCXPRT *xprt; SVCXPRT_EXT *ext; @@ -583,8 +551,7 @@ svc_xprt_alloc() * Free a server transport structure. */ void -svc_xprt_free(xprt) - SVCXPRT *xprt; +svc_xprt_free(SVCXPRT *xprt) { mem_free(xprt->xp_p3, sizeof(SVCXPRT_EXT)); @@ -610,8 +577,7 @@ svc_xprt_free(xprt) */ void -svc_getreq(rdfds) - int rdfds; +svc_getreq(int rdfds) { fd_set readfds; @@ -621,8 +587,7 @@ svc_getreq(rdfds) } void -svc_getreqset(readfds) - fd_set *readfds; +svc_getreqset(fd_set *readfds) { int bit, fd; fd_mask mask, *maskp; @@ -642,8 +607,7 @@ svc_getreqset(readfds) } void -svc_getreq_common(fd) - int fd; +svc_getreq_common(int fd) { SVCXPRT *xprt; struct svc_req r; @@ -738,9 +702,7 @@ call_done: void -svc_getreq_poll(pfdp, pollretval) - struct pollfd *pfdp; - int pollretval; +svc_getreq_poll(struct pollfd *pfdp, int pollretval) { int i; int fds_found; From owner-svn-src-all@freebsd.org Sat Dec 3 18:26:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82423C64444; Sat, 3 Dec 2016 18:26:42 +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 518AC1062; Sat, 3 Dec 2016 18:26:42 +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 uB3IQfTY040581; Sat, 3 Dec 2016 18:26:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3IQfUF040580; Sat, 3 Dec 2016 18:26:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612031826.uB3IQfUF040580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 18:26:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309497 - stable/10/lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 18:26:42 -0000 Author: ngie Date: Sat Dec 3 18:26:41 2016 New Revision: 309497 URL: https://svnweb.freebsd.org/changeset/base/309497 Log: MFC r278039: r278039 (by pfg): Resource leak CID: 1016703 Modified: stable/10/lib/libc/rpc/crypt_client.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/crypt_client.c ============================================================================== --- stable/10/lib/libc/rpc/crypt_client.c Sat Dec 3 18:25:23 2016 (r309496) +++ stable/10/lib/libc/rpc/crypt_client.c Sat Dec 3 18:26:41 2016 (r309497) @@ -61,6 +61,7 @@ _des_crypt_call(char *buf, int len, stru } if (nconf == NULL) { warnx("getnetconfig: %s", nc_sperror()); + endnetconfig(localhandle); return(DESERR_HWERROR); } clnt = clnt_tp_create(NULL, CRYPT_PROG, CRYPT_VERS, nconf); From owner-svn-src-all@freebsd.org Sat Dec 3 18:40:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2586BC6496C; Sat, 3 Dec 2016 18:40:41 +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 D6D8F1969; Sat, 3 Dec 2016 18:40:40 +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 uB3IeeLC045356; Sat, 3 Dec 2016 18:40:40 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3Ieet2045355; Sat, 3 Dec 2016 18:40:40 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612031840.uB3Ieet2045355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 18:40:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309498 - stable/10/lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 18:40:41 -0000 Author: ngie Date: Sat Dec 3 18:40:39 2016 New Revision: 309498 URL: https://svnweb.freebsd.org/changeset/base/309498 Log: MFC r296386: r296386 (by pfg): Work around aliasing issues detected in modern GCC. Avoid casting gymnastics that lead to pointer aliasing by introducing an inline function as done in NetBSD (but without #if0'd WIP code). Obtained from: NetBSD (CVS Rev. 1.24, 1.25) Modified: stable/10/lib/libc/rpc/clnt_vc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/clnt_vc.c ============================================================================== --- stable/10/lib/libc/rpc/clnt_vc.c Sat Dec 3 18:26:41 2016 (r309497) +++ stable/10/lib/libc/rpc/clnt_vc.c Sat Dec 3 18:40:39 2016 (r309498) @@ -503,6 +503,20 @@ clnt_vc_abort(CLIENT *cl) { } +static __inline void +htonlp(void *dst, const void *src, uint32_t incr) +{ + /* We are aligned, so we think */ + *(uint32_t *)dst = htonl(*(const uint32_t *)src + incr); +} + +static __inline void +ntohlp(void *dst, const void *src) +{ + /* We are aligned, so we think */ + *(uint32_t *)dst = htonl(*(const uint32_t *)src); +} + static bool_t clnt_vc_control(CLIENT *cl, u_int request, void *info) { @@ -577,14 +591,12 @@ clnt_vc_control(CLIENT *cl, u_int reques * first element in the call structure * This will get the xid of the PREVIOUS call */ - *(u_int32_t *)info = - ntohl(*(u_int32_t *)(void *)&ct->ct_u.ct_mcalli); + ntohlp(info, &ct->ct_u.ct_mcalli); break; case CLSET_XID: /* This will set the xid of the NEXT call */ - *(u_int32_t *)(void *)&ct->ct_u.ct_mcalli = - htonl(*((u_int32_t *)info) + 1); /* increment by 1 as clnt_vc_call() decrements once */ + htonlp(&ct->ct_u.ct_mcalli, info, 1); break; case CLGET_VERS: /* @@ -593,15 +605,11 @@ clnt_vc_control(CLIENT *cl, u_int reques * begining of the RPC header. MUST be changed if the * call_struct is changed */ - *(u_int32_t *)info = - ntohl(*(u_int32_t *)(void *)(ct->ct_u.ct_mcallc + - 4 * BYTES_PER_XDR_UNIT)); + ntohlp(info, ct->ct_u.ct_mcallc + 4 * BYTES_PER_XDR_UNIT); break; case CLSET_VERS: - *(u_int32_t *)(void *)(ct->ct_u.ct_mcallc + - 4 * BYTES_PER_XDR_UNIT) = - htonl(*(u_int32_t *)info); + htonlp(ct->ct_u.ct_mcallc + 4 * BYTES_PER_XDR_UNIT, info, 0); break; case CLGET_PROG: @@ -611,15 +619,11 @@ clnt_vc_control(CLIENT *cl, u_int reques * begining of the RPC header. MUST be changed if the * call_struct is changed */ - *(u_int32_t *)info = - ntohl(*(u_int32_t *)(void *)(ct->ct_u.ct_mcallc + - 3 * BYTES_PER_XDR_UNIT)); + ntohlp(info, ct->ct_u.ct_mcallc + 3 * BYTES_PER_XDR_UNIT); break; case CLSET_PROG: - *(u_int32_t *)(void *)(ct->ct_u.ct_mcallc + - 3 * BYTES_PER_XDR_UNIT) = - htonl(*(u_int32_t *)info); + htonlp(ct->ct_u.ct_mcallc + 3 * BYTES_PER_XDR_UNIT, info, 0); break; default: From owner-svn-src-all@freebsd.org Sat Dec 3 18:45:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59975C64BB8; Sat, 3 Dec 2016 18:45:13 +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 28C6C1DAF; Sat, 3 Dec 2016 18:45:13 +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 uB3IjC7a049379; Sat, 3 Dec 2016 18:45:12 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3IjC5W049378; Sat, 3 Dec 2016 18:45:12 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612031845.uB3IjC5W049378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 18:45:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309499 - stable/10/lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 18:45:13 -0000 Author: ngie Date: Sat Dec 3 18:45:12 2016 New Revision: 309499 URL: https://svnweb.freebsd.org/changeset/base/309499 Log: MFC r287353: r287353 (by rodrigc): Use unsigned variable. Eliminates gcc 4.9 compiler warning. Modified: stable/10/lib/libc/rpc/clnt_bcast.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/clnt_bcast.c ============================================================================== --- stable/10/lib/libc/rpc/clnt_bcast.c Sat Dec 3 18:40:39 2016 (r309498) +++ stable/10/lib/libc/rpc/clnt_bcast.c Sat Dec 3 18:45:12 2016 (r309499) @@ -256,7 +256,7 @@ rpc_broadcast_exp(rpcprog_t prog, rpcver int inlen; u_int maxbufsize = 0; AUTH *sys_auth = authunix_create_default(); - int i; + u_int i; void *handle; char uaddress[1024]; /* A self imposed limit */ char *uaddrp = uaddress; From owner-svn-src-all@freebsd.org Sat Dec 3 18:48:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 966A3C64CCD; Sat, 3 Dec 2016 18:48:40 +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 4C0D71F40; Sat, 3 Dec 2016 18:48:40 +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 uB3Imdwo049557; Sat, 3 Dec 2016 18:48:39 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3ImdZp049556; Sat, 3 Dec 2016 18:48:39 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612031848.uB3ImdZp049556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 18:48:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309500 - stable/10/lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 18:48:40 -0000 Author: ngie Date: Sat Dec 3 18:48:39 2016 New Revision: 309500 URL: https://svnweb.freebsd.org/changeset/base/309500 Log: MFC r296404: r296404 (by pfg): Stray tabs and spaces. No functional change. Modified: stable/10/lib/libc/rpc/rtime.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/rtime.c ============================================================================== --- stable/10/lib/libc/rpc/rtime.c Sat Dec 3 18:45:12 2016 (r309499) +++ stable/10/lib/libc/rpc/rtime.c Sat Dec 3 18:48:39 2016 (r309500) @@ -61,8 +61,8 @@ __FBSDID("$FreeBSD$"); extern int _rpc_dtablesize( void ); -#define NYEARS (unsigned long)(1970 - 1900) -#define TOFFSET (unsigned long)(60*60*24*(365*NYEARS + (NYEARS/4))) +#define NYEARS (unsigned long)(1970 - 1900) +#define TOFFSET (unsigned long)(60*60*24*(365*NYEARS + (NYEARS/4))) static void do_close( int ); @@ -98,11 +98,11 @@ rtime(struct sockaddr_in *addrp, struct addrp->sin_port = serv->s_port; if (type == SOCK_DGRAM) { - res = _sendto(s, (char *)&thetime, sizeof(thetime), 0, + res = _sendto(s, (char *)&thetime, sizeof(thetime), 0, (struct sockaddr *)addrp, sizeof(*addrp)); if (res < 0) { do_close(s); - return(-1); + return(-1); } do { FD_ZERO(&readfds); @@ -115,14 +115,14 @@ rtime(struct sockaddr_in *addrp, struct errno = ETIMEDOUT; } do_close(s); - return(-1); + return(-1); } fromlen = sizeof(from); - res = _recvfrom(s, (char *)&thetime, sizeof(thetime), 0, + res = _recvfrom(s, (char *)&thetime, sizeof(thetime), 0, (struct sockaddr *)&from, &fromlen); do_close(s); if (res < 0) { - return(-1); + return(-1); } } else { if (_connect(s, (struct sockaddr *)addrp, sizeof(*addrp)) < 0) { @@ -137,7 +137,7 @@ rtime(struct sockaddr_in *addrp, struct } if (res != sizeof(thetime)) { errno = EIO; - return(-1); + return(-1); } thetime = ntohl(thetime); timep->tv_sec = thetime - TOFFSET; From owner-svn-src-all@freebsd.org Sat Dec 3 18:53:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80E34C64F2B; Sat, 3 Dec 2016 18:53:04 +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 4D67075E; Sat, 3 Dec 2016 18:53:04 +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 uB3Ir3w0053388; Sat, 3 Dec 2016 18:53:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3Ir38R053386; Sat, 3 Dec 2016 18:53:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612031853.uB3Ir38R053386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 18:53:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309501 - in stable/10: lib/libc/rpc sys/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 18:53:04 -0000 Author: ngie Date: Sat Dec 3 18:53:03 2016 New Revision: 309501 URL: https://svnweb.freebsd.org/changeset/base/309501 Log: MFC r301734: r301734 (by kevlo): Fix the rpcb_getaddr() definition to match its declaration. Modified: stable/10/lib/libc/rpc/rpcb_clnt.c stable/10/sys/rpc/rpcb_clnt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/rpcb_clnt.c ============================================================================== --- stable/10/lib/libc/rpc/rpcb_clnt.c Sat Dec 3 18:48:39 2016 (r309500) +++ stable/10/lib/libc/rpc/rpcb_clnt.c Sat Dec 3 18:53:03 2016 (r309501) @@ -1010,7 +1010,7 @@ done: * * Assuming that the address is all properly allocated */ -int +bool_t rpcb_getaddr(rpcprog_t program, rpcvers_t version, const struct netconfig *nconf, struct netbuf *address, const char *host) { Modified: stable/10/sys/rpc/rpcb_clnt.c ============================================================================== --- stable/10/sys/rpc/rpcb_clnt.c Sat Dec 3 18:48:39 2016 (r309500) +++ stable/10/sys/rpc/rpcb_clnt.c Sat Dec 3 18:53:03 2016 (r309501) @@ -1051,7 +1051,7 @@ done: * * Assuming that the address is all properly allocated */ -int +bool_t rpcb_getaddr(program, version, nconf, address, host) rpcprog_t program; rpcvers_t version; From owner-svn-src-all@freebsd.org Sat Dec 3 18:56:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3144EC63134; Sat, 3 Dec 2016 18:56:30 +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 DA8D7920; Sat, 3 Dec 2016 18:56:29 +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 uB3IuT7W053602; Sat, 3 Dec 2016 18:56:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3IuSGE053599; Sat, 3 Dec 2016 18:56:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612031856.uB3IuSGE053599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 18:56:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309502 - in stable/10: include/rpc lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 18:56:30 -0000 Author: ngie Date: Sat Dec 3 18:56:28 2016 New Revision: 309502 URL: https://svnweb.freebsd.org/changeset/base/309502 Log: MFC r296133: r296133 (by pfg): RPC: update the getrpcbyname() definition to include a const qualifier. Add const qualifier making getrpcbyname() and getrpcbyname_r() prototypes match those used in latest Sun RPC code (TI-RPC 2.3). Obtained from: NetBSD Modified: stable/10/include/rpc/rpcent.h stable/10/lib/libc/rpc/getrpcent.3 stable/10/lib/libc/rpc/getrpcent.c Directory Properties: stable/10/ (props changed) Modified: stable/10/include/rpc/rpcent.h ============================================================================== --- stable/10/include/rpc/rpcent.h Sat Dec 3 18:53:03 2016 (r309501) +++ stable/10/include/rpc/rpcent.h Sat Dec 3 18:56:28 2016 (r309502) @@ -56,7 +56,7 @@ __BEGIN_DECLS * These interfaces are currently implemented through nsswitch and are * MT-safe. */ -extern struct rpcent *getrpcbyname(char *); +extern struct rpcent *getrpcbyname(const char *); extern struct rpcent *getrpcbynumber(int); extern struct rpcent *getrpcent(void); extern void setrpcent(int); Modified: stable/10/lib/libc/rpc/getrpcent.3 ============================================================================== --- stable/10/lib/libc/rpc/getrpcent.3 Sat Dec 3 18:53:03 2016 (r309501) +++ stable/10/lib/libc/rpc/getrpcent.3 Sat Dec 3 18:56:28 2016 (r309502) @@ -2,7 +2,7 @@ .\" $NetBSD: getrpcent.3,v 1.6 1998/02/05 18:49:06 perry Exp $ .\" $FreeBSD$ .\" -.Dd December 14, 1987 +.Dd February 26, 2016 .Dt GETRPCENT 3 .Os .Sh NAME @@ -19,7 +19,7 @@ .Ft struct rpcent * .Fn getrpcent void .Ft struct rpcent * -.Fn getrpcbyname "char *name" +.Fn getrpcbyname "const char *name" .Ft struct rpcent * .Fn getrpcbynumber "int number" .Ft void Modified: stable/10/lib/libc/rpc/getrpcent.c ============================================================================== --- stable/10/lib/libc/rpc/getrpcent.c Sat Dec 3 18:53:03 2016 (r309501) +++ stable/10/lib/libc/rpc/getrpcent.c Sat Dec 3 18:56:28 2016 (r309502) @@ -971,7 +971,7 @@ getrpc(int (*fn)(union key, struct rpcen } struct rpcent * -getrpcbyname(char *name) +getrpcbyname(const char *name) { union key key; From owner-svn-src-all@freebsd.org Sat Dec 3 19:03:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99059C633FE; Sat, 3 Dec 2016 19:03:26 +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 68512D4F; Sat, 3 Dec 2016 19:03:26 +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 uB3J3PY0057597; Sat, 3 Dec 2016 19:03:25 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3J3P1e057594; Sat, 3 Dec 2016 19:03:25 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612031903.uB3J3P1e057594@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 19:03:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309503 - in stable/10/sys: rpc xdr X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 19:03:26 -0000 Author: ngie Date: Sat Dec 3 19:03:25 2016 New Revision: 309503 URL: https://svnweb.freebsd.org/changeset/base/309503 Log: MFC r297975: r297975 (by pfg): RPC: for pointers replace 0 with NULL. These are mostly cosmetical, no functional change. Found with devel/coccinelle. Modified: stable/10/sys/rpc/svc_vc.c stable/10/sys/xdr/xdr_mem.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/rpc/svc_vc.c ============================================================================== --- stable/10/sys/rpc/svc_vc.c Sat Dec 3 18:56:28 2016 (r309502) +++ stable/10/sys/rpc/svc_vc.c Sat Dec 3 19:03:25 2016 (r309503) @@ -414,7 +414,7 @@ svc_vc_rendezvous_recv(SVCXPRT *xprt, st sx_xunlock(&xprt->xp_lock); - sa = 0; + sa = NULL; error = soaccept(so, &sa); if (error) { Modified: stable/10/sys/xdr/xdr_mem.c ============================================================================== --- stable/10/sys/xdr/xdr_mem.c Sat Dec 3 18:56:28 2016 (r309502) +++ stable/10/sys/xdr/xdr_mem.c Sat Dec 3 19:03:25 2016 (r309503) @@ -214,7 +214,7 @@ xdrmem_setpos(XDR *xdrs, u_int pos) static int32_t * xdrmem_inline_aligned(XDR *xdrs, u_int len) { - int32_t *buf = 0; + int32_t *buf = NULL; if (xdrs->x_handy >= len) { xdrs->x_handy -= len; From owner-svn-src-all@freebsd.org Sat Dec 3 19:03:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C92FC6344F; Sat, 3 Dec 2016 19:03:41 +0000 (UTC) (envelope-from dteske@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 6C676E50; Sat, 3 Dec 2016 19:03:41 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB3J3enJ057648; Sat, 3 Dec 2016 19:03:40 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3J3eq0057647; Sat, 3 Dec 2016 19:03:40 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201612031903.uB3J3eq0057647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sat, 3 Dec 2016 19:03:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309504 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 19:03:41 -0000 Author: dteske Date: Sat Dec 3 19:03:40 2016 New Revision: 309504 URL: https://svnweb.freebsd.org/changeset/base/309504 Log: Fix bug preventing limits(1) from being applied PR: misc/212493 Differential Revision: https://reviews.freebsd.org/D8232 Submitted by: girgen Reviewed by: adrian MFC after: 3 days X-MFC-to: stable/11 Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Sat Dec 3 19:03:25 2016 (r309503) +++ head/etc/rc.subr Sat Dec 3 19:03:40 2016 (r309504) @@ -1045,6 +1045,7 @@ run_rc_command() # check_startmsgs && echo "Starting ${name}." if [ -n "$_chroot" ]; then + _cd= _doit="\ ${_nice:+nice -n $_nice }\ ${_fib:+setfib -F $_fib }\ @@ -1052,8 +1053,8 @@ ${_env:+env $_env }\ chroot ${_user:+-u $_user }${_group:+-g $_group }${_groups:+-G $_groups }\ $_chroot $command $rc_flags $command_args" else + _cd="${_chdir:+cd $_chdir && }" _doit="\ -${_chdir:+cd $_chdir && }\ ${_fib:+setfib -F $_fib }\ ${_env:+env $_env }\ $command $rc_flags $command_args" @@ -1072,7 +1073,7 @@ $command $rc_flags $command_args" fi # Prepend default limits - _doit="limits -C $_login_class $_doit" + _doit="$_cd limits -C $_login_class $_doit" # run the full command # From owner-svn-src-all@freebsd.org Sat Dec 3 19:15:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01409C637B6; Sat, 3 Dec 2016 19:15:28 +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 C48821510; Sat, 3 Dec 2016 19:15:27 +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 uB3JFQuJ061771; Sat, 3 Dec 2016 19:15:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3JFQTH061770; Sat, 3 Dec 2016 19:15:26 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612031915.uB3JFQTH061770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 19:15:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309505 - stable/10/usr.bin/rpcgen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 19:15:28 -0000 Author: ngie Date: Sat Dec 3 19:15:26 2016 New Revision: 309505 URL: https://svnweb.freebsd.org/changeset/base/309505 Log: MFC r298183,r304226: r298183 (by araujo): Use NULL for pointers. strrchr(3) will return NULL if the character does not appears in the string. r304226 (by araujo): Use nitems() from sys/param.h. Modified: stable/10/usr.bin/rpcgen/rpc_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/rpcgen/rpc_main.c ============================================================================== --- stable/10/usr.bin/rpcgen/rpc_main.c Sat Dec 3 19:03:40 2016 (r309504) +++ stable/10/usr.bin/rpcgen/rpc_main.c Sat Dec 3 19:15:26 2016 (r309505) @@ -82,11 +82,11 @@ static char pathbuf[MAXPATHLEN + 1]; static const char *allv[] = { "rpcgen", "-s", "udp", "-s", "tcp", }; -static int allc = sizeof (allv)/sizeof (allv[0]); +static int allc = nitems(allv); static const char *allnv[] = { "rpcgen", "-s", "netpath", }; -static int allnc = sizeof (allnv)/sizeof (allnv[0]); +static int allnc = nitems(allnv); /* * machinations for handling expanding argument list @@ -451,7 +451,7 @@ generate_guard(const char *pathname) char *guard, *tmp, *stopat; filename = strrchr(pathname, '/'); /* find last component */ - filename = ((filename == 0) ? pathname : filename+1); + filename = ((filename == NULL) ? pathname : filename+1); guard = xstrdup(filename); stopat = strrchr(guard, '.'); From owner-svn-src-all@freebsd.org Sat Dec 3 19:21:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F0D8C63AF6; Sat, 3 Dec 2016 19:21:36 +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 2E618185D; Sat, 3 Dec 2016 19:21:36 +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 uB3JLZ9s063764; Sat, 3 Dec 2016 19:21:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3JLZF8063763; Sat, 3 Dec 2016 19:21:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612031921.uB3JLZF8063763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 19:21:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309506 - stable/10/usr.sbin/rpcbind X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 19:21:36 -0000 Author: ngie Date: Sat Dec 3 19:21:35 2016 New Revision: 309506 URL: https://svnweb.freebsd.org/changeset/base/309506 Log: MFC r301770: r301770 (by pfg): rpcbind(8): Make use of some xdr_* macros. xdr_rpcproc, xdr_rpcprog and xdr_rpcvers were broken in older versions of FreeBSD but fixed in r296394. Give them some use hoping they help make the code somewhat more readable. Modified: stable/10/usr.sbin/rpcbind/rpcb_svc_com.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rpcbind/rpcb_svc_com.c ============================================================================== --- stable/10/usr.sbin/rpcbind/rpcb_svc_com.c Sat Dec 3 19:15:26 2016 (r309505) +++ stable/10/usr.sbin/rpcbind/rpcb_svc_com.c Sat Dec 3 19:21:35 2016 (r309506) @@ -430,9 +430,9 @@ static bool_t xdr_rmtcall_args(XDR *xdrs, struct r_rmtcall_args *cap) { /* does not get the address or the arguments */ - if (xdr_u_int32_t(xdrs, &(cap->rmt_prog)) && - xdr_u_int32_t(xdrs, &(cap->rmt_vers)) && - xdr_u_int32_t(xdrs, &(cap->rmt_proc))) { + if (xdr_rpcprog(xdrs, &(cap->rmt_prog)) && + xdr_rpcvers(xdrs, &(cap->rmt_vers)) && + xdr_rpcproc(xdrs, &(cap->rmt_proc))) { return (xdr_encap_parms(xdrs, &(cap->rmt_args))); } return (FALSE); From owner-svn-src-all@freebsd.org Sat Dec 3 19:52:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 773A2C65A1D; Sat, 3 Dec 2016 19:52:34 +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 4682DA95; Sat, 3 Dec 2016 19:52:34 +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 uB3JqXNE089583; Sat, 3 Dec 2016 19:52:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3JqXc6089581; Sat, 3 Dec 2016 19:52:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201612031952.uB3JqXc6089581@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Sat, 3 Dec 2016 19:52:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309507 - stable/10/lib/libc/rpc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 19:52:34 -0000 Author: ngie Date: Sat Dec 3 19:52:33 2016 New Revision: 309507 URL: https://svnweb.freebsd.org/changeset/base/309507 Log: MFC r264196: r264196 (by theraven): Move definitions out of rpc_com so that the linker doesn't complain about multiple definitions. Modified: stable/10/lib/libc/rpc/rpc_com.h stable/10/lib/libc/rpc/svc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/rpc/rpc_com.h ============================================================================== --- stable/10/lib/libc/rpc/rpc_com.h Sat Dec 3 19:21:35 2016 (r309506) +++ stable/10/lib/libc/rpc/rpc_com.h Sat Dec 3 19:52:33 2016 (r309507) @@ -86,8 +86,8 @@ bool_t __xdrrec_setnonblock(XDR *, int); bool_t __xdrrec_getrec(XDR *, enum xprt_stat *, bool_t); void __xprt_unregister_unlocked(SVCXPRT *); -SVCXPRT **__svc_xports; -int __svc_maxrec; +extern SVCXPRT **__svc_xports; +extern int __svc_maxrec; __END_DECLS Modified: stable/10/lib/libc/rpc/svc.c ============================================================================== --- stable/10/lib/libc/rpc/svc.c Sat Dec 3 19:21:35 2016 (r309506) +++ stable/10/lib/libc/rpc/svc.c Sat Dec 3 19:52:33 2016 (r309507) @@ -84,6 +84,9 @@ static struct svc_callout { void (*sc_dispatch)(struct svc_req *, SVCXPRT *); } *svc_head; +SVCXPRT **__svc_xports; +int __svc_maxrec; + static struct svc_callout *svc_find(rpcprog_t, rpcvers_t, struct svc_callout **, char *); static void __xprt_do_unregister (SVCXPRT *xprt, bool_t dolock); From owner-svn-src-all@freebsd.org Sat Dec 3 19:53:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9F53C65A87; Sat, 3 Dec 2016 19:53:16 +0000 (UTC) (envelope-from trasz@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 94F71BFA; Sat, 3 Dec 2016 19:53:16 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB3JrF2O089669; Sat, 3 Dec 2016 19:53:15 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3JrFRp089668; Sat, 3 Dec 2016 19:53:15 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201612031953.uB3JrFRp089668@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 3 Dec 2016 19:53:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309508 - stable/11/usr.sbin/autofs X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 19:53:16 -0000 Author: trasz Date: Sat Dec 3 19:53:15 2016 New Revision: 309508 URL: https://svnweb.freebsd.org/changeset/base/309508 Log: MFC r308206: Make autounmountd(8) not die when traced with "truss -p". Modified: stable/11/usr.sbin/autofs/autounmountd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/autofs/autounmountd.c ============================================================================== --- stable/11/usr.sbin/autofs/autounmountd.c Sat Dec 3 19:52:33 2016 (r309507) +++ stable/11/usr.sbin/autofs/autounmountd.c Sat Dec 3 19:53:15 2016 (r309508) @@ -244,8 +244,11 @@ do_wait(int kq, double sleep_time) log_debugx("waiting for filesystem event"); nevents = kevent(kq, NULL, 0, &unused, 1, NULL); } - if (nevents < 0) + if (nevents < 0) { + if (errno == EINTR) + return; log_err(1, "kevent"); + } if (nevents == 0) { log_debugx("timeout reached"); From owner-svn-src-all@freebsd.org Sat Dec 3 19:55:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A06D7C65AF7; Sat, 3 Dec 2016 19:55:56 +0000 (UTC) (envelope-from trasz@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 5C763D5C; Sat, 3 Dec 2016 19:55:56 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB3Jtt6u089847; Sat, 3 Dec 2016 19:55:55 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3JttN6089846; Sat, 3 Dec 2016 19:55:55 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201612031955.uB3JttN6089846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 3 Dec 2016 19:55:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309509 - stable/10/usr.sbin/autofs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 19:55:56 -0000 Author: trasz Date: Sat Dec 3 19:55:55 2016 New Revision: 309509 URL: https://svnweb.freebsd.org/changeset/base/309509 Log: MFC r308206: Make autounmountd(8) not die when traced with "truss -p". Modified: stable/10/usr.sbin/autofs/autounmountd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/autofs/autounmountd.c ============================================================================== --- stable/10/usr.sbin/autofs/autounmountd.c Sat Dec 3 19:53:15 2016 (r309508) +++ stable/10/usr.sbin/autofs/autounmountd.c Sat Dec 3 19:55:55 2016 (r309509) @@ -244,8 +244,11 @@ do_wait(int kq, double sleep_time) log_debugx("waiting for filesystem event"); nevents = kevent(kq, NULL, 0, &unused, 1, NULL); } - if (nevents < 0) + if (nevents < 0) { + if (errno == EINTR) + return; log_err(1, "kevent"); + } if (nevents == 0) { log_debugx("timeout reached"); From owner-svn-src-all@freebsd.org Sat Dec 3 20:01:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B722EC65DCC; Sat, 3 Dec 2016 20:01:13 +0000 (UTC) (envelope-from trasz@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 860E810DD; Sat, 3 Dec 2016 20:01:13 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB3K1Ckr090764; Sat, 3 Dec 2016 20:01:12 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3K1CjJ090763; Sat, 3 Dec 2016 20:01:12 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201612032001.uB3K1CjJ090763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 3 Dec 2016 20:01:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309510 - stable/10/lib/msun/src X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 20:01:13 -0000 Author: trasz Date: Sat Dec 3 20:01:12 2016 New Revision: 309510 URL: https://svnweb.freebsd.org/changeset/base/309510 Log: MFC r301761: Fix frexpl() declaration to not include the field name. Modified: stable/10/lib/msun/src/math.h Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/msun/src/math.h ============================================================================== --- stable/10/lib/msun/src/math.h Sat Dec 3 19:55:55 2016 (r309509) +++ stable/10/lib/msun/src/math.h Sat Dec 3 20:01:12 2016 (r309510) @@ -465,7 +465,7 @@ long double fmal(long double, long doubl long double fmaxl(long double, long double) __pure2; long double fminl(long double, long double) __pure2; long double fmodl(long double, long double); -long double frexpl(long double value, int *); /* fundamentally !__pure2 */ +long double frexpl(long double, int *); /* fundamentally !__pure2 */ long double hypotl(long double, long double); int ilogbl(long double) __pure2; long double ldexpl(long double, int); From owner-svn-src-all@freebsd.org Sat Dec 3 20:12:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25EC5C651AA for ; Sat, 3 Dec 2016 20:12:58 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wj0-x231.google.com (mail-wj0-x231.google.com [IPv6:2a00:1450:400c:c01::231]) (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 9FF581A24 for ; Sat, 3 Dec 2016 20:12:57 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wj0-x231.google.com with SMTP id qp4so259003957wjc.3 for ; Sat, 03 Dec 2016 12:12:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=lw6RGDeRXuN0KtgadeSCzICi5TByre7EBmLblUkBBhA=; b=C/0dKZnOC9GKg0f/AMpSf+21NSSXeopI6p/OFo2cjQh+D2YU3+RG1lepZulhycZsko 4CU/sJQxP6f7hTyLg96jmpmz8uKjJcQ/AULSxvCP0l59rUDF0OUTVhJc99JiIX3keA3o MuuT8ypM033AKniBx3/TZxVEMx7Lh+wE/GSovkF+P9Qr8U6ny8PeofmdlkxgDyx1MlRs Ljpkq28WO2i+YyVfw3psCLBk+js4oZQAXRAmZc9DO4v+/yftdDOPBEwvDx067IZ4wdKV hhX/eRmU+Hnj5VSs5h+twL3dEjMsjOcTRLJwQUl0v2aZfecWfBkJwFo7/7sEXrhxhhD8 BaQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=lw6RGDeRXuN0KtgadeSCzICi5TByre7EBmLblUkBBhA=; b=h1yQyyK+uno2C9Ywb4uUL0oCTvNXJHGOP1ML61jmoEywIg3WQQ7o8soiMknVhbuF5z 3OEBHRPkB6vEoTHtpQ7D0hs1zmtNI6Q3rzoAkYthu86zkqXALddnZ2OClR/UsYl/znN0 OvBx7W/9kIQJpKuKR9yiG7ZzweVt5txfp+PtRECYND+7/SWNhcIaz098vTrYuZw6tyHx taciyj62N6hepmDizfn4pGma4bNnsFN+QWCA/tiSpAX0DUjCndXKZkN/Quqfebfym26W 6aq17YORo+gMDJU70X9sqi2/rb9A+7Pf7RzIiU8Q6b1VuxiOtu5Pg+PokdNyikv5aX+a dmGw== X-Gm-Message-State: AKaTC01EF+7FbRfZoU8f8gLL3gkw2fetcbDaBHIMEgAcYskh+feISvozp76vEKQI5G3HFp3fQMW6AR+0FxIaK+vF X-Received: by 10.194.0.43 with SMTP id 11mr43765066wjb.218.1480795975113; Sat, 03 Dec 2016 12:12:55 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.253.65 with HTTP; Sat, 3 Dec 2016 12:12:54 -0800 (PST) In-Reply-To: <201612020821.uB28L8s2000195@repo.freebsd.org> References: <201612020821.uB28L8s2000195@repo.freebsd.org> From: Oliver Pinter Date: Sat, 3 Dec 2016 21:12:54 +0100 Message-ID: Subject: Re: svn commit: r309400 - head/sys/dev/acpica To: Hans Petter Selasky Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , freebsd-acpi@freebsd.org Content-Type: multipart/mixed; boundary=f46d0421a85915aa600542c6ae3f X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 20:12:58 -0000 --f46d0421a85915aa600542c6ae3f Content-Type: text/plain; charset=UTF-8 On Fri, Dec 2, 2016 at 9:21 AM, Hans Petter Selasky wrote: > Author: hselasky > Date: Fri Dec 2 08:21:08 2016 > New Revision: 309400 > URL: https://svnweb.freebsd.org/changeset/base/309400 > > Log: > Fix for endless recursion in the ACPI GPE handler during boot. > > When handling a GPE ACPI interrupt object the EcSpaceHandler() > function can be called which checks the EC_EVENT_SCI bit and then > recurse on the EcGpeQueryHandler() function. If there are multiple GPE > events pending the EC_EVENT_SCI bit will be set at the next call to > EcSpaceHandler() causing it to recurse again via the > EcGpeQueryHandler() function. This leads to a slow never ending > recursion during boot which prevents proper system startup, because > the EC_EVENT_SCI bit never gets cleared in this scenario. > > The behaviour is reproducible with the ALASKA AMI in combination with > a newer Skylake based mainboard in the following way: > > Enter BIOS and adjust the clock one hour forward. Save and exit the > BIOS. System fails to boot due to the above mentioned bug in > EcGpeQueryHandler() which was observed recursing multiple times. > > This patch adds a simple recursion guard to the EcGpeQueryHandler() > function and also also adds logic to detect if new GPE events occurred > during the execution of EcGpeQueryHandler() and then loop on this > function instead of recursing. > > Reviewed by: jhb > MFC after: 2 weeks > > Modified: > head/sys/dev/acpica/acpi_ec.c I have similar error since the latest BIOS update on my gigabyte H170N-Wifi board. The curiosity of the BIOS update was after upgrading to this version, there are no possibility to rollback to older version. The other weird thing, is that MFCing back this patch does not help. I get stucked lock in acmtx mutex, as you could see from the attached log. The other interesting is the ACPI error at boot time: [1] ACPI Error: Mutex [0x0] is not acquired, cannot release (20160527/utmutex-386) [1] ACPI Error: Could not release AML Interpreter mutex (20160527/exutils-147) [1] ACPI Error: Mutex [0x0] is not acquired, cannot release (20160527/utmutex-386) [1] ACPI Error: Could not release AML Interpreter mutex (20160527/exutils-147) [1] cpu1: on acpi0 [1] ACPI Error: Mutex [0x0] is not acquired, cannot release (20160527/utmutex-386) [1] ACPI Error: Could not release AML Interpreter mutex (20160527/exutils-147) [1] ACPI Error: Mutex [0x0] is not acquired, cannot release (20160527/utmutex-386) [1] ACPI Error: Could not release AML Interpreter mutex (20160527/exutils-147) (This error is on 10-STABLE.) > > Modified: head/sys/dev/acpica/acpi_ec.c > ============================================================================== > --- head/sys/dev/acpica/acpi_ec.c Fri Dec 2 08:15:52 2016 (r309399) > +++ head/sys/dev/acpica/acpi_ec.c Fri Dec 2 08:21:08 2016 (r309400) > @@ -613,16 +613,14 @@ EcCheckStatus(struct acpi_ec_softc *sc, > } > > static void > -EcGpeQueryHandler(void *Context) > +EcGpeQueryHandlerSub(struct acpi_ec_softc *sc) > { > - struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context; > UINT8 Data; > ACPI_STATUS Status; > int retry; > char qxx[5]; > > ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); > - KASSERT(Context != NULL, ("EcGpeQueryHandler called with NULL")); > > /* Serialize user access with EcSpaceHandler(). */ > Status = EcLock(sc); > @@ -647,7 +645,6 @@ EcGpeQueryHandler(void *Context) > EC_EVENT_INPUT_BUFFER_EMPTY))) > break; > } > - sc->ec_sci_pend = FALSE; > if (ACPI_FAILURE(Status)) { > EcUnlock(sc); > device_printf(sc->ec_dev, "GPE query failed: %s\n", > @@ -678,6 +675,29 @@ EcGpeQueryHandler(void *Context) > } > } > > +static void > +EcGpeQueryHandler(void *Context) > +{ > + struct acpi_ec_softc *sc = (struct acpi_ec_softc *)Context; > + int pending; > + > + KASSERT(Context != NULL, ("EcGpeQueryHandler called with NULL")); > + > + do { > + /* Read the current pending count */ > + pending = atomic_load_acq_int(&sc->ec_sci_pend); > + > + /* Call GPE handler function */ > + EcGpeQueryHandlerSub(sc); > + > + /* > + * Try to reset the pending count to zero. If this fails we > + * know another GPE event has occurred while handling the > + * current GPE event and need to loop. > + */ > + } while (!atomic_cmpset_int(&sc->ec_sci_pend, pending, 0)); > +} > + > /* > * The GPE handler is called when IBE/OBF or SCI events occur. We are > * called from an unknown lock context. > @@ -706,13 +726,14 @@ EcGpeHandler(ACPI_HANDLE GpeDevice, UINT > * It will run the query and _Qxx method later, under the lock. > */ > EcStatus = EC_GET_CSR(sc); > - if ((EcStatus & EC_EVENT_SCI) && !sc->ec_sci_pend) { > + if ((EcStatus & EC_EVENT_SCI) && > + atomic_fetchadd_int(&sc->ec_sci_pend, 1) == 0) { > CTR0(KTR_ACPI, "ec gpe queueing query handler"); > Status = AcpiOsExecute(OSL_GPE_HANDLER, EcGpeQueryHandler, Context); > - if (ACPI_SUCCESS(Status)) > - sc->ec_sci_pend = TRUE; > - else > + if (ACPI_FAILURE(Status)) { > printf("EcGpeHandler: queuing GPE query handler failed\n"); > + atomic_store_rel_int(&sc->ec_sci_pend, 0); > + } > } > return (ACPI_REENABLE_GPE); > } > @@ -759,7 +780,8 @@ EcSpaceHandler(UINT32 Function, ACPI_PHY > * we call it directly here since our thread taskq is not active yet. > */ > if (cold || rebooting || sc->ec_suspending) { > - if ((EC_GET_CSR(sc) & EC_EVENT_SCI)) { > + if ((EC_GET_CSR(sc) & EC_EVENT_SCI) && > + atomic_fetchadd_int(&sc->ec_sci_pend, 1) == 0) { > CTR0(KTR_ACPI, "ec running gpe handler directly"); > EcGpeQueryHandler(sc); > } > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" --f46d0421a85915aa600542c6ae3f Content-Type: application/octet-stream; name="sysctl.lockup" Content-Disposition: attachment; filename="sysctl.lockup" Content-Transfer-Encoding: base64 X-Attachment-Id: f_iw9nn1fp0 cHJvY3N0YXQgLWsKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KICBQSUQgICAgVElEIENPTU0gICAg ICAgICAgICAgVEROQU1FICAgICAgICAgICBLU1RBQ0sgICAgICAgICAgICAgICAgICAgICAgIAo0 NzUzNiAxMDAxNDIgc3lzY3RsICAgICAgICAgICAtICAgICAgICAgICAgICAgIG1pX3N3aXRjaCBz bGVlcHFfc3dpdGNoIHNsZWVwcV9jYXRjaF9zaWduYWxzIHNsZWVwcV93YWl0X3NpZyBfc2xlZXAg QWNwaU9zQWNxdWlyZU11dGV4IEFjcGlVdEFjcXVpcmVNdXRleCBBY3BpRXhFbnRlckludGVycHJl dGVyIEFjcGlOc0V2YWx1YXRlIEFjcGlVdEV2YWx1YXRlT2JqZWN0IEFjcGlVdEV4ZWN1dGVfSElE IEFjcGlHZXRPYmplY3RJbmZvIGFjcGlfY2hpbGRfcG5waW5mb19zdHJfbWV0aG9kIGRldmljZV9z eXNjdGxfaGFuZGxlciBzeXNjdGxfcm9vdCB1c2VybGFuZF9zeXNjdGwgc3lzX19fc3lzY3RsIGFt ZDY0X3N5c2NhbGwgCgpwcm9jc3RhdCAta2sKCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tClBJRCAg ICBUSUQgQ09NTSAgICAgICAgICAgICBURE5BTUUgICAgICAgICAgIEtTVEFDSyAgICAgICAgICAg ICAgICAgICAgICAgCjQ3NTM2IDEwMDE0MiBzeXNjdGwgICAgICAgICAgIC0gICAgICAgICAgICAg ICAgbWlfc3dpdGNoKzB4MTU5IHNsZWVwcV9zd2l0Y2grMHgxMmUgc2xlZXBxX2NhdGNoX3NpZ25h bHMrMHgyZGMgc2xlZXBxX3dhaXRfc2lnKzB4ZiBfc2xlZXArMHgzMTkgQWNwaU9zQWNxdWlyZU11 dGV4KzB4MTU1IEFjcGlVdEFjcXVpcmVNdXRleCsweDNhIEFjcGlFeEVudGVySW50ZXJwcmV0ZXIr MHhiIEFjcGlOc0V2YWx1YXRlKzB4MWNiIEFjcGlVdEV2YWx1YXRlT2JqZWN0KzB4NGMgQWNwaVV0 RXhlY3V0ZV9ISUQrMHgyNyBBY3BpR2V0T2JqZWN0SW5mbysweGRlIGFjcGlfY2hpbGRfcG5waW5m b19zdHJfbWV0aG9kKzB4MjQgZGV2aWNlX3N5c2N0bF9oYW5kbGVyKzB4MTFiIHN5c2N0bF9yb290 KzB4MWQ5IHVzZXJsYW5kX3N5c2N0bCsweDE5MiBzeXNfX19zeXNjdGwrMHg3NCBhbWQ2NF9zeXNj YWxsKzB4Mjk4IAoKcGNpY29uZgotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQpob3N0YjBAcGNpMDow OjA6MDoJY2xhc3M9MHgwNjAwMDAgY2FyZD0weDUwMDAxNDU4IGNoaXA9MHgxOTFmODA4NiByZXY9 MHgwNyBoZHI9MHgwMAogICAgdmVuZG9yICAgICA9ICdJbnRlbCBDb3Jwb3JhdGlvbicKICAgIGRl dmljZSAgICAgPSAnU2t5bGFrZSBIb3N0IEJyaWRnZS9EUkFNIFJlZ2lzdGVycycKICAgIGNsYXNz ICAgICAgPSBicmlkZ2UKICAgIHN1YmNsYXNzICAgPSBIT1NULVBDSQpwY2liMUBwY2kwOjA6MTow OgljbGFzcz0weDA2MDQwMCBjYXJkPTB4NTAwMDE0NTggY2hpcD0weDE5MDE4MDg2IHJldj0weDA3 IGhkcj0weDAxCiAgICB2ZW5kb3IgICAgID0gJ0ludGVsIENvcnBvcmF0aW9uJwogICAgZGV2aWNl ICAgICA9ICdTa3lsYWtlIFBDSWUgQ29udHJvbGxlciAoeDE2KScKICAgIGNsYXNzICAgICAgPSBi cmlkZ2UKICAgIHN1YmNsYXNzICAgPSBQQ0ktUENJCnhoY2kwQHBjaTA6MDoyMDowOgljbGFzcz0w eDBjMDMzMCBjYXJkPTB4NTAwNzE0NTggY2hpcD0weGExMmY4MDg2IHJldj0weDMxIGhkcj0weDAw CiAgICB2ZW5kb3IgICAgID0gJ0ludGVsIENvcnBvcmF0aW9uJwogICAgZGV2aWNlICAgICA9ICdT dW5yaXNlIFBvaW50LUggVVNCIDMuMCB4SENJIENvbnRyb2xsZXInCiAgICBjbGFzcyAgICAgID0g c2VyaWFsIGJ1cwogICAgc3ViY2xhc3MgICA9IFVTQgpub25lMEBwY2kwOjA6MjI6MDoJY2xhc3M9 MHgwNzgwMDAgY2FyZD0weDFjM2ExNDU4IGNoaXA9MHhhMTNhODA4NiByZXY9MHgzMSBoZHI9MHgw MAogICAgdmVuZG9yICAgICA9ICdJbnRlbCBDb3Jwb3JhdGlvbicKICAgIGRldmljZSAgICAgPSAn U3VucmlzZSBQb2ludC1IIENTTUUgSEVDSScKICAgIGNsYXNzICAgICAgPSBzaW1wbGUgY29tbXMK YWhjaTBAcGNpMDowOjIzOjA6CWNsYXNzPTB4MDEwNjAxIGNhcmQ9MHhiMDA1MTQ1OCBjaGlwPTB4 YTEwMjgwODYgcmV2PTB4MzEgaGRyPTB4MDAKICAgIHZlbmRvciAgICAgPSAnSW50ZWwgQ29ycG9y YXRpb24nCiAgICBkZXZpY2UgICAgID0gJ1N1bnJpc2UgUG9pbnQtSCBTQVRBIGNvbnRyb2xsZXIg W0FIQ0kgbW9kZV0nCiAgICBjbGFzcyAgICAgID0gbWFzcyBzdG9yYWdlCiAgICBzdWJjbGFzcyAg ID0gU0FUQQpwY2liMkBwY2kwOjA6Mjc6MDoJY2xhc3M9MHgwNjA0MDAgY2FyZD0weDUwMDExNDU4 IGNoaXA9MHhhMTY5ODA4NiByZXY9MHhmMSBoZHI9MHgwMQogICAgdmVuZG9yICAgICA9ICdJbnRl bCBDb3Jwb3JhdGlvbicKICAgIGRldmljZSAgICAgPSAnU3VucmlzZSBQb2ludC1IIFBDSSBSb290 IFBvcnQnCiAgICBjbGFzcyAgICAgID0gYnJpZGdlCiAgICBzdWJjbGFzcyAgID0gUENJLVBDSQpw Y2liM0BwY2kwOjA6Mjc6MzoJY2xhc3M9MHgwNjA0MDAgY2FyZD0weDUwMDExNDU4IGNoaXA9MHhh MTZhODA4NiByZXY9MHhmMSBoZHI9MHgwMQogICAgdmVuZG9yICAgICA9ICdJbnRlbCBDb3Jwb3Jh dGlvbicKICAgIGRldmljZSAgICAgPSAnU3VucmlzZSBQb2ludC1IIFBDSSBSb290IFBvcnQnCiAg ICBjbGFzcyAgICAgID0gYnJpZGdlCiAgICBzdWJjbGFzcyAgID0gUENJLVBDSQpwY2liNEBwY2kw OjA6Mjg6MDoJY2xhc3M9MHgwNjA0MDAgY2FyZD0weDUwMDExNDU4IGNoaXA9MHhhMTEyODA4NiBy ZXY9MHhmMSBoZHI9MHgwMQogICAgdmVuZG9yICAgICA9ICdJbnRlbCBDb3Jwb3JhdGlvbicKICAg IGRldmljZSAgICAgPSAnU3VucmlzZSBQb2ludC1IIFBDSSBFeHByZXNzIFJvb3QgUG9ydCcKICAg IGNsYXNzICAgICAgPSBicmlkZ2UKICAgIHN1YmNsYXNzICAgPSBQQ0ktUENJCnBjaWI1QHBjaTA6 MDoyODo0OgljbGFzcz0weDA2MDQwMCBjYXJkPTB4NTAwMTE0NTggY2hpcD0weGExMTQ4MDg2IHJl dj0weGYxIGhkcj0weDAxCiAgICB2ZW5kb3IgICAgID0gJ0ludGVsIENvcnBvcmF0aW9uJwogICAg ZGV2aWNlICAgICA9ICdTdW5yaXNlIFBvaW50LUggUENJIEV4cHJlc3MgUm9vdCBQb3J0JwogICAg Y2xhc3MgICAgICA9IGJyaWRnZQogICAgc3ViY2xhc3MgICA9IFBDSS1QQ0kKcGNpYjZAcGNpMDow OjI4OjU6CWNsYXNzPTB4MDYwNDAwIGNhcmQ9MHg1MDAxMTQ1OCBjaGlwPTB4YTExNTgwODYgcmV2 PTB4ZjEgaGRyPTB4MDEKICAgIHZlbmRvciAgICAgPSAnSW50ZWwgQ29ycG9yYXRpb24nCiAgICBk ZXZpY2UgICAgID0gJ1N1bnJpc2UgUG9pbnQtSCBQQ0kgRXhwcmVzcyBSb290IFBvcnQnCiAgICBj bGFzcyAgICAgID0gYnJpZGdlCiAgICBzdWJjbGFzcyAgID0gUENJLVBDSQpwY2liN0BwY2kwOjA6 Mjg6NjoJY2xhc3M9MHgwNjA0MDAgY2FyZD0weDUwMDExNDU4IGNoaXA9MHhhMTE2ODA4NiByZXY9 MHhmMSBoZHI9MHgwMQogICAgdmVuZG9yICAgICA9ICdJbnRlbCBDb3Jwb3JhdGlvbicKICAgIGRl dmljZSAgICAgPSAnU3VucmlzZSBQb2ludC1IIFBDSSBFeHByZXNzIFJvb3QgUG9ydCcKICAgIGNs YXNzICAgICAgPSBicmlkZ2UKICAgIHN1YmNsYXNzICAgPSBQQ0ktUENJCnBjaWI4QHBjaTA6MDoy ODo3OgljbGFzcz0weDA2MDQwMCBjYXJkPTB4NTAwMTE0NTggY2hpcD0weGExMTc4MDg2IHJldj0w eGYxIGhkcj0weDAxCiAgICB2ZW5kb3IgICAgID0gJ0ludGVsIENvcnBvcmF0aW9uJwogICAgZGV2 aWNlICAgICA9ICdTdW5yaXNlIFBvaW50LUggUENJIEV4cHJlc3MgUm9vdCBQb3J0JwogICAgY2xh c3MgICAgICA9IGJyaWRnZQogICAgc3ViY2xhc3MgICA9IFBDSS1QQ0kKcGNpYjlAcGNpMDowOjI5 OjA6CWNsYXNzPTB4MDYwNDAwIGNhcmQ9MHg1MDAxMTQ1OCBjaGlwPTB4YTExODgwODYgcmV2PTB4 ZjEgaGRyPTB4MDEKICAgIHZlbmRvciAgICAgPSAnSW50ZWwgQ29ycG9yYXRpb24nCiAgICBkZXZp Y2UgICAgID0gJ1N1bnJpc2UgUG9pbnQtSCBQQ0kgRXhwcmVzcyBSb290IFBvcnQnCiAgICBjbGFz cyAgICAgID0gYnJpZGdlCiAgICBzdWJjbGFzcyAgID0gUENJLVBDSQppc2FiMEBwY2kwOjA6MzE6 MDoJY2xhc3M9MHgwNjAxMDAgY2FyZD0weDUwMDExNDU4IGNoaXA9MHhhMTQ0ODA4NiByZXY9MHgz MSBoZHI9MHgwMAogICAgdmVuZG9yICAgICA9ICdJbnRlbCBDb3Jwb3JhdGlvbicKICAgIGRldmlj ZSAgICAgPSAnU3VucmlzZSBQb2ludC1IIExQQyBDb250cm9sbGVyJwogICAgY2xhc3MgICAgICA9 IGJyaWRnZQogICAgc3ViY2xhc3MgICA9IFBDSS1JU0EKbm9uZTFAcGNpMDowOjMxOjI6CWNsYXNz PTB4MDU4MDAwIGNhcmQ9MHg1MDAxMTQ1OCBjaGlwPTB4YTEyMTgwODYgcmV2PTB4MzEgaGRyPTB4 MDAKICAgIHZlbmRvciAgICAgPSAnSW50ZWwgQ29ycG9yYXRpb24nCiAgICBkZXZpY2UgICAgID0g J1N1bnJpc2UgUG9pbnQtSCBQTUMnCiAgICBjbGFzcyAgICAgID0gbWVtb3J5CmhkYWMxQHBjaTA6 MDozMTozOgljbGFzcz0weDA0MDMwMCBjYXJkPTB4YTE4MjE0NTggY2hpcD0weGExNzA4MDg2IHJl dj0weDMxIGhkcj0weDAwCiAgICB2ZW5kb3IgICAgID0gJ0ludGVsIENvcnBvcmF0aW9uJwogICAg ZGV2aWNlICAgICA9ICdTdW5yaXNlIFBvaW50LUggSEQgQXVkaW8nCiAgICBjbGFzcyAgICAgID0g bXVsdGltZWRpYQogICAgc3ViY2xhc3MgICA9IEhEQQpub25lMkBwY2kwOjA6MzE6NDoJY2xhc3M9 MHgwYzA1MDAgY2FyZD0weDUwMDExNDU4IGNoaXA9MHhhMTIzODA4NiByZXY9MHgzMSBoZHI9MHgw MAogICAgdmVuZG9yICAgICA9ICdJbnRlbCBDb3Jwb3JhdGlvbicKICAgIGRldmljZSAgICAgPSAn U3VucmlzZSBQb2ludC1IIFNNQnVzJwogICAgY2xhc3MgICAgICA9IHNlcmlhbCBidXMKICAgIHN1 YmNsYXNzICAgPSBTTUJ1cwplbTBAcGNpMDowOjMxOjY6CWNsYXNzPTB4MDIwMDAwIGNhcmQ9MHhl MDAwMTQ1OCBjaGlwPTB4MTViODgwODYgcmV2PTB4MzEgaGRyPTB4MDAKICAgIHZlbmRvciAgICAg PSAnSW50ZWwgQ29ycG9yYXRpb24nCiAgICBkZXZpY2UgICAgID0gJ0V0aGVybmV0IENvbm5lY3Rp b24gKDIpIEkyMTktVicKICAgIGNsYXNzICAgICAgPSBuZXR3b3JrCiAgICBzdWJjbGFzcyAgID0g ZXRoZXJuZXQKdmdhcGNpMEBwY2kwOjE6MDowOgljbGFzcz0weDAzMDAwMCBjYXJkPTB4ZTE2NDE3 NGIgY2hpcD0weDY4ZjkxMDAyIHJldj0weDAwIGhkcj0weDAwCiAgICB2ZW5kb3IgICAgID0gJ0Fk dmFuY2VkIE1pY3JvIERldmljZXMsIEluYy4gW0FNRC9BVEldJwogICAgZGV2aWNlICAgICA9ICdD ZWRhciBbUmFkZW9uIEhEIDUwMDAvNjAwMC83MzUwLzgzNTAgU2VyaWVzXScKICAgIGNsYXNzICAg ICAgPSBkaXNwbGF5CiAgICBzdWJjbGFzcyAgID0gVkdBCmhkYWMwQHBjaTA6MTowOjE6CWNsYXNz PTB4MDQwMzAwIGNhcmQ9MHhhYTY4MTc0YiBjaGlwPTB4YWE2ODEwMDIgcmV2PTB4MDAgaGRyPTB4 MDAKICAgIHZlbmRvciAgICAgPSAnQWR2YW5jZWQgTWljcm8gRGV2aWNlcywgSW5jLiBbQU1EL0FU SV0nCiAgICBkZXZpY2UgICAgID0gJ0NlZGFyIEhETUkgQXVkaW8gW1JhZGVvbiBIRCA1NDAwLzYz MDAvNzMwMCBTZXJpZXNdJwogICAgY2xhc3MgICAgICA9IG11bHRpbWVkaWEKICAgIHN1YmNsYXNz ICAgPSBIREEKaWdiMEBwY2kwOjU6MDowOgljbGFzcz0weDAyMDAwMCBjYXJkPTB4ZTAwMDE0NTgg Y2hpcD0weDE1Mzk4MDg2IHJldj0weDAzIGhkcj0weDAwCiAgICB2ZW5kb3IgICAgID0gJ0ludGVs IENvcnBvcmF0aW9uJwogICAgZGV2aWNlICAgICA9ICdJMjExIEdpZ2FiaXQgTmV0d29yayBDb25u ZWN0aW9uJwogICAgY2xhc3MgICAgICA9IG5ldHdvcmsKICAgIHN1YmNsYXNzICAgPSBldGhlcm5l dApub25lM0BwY2kwOjY6MDowOgljbGFzcz0weDAyODAwMCBjYXJkPTB4MDAxMDgwODYgY2hpcD0w eDI0ZjM4MDg2IHJldj0weDNhIGhkcj0weDAwCiAgICB2ZW5kb3IgICAgID0gJ0ludGVsIENvcnBv cmF0aW9uJwogICAgZGV2aWNlICAgICA9ICdXaXJlbGVzcyA4MjYwJwogICAgY2xhc3MgICAgICA9 IG5ldHdvcmsKCmRtZXNnCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCgpbMV0gQ1BVOiBJbnRlbChS KSBDb3JlKFRNKSBpNy02NzAwIENQVSBAIDMuNDBHSHogKDM0MDguMTMtTUh6IEs4LWNsYXNzIENQ VSkKWzFdICAgT3JpZ2luPSJHZW51aW5lSW50ZWwiICBJZD0weDUwNmUzICBGYW1pbHk9MHg2ICBN b2RlbD0weDVlICBTdGVwcGluZz0zClsxXSAgIEZlYXR1cmVzPTB4YmZlYmZiZmY8RlBVLFZNRSxE RSxQU0UsVFNDLE1TUixQQUUsTUNFLENYOCxBUElDLFNFUCxNVFJSLFBHRSxNQ0EsQ01PVixQQVQs UFNFMzYsQ0xGTFVTSCxEVFMsQUNQSSxNTVgsRlhTUixTU0UsU1NFMixTUyxIVFQsVE0sUEJFPgpb MV0gICBGZWF0dXJlczI9MHg3ZmZhZmJmZjxTU0UzLFBDTE1VTFFEUSxEVEVTNjQsTU9OLERTX0NQ TCxWTVgsU01YLEVTVCxUTTIsU1NTRTMsU0RCRyxGTUEsQ1gxNix4VFBSLFBEQ00sUENJRCxTU0U0 LjEsU1NFNC4yLHgyQVBJQyxNT1ZCRSxQT1BDTlQsVFNDRExULEFFU05JLFhTQVZFLE9TWFNBVkUs QVZYLEYxNkMsUkRSQU5EPgpbMV0gICBBTUQgRmVhdHVyZXM9MHgyYzEwMDgwMDxTWVNDQUxMLE5Y LFBhZ2UxR0IsUkRUU0NQLExNPgpbMV0gICBBTUQgRmVhdHVyZXMyPTB4MTIxPExBSEYsQUJNLFBy ZWZldGNoPgpbMV0gICBTdHJ1Y3R1cmVkIEV4dGVuZGVkIEZlYXR1cmVzPTB4MjljNmZiZjxGU0dT QkFTRSxUU0NBREosU0dYLEJNSTEsSExFLEFWWDIsU01FUCxCTUkyLEVSTVMsSU5WUENJRCxSVE0s TkZQVVNHLE1QWCxSRFNFRUQsQURYLFNNQVAsQ0xGTFVTSE9QVCxQUk9DVFJBQ0U+ClsxXSAgIFhT QVZFIEZlYXR1cmVzPTB4ZjxYU0FWRU9QVCxYU0FWRUMsWElOVVNFLFhTQVZFUz4KWzFdICAgVlQt eDogUEFULEhMVCxNVEYsUEFVU0UsRVBULFVHLFZQSUQKWzFdICAgVFNDOiBQLXN0YXRlIGludmFy aWFudCwgcGVyZm9ybWFuY2Ugc3RhdGlzdGljcwpbMV0gcmVhbCBtZW1vcnkgID0gMTcxNzk4Njkx ODQgKDE2Mzg0IE1CKQpbMV0gYXZhaWwgbWVtb3J5ID0gMTY1MzU5ODIwODAgKDE1NzY5IE1CKQpb MV0gRXZlbnQgdGltZXIgIkxBUElDIiBxdWFsaXR5IDYwMApbMV0gQUNQSSBBUElDIFRhYmxlOiA8 QUxBU0tBIEEgTSBJID4KWzFdIEZyZWVCU0QvU01QOiBNdWx0aXByb2Nlc3NvciBTeXN0ZW0gRGV0 ZWN0ZWQ6IDggQ1BVcwpbMV0gRnJlZUJTRC9TTVA6IDEgcGFja2FnZShzKSB4IDQgY29yZShzKSB4 IDIgU01UIHRocmVhZHMKWzFdICBjcHUwIChCU1ApOiBBUElDIElEOiAgMApbMV0gIGNwdTEgKEFQ KTogQVBJQyBJRDogIDEKWzFdICBjcHUyIChBUCk6IEFQSUMgSUQ6ICAyClsxXSAgY3B1MyAoQVAp OiBBUElDIElEOiAgMwpbMV0gIGNwdTQgKEFQKTogQVBJQyBJRDogIDQKWzFdICBjcHU1IChBUCk6 IEFQSUMgSUQ6ICA1ClsxXSAgY3B1NiAoQVApOiBBUElDIElEOiAgNgpbMV0gIGNwdTcgKEFQKTog QVBJQyBJRDogIDcKCi4uLgoKWzFdIGFjcGkwOiA8QUxBU0tBIEEgTSBJID4gb24gbW90aGVyYm9h cmQKWzFdIGFjcGkwOiBQb3dlciBCdXR0b24gKGZpeGVkKQpbMV0gY3B1MDogPEFDUEkgQ1BVPiBv biBhY3BpMApbMV0gQUNQSSBFcnJvcjogTXV0ZXggWzB4MF0gaXMgbm90IGFjcXVpcmVkLCBjYW5u b3QgcmVsZWFzZSAoMjAxNjA1MjcvdXRtdXRleC0zODYpClsxXSBBQ1BJIEVycm9yOiBDb3VsZCBu b3QgcmVsZWFzZSBBTUwgSW50ZXJwcmV0ZXIgbXV0ZXggKDIwMTYwNTI3L2V4dXRpbHMtMTQ3KQpb MV0gQUNQSSBFcnJvcjogTXV0ZXggWzB4MF0gaXMgbm90IGFjcXVpcmVkLCBjYW5ub3QgcmVsZWFz ZSAoMjAxNjA1MjcvdXRtdXRleC0zODYpClsxXSBBQ1BJIEVycm9yOiBDb3VsZCBub3QgcmVsZWFz ZSBBTUwgSW50ZXJwcmV0ZXIgbXV0ZXggKDIwMTYwNTI3L2V4dXRpbHMtMTQ3KQpbMV0gY3B1MTog PEFDUEkgQ1BVPiBvbiBhY3BpMApbMV0gQUNQSSBFcnJvcjogTXV0ZXggWzB4MF0gaXMgbm90IGFj cXVpcmVkLCBjYW5ub3QgcmVsZWFzZSAoMjAxNjA1MjcvdXRtdXRleC0zODYpClsxXSBBQ1BJIEVy cm9yOiBDb3VsZCBub3QgcmVsZWFzZSBBTUwgSW50ZXJwcmV0ZXIgbXV0ZXggKDIwMTYwNTI3L2V4 dXRpbHMtMTQ3KQpbMV0gQUNQSSBFcnJvcjogTXV0ZXggWzB4MF0gaXMgbm90IGFjcXVpcmVkLCBj YW5ub3QgcmVsZWFzZSAoMjAxNjA1MjcvdXRtdXRleC0zODYpClsxXSBBQ1BJIEVycm9yOiBDb3Vs ZCBub3QgcmVsZWFzZSBBTUwgSW50ZXJwcmV0ZXIgbXV0ZXggKDIwMTYwNTI3L2V4dXRpbHMtMTQ3 KQpbMV0gY3B1MjogPEFDUEkgQ1BVPiBvbiBhY3BpMApbMV0gY3B1MzogPEFDUEkgQ1BVPiBvbiBh Y3BpMApbMV0gY3B1NDogPEFDUEkgQ1BVPiBvbiBhY3BpMApbMV0gY3B1NTogPEFDUEkgQ1BVPiBv biBhY3BpMApbMV0gY3B1NjogPEFDUEkgQ1BVPiBvbiBhY3BpMApbMV0gY3B1NzogPEFDUEkgQ1BV PiBvbiBhY3BpMAoKa2VudgotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQpzbWJpb3MuYmlvcy5yZWxk YXRlPSIxMS8xMS8yMDE2IgpzbWJpb3MuYmlvcy52ZW5kb3I9IkFtZXJpY2FuIE1lZ2F0cmVuZHMg SW5jLiIKc21iaW9zLmJpb3MudmVyc2lvbj0iRjIwIgpzbWJpb3MuY2hhc3Npcy5tYWtlcj0iRGVm YXVsdCBzdHJpbmciCnNtYmlvcy5jaGFzc2lzLnNlcmlhbD0iRGVmYXVsdCBzdHJpbmciCnNtYmlv cy5jaGFzc2lzLnRhZz0iRGVmYXVsdCBzdHJpbmciCnNtYmlvcy5jaGFzc2lzLnZlcnNpb249IkRl ZmF1bHQgc3RyaW5nIgpzbWJpb3MubWVtb3J5LmVuYWJsZWQ9IjE2Nzc3MjE2IgpzbWJpb3MucGxh bmFyLmxvY2F0aW9uPSJEZWZhdWx0IHN0cmluZyIKc21iaW9zLnBsYW5hci5tYWtlcj0iR2lnYWJ5 dGUgVGVjaG5vbG9neSBDby4sIEx0ZC4iCnNtYmlvcy5wbGFuYXIucHJvZHVjdD0iSDE3ME4tV0lG SS1DRiIKc21iaW9zLnBsYW5hci5zZXJpYWw9IkRlZmF1bHQgc3RyaW5nIgpzbWJpb3MucGxhbmFy LnRhZz0iRGVmYXVsdCBzdHJpbmciCnNtYmlvcy5wbGFuYXIudmVyc2lvbj0ieC54IgpzbWJpb3Mu c29ja2V0LmVuYWJsZWQ9IjEiCnNtYmlvcy5zb2NrZXQucG9wdWxhdGVkPSIxIgpzbWJpb3Muc3lz dGVtLm1ha2VyPSJHaWdhYnl0ZSBUZWNobm9sb2d5IENvLiwgTHRkLiIKc21iaW9zLnN5c3RlbS5w cm9kdWN0PSJIMTcwTi1XSUZJIgpzbWJpb3Muc3lzdGVtLnNlcmlhbD0iRGVmYXVsdCBzdHJpbmci CnNtYmlvcy5zeXN0ZW0udXVpZD0iWFhYWFhYWFgtWFhYWC1YWFhYLVhYWFgtWFhYWFhYWFhYWFhY IgpzbWJpb3Muc3lzdGVtLnZlcnNpb249IkRlZmF1bHQgc3RyaW5nIgpzbWJpb3MudmVyc2lvbj0i My4wIgo= --f46d0421a85915aa600542c6ae3f-- From owner-svn-src-all@freebsd.org Sat Dec 3 20:30:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E57FC655D7; Sat, 3 Dec 2016 20:30:08 +0000 (UTC) (envelope-from peter@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 0479A1FD0; Sat, 3 Dec 2016 20:30:07 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB3KU7RE002282; Sat, 3 Dec 2016 20:30:07 GMT (envelope-from peter@FreeBSD.org) Received: (from peter@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3KU5PH002266; Sat, 3 Dec 2016 20:30:05 GMT (envelope-from peter@FreeBSD.org) Message-Id: <201612032030.uB3KU5PH002266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: peter set sender to peter@FreeBSD.org using -f From: Peter Wemm Date: Sat, 3 Dec 2016 20:30:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309511 - in stable/11/contrib/subversion: . subversion/include subversion/include/private subversion/libsvn_client subversion/libsvn_fs_fs subversion/libsvn_fs_x subversion/libsvn_ra_s... X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 20:30:08 -0000 Author: peter Date: Sat Dec 3 20:30:05 2016 New Revision: 309511 URL: https://svnweb.freebsd.org/changeset/base/309511 Log: MFC r309356: svn 1.9.4 -> 1.9.5 Modified: stable/11/contrib/subversion/CHANGES stable/11/contrib/subversion/README stable/11/contrib/subversion/build-outputs.mk stable/11/contrib/subversion/configure stable/11/contrib/subversion/configure.ac stable/11/contrib/subversion/get-deps.sh stable/11/contrib/subversion/subversion/include/private/svn_sqlite.h stable/11/contrib/subversion/subversion/include/svn_version.h stable/11/contrib/subversion/subversion/libsvn_client/merge.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/caching.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/fs.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/low_level.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/pack.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/pack.h stable/11/contrib/subversion/subversion/libsvn_fs_fs/rep-cache-db.h stable/11/contrib/subversion/subversion/libsvn_fs_fs/rep-cache.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/rep-cache.h stable/11/contrib/subversion/subversion/libsvn_fs_fs/transaction.c stable/11/contrib/subversion/subversion/libsvn_fs_fs/tree.c stable/11/contrib/subversion/subversion/libsvn_fs_x/rep-cache-db.h stable/11/contrib/subversion/subversion/libsvn_ra_serf/xml.c stable/11/contrib/subversion/subversion/libsvn_repos/reporter.c stable/11/contrib/subversion/subversion/libsvn_repos/repos.c stable/11/contrib/subversion/subversion/libsvn_subr/config_file.c stable/11/contrib/subversion/subversion/libsvn_subr/deprecated.c stable/11/contrib/subversion/subversion/libsvn_subr/gpg_agent.c stable/11/contrib/subversion/subversion/libsvn_subr/internal_statements.h stable/11/contrib/subversion/subversion/libsvn_subr/sqlite.c stable/11/contrib/subversion/subversion/libsvn_subr/sysinfo.c stable/11/contrib/subversion/subversion/libsvn_subr/win32_crashrpt.c stable/11/contrib/subversion/subversion/libsvn_subr/xml.c stable/11/contrib/subversion/subversion/libsvn_wc/conflicts.c stable/11/contrib/subversion/subversion/libsvn_wc/update_editor.c stable/11/contrib/subversion/subversion/libsvn_wc/wc-checks.h stable/11/contrib/subversion/subversion/libsvn_wc/wc-metadata.h stable/11/contrib/subversion/subversion/libsvn_wc/wc-queries.h stable/11/contrib/subversion/subversion/svn/info-cmd.c stable/11/contrib/subversion/subversion/svn/merge-cmd.c stable/11/contrib/subversion/subversion/svnserve/serve.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/subversion/CHANGES ============================================================================== --- stable/11/contrib/subversion/CHANGES Sat Dec 3 20:01:12 2016 (r309510) +++ stable/11/contrib/subversion/CHANGES Sat Dec 3 20:30:05 2016 (r309511) @@ -1,3 +1,54 @@ +Version 1.9.5 +(29 Nov 2016, from /branches/1.9.x) +http://svn.apache.org/repos/asf/subversion/tags/1.9.5 + + User-visible changes: + - Client-side bugfixes: + * fix accessing non-existent paths during reintegrate merge (r1766699 et al) + * fix handling of newly secured subdirectories in working copy (r1724448) + * info: remove trailing whitespace in --show-item=revision (issue #4660) + * fix recording wrong revisions for tree conflicts (r1734106) + * gpg-agent: improve discovery of gpg-agent sockets (r1766327) + * gpg-agent: fix file descriptor leak (r1766323) + * resolve: fix --accept=mine-full for binary files (issue #4647) + * merge: fix possible crash (issue #4652) + * resolve: fix possible crash (r1748514) + * fix potential crash in Win32 crash reporter (r1663253 et al) + + - Server-side bugfixes: + * fsfs: fix "offset too large" error during pack (issue #4657) + * svnserve: enable hook script environments (r1769152) + * fsfs: fix possible data reconstruction error (issue #4658) + * fix source of spurious 'incoming edit' tree conflicts (r1770108) + * fsfs: improve caching for large directories (r1721285) + * fsfs: fix crash when encountering all-zero checksums (r1759686) + * fsfs: fix potential source of repository corruptions (r1756266) + * mod_dav_svn: fix excessive memory usage with mod_headers/mod_deflate + (issue #3084) + * mod_dav_svn: reduce memory usage during GET requests (r1757529 et al) + * fsfs: fix unexpected "database is locked" errors (r1741096 et al) + * fsfs: fix opening old repositories without db/format files (r1720015) + + - Client-side and server-side bugfixes: + * fix possible crash when reading invalid configuration files (r1715777) + + - Bindings bugfixes: + * swig-pl: do not corrupt "{DATE}" revision variable (r1767768) + * javahl: fix temporary accepting SSL server certificates (r1764851) + * swig-pl: fix possible stack corruption (r1683266, r1683267) + + Developer-visible changes: + - General: + * add zlib discovery through pkg-config (issue #4655) + * fix potential build issue with invalid SVN_LOCALE_DIR (issue #4653) + * ruby: fix test failures with ruby >= 2.2 (r1766621) + * fix link error with --disable-keychain on OS X (r1765385) + * swig: enable building with SWIG >= 3.0.6 (r1721488 et al) + * swig: fix building with -Wdate-time in $CPPFLAGS (r1722164) + * update serf download URI in build scripts (r1700130 et al) + * raise minimal httpd version from 2.0 to 2.2 (r1754193) + + Version 1.9.4 (28 Apr 2016, from /branches/1.9.x) http://svn.apache.org/repos/asf/subversion/tags/1.9.4 @@ -14,6 +65,8 @@ http://svn.apache.org/repos/asf/subversi * ra_serf: fix deleting directories with many files (issue #4557) - Server-side bugfixes: + * mod_authz_svn: fix crash in COPY/MOVE authorization check (CVE-2016-2168) + * svnserve/sasl: fix authenticating users with wrong realm (CVE-2016-2167) * improve documentation for AuthzSVNGroupsFile and groups-db (r1730856) * fsfs: reduce peak memory usage when listing large directories (r1725180) * fsfs: fix a rare source of incomplete dump files and reports (r1717876) @@ -31,8 +84,7 @@ http://svn.apache.org/repos/asf/subversi * fix ruby test suite to work with test-unit gem (r1714790) * allow building against KDE4 without conflict with KDE5 (r1734926) * fix update_tests.py#76 with SVNPathAuthz short_circuit (r1736432) - * build system tweaks: - * tweak how symbolic error names in maintainer mode (r1735179) + * tweak getting symbolic error names in maintainer mode (r1735179) * fix inconsistent behavior of inherited property API (r1717874 et al) - API changes: @@ -882,12 +934,44 @@ http://svn.apache.org/repos/asf/subversi * javahl: allow compiling with a C++11 compiler (r1684412) +Version 1.8.17 +(29 Nov 2016, from /branches/1.8.x) +http://svn.apache.org/repos/asf/subversion/tags/1.8.17 + + User-visible changes: + - Client-side bugfixes: + * fix handling of newly secured subdirectories in working copy (r1724448) + * ra_serf: fix deleting directories with many files (issue #4557) + * svnlook: properly remove tempfiles on diff errors (r1711346) + * gpg-agent: properly handle passwords with percent characters (issue #4611) + * merge: fix crash when merging to a local add (r1702299 et al) + + - Server-side bugfixes: + * fsfs: fix possible data reconstruction error (issue #4658) + + - Client-side and server-side bugfixes: + * fix potential memory access bugs (r1722860 et al) + + - Bindings bugfixes: + * javahl: fix temporary accepting SSL server certificates (r1764851) + * swig-pl: do not corrupt "{DATE}" revision variable (r1767768) + * swig-pl: fix possible stack corruption (r1683266) + + Developer-visible changes: + - General: + * fix inconsistent behavior of inherited property API (r1717875, r1717878) + * fix patch filter invocation in svn_client_patch() (r1706783) + * fix potential build issue with invalid SVN_LOCALE_DIR (issue #4653) + + Version 1.8.16 (28 Apr 2016, from /branches/1.8.x) http://svn.apache.org/repos/asf/subversion/tags/1.8.16 User-visible changes: - Server-side bugfixes: + * mod_authz_svn: fix crash in COPY/MOVE authorization check (CVE-2016-2168) + * svnserve/sasl: fix authenticating users with wrong realm (CVE-2016-2167) * mod_authz_svn: fix authz with mod_auth_kerb/mod_auth_ntlm (issue #4602) * dump: don't write broken dump files in some ambiguously encoded fsfs repositories (issue #4554) @@ -1641,7 +1725,7 @@ http://svn.apache.org/repos/asf/subversi * fix bug in mergeinfo recording during foreign-repos merge (r1430310) * fix spurious merge conflicts for binary files with keywords (issue #4221) * fix patching symlinks with 'svn patch' (issue #4273) - * make 'svn switch' refresh lock information (issue #3376) + * make 'svn switch' refresh lock information (issue #3378) * fix 'svn diff' output doesn't apply as patch without fuzz (issue #3362) * fix mergeinfo recording for multiple-revision-range merge (issue #4306) * fix diffs shown by 'show-diff' conflict prompt option (r1438879) Modified: stable/11/contrib/subversion/README ============================================================================== --- stable/11/contrib/subversion/README Sat Dec 3 20:01:12 2016 (r309510) +++ stable/11/contrib/subversion/README Sat Dec 3 20:30:05 2016 (r309511) @@ -2,7 +2,7 @@ Subversion, a version control system. ===================================== -$LastChangedDate: 2012-02-10 14:58:53 +0000 (Fri, 10 Feb 2012) $ +$LastChangedDate: 2016-05-31 16:08:20 +0000 (Tue, 31 May 2016) $ Contents: @@ -36,10 +36,10 @@ II. DOCUMENTATION It is written in DocBook XML, and the sources can be found at: - http://svnbook.googlecode.com/svn/trunk/ + http://svn.code.sf.net/p/svnbook/source/trunk/ If you wish to build the documentation from source, read the - src/en/README file within the book source. + en/README file within the book source. Modified: stable/11/contrib/subversion/build-outputs.mk ============================================================================== --- stable/11/contrib/subversion/build-outputs.mk Sat Dec 3 20:01:12 2016 (r309510) +++ stable/11/contrib/subversion/build-outputs.mk Sat Dec 3 20:30:05 2016 (r309511) @@ -3351,7 +3351,7 @@ subversion/tests/libsvn_diff/diff-diff3- subversion/tests/libsvn_diff/parse-diff-test.lo: subversion/tests/libsvn_diff/parse-diff-test.c subversion/include/private/svn_debug.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_utf.h subversion/tests/svn_test.h -subversion/tests/libsvn_fs/fs-test.lo: subversion/tests/libsvn_fs/fs-test.c subversion/include/private/svn_debug.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_fs_util.h subversion/include/private/svn_fspath.h subversion/include/private/svn_mutex.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_time.h subversion/include/svn_types.h subversion/include/svn_version.h subversion/libsvn_delta/delta.h subversion/libsvn_fs/fs-loader.h subversion/s vn_private_config.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h +subversion/tests/libsvn_fs/fs-test.lo: subversion/tests/libsvn_fs/fs-test.c subversion/include/private/svn_debug.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_fs_util.h subversion/include/private/svn_fspath.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_time.h subversion/include/svn_types.h subversion/include/svn_version. h subversion/libsvn_delta/delta.h subversion/libsvn_fs/fs-loader.h subversion/svn_private_config.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h subversion/tests/libsvn_fs/locks-test.lo: subversion/tests/libsvn_fs/locks-test.c subversion/include/private/svn_debug.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h @@ -3363,7 +3363,7 @@ subversion/tests/libsvn_fs_base/strings- subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.lo: subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.c subversion/include/private/svn_atomic.h subversion/include/private/svn_cache.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_fs_private.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_string_private.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_iter.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_poo ls.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/libsvn_fs_fs/fs.h subversion/libsvn_fs_fs/fs_fs.h subversion/libsvn_fs_fs/id.h subversion/libsvn_fs_fs/rev_file.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h -subversion/tests/libsvn_fs_fs/fs-fs-pack-test.lo: subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c subversion/include/private/svn_atomic.h subversion/include/private/svn_cache.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_fs_private.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_string_private.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_iter.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools .h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/libsvn_fs/fs-loader.h subversion/libsvn_fs_fs/fs.h subversion/libsvn_fs_fs/fs_fs.h subversion/libsvn_fs_fs/id.h subversion/libsvn_fs_fs/low_level.h subversion/libsvn_fs_fs/util.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h +subversion/tests/libsvn_fs_fs/fs-fs-pack-test.lo: subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c subversion/include/private/svn_atomic.h subversion/include/private/svn_cache.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_fs_private.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_string_private.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_iter.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools .h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/libsvn_fs/fs-loader.h subversion/libsvn_fs_fs/fs.h subversion/libsvn_fs_fs/fs_fs.h subversion/libsvn_fs_fs/id.h subversion/libsvn_fs_fs/low_level.h subversion/libsvn_fs_fs/pack.h subversion/libsvn_fs_fs/util.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h subversion/tests/libsvn_fs_fs/fs-fs-private-test.lo: subversion/tests/libsvn_fs_fs/fs-fs-private-test.c subversion/include/private/svn_atomic.h subversion/include/private/svn_cache.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_fs_private.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_string_private.h subversion/include/private/svn_subr_private.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_iter.h subversion/include/svn_mergeinfo.h subver sion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/libsvn_fs_fs/fs.h subversion/libsvn_fs_fs/id.h subversion/libsvn_fs_fs/index.h subversion/libsvn_fs_fs/rev_file.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h Modified: stable/11/contrib/subversion/configure ============================================================================== --- stable/11/contrib/subversion/configure Sat Dec 3 20:01:12 2016 (r309510) +++ stable/11/contrib/subversion/configure Sat Dec 3 20:30:05 2016 (r309511) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for subversion 1.9.4. +# Generated by GNU Autoconf 2.69 for subversion 1.9.5. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='subversion' PACKAGE_TARNAME='subversion' -PACKAGE_VERSION='1.9.4' -PACKAGE_STRING='subversion 1.9.4' +PACKAGE_VERSION='1.9.5' +PACKAGE_STRING='subversion 1.9.5' PACKAGE_BUGREPORT='http://subversion.apache.org/' PACKAGE_URL='' @@ -1471,7 +1471,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures subversion 1.9.4 to adapt to many kinds of systems. +\`configure' configures subversion 1.9.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1537,7 +1537,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of subversion 1.9.4:";; + short | recursive ) echo "Configuration of subversion 1.9.5:";; esac cat <<\_ACEOF @@ -1751,7 +1751,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -subversion configure 1.9.4 +subversion configure 1.9.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2295,7 +2295,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by subversion $as_me 1.9.4, which was +It was created by subversion $as_me 1.9.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2675,8 +2675,8 @@ ac_configure="$SHELL $ac_aux_dir/configu -{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring Subversion 1.9.4" >&5 -$as_echo "$as_me: Configuring Subversion 1.9.4" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring Subversion 1.9.5" >&5 +$as_echo "$as_me: Configuring Subversion 1.9.5" >&6;} abs_srcdir="`cd $srcdir && pwd`" @@ -7422,7 +7422,10 @@ _ACEOF localedir='${datadir}/locale' -if test "${datadir}" = '${prefix}/share' && test "${prefix}" = "NONE"; then +if test "${prefix}" = "NONE" \ + && ( test "${datadir}" = '${prefix}/share' \ + || ( test "${datadir}" = '${datarootdir}' \ + && test "${datarootdir}" = '${prefix}/share' ) ); then exp_localedir='${ac_default_prefix}/share/locale' else exp_localedir=$localedir @@ -22550,68 +22553,34 @@ fi zlib_found=no + zlib_skip=no # Check whether --with-zlib was given. if test "${with_zlib+set}" = set; then : withval=$with_zlib; - if test "$withval" = "yes" ; then - ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" -if test "x$ac_cv_header_zlib_h" = xyes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 -$as_echo_n "checking for inflate in -lz... " >&6; } -if ${ac_cv_lib_z_inflate+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lz $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + if test "$withval" = "yes"; then + zlib_skip=no + elif test "$withval" = "no"; then + zlib_skip=yes + else + zlib_skip=no + zlib_prefix="$withval" + fi -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char inflate (); -int -main () -{ -return inflate (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_z_inflate=yes -else - ac_cv_lib_z_inflate=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5 -$as_echo "$ac_cv_lib_z_inflate" >&6; } -if test "x$ac_cv_lib_z_inflate" = xyes; then : - zlib_found="builtin" fi -fi - + if test "$zlib_skip" = "yes"; then + as_fn_error $? "subversion requires zlib" "$LINENO" 5 + fi - elif test "$withval" = "no" ; then - as_fn_error $? "cannot compile without zlib." "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: zlib library configuration" >&5 -$as_echo "$as_me: zlib library configuration" >&6;} - zlib_prefix=$withval - save_cppflags="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I$zlib_prefix/include" - for ac_header in zlib.h + if test -n "$zlib_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: zlib library configuration via prefix" >&5 +$as_echo "$as_me: zlib library configuration via prefix" >&6;} + save_cppflags="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -I$zlib_prefix/include" + for ac_header in zlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" if test "x$ac_cv_header_zlib_h" = xyes; then : @@ -22619,9 +22588,9 @@ if test "x$ac_cv_header_zlib_h" = xyes; #define HAVE_ZLIB_H 1 _ACEOF - save_ldflags="$LDFLAGS" - LDFLAGS="$LDFLAGS -L$zlib_prefix/lib" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 + save_ldflags="$LDFLAGS" + LDFLAGS="$LDFLAGS -L$zlib_prefix/lib" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 $as_echo_n "checking for inflate in -lz... " >&6; } if ${ac_cv_lib_z_inflate+:} false; then : $as_echo_n "(cached) " >&6 @@ -22658,24 +22627,86 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5 $as_echo "$ac_cv_lib_z_inflate" >&6; } if test "x$ac_cv_lib_z_inflate" = xyes; then : - zlib_found="yes" + + zlib_found="yes" + SVN_ZLIB_INCLUDES="-I$zlib_prefix/include" + SVN_ZLIB_LIBS="` + input_flags="-L$zlib_prefix/lib" + output_flags="" + filtered_dirs="/lib /lib64 /usr/lib /usr/lib64" + for flag in $input_flags; do + filter="no" + for dir in $filtered_dirs; do + if test "$flag" = "-L$dir" || test "$flag" = "-L$dir/"; then + filter="yes" + break + fi + done + if test "$filter" = "no"; then + output_flags="$output_flags $flag" + fi + done + if test -n "$output_flags"; then + printf "%s" "${output_flags# }" + fi +` -lz" + fi - LDFLAGS="$save_ldflags" + LDFLAGS="$save_ldflags" fi done - CPPFLAGS="$save_cppflags" + CPPFLAGS="$save_cppflags" + else + + { $as_echo "$as_me:${as_lineno-$LINENO}: zlib library configuration via pkg-config" >&5 +$as_echo "$as_me: zlib library configuration via pkg-config" >&6;} + if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlib library" >&5 +$as_echo_n "checking for zlib library... " >&6; } + if $PKG_CONFIG zlib --exists; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + zlib_found=yes + SVN_ZLIB_INCLUDES=`$PKG_CONFIG zlib --cflags` + SVN_ZLIB_LIBS=`$PKG_CONFIG zlib --libs` + SVN_ZLIB_LIBS="` + input_flags="$SVN_ZLIB_LIBS" + output_flags="" + filtered_dirs="/lib /lib64 /usr/lib /usr/lib64" + for flag in $input_flags; do + filter="no" + for dir in $filtered_dirs; do + if test "$flag" = "-L$dir" || test "$flag" = "-L$dir/"; then + filter="yes" + break + fi + done + if test "$filter" = "no"; then + output_flags="$output_flags $flag" + fi + done + if test -n "$output_flags"; then + printf "%s" "${output_flags# }" + fi +`" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi -else - ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" + if test "$zlib_found" = "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: zlib library configuration" >&5 +$as_echo "$as_me: zlib library configuration" >&6;} + ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" if test "x$ac_cv_header_zlib_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 $as_echo_n "checking for inflate in -lz... " >&6; } if ${ac_cv_lib_z_inflate+:} false; then : $as_echo_n "(cached) " >&6 @@ -22712,46 +22743,22 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5 $as_echo "$ac_cv_lib_z_inflate" >&6; } if test "x$ac_cv_lib_z_inflate" = xyes; then : - zlib_found="builtin" -fi + zlib_found="builtin" + SVN_ZLIB_LIBS="-lz" fi - fi - if test "$zlib_found" = "no"; then - as_fn_error $? "subversion requires zlib" "$LINENO" 5 - fi - - if test "$zlib_found" = "yes"; then - SVN_ZLIB_INCLUDES="-I$zlib_prefix/include" - LDFLAGS="$LDFLAGS ` - input_flags="-L$zlib_prefix/lib" - output_flags="" - filtered_dirs="/lib /lib64 /usr/lib /usr/lib64" - for flag in $input_flags; do - filter="no" - for dir in $filtered_dirs; do - if test "$flag" = "-L$dir" || test "$flag" = "-L$dir/"; then - filter="yes" - break - fi - done - if test "$filter" = "no"; then - output_flags="$output_flags $flag" fi - done - if test -n "$output_flags"; then - printf "%s" "${output_flags# }" - fi -`" fi - SVN_ZLIB_LIBS="-lz" + if test "$zlib_found" = "no"; then + as_fn_error $? "subversion requires zlib" "$LINENO" 5 + fi @@ -23785,15 +23792,14 @@ $as_echo "$SWIG_VERSION_RAW" >&6; } # packages/rpm/redhat-7.x/subversion.spec # packages/rpm/rhel-3/subversion.spec # packages/rpm/rhel-4/subversion.spec - if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" && \ - test "$SWIG_VERSION" -lt "300000"; then + if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024"; then SWIG_SUITABLE=yes else SWIG_SUITABLE=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&5 $as_echo "$as_me: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&5 -$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24" >&5 +$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24" >&2;} fi fi @@ -24274,15 +24280,14 @@ $as_echo "$SWIG_VERSION_RAW" >&6; } # packages/rpm/redhat-7.x/subversion.spec # packages/rpm/rhel-3/subversion.spec # packages/rpm/rhel-4/subversion.spec - if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" && \ - test "$SWIG_VERSION" -lt "300000"; then + if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024"; then SWIG_SUITABLE=yes else SWIG_SUITABLE=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&5 $as_echo "$as_me: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&5 -$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24" >&5 +$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24" >&2;} fi fi @@ -24763,15 +24768,14 @@ $as_echo "$SWIG_VERSION_RAW" >&6; } # packages/rpm/redhat-7.x/subversion.spec # packages/rpm/rhel-3/subversion.spec # packages/rpm/rhel-4/subversion.spec - if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" && \ - test "$SWIG_VERSION" -lt "300000"; then + if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024"; then SWIG_SUITABLE=yes else SWIG_SUITABLE=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&5 $as_echo "$as_me: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&5 -$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24" >&5 +$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24" >&2;} fi fi @@ -25255,15 +25259,14 @@ $as_echo "$SWIG_VERSION_RAW" >&6; } # packages/rpm/redhat-7.x/subversion.spec # packages/rpm/rhel-3/subversion.spec # packages/rpm/rhel-4/subversion.spec - if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" && \ - test "$SWIG_VERSION" -lt "300000"; then + if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024"; then SWIG_SUITABLE=yes else SWIG_SUITABLE=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&5 $as_echo "$as_me: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&5 -$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24" >&5 +$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24" >&2;} fi fi @@ -26152,6 +26155,9 @@ SWIG_CPPFLAGS="$CPPFLAGS" SWIG_CPPFLAGS=`echo "$SWIG_CPPFLAGS" | $SED -e 's/-no-cpp-precomp //'` + SWIG_CPPFLAGS=`echo "$SWIG_CPPFLAGS" | $SED -e 's/-Wdate-time //'` + + cat >>confdefs.h <<_ACEOF @@ -26750,7 +26756,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by subversion $as_me 1.9.4, which was +This file was extended by subversion $as_me 1.9.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -26816,7 +26822,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -subversion config.status 1.9.4 +subversion config.status 1.9.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/11/contrib/subversion/configure.ac ============================================================================== --- stable/11/contrib/subversion/configure.ac Sat Dec 3 20:01:12 2016 (r309510) +++ stable/11/contrib/subversion/configure.ac Sat Dec 3 20:30:05 2016 (r309511) @@ -199,7 +199,10 @@ localedir='${datadir}/locale' AC_SUBST(localedir) dnl For SVN_LOCALE_DIR, we have to expand it to something. See SVN_BINDIR. -if test "${datadir}" = '${prefix}/share' && test "${prefix}" = "NONE"; then +if test "${prefix}" = "NONE" \ + && ( test "${datadir}" = '${prefix}/share' \ + || ( test "${datadir}" = '${datarootdir}' \ + && test "${datarootdir}" = '${prefix}/share' ) ); then exp_localedir='${ac_default_prefix}/share/locale' else exp_localedir=$localedir @@ -1504,6 +1507,7 @@ fi # Need to strip '-no-cpp-precomp' from CPPFLAGS for SWIG as well. SWIG_CPPFLAGS="$CPPFLAGS" SVN_STRIP_FLAG(SWIG_CPPFLAGS, [-no-cpp-precomp ]) +SVN_STRIP_FLAG(SWIG_CPPFLAGS, [-Wdate-time ]) AC_SUBST([SWIG_CPPFLAGS]) dnl Since this is used only on Unix-y systems, define the path separator as '/' Modified: stable/11/contrib/subversion/get-deps.sh ============================================================================== --- stable/11/contrib/subversion/get-deps.sh Sat Dec 3 20:01:12 2016 (r309510) +++ stable/11/contrib/subversion/get-deps.sh Sat Dec 3 20:30:05 2016 (r309511) @@ -89,7 +89,7 @@ get_serf() { test -d $BASEDIR/serf && return cd $TEMPDIR - $HTTP_FETCH http://serf.googlecode.com/svn/src_releases/$SERF.tar.bz2 + $HTTP_FETCH https://archive.apache.org/dist/serf/$SERF.tar.bz2 cd $BASEDIR bzip2 -dc $TEMPDIR/$SERF.tar.bz2 | tar -xf - Modified: stable/11/contrib/subversion/subversion/include/private/svn_sqlite.h ============================================================================== --- stable/11/contrib/subversion/subversion/include/private/svn_sqlite.h Sat Dec 3 20:01:12 2016 (r309510) +++ stable/11/contrib/subversion/subversion/include/private/svn_sqlite.h Sat Dec 3 20:30:05 2016 (r309511) @@ -555,6 +555,9 @@ svn_sqlite__hotcopy(const char *src_path const char *dst_path, apr_pool_t *scratch_pool); +/* Backported version of SVN_ERR_SQLITE_ROLLBACK_FAILED. */ +#define SVN_SQLITE__ERR_ROLLBACK_FAILED (SVN_ERR_MISC_CATEGORY_START + 44) + #ifdef __cplusplus } #endif /* __cplusplus */ Modified: stable/11/contrib/subversion/subversion/include/svn_version.h ============================================================================== --- stable/11/contrib/subversion/subversion/include/svn_version.h Sat Dec 3 20:01:12 2016 (r309510) +++ stable/11/contrib/subversion/subversion/include/svn_version.h Sat Dec 3 20:30:05 2016 (r309511) @@ -70,7 +70,7 @@ extern "C" { * * @since New in 1.1. */ -#define SVN_VER_PATCH 4 +#define SVN_VER_PATCH 5 /** @deprecated Provided for backward compatibility with the 1.0 API. */ @@ -93,7 +93,7 @@ extern "C" { * * Always change this at the same time as SVN_VER_NUMTAG. */ -#define SVN_VER_TAG " (r1740329)" +#define SVN_VER_TAG " (r1770682)" /** Number tag: a string describing the version. @@ -117,7 +117,7 @@ extern "C" { * file version. Its value remains 0 in the repository except in release * tags where it is the revision from which the tag was created. */ -#define SVN_VER_REVISION 1740329 +#define SVN_VER_REVISION 1770682 /* Version strings composed from the above definitions. */ Modified: stable/11/contrib/subversion/subversion/libsvn_client/merge.c ============================================================================== --- stable/11/contrib/subversion/subversion/libsvn_client/merge.c Sat Dec 3 20:01:12 2016 (r309510) +++ stable/11/contrib/subversion/subversion/libsvn_client/merge.c Sat Dec 3 20:30:05 2016 (r309511) @@ -1295,6 +1295,15 @@ record_skip(merge_cmd_baton_t *merge_b, return SVN_NO_ERROR; } +/* Forward declaration */ +static svn_client__merge_path_t * +find_nearest_ancestor_with_intersecting_ranges( + svn_revnum_t *start, + svn_revnum_t *end, + const apr_array_header_t *children_with_mergeinfo, + svn_boolean_t path_is_own_ancestor, + const char *local_abspath); + /* Record a tree conflict in the WC, unless this is a dry run or a record- * only merge, or if a tree conflict is already flagged for the VICTIM_PATH. * (The latter can happen if a merge-tracking-aware merge is doing multiple @@ -1366,11 +1375,45 @@ record_tree_conflict(merge_cmd_baton_t * reason = svn_wc_conflict_reason_moved_here; } - SVN_ERR(make_conflict_versions(&left, &right, local_abspath, - merge_left_node_kind, - merge_right_node_kind, - &merge_b->merge_source, merge_b->target, - result_pool, scratch_pool)); + if (HONOR_MERGEINFO(merge_b) && merge_b->merge_source.ancestral) + { + struct merge_source_t *source; + svn_client__pathrev_t *loc1; + svn_client__pathrev_t *loc2; + svn_merge_range_t range = + {SVN_INVALID_REVNUM, SVN_INVALID_REVNUM, TRUE}; + + /* We are honoring mergeinfo so do not blindly record + * a conflict describing the merge of + * SOURCE->LOC1->URL@SOURCE->LOC1->REV through + * SOURCE->LOC2->URL@SOURCE->LOC2->REV + * but figure out the actual revision range merged. */ + (void)find_nearest_ancestor_with_intersecting_ranges( + &(range.start), &(range.end), + merge_b->notify_begin.nodes_with_mergeinfo, + action != svn_wc_conflict_action_delete, + local_abspath); + loc1 = svn_client__pathrev_dup(merge_b->merge_source.loc1, + scratch_pool); + loc2 = svn_client__pathrev_dup(merge_b->merge_source.loc2, + scratch_pool); + loc1->rev = range.start; + loc2->rev = range.end; + source = merge_source_create(loc1, loc2, + merge_b->merge_source.ancestral, + scratch_pool); + SVN_ERR(make_conflict_versions(&left, &right, local_abspath, + merge_left_node_kind, + merge_right_node_kind, + source, merge_b->target, + result_pool, scratch_pool)); + } + else + SVN_ERR(make_conflict_versions(&left, &right, local_abspath, + merge_left_node_kind, + merge_right_node_kind, + &merge_b->merge_source, merge_b->target, + result_pool, scratch_pool)); /* Fix up delete of file, add of dir replacement (or other way around) */ if (existing_conflict != NULL && existing_conflict->src_left_version) @@ -10956,7 +10999,7 @@ find_unsynced_ranges(const svn_client__p potentially_unmerged_ranges->nelts - 1, svn_merge_range_t *))->end; log_find_operative_baton_t log_baton; - const char *old_session_url; + const char *old_session_url = NULL; svn_error_t *err; log_baton.merged_catalog = merged_catalog; @@ -10967,14 +11010,22 @@ find_unsynced_ranges(const svn_client__p = svn_client__pathrev_fspath(target_loc, scratch_pool); log_baton.result_pool = result_pool; - SVN_ERR(svn_client__ensure_ra_session_url( - &old_session_url, ra_session, target_loc->url, scratch_pool)); + /* Reparent the session to TARGET_LOC if this target location + * exists within the unmerged revision range. */ + if (target_loc->rev <= youngest_rev && target_loc->rev >= oldest_rev) + SVN_ERR(svn_client__ensure_ra_session_url( + &old_session_url, ra_session, target_loc->url, scratch_pool)); + err = get_log(ra_session, "", youngest_rev, oldest_rev, TRUE, /* discover_changed_paths */ log_find_operative_revs, &log_baton, scratch_pool); - SVN_ERR(svn_error_compose_create( - err, svn_ra_reparent(ra_session, old_session_url, scratch_pool))); + if (old_session_url) + err = svn_error_compose_create(err, + svn_ra_reparent(ra_session, + old_session_url, + scratch_pool)); + SVN_ERR(err); } return SVN_NO_ERROR; Modified: stable/11/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c ============================================================================== --- stable/11/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c Sat Dec 3 20:01:12 2016 (r309510) +++ stable/11/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c Sat Dec 3 20:30:05 2016 (r309511) @@ -1571,6 +1571,17 @@ read_plain_window(svn_stringbuf_t **nwin return SVN_NO_ERROR; } +/* Skip SIZE bytes from the PLAIN representation RS. */ +static svn_error_t * +skip_plain_window(rep_state_t *rs, + apr_size_t size) +{ + /* Update RS. */ + rs->current += (apr_off_t)size; + + return SVN_NO_ERROR; +} + /* Get the undeltified window that is a result of combining all deltas from the current desired representation identified in *RB with its base representation. Store the window in *RESULT. */ @@ -1628,9 +1639,18 @@ get_combined_window(svn_stringbuf_t **re Also note that we may have short-cut reading the delta chain -- in which case SRC_OPS is 0 and it might not be a PLAIN rep. */ source = buf; - if (source == NULL && rb->src_state != NULL && window->src_ops) - SVN_ERR(read_plain_window(&source, rb->src_state, window->sview_len, - pool, iterpool)); + if (source == NULL && rb->src_state != NULL) + { + /* Even if we don't need the source rep now, we still must keep + * its read offset in sync with what we might need for the next + * window. */ + if (window->src_ops) + SVN_ERR(read_plain_window(&source, rb->src_state, + window->sview_len, + pool, iterpool)); + else + SVN_ERR(skip_plain_window(rb->src_state, window->sview_len)); + } /* Combine this window with the current one. */ new_pool = svn_pool_create(rb->pool); Modified: stable/11/contrib/subversion/subversion/libsvn_fs_fs/caching.c ============================================================================== --- stable/11/contrib/subversion/subversion/libsvn_fs_fs/caching.c Sat Dec 3 20:01:12 2016 (r309510) +++ stable/11/contrib/subversion/subversion/libsvn_fs_fs/caching.c Sat Dec 3 20:30:05 2016 (r309511) @@ -430,7 +430,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f svn_fs_fs__deserialize_dir_entries, sizeof(pair_cache_key_t), apr_pstrcat(pool, prefix, "DIR", SVN_VA_NULL), - SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY, + SVN_CACHE__MEMBUFFER_HIGH_PRIORITY, fs, no_handler, fs->pool, pool)); @@ -806,7 +806,7 @@ svn_fs_fs__initialize_txn_caches(svn_fs_ APR_HASH_KEY_STRING, apr_pstrcat(pool, prefix, "TXNDIR", SVN_VA_NULL), - 0, + SVN_CACHE__MEMBUFFER_HIGH_PRIORITY, fs, TRUE, pool, pool)); Modified: stable/11/contrib/subversion/subversion/libsvn_fs_fs/fs.c ============================================================================== --- stable/11/contrib/subversion/subversion/libsvn_fs_fs/fs.c Sat Dec 3 20:01:12 2016 (r309510) +++ stable/11/contrib/subversion/subversion/libsvn_fs_fs/fs.c Sat Dec 3 20:30:05 2016 (r309511) @@ -452,7 +452,7 @@ fs_pack(svn_fs_t *fs, apr_pool_t *common_pool) { SVN_ERR(fs_open(fs, path, common_pool_lock, pool, common_pool)); - return svn_fs_fs__pack(fs, notify_func, notify_baton, + return svn_fs_fs__pack(fs, 0, notify_func, notify_baton, cancel_func, cancel_baton, pool); } Modified: stable/11/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c ============================================================================== --- stable/11/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c Sat Dec 3 20:01:12 2016 (r309510) +++ stable/11/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c Sat Dec 3 20:30:05 2016 (r309511) @@ -492,6 +492,7 @@ read_format(int *pformat, svn_error_clear(err); *pformat = 1; *max_files_per_dir = 0; + *use_log_addressing = FALSE; return SVN_NO_ERROR; } Modified: stable/11/contrib/subversion/subversion/libsvn_fs_fs/low_level.c ============================================================================== --- stable/11/contrib/subversion/subversion/libsvn_fs_fs/low_level.c Sat Dec 3 20:01:12 2016 (r309510) +++ stable/11/contrib/subversion/subversion/libsvn_fs_fs/low_level.c Sat Dec 3 20:30:05 2016 (r309511) @@ -764,7 +764,11 @@ svn_fs_fs__parse_representation(represen SVN_ERR(svn_checksum_parse_hex(&checksum, svn_checksum_md5, str, scratch_pool)); - memcpy(rep->md5_digest, checksum->digest, sizeof(rep->md5_digest)); + + /* If STR is a all-zero checksum, CHECKSUM will be NULL and REP already + contains the correct value. */ + if (checksum) + memcpy(rep->md5_digest, checksum->digest, sizeof(rep->md5_digest)); /* The remaining fields are only used for formats >= 4, so check that. */ str = svn_cstring_tokenize(" ", &string); @@ -778,8 +782,16 @@ svn_fs_fs__parse_representation(represen SVN_ERR(svn_checksum_parse_hex(&checksum, svn_checksum_sha1, str, scratch_pool)); + + /* We do have a valid SHA1 but it might be all 0. + We cannot be sure where that came from (Alas! legacy), so let's not + claim we know the SHA1 in that case. */ rep->has_sha1 = checksum != NULL; - memcpy(rep->sha1_digest, checksum->digest, sizeof(rep->sha1_digest)); + + /* If STR is a all-zero checksum, CHECKSUM will be NULL and REP already + contains the correct value. */ + if (checksum) + memcpy(rep->sha1_digest, checksum->digest, sizeof(rep->sha1_digest)); /* Read the uniquifier. */ str = svn_cstring_tokenize("/", &string); Modified: stable/11/contrib/subversion/subversion/libsvn_fs_fs/pack.c ============================================================================== --- stable/11/contrib/subversion/subversion/libsvn_fs_fs/pack.c Sat Dec 3 20:01:12 2016 (r309510) +++ stable/11/contrib/subversion/subversion/libsvn_fs_fs/pack.c Sat Dec 3 20:30:05 2016 (r309511) @@ -335,21 +335,40 @@ static svn_error_t * reset_pack_context(pack_context_t *context, apr_pool_t *pool) { + const char *temp_dir; + apr_array_clear(context->changes); - SVN_ERR(svn_io_file_trunc(context->changes_file, 0, pool)); + SVN_ERR(svn_io_file_close(context->changes_file, pool)); apr_array_clear(context->file_props); - SVN_ERR(svn_io_file_trunc(context->file_props_file, 0, pool)); + SVN_ERR(svn_io_file_close(context->file_props_file, pool)); apr_array_clear(context->dir_props); - SVN_ERR(svn_io_file_trunc(context->dir_props_file, 0, pool)); + SVN_ERR(svn_io_file_close(context->dir_props_file, pool)); apr_array_clear(context->rev_offsets); apr_array_clear(context->path_order); apr_array_clear(context->references); apr_array_clear(context->reps); - SVN_ERR(svn_io_file_trunc(context->reps_file, 0, pool)); + SVN_ERR(svn_io_file_close(context->reps_file, pool)); svn_pool_clear(context->info_pool); + /* The new temporary files must live at least as long as any other info + * object in CONTEXT. */ + SVN_ERR(svn_io_temp_dir(&temp_dir, pool)); + SVN_ERR(svn_io_open_unique_file3(&context->changes_file, NULL, temp_dir, + svn_io_file_del_on_close, + context->info_pool, pool)); + SVN_ERR(svn_io_open_unique_file3(&context->file_props_file, NULL, temp_dir, + svn_io_file_del_on_close, + context->info_pool, pool)); + SVN_ERR(svn_io_open_unique_file3(&context->dir_props_file, NULL, temp_dir, + svn_io_file_del_on_close, + context->info_pool, pool)); + SVN_ERR(svn_io_open_unique_file3(&context->reps_file, NULL, temp_dir, + svn_io_file_del_on_close, + context->info_pool, pool)); + context->paths = svn_prefix_tree__create(context->info_pool); + return SVN_NO_ERROR; } @@ -1410,21 +1429,20 @@ append_revision(pack_context_t *context, apr_off_t offset = 0; apr_pool_t *iterpool = svn_pool_create(pool); svn_fs_fs__revision_file_t *rev_file; - apr_finfo_t finfo; - - /* Get the size of the file. */ - const char *path = svn_dirent_join(context->shard_dir, - apr_psprintf(iterpool, "%ld", - context->start_rev), - pool); - SVN_ERR(svn_io_stat(&finfo, path, APR_FINFO_SIZE, pool)); + svn_filesize_t revdata_size; - /* Copy all the bits from the rev file to the end of the pack file. */ + /* Copy all non-index contents the rev file to the end of the pack file. */ SVN_ERR(svn_fs_fs__open_pack_or_rev_file(&rev_file, context->fs, context->start_rev, pool, iterpool)); + + SVN_ERR(svn_fs_fs__auto_read_footer(rev_file)); + revdata_size = rev_file->l2p_offset; + + SVN_ERR(svn_io_file_aligned_seek(rev_file->file, ffd->block_size, NULL, 0, + iterpool)); SVN_ERR(copy_file_data(context, context->pack_file, rev_file->file, - finfo.size, iterpool)); + revdata_size, iterpool)); /* mark the start of a new revision */ SVN_ERR(svn_fs_fs__l2p_proto_index_add_revision(context->proto_l2p_index, @@ -1432,7 +1450,7 @@ append_revision(pack_context_t *context, /* read the phys-to-log index file until we covered the whole rev file. * That index contains enough info to build both target indexes from it. */ - while (offset < finfo.size) + while (offset < revdata_size) { /* read one cluster */ int i; @@ -1456,7 +1474,7 @@ append_revision(pack_context_t *context, /* process entry while inside the rev file */ offset = entry->offset; - if (offset < finfo.size) + if (offset < revdata_size) { entry->offset += context->pack_offset; offset += entry->size; @@ -1470,7 +1488,7 @@ append_revision(pack_context_t *context, } svn_pool_destroy(iterpool); - context->pack_offset += finfo.size; + context->pack_offset += revdata_size; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Dec 3 20:30:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F816C6562D; Sat, 3 Dec 2016 20:30:28 +0000 (UTC) (envelope-from peter@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 EA172172; Sat, 3 Dec 2016 20:30:27 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB3KURef002352; Sat, 3 Dec 2016 20:30:27 GMT (envelope-from peter@FreeBSD.org) Received: (from peter@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3KUPhi002336; Sat, 3 Dec 2016 20:30:25 GMT (envelope-from peter@FreeBSD.org) Message-Id: <201612032030.uB3KUPhi002336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: peter set sender to peter@FreeBSD.org using -f From: Peter Wemm Date: Sat, 3 Dec 2016 20:30:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309512 - in stable/10/contrib/subversion: . subversion/include subversion/include/private subversion/libsvn_client subversion/libsvn_fs_fs subversion/libsvn_fs_x subversion/libsvn_ra_s... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 20:30:28 -0000 Author: peter Date: Sat Dec 3 20:30:25 2016 New Revision: 309512 URL: https://svnweb.freebsd.org/changeset/base/309512 Log: MFC r309356: svn 1.9.4 -> 1.9.5 Modified: stable/10/contrib/subversion/CHANGES stable/10/contrib/subversion/README stable/10/contrib/subversion/build-outputs.mk stable/10/contrib/subversion/configure stable/10/contrib/subversion/configure.ac stable/10/contrib/subversion/get-deps.sh stable/10/contrib/subversion/subversion/include/private/svn_sqlite.h stable/10/contrib/subversion/subversion/include/svn_version.h stable/10/contrib/subversion/subversion/libsvn_client/merge.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/caching.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/fs.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/low_level.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/pack.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/pack.h stable/10/contrib/subversion/subversion/libsvn_fs_fs/rep-cache-db.h stable/10/contrib/subversion/subversion/libsvn_fs_fs/rep-cache.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/rep-cache.h stable/10/contrib/subversion/subversion/libsvn_fs_fs/transaction.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/tree.c stable/10/contrib/subversion/subversion/libsvn_fs_x/rep-cache-db.h stable/10/contrib/subversion/subversion/libsvn_ra_serf/xml.c stable/10/contrib/subversion/subversion/libsvn_repos/reporter.c stable/10/contrib/subversion/subversion/libsvn_repos/repos.c stable/10/contrib/subversion/subversion/libsvn_subr/config_file.c stable/10/contrib/subversion/subversion/libsvn_subr/deprecated.c stable/10/contrib/subversion/subversion/libsvn_subr/gpg_agent.c stable/10/contrib/subversion/subversion/libsvn_subr/internal_statements.h stable/10/contrib/subversion/subversion/libsvn_subr/sqlite.c stable/10/contrib/subversion/subversion/libsvn_subr/sysinfo.c stable/10/contrib/subversion/subversion/libsvn_subr/win32_crashrpt.c stable/10/contrib/subversion/subversion/libsvn_subr/xml.c stable/10/contrib/subversion/subversion/libsvn_wc/conflicts.c stable/10/contrib/subversion/subversion/libsvn_wc/update_editor.c stable/10/contrib/subversion/subversion/libsvn_wc/wc-checks.h stable/10/contrib/subversion/subversion/libsvn_wc/wc-metadata.h stable/10/contrib/subversion/subversion/libsvn_wc/wc-queries.h stable/10/contrib/subversion/subversion/svn/info-cmd.c stable/10/contrib/subversion/subversion/svn/merge-cmd.c stable/10/contrib/subversion/subversion/svnserve/serve.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/subversion/CHANGES ============================================================================== --- stable/10/contrib/subversion/CHANGES Sat Dec 3 20:30:05 2016 (r309511) +++ stable/10/contrib/subversion/CHANGES Sat Dec 3 20:30:25 2016 (r309512) @@ -1,3 +1,54 @@ +Version 1.9.5 +(29 Nov 2016, from /branches/1.9.x) +http://svn.apache.org/repos/asf/subversion/tags/1.9.5 + + User-visible changes: + - Client-side bugfixes: + * fix accessing non-existent paths during reintegrate merge (r1766699 et al) + * fix handling of newly secured subdirectories in working copy (r1724448) + * info: remove trailing whitespace in --show-item=revision (issue #4660) + * fix recording wrong revisions for tree conflicts (r1734106) + * gpg-agent: improve discovery of gpg-agent sockets (r1766327) + * gpg-agent: fix file descriptor leak (r1766323) + * resolve: fix --accept=mine-full for binary files (issue #4647) + * merge: fix possible crash (issue #4652) + * resolve: fix possible crash (r1748514) + * fix potential crash in Win32 crash reporter (r1663253 et al) + + - Server-side bugfixes: + * fsfs: fix "offset too large" error during pack (issue #4657) + * svnserve: enable hook script environments (r1769152) + * fsfs: fix possible data reconstruction error (issue #4658) + * fix source of spurious 'incoming edit' tree conflicts (r1770108) + * fsfs: improve caching for large directories (r1721285) + * fsfs: fix crash when encountering all-zero checksums (r1759686) + * fsfs: fix potential source of repository corruptions (r1756266) + * mod_dav_svn: fix excessive memory usage with mod_headers/mod_deflate + (issue #3084) + * mod_dav_svn: reduce memory usage during GET requests (r1757529 et al) + * fsfs: fix unexpected "database is locked" errors (r1741096 et al) + * fsfs: fix opening old repositories without db/format files (r1720015) + + - Client-side and server-side bugfixes: + * fix possible crash when reading invalid configuration files (r1715777) + + - Bindings bugfixes: + * swig-pl: do not corrupt "{DATE}" revision variable (r1767768) + * javahl: fix temporary accepting SSL server certificates (r1764851) + * swig-pl: fix possible stack corruption (r1683266, r1683267) + + Developer-visible changes: + - General: + * add zlib discovery through pkg-config (issue #4655) + * fix potential build issue with invalid SVN_LOCALE_DIR (issue #4653) + * ruby: fix test failures with ruby >= 2.2 (r1766621) + * fix link error with --disable-keychain on OS X (r1765385) + * swig: enable building with SWIG >= 3.0.6 (r1721488 et al) + * swig: fix building with -Wdate-time in $CPPFLAGS (r1722164) + * update serf download URI in build scripts (r1700130 et al) + * raise minimal httpd version from 2.0 to 2.2 (r1754193) + + Version 1.9.4 (28 Apr 2016, from /branches/1.9.x) http://svn.apache.org/repos/asf/subversion/tags/1.9.4 @@ -14,6 +65,8 @@ http://svn.apache.org/repos/asf/subversi * ra_serf: fix deleting directories with many files (issue #4557) - Server-side bugfixes: + * mod_authz_svn: fix crash in COPY/MOVE authorization check (CVE-2016-2168) + * svnserve/sasl: fix authenticating users with wrong realm (CVE-2016-2167) * improve documentation for AuthzSVNGroupsFile and groups-db (r1730856) * fsfs: reduce peak memory usage when listing large directories (r1725180) * fsfs: fix a rare source of incomplete dump files and reports (r1717876) @@ -31,8 +84,7 @@ http://svn.apache.org/repos/asf/subversi * fix ruby test suite to work with test-unit gem (r1714790) * allow building against KDE4 without conflict with KDE5 (r1734926) * fix update_tests.py#76 with SVNPathAuthz short_circuit (r1736432) - * build system tweaks: - * tweak how symbolic error names in maintainer mode (r1735179) + * tweak getting symbolic error names in maintainer mode (r1735179) * fix inconsistent behavior of inherited property API (r1717874 et al) - API changes: @@ -882,12 +934,44 @@ http://svn.apache.org/repos/asf/subversi * javahl: allow compiling with a C++11 compiler (r1684412) +Version 1.8.17 +(29 Nov 2016, from /branches/1.8.x) +http://svn.apache.org/repos/asf/subversion/tags/1.8.17 + + User-visible changes: + - Client-side bugfixes: + * fix handling of newly secured subdirectories in working copy (r1724448) + * ra_serf: fix deleting directories with many files (issue #4557) + * svnlook: properly remove tempfiles on diff errors (r1711346) + * gpg-agent: properly handle passwords with percent characters (issue #4611) + * merge: fix crash when merging to a local add (r1702299 et al) + + - Server-side bugfixes: + * fsfs: fix possible data reconstruction error (issue #4658) + + - Client-side and server-side bugfixes: + * fix potential memory access bugs (r1722860 et al) + + - Bindings bugfixes: + * javahl: fix temporary accepting SSL server certificates (r1764851) + * swig-pl: do not corrupt "{DATE}" revision variable (r1767768) + * swig-pl: fix possible stack corruption (r1683266) + + Developer-visible changes: + - General: + * fix inconsistent behavior of inherited property API (r1717875, r1717878) + * fix patch filter invocation in svn_client_patch() (r1706783) + * fix potential build issue with invalid SVN_LOCALE_DIR (issue #4653) + + Version 1.8.16 (28 Apr 2016, from /branches/1.8.x) http://svn.apache.org/repos/asf/subversion/tags/1.8.16 User-visible changes: - Server-side bugfixes: + * mod_authz_svn: fix crash in COPY/MOVE authorization check (CVE-2016-2168) + * svnserve/sasl: fix authenticating users with wrong realm (CVE-2016-2167) * mod_authz_svn: fix authz with mod_auth_kerb/mod_auth_ntlm (issue #4602) * dump: don't write broken dump files in some ambiguously encoded fsfs repositories (issue #4554) @@ -1641,7 +1725,7 @@ http://svn.apache.org/repos/asf/subversi * fix bug in mergeinfo recording during foreign-repos merge (r1430310) * fix spurious merge conflicts for binary files with keywords (issue #4221) * fix patching symlinks with 'svn patch' (issue #4273) - * make 'svn switch' refresh lock information (issue #3376) + * make 'svn switch' refresh lock information (issue #3378) * fix 'svn diff' output doesn't apply as patch without fuzz (issue #3362) * fix mergeinfo recording for multiple-revision-range merge (issue #4306) * fix diffs shown by 'show-diff' conflict prompt option (r1438879) Modified: stable/10/contrib/subversion/README ============================================================================== --- stable/10/contrib/subversion/README Sat Dec 3 20:30:05 2016 (r309511) +++ stable/10/contrib/subversion/README Sat Dec 3 20:30:25 2016 (r309512) @@ -2,7 +2,7 @@ Subversion, a version control system. ===================================== -$LastChangedDate: 2012-02-10 14:58:53 +0000 (Fri, 10 Feb 2012) $ +$LastChangedDate: 2016-05-31 16:08:20 +0000 (Tue, 31 May 2016) $ Contents: @@ -36,10 +36,10 @@ II. DOCUMENTATION It is written in DocBook XML, and the sources can be found at: - http://svnbook.googlecode.com/svn/trunk/ + http://svn.code.sf.net/p/svnbook/source/trunk/ If you wish to build the documentation from source, read the - src/en/README file within the book source. + en/README file within the book source. Modified: stable/10/contrib/subversion/build-outputs.mk ============================================================================== --- stable/10/contrib/subversion/build-outputs.mk Sat Dec 3 20:30:05 2016 (r309511) +++ stable/10/contrib/subversion/build-outputs.mk Sat Dec 3 20:30:25 2016 (r309512) @@ -3351,7 +3351,7 @@ subversion/tests/libsvn_diff/diff-diff3- subversion/tests/libsvn_diff/parse-diff-test.lo: subversion/tests/libsvn_diff/parse-diff-test.c subversion/include/private/svn_debug.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_utf.h subversion/tests/svn_test.h -subversion/tests/libsvn_fs/fs-test.lo: subversion/tests/libsvn_fs/fs-test.c subversion/include/private/svn_debug.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_fs_util.h subversion/include/private/svn_fspath.h subversion/include/private/svn_mutex.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_time.h subversion/include/svn_types.h subversion/include/svn_version.h subversion/libsvn_delta/delta.h subversion/libsvn_fs/fs-loader.h subversion/s vn_private_config.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h +subversion/tests/libsvn_fs/fs-test.lo: subversion/tests/libsvn_fs/fs-test.c subversion/include/private/svn_debug.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_fs_util.h subversion/include/private/svn_fspath.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_time.h subversion/include/svn_types.h subversion/include/svn_version. h subversion/libsvn_delta/delta.h subversion/libsvn_fs/fs-loader.h subversion/svn_private_config.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h subversion/tests/libsvn_fs/locks-test.lo: subversion/tests/libsvn_fs/locks-test.c subversion/include/private/svn_debug.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h @@ -3363,7 +3363,7 @@ subversion/tests/libsvn_fs_base/strings- subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.lo: subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.c subversion/include/private/svn_atomic.h subversion/include/private/svn_cache.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_fs_private.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_string_private.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_iter.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_poo ls.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/libsvn_fs_fs/fs.h subversion/libsvn_fs_fs/fs_fs.h subversion/libsvn_fs_fs/id.h subversion/libsvn_fs_fs/rev_file.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h -subversion/tests/libsvn_fs_fs/fs-fs-pack-test.lo: subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c subversion/include/private/svn_atomic.h subversion/include/private/svn_cache.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_fs_private.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_string_private.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_iter.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools .h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/libsvn_fs/fs-loader.h subversion/libsvn_fs_fs/fs.h subversion/libsvn_fs_fs/fs_fs.h subversion/libsvn_fs_fs/id.h subversion/libsvn_fs_fs/low_level.h subversion/libsvn_fs_fs/util.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h +subversion/tests/libsvn_fs_fs/fs-fs-pack-test.lo: subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c subversion/include/private/svn_atomic.h subversion/include/private/svn_cache.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_fs_private.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_string_private.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_iter.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools .h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/libsvn_fs/fs-loader.h subversion/libsvn_fs_fs/fs.h subversion/libsvn_fs_fs/fs_fs.h subversion/libsvn_fs_fs/id.h subversion/libsvn_fs_fs/low_level.h subversion/libsvn_fs_fs/pack.h subversion/libsvn_fs_fs/util.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h subversion/tests/libsvn_fs_fs/fs-fs-private-test.lo: subversion/tests/libsvn_fs_fs/fs-fs-private-test.c subversion/include/private/svn_atomic.h subversion/include/private/svn_cache.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_fs_private.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_mutex.h subversion/include/private/svn_sqlite.h subversion/include/private/svn_string_private.h subversion/include/private/svn_subr_private.h subversion/include/private/svn_token.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_iter.h subversion/include/svn_mergeinfo.h subver sion/include/svn_path.h subversion/include/svn_pools.h subversion/include/svn_props.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/libsvn_fs_fs/fs.h subversion/libsvn_fs_fs/id.h subversion/libsvn_fs_fs/index.h subversion/libsvn_fs_fs/rev_file.h subversion/tests/svn_test.h subversion/tests/svn_test_fs.h Modified: stable/10/contrib/subversion/configure ============================================================================== --- stable/10/contrib/subversion/configure Sat Dec 3 20:30:05 2016 (r309511) +++ stable/10/contrib/subversion/configure Sat Dec 3 20:30:25 2016 (r309512) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for subversion 1.9.4. +# Generated by GNU Autoconf 2.69 for subversion 1.9.5. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='subversion' PACKAGE_TARNAME='subversion' -PACKAGE_VERSION='1.9.4' -PACKAGE_STRING='subversion 1.9.4' +PACKAGE_VERSION='1.9.5' +PACKAGE_STRING='subversion 1.9.5' PACKAGE_BUGREPORT='http://subversion.apache.org/' PACKAGE_URL='' @@ -1471,7 +1471,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures subversion 1.9.4 to adapt to many kinds of systems. +\`configure' configures subversion 1.9.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1537,7 +1537,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of subversion 1.9.4:";; + short | recursive ) echo "Configuration of subversion 1.9.5:";; esac cat <<\_ACEOF @@ -1751,7 +1751,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -subversion configure 1.9.4 +subversion configure 1.9.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2295,7 +2295,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by subversion $as_me 1.9.4, which was +It was created by subversion $as_me 1.9.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2675,8 +2675,8 @@ ac_configure="$SHELL $ac_aux_dir/configu -{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring Subversion 1.9.4" >&5 -$as_echo "$as_me: Configuring Subversion 1.9.4" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring Subversion 1.9.5" >&5 +$as_echo "$as_me: Configuring Subversion 1.9.5" >&6;} abs_srcdir="`cd $srcdir && pwd`" @@ -7422,7 +7422,10 @@ _ACEOF localedir='${datadir}/locale' -if test "${datadir}" = '${prefix}/share' && test "${prefix}" = "NONE"; then +if test "${prefix}" = "NONE" \ + && ( test "${datadir}" = '${prefix}/share' \ + || ( test "${datadir}" = '${datarootdir}' \ + && test "${datarootdir}" = '${prefix}/share' ) ); then exp_localedir='${ac_default_prefix}/share/locale' else exp_localedir=$localedir @@ -22550,68 +22553,34 @@ fi zlib_found=no + zlib_skip=no # Check whether --with-zlib was given. if test "${with_zlib+set}" = set; then : withval=$with_zlib; - if test "$withval" = "yes" ; then - ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" -if test "x$ac_cv_header_zlib_h" = xyes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 -$as_echo_n "checking for inflate in -lz... " >&6; } -if ${ac_cv_lib_z_inflate+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lz $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + if test "$withval" = "yes"; then + zlib_skip=no + elif test "$withval" = "no"; then + zlib_skip=yes + else + zlib_skip=no + zlib_prefix="$withval" + fi -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char inflate (); -int -main () -{ -return inflate (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_z_inflate=yes -else - ac_cv_lib_z_inflate=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5 -$as_echo "$ac_cv_lib_z_inflate" >&6; } -if test "x$ac_cv_lib_z_inflate" = xyes; then : - zlib_found="builtin" fi -fi - + if test "$zlib_skip" = "yes"; then + as_fn_error $? "subversion requires zlib" "$LINENO" 5 + fi - elif test "$withval" = "no" ; then - as_fn_error $? "cannot compile without zlib." "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: zlib library configuration" >&5 -$as_echo "$as_me: zlib library configuration" >&6;} - zlib_prefix=$withval - save_cppflags="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS -I$zlib_prefix/include" - for ac_header in zlib.h + if test -n "$zlib_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: zlib library configuration via prefix" >&5 +$as_echo "$as_me: zlib library configuration via prefix" >&6;} + save_cppflags="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -I$zlib_prefix/include" + for ac_header in zlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" if test "x$ac_cv_header_zlib_h" = xyes; then : @@ -22619,9 +22588,9 @@ if test "x$ac_cv_header_zlib_h" = xyes; #define HAVE_ZLIB_H 1 _ACEOF - save_ldflags="$LDFLAGS" - LDFLAGS="$LDFLAGS -L$zlib_prefix/lib" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 + save_ldflags="$LDFLAGS" + LDFLAGS="$LDFLAGS -L$zlib_prefix/lib" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 $as_echo_n "checking for inflate in -lz... " >&6; } if ${ac_cv_lib_z_inflate+:} false; then : $as_echo_n "(cached) " >&6 @@ -22658,24 +22627,86 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5 $as_echo "$ac_cv_lib_z_inflate" >&6; } if test "x$ac_cv_lib_z_inflate" = xyes; then : - zlib_found="yes" + + zlib_found="yes" + SVN_ZLIB_INCLUDES="-I$zlib_prefix/include" + SVN_ZLIB_LIBS="` + input_flags="-L$zlib_prefix/lib" + output_flags="" + filtered_dirs="/lib /lib64 /usr/lib /usr/lib64" + for flag in $input_flags; do + filter="no" + for dir in $filtered_dirs; do + if test "$flag" = "-L$dir" || test "$flag" = "-L$dir/"; then + filter="yes" + break + fi + done + if test "$filter" = "no"; then + output_flags="$output_flags $flag" + fi + done + if test -n "$output_flags"; then + printf "%s" "${output_flags# }" + fi +` -lz" + fi - LDFLAGS="$save_ldflags" + LDFLAGS="$save_ldflags" fi done - CPPFLAGS="$save_cppflags" + CPPFLAGS="$save_cppflags" + else + + { $as_echo "$as_me:${as_lineno-$LINENO}: zlib library configuration via pkg-config" >&5 +$as_echo "$as_me: zlib library configuration via pkg-config" >&6;} + if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlib library" >&5 +$as_echo_n "checking for zlib library... " >&6; } + if $PKG_CONFIG zlib --exists; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + zlib_found=yes + SVN_ZLIB_INCLUDES=`$PKG_CONFIG zlib --cflags` + SVN_ZLIB_LIBS=`$PKG_CONFIG zlib --libs` + SVN_ZLIB_LIBS="` + input_flags="$SVN_ZLIB_LIBS" + output_flags="" + filtered_dirs="/lib /lib64 /usr/lib /usr/lib64" + for flag in $input_flags; do + filter="no" + for dir in $filtered_dirs; do + if test "$flag" = "-L$dir" || test "$flag" = "-L$dir/"; then + filter="yes" + break + fi + done + if test "$filter" = "no"; then + output_flags="$output_flags $flag" + fi + done + if test -n "$output_flags"; then + printf "%s" "${output_flags# }" + fi +`" + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi + fi -else - ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" + if test "$zlib_found" = "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: zlib library configuration" >&5 +$as_echo "$as_me: zlib library configuration" >&6;} + ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" if test "x$ac_cv_header_zlib_h" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inflate in -lz" >&5 $as_echo_n "checking for inflate in -lz... " >&6; } if ${ac_cv_lib_z_inflate+:} false; then : $as_echo_n "(cached) " >&6 @@ -22712,46 +22743,22 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_inflate" >&5 $as_echo "$ac_cv_lib_z_inflate" >&6; } if test "x$ac_cv_lib_z_inflate" = xyes; then : - zlib_found="builtin" -fi + zlib_found="builtin" + SVN_ZLIB_LIBS="-lz" fi - fi - if test "$zlib_found" = "no"; then - as_fn_error $? "subversion requires zlib" "$LINENO" 5 - fi - - if test "$zlib_found" = "yes"; then - SVN_ZLIB_INCLUDES="-I$zlib_prefix/include" - LDFLAGS="$LDFLAGS ` - input_flags="-L$zlib_prefix/lib" - output_flags="" - filtered_dirs="/lib /lib64 /usr/lib /usr/lib64" - for flag in $input_flags; do - filter="no" - for dir in $filtered_dirs; do - if test "$flag" = "-L$dir" || test "$flag" = "-L$dir/"; then - filter="yes" - break - fi - done - if test "$filter" = "no"; then - output_flags="$output_flags $flag" fi - done - if test -n "$output_flags"; then - printf "%s" "${output_flags# }" - fi -`" fi - SVN_ZLIB_LIBS="-lz" + if test "$zlib_found" = "no"; then + as_fn_error $? "subversion requires zlib" "$LINENO" 5 + fi @@ -23785,15 +23792,14 @@ $as_echo "$SWIG_VERSION_RAW" >&6; } # packages/rpm/redhat-7.x/subversion.spec # packages/rpm/rhel-3/subversion.spec # packages/rpm/rhel-4/subversion.spec - if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" && \ - test "$SWIG_VERSION" -lt "300000"; then + if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024"; then SWIG_SUITABLE=yes else SWIG_SUITABLE=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&5 $as_echo "$as_me: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&5 -$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24" >&5 +$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24" >&2;} fi fi @@ -24274,15 +24280,14 @@ $as_echo "$SWIG_VERSION_RAW" >&6; } # packages/rpm/redhat-7.x/subversion.spec # packages/rpm/rhel-3/subversion.spec # packages/rpm/rhel-4/subversion.spec - if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" && \ - test "$SWIG_VERSION" -lt "300000"; then + if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024"; then SWIG_SUITABLE=yes else SWIG_SUITABLE=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&5 $as_echo "$as_me: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&5 -$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24" >&5 +$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24" >&2;} fi fi @@ -24763,15 +24768,14 @@ $as_echo "$SWIG_VERSION_RAW" >&6; } # packages/rpm/redhat-7.x/subversion.spec # packages/rpm/rhel-3/subversion.spec # packages/rpm/rhel-4/subversion.spec - if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" && \ - test "$SWIG_VERSION" -lt "300000"; then + if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024"; then SWIG_SUITABLE=yes else SWIG_SUITABLE=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&5 $as_echo "$as_me: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&5 -$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24" >&5 +$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24" >&2;} fi fi @@ -25255,15 +25259,14 @@ $as_echo "$SWIG_VERSION_RAW" >&6; } # packages/rpm/redhat-7.x/subversion.spec # packages/rpm/rhel-3/subversion.spec # packages/rpm/rhel-4/subversion.spec - if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024" && \ - test "$SWIG_VERSION" -lt "300000"; then + if test -n "$SWIG_VERSION" && test "$SWIG_VERSION" -ge "103024"; then SWIG_SUITABLE=yes else SWIG_SUITABLE=no { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&5 $as_echo "$as_me: WARNING: Detected SWIG version $SWIG_VERSION_RAW" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&5 -$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24 and < 3.0.0 " >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Subversion requires SWIG >= 1.3.24" >&5 +$as_echo "$as_me: WARNING: Subversion requires SWIG >= 1.3.24" >&2;} fi fi @@ -26152,6 +26155,9 @@ SWIG_CPPFLAGS="$CPPFLAGS" SWIG_CPPFLAGS=`echo "$SWIG_CPPFLAGS" | $SED -e 's/-no-cpp-precomp //'` + SWIG_CPPFLAGS=`echo "$SWIG_CPPFLAGS" | $SED -e 's/-Wdate-time //'` + + cat >>confdefs.h <<_ACEOF @@ -26750,7 +26756,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by subversion $as_me 1.9.4, which was +This file was extended by subversion $as_me 1.9.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -26816,7 +26822,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -subversion config.status 1.9.4 +subversion config.status 1.9.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/10/contrib/subversion/configure.ac ============================================================================== --- stable/10/contrib/subversion/configure.ac Sat Dec 3 20:30:05 2016 (r309511) +++ stable/10/contrib/subversion/configure.ac Sat Dec 3 20:30:25 2016 (r309512) @@ -199,7 +199,10 @@ localedir='${datadir}/locale' AC_SUBST(localedir) dnl For SVN_LOCALE_DIR, we have to expand it to something. See SVN_BINDIR. -if test "${datadir}" = '${prefix}/share' && test "${prefix}" = "NONE"; then +if test "${prefix}" = "NONE" \ + && ( test "${datadir}" = '${prefix}/share' \ + || ( test "${datadir}" = '${datarootdir}' \ + && test "${datarootdir}" = '${prefix}/share' ) ); then exp_localedir='${ac_default_prefix}/share/locale' else exp_localedir=$localedir @@ -1504,6 +1507,7 @@ fi # Need to strip '-no-cpp-precomp' from CPPFLAGS for SWIG as well. SWIG_CPPFLAGS="$CPPFLAGS" SVN_STRIP_FLAG(SWIG_CPPFLAGS, [-no-cpp-precomp ]) +SVN_STRIP_FLAG(SWIG_CPPFLAGS, [-Wdate-time ]) AC_SUBST([SWIG_CPPFLAGS]) dnl Since this is used only on Unix-y systems, define the path separator as '/' Modified: stable/10/contrib/subversion/get-deps.sh ============================================================================== --- stable/10/contrib/subversion/get-deps.sh Sat Dec 3 20:30:05 2016 (r309511) +++ stable/10/contrib/subversion/get-deps.sh Sat Dec 3 20:30:25 2016 (r309512) @@ -89,7 +89,7 @@ get_serf() { test -d $BASEDIR/serf && return cd $TEMPDIR - $HTTP_FETCH http://serf.googlecode.com/svn/src_releases/$SERF.tar.bz2 + $HTTP_FETCH https://archive.apache.org/dist/serf/$SERF.tar.bz2 cd $BASEDIR bzip2 -dc $TEMPDIR/$SERF.tar.bz2 | tar -xf - Modified: stable/10/contrib/subversion/subversion/include/private/svn_sqlite.h ============================================================================== --- stable/10/contrib/subversion/subversion/include/private/svn_sqlite.h Sat Dec 3 20:30:05 2016 (r309511) +++ stable/10/contrib/subversion/subversion/include/private/svn_sqlite.h Sat Dec 3 20:30:25 2016 (r309512) @@ -555,6 +555,9 @@ svn_sqlite__hotcopy(const char *src_path const char *dst_path, apr_pool_t *scratch_pool); +/* Backported version of SVN_ERR_SQLITE_ROLLBACK_FAILED. */ +#define SVN_SQLITE__ERR_ROLLBACK_FAILED (SVN_ERR_MISC_CATEGORY_START + 44) + #ifdef __cplusplus } #endif /* __cplusplus */ Modified: stable/10/contrib/subversion/subversion/include/svn_version.h ============================================================================== --- stable/10/contrib/subversion/subversion/include/svn_version.h Sat Dec 3 20:30:05 2016 (r309511) +++ stable/10/contrib/subversion/subversion/include/svn_version.h Sat Dec 3 20:30:25 2016 (r309512) @@ -70,7 +70,7 @@ extern "C" { * * @since New in 1.1. */ -#define SVN_VER_PATCH 4 +#define SVN_VER_PATCH 5 /** @deprecated Provided for backward compatibility with the 1.0 API. */ @@ -93,7 +93,7 @@ extern "C" { * * Always change this at the same time as SVN_VER_NUMTAG. */ -#define SVN_VER_TAG " (r1740329)" +#define SVN_VER_TAG " (r1770682)" /** Number tag: a string describing the version. @@ -117,7 +117,7 @@ extern "C" { * file version. Its value remains 0 in the repository except in release * tags where it is the revision from which the tag was created. */ -#define SVN_VER_REVISION 1740329 +#define SVN_VER_REVISION 1770682 /* Version strings composed from the above definitions. */ Modified: stable/10/contrib/subversion/subversion/libsvn_client/merge.c ============================================================================== --- stable/10/contrib/subversion/subversion/libsvn_client/merge.c Sat Dec 3 20:30:05 2016 (r309511) +++ stable/10/contrib/subversion/subversion/libsvn_client/merge.c Sat Dec 3 20:30:25 2016 (r309512) @@ -1295,6 +1295,15 @@ record_skip(merge_cmd_baton_t *merge_b, return SVN_NO_ERROR; } +/* Forward declaration */ +static svn_client__merge_path_t * +find_nearest_ancestor_with_intersecting_ranges( + svn_revnum_t *start, + svn_revnum_t *end, + const apr_array_header_t *children_with_mergeinfo, + svn_boolean_t path_is_own_ancestor, + const char *local_abspath); + /* Record a tree conflict in the WC, unless this is a dry run or a record- * only merge, or if a tree conflict is already flagged for the VICTIM_PATH. * (The latter can happen if a merge-tracking-aware merge is doing multiple @@ -1366,11 +1375,45 @@ record_tree_conflict(merge_cmd_baton_t * reason = svn_wc_conflict_reason_moved_here; } - SVN_ERR(make_conflict_versions(&left, &right, local_abspath, - merge_left_node_kind, - merge_right_node_kind, - &merge_b->merge_source, merge_b->target, - result_pool, scratch_pool)); + if (HONOR_MERGEINFO(merge_b) && merge_b->merge_source.ancestral) + { + struct merge_source_t *source; + svn_client__pathrev_t *loc1; + svn_client__pathrev_t *loc2; + svn_merge_range_t range = + {SVN_INVALID_REVNUM, SVN_INVALID_REVNUM, TRUE}; + + /* We are honoring mergeinfo so do not blindly record + * a conflict describing the merge of + * SOURCE->LOC1->URL@SOURCE->LOC1->REV through + * SOURCE->LOC2->URL@SOURCE->LOC2->REV + * but figure out the actual revision range merged. */ + (void)find_nearest_ancestor_with_intersecting_ranges( + &(range.start), &(range.end), + merge_b->notify_begin.nodes_with_mergeinfo, + action != svn_wc_conflict_action_delete, + local_abspath); + loc1 = svn_client__pathrev_dup(merge_b->merge_source.loc1, + scratch_pool); + loc2 = svn_client__pathrev_dup(merge_b->merge_source.loc2, + scratch_pool); + loc1->rev = range.start; + loc2->rev = range.end; + source = merge_source_create(loc1, loc2, + merge_b->merge_source.ancestral, + scratch_pool); + SVN_ERR(make_conflict_versions(&left, &right, local_abspath, + merge_left_node_kind, + merge_right_node_kind, + source, merge_b->target, + result_pool, scratch_pool)); + } + else + SVN_ERR(make_conflict_versions(&left, &right, local_abspath, + merge_left_node_kind, + merge_right_node_kind, + &merge_b->merge_source, merge_b->target, + result_pool, scratch_pool)); /* Fix up delete of file, add of dir replacement (or other way around) */ if (existing_conflict != NULL && existing_conflict->src_left_version) @@ -10956,7 +10999,7 @@ find_unsynced_ranges(const svn_client__p potentially_unmerged_ranges->nelts - 1, svn_merge_range_t *))->end; log_find_operative_baton_t log_baton; - const char *old_session_url; + const char *old_session_url = NULL; svn_error_t *err; log_baton.merged_catalog = merged_catalog; @@ -10967,14 +11010,22 @@ find_unsynced_ranges(const svn_client__p = svn_client__pathrev_fspath(target_loc, scratch_pool); log_baton.result_pool = result_pool; - SVN_ERR(svn_client__ensure_ra_session_url( - &old_session_url, ra_session, target_loc->url, scratch_pool)); + /* Reparent the session to TARGET_LOC if this target location + * exists within the unmerged revision range. */ + if (target_loc->rev <= youngest_rev && target_loc->rev >= oldest_rev) + SVN_ERR(svn_client__ensure_ra_session_url( + &old_session_url, ra_session, target_loc->url, scratch_pool)); + err = get_log(ra_session, "", youngest_rev, oldest_rev, TRUE, /* discover_changed_paths */ log_find_operative_revs, &log_baton, scratch_pool); - SVN_ERR(svn_error_compose_create( - err, svn_ra_reparent(ra_session, old_session_url, scratch_pool))); + if (old_session_url) + err = svn_error_compose_create(err, + svn_ra_reparent(ra_session, + old_session_url, + scratch_pool)); + SVN_ERR(err); } return SVN_NO_ERROR; Modified: stable/10/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c ============================================================================== --- stable/10/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c Sat Dec 3 20:30:05 2016 (r309511) +++ stable/10/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c Sat Dec 3 20:30:25 2016 (r309512) @@ -1571,6 +1571,17 @@ read_plain_window(svn_stringbuf_t **nwin return SVN_NO_ERROR; } +/* Skip SIZE bytes from the PLAIN representation RS. */ +static svn_error_t * +skip_plain_window(rep_state_t *rs, + apr_size_t size) +{ + /* Update RS. */ + rs->current += (apr_off_t)size; + + return SVN_NO_ERROR; +} + /* Get the undeltified window that is a result of combining all deltas from the current desired representation identified in *RB with its base representation. Store the window in *RESULT. */ @@ -1628,9 +1639,18 @@ get_combined_window(svn_stringbuf_t **re Also note that we may have short-cut reading the delta chain -- in which case SRC_OPS is 0 and it might not be a PLAIN rep. */ source = buf; - if (source == NULL && rb->src_state != NULL && window->src_ops) - SVN_ERR(read_plain_window(&source, rb->src_state, window->sview_len, - pool, iterpool)); + if (source == NULL && rb->src_state != NULL) + { + /* Even if we don't need the source rep now, we still must keep + * its read offset in sync with what we might need for the next + * window. */ + if (window->src_ops) + SVN_ERR(read_plain_window(&source, rb->src_state, + window->sview_len, + pool, iterpool)); + else + SVN_ERR(skip_plain_window(rb->src_state, window->sview_len)); + } /* Combine this window with the current one. */ new_pool = svn_pool_create(rb->pool); Modified: stable/10/contrib/subversion/subversion/libsvn_fs_fs/caching.c ============================================================================== --- stable/10/contrib/subversion/subversion/libsvn_fs_fs/caching.c Sat Dec 3 20:30:05 2016 (r309511) +++ stable/10/contrib/subversion/subversion/libsvn_fs_fs/caching.c Sat Dec 3 20:30:25 2016 (r309512) @@ -430,7 +430,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f svn_fs_fs__deserialize_dir_entries, sizeof(pair_cache_key_t), apr_pstrcat(pool, prefix, "DIR", SVN_VA_NULL), - SVN_CACHE__MEMBUFFER_DEFAULT_PRIORITY, + SVN_CACHE__MEMBUFFER_HIGH_PRIORITY, fs, no_handler, fs->pool, pool)); @@ -806,7 +806,7 @@ svn_fs_fs__initialize_txn_caches(svn_fs_ APR_HASH_KEY_STRING, apr_pstrcat(pool, prefix, "TXNDIR", SVN_VA_NULL), - 0, + SVN_CACHE__MEMBUFFER_HIGH_PRIORITY, fs, TRUE, pool, pool)); Modified: stable/10/contrib/subversion/subversion/libsvn_fs_fs/fs.c ============================================================================== --- stable/10/contrib/subversion/subversion/libsvn_fs_fs/fs.c Sat Dec 3 20:30:05 2016 (r309511) +++ stable/10/contrib/subversion/subversion/libsvn_fs_fs/fs.c Sat Dec 3 20:30:25 2016 (r309512) @@ -452,7 +452,7 @@ fs_pack(svn_fs_t *fs, apr_pool_t *common_pool) { SVN_ERR(fs_open(fs, path, common_pool_lock, pool, common_pool)); - return svn_fs_fs__pack(fs, notify_func, notify_baton, + return svn_fs_fs__pack(fs, 0, notify_func, notify_baton, cancel_func, cancel_baton, pool); } Modified: stable/10/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c ============================================================================== --- stable/10/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c Sat Dec 3 20:30:05 2016 (r309511) +++ stable/10/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c Sat Dec 3 20:30:25 2016 (r309512) @@ -492,6 +492,7 @@ read_format(int *pformat, svn_error_clear(err); *pformat = 1; *max_files_per_dir = 0; + *use_log_addressing = FALSE; return SVN_NO_ERROR; } Modified: stable/10/contrib/subversion/subversion/libsvn_fs_fs/low_level.c ============================================================================== --- stable/10/contrib/subversion/subversion/libsvn_fs_fs/low_level.c Sat Dec 3 20:30:05 2016 (r309511) +++ stable/10/contrib/subversion/subversion/libsvn_fs_fs/low_level.c Sat Dec 3 20:30:25 2016 (r309512) @@ -764,7 +764,11 @@ svn_fs_fs__parse_representation(represen SVN_ERR(svn_checksum_parse_hex(&checksum, svn_checksum_md5, str, scratch_pool)); - memcpy(rep->md5_digest, checksum->digest, sizeof(rep->md5_digest)); + + /* If STR is a all-zero checksum, CHECKSUM will be NULL and REP already + contains the correct value. */ + if (checksum) + memcpy(rep->md5_digest, checksum->digest, sizeof(rep->md5_digest)); /* The remaining fields are only used for formats >= 4, so check that. */ str = svn_cstring_tokenize(" ", &string); @@ -778,8 +782,16 @@ svn_fs_fs__parse_representation(represen SVN_ERR(svn_checksum_parse_hex(&checksum, svn_checksum_sha1, str, scratch_pool)); + + /* We do have a valid SHA1 but it might be all 0. + We cannot be sure where that came from (Alas! legacy), so let's not + claim we know the SHA1 in that case. */ rep->has_sha1 = checksum != NULL; - memcpy(rep->sha1_digest, checksum->digest, sizeof(rep->sha1_digest)); + + /* If STR is a all-zero checksum, CHECKSUM will be NULL and REP already + contains the correct value. */ + if (checksum) + memcpy(rep->sha1_digest, checksum->digest, sizeof(rep->sha1_digest)); /* Read the uniquifier. */ str = svn_cstring_tokenize("/", &string); Modified: stable/10/contrib/subversion/subversion/libsvn_fs_fs/pack.c ============================================================================== --- stable/10/contrib/subversion/subversion/libsvn_fs_fs/pack.c Sat Dec 3 20:30:05 2016 (r309511) +++ stable/10/contrib/subversion/subversion/libsvn_fs_fs/pack.c Sat Dec 3 20:30:25 2016 (r309512) @@ -335,21 +335,40 @@ static svn_error_t * reset_pack_context(pack_context_t *context, apr_pool_t *pool) { + const char *temp_dir; + apr_array_clear(context->changes); - SVN_ERR(svn_io_file_trunc(context->changes_file, 0, pool)); + SVN_ERR(svn_io_file_close(context->changes_file, pool)); apr_array_clear(context->file_props); - SVN_ERR(svn_io_file_trunc(context->file_props_file, 0, pool)); + SVN_ERR(svn_io_file_close(context->file_props_file, pool)); apr_array_clear(context->dir_props); - SVN_ERR(svn_io_file_trunc(context->dir_props_file, 0, pool)); + SVN_ERR(svn_io_file_close(context->dir_props_file, pool)); apr_array_clear(context->rev_offsets); apr_array_clear(context->path_order); apr_array_clear(context->references); apr_array_clear(context->reps); - SVN_ERR(svn_io_file_trunc(context->reps_file, 0, pool)); + SVN_ERR(svn_io_file_close(context->reps_file, pool)); svn_pool_clear(context->info_pool); + /* The new temporary files must live at least as long as any other info + * object in CONTEXT. */ + SVN_ERR(svn_io_temp_dir(&temp_dir, pool)); + SVN_ERR(svn_io_open_unique_file3(&context->changes_file, NULL, temp_dir, + svn_io_file_del_on_close, + context->info_pool, pool)); + SVN_ERR(svn_io_open_unique_file3(&context->file_props_file, NULL, temp_dir, + svn_io_file_del_on_close, + context->info_pool, pool)); + SVN_ERR(svn_io_open_unique_file3(&context->dir_props_file, NULL, temp_dir, + svn_io_file_del_on_close, + context->info_pool, pool)); + SVN_ERR(svn_io_open_unique_file3(&context->reps_file, NULL, temp_dir, + svn_io_file_del_on_close, + context->info_pool, pool)); + context->paths = svn_prefix_tree__create(context->info_pool); + return SVN_NO_ERROR; } @@ -1410,21 +1429,20 @@ append_revision(pack_context_t *context, apr_off_t offset = 0; apr_pool_t *iterpool = svn_pool_create(pool); svn_fs_fs__revision_file_t *rev_file; - apr_finfo_t finfo; - - /* Get the size of the file. */ - const char *path = svn_dirent_join(context->shard_dir, - apr_psprintf(iterpool, "%ld", - context->start_rev), - pool); - SVN_ERR(svn_io_stat(&finfo, path, APR_FINFO_SIZE, pool)); + svn_filesize_t revdata_size; - /* Copy all the bits from the rev file to the end of the pack file. */ + /* Copy all non-index contents the rev file to the end of the pack file. */ SVN_ERR(svn_fs_fs__open_pack_or_rev_file(&rev_file, context->fs, context->start_rev, pool, iterpool)); + + SVN_ERR(svn_fs_fs__auto_read_footer(rev_file)); + revdata_size = rev_file->l2p_offset; + + SVN_ERR(svn_io_file_aligned_seek(rev_file->file, ffd->block_size, NULL, 0, + iterpool)); SVN_ERR(copy_file_data(context, context->pack_file, rev_file->file, - finfo.size, iterpool)); + revdata_size, iterpool)); /* mark the start of a new revision */ SVN_ERR(svn_fs_fs__l2p_proto_index_add_revision(context->proto_l2p_index, @@ -1432,7 +1450,7 @@ append_revision(pack_context_t *context, /* read the phys-to-log index file until we covered the whole rev file. * That index contains enough info to build both target indexes from it. */ - while (offset < finfo.size) + while (offset < revdata_size) { /* read one cluster */ int i; @@ -1456,7 +1474,7 @@ append_revision(pack_context_t *context, /* process entry while inside the rev file */ offset = entry->offset; - if (offset < finfo.size) + if (offset < revdata_size) { entry->offset += context->pack_offset; offset += entry->size; @@ -1470,7 +1488,7 @@ append_revision(pack_context_t *context, } svn_pool_destroy(iterpool); - context->pack_offset += finfo.size; + context->pack_offset += revdata_size; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Dec 3 20:35:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1983C6585A; Sat, 3 Dec 2016 20:35:23 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-qk0-f177.google.com (mail-qk0-f177.google.com [209.85.220.177]) (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 B4D858A9; Sat, 3 Dec 2016 20:35:23 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-qk0-f177.google.com with SMTP id x190so311862213qkb.0; Sat, 03 Dec 2016 12:35:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=yn+oPAz3nkAAxa+E2JTljMte2mt+eBgpUzwnUZtpArM=; b=KyrXUtccP/WwKfUl3uVaGwD8t+6vgJoGXeRMUMqdXoY1su9KL1O6DaB9TPwu/EuWNk 3UF3+2LglksMv9OcfuEs2sBDAT/drBGiAj+86GvWdsAEQqOBUuteC4mwixCT/+KDLK9d ngJV+XS0t/VRSYpA4wChyRNdduorCBdkU2JRx5FuoTE5jOCJeAa63x+i9H8qAbTbAo3+ PH+m+Q2WsBDdMUj/0NzhqJvDiZ63rFQOleX1rSwMQ+P+SBcMYUItekkB466YVcmalRTK 5yFcAYnTeIXiiW62XM1VIocwAPpuk43IndBPn7qu40KgvLqZnBbNyu9Icfq0GrRR4+wU K/YA== X-Gm-Message-State: AKaTC02uywxsh/nP5O9LJg7cl/q9CL9ObU6UfCyFrnI2yEdqQFvR+AcmuZC32+2YlIqZQg== X-Received: by 10.55.73.148 with SMTP id w142mr48616103qka.284.1480797322210; Sat, 03 Dec 2016 12:35:22 -0800 (PST) Received: from mail-qk0-f178.google.com (mail-qk0-f178.google.com. [209.85.220.178]) by smtp.gmail.com with ESMTPSA id b94sm5640467qkb.16.2016.12.03.12.35.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Dec 2016 12:35:21 -0800 (PST) Received: by mail-qk0-f178.google.com with SMTP id n204so311875983qke.2; Sat, 03 Dec 2016 12:35:21 -0800 (PST) X-Received: by 10.55.212.29 with SMTP id l29mr16206031qki.64.1480797321444; Sat, 03 Dec 2016 12:35:21 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.200.58.165 with HTTP; Sat, 3 Dec 2016 12:35:21 -0800 (PST) In-Reply-To: References: <201612012220.uB1MKSbR054941@repo.freebsd.org> From: Conrad Meyer Date: Sat, 3 Dec 2016 12:35:21 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r309374 - in head: sbin/camcontrol sys/cam/scsi To: Ravi Pokala Cc: Kyle Evans , "Kenneth D. Merry" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 20:35:24 -0000 On Fri, Dec 2, 2016 at 9:38 PM, Ravi Pokala wrote: > -----Original Message----- >> From: on behalf of Kyle Evans >> >> I understand that this is a bogus error because at this point it >> pretty much *has* to be set by the report_timestamp call just prior, >> but is there a clean way to trick GCC into agreeing, or is it just a >> matter of explicitly initializing it to 0 before the report_timestamp >> call? > > Actually, it's a valid warning. While all paths to that point in timestam= p() go through report_timestamp(), not all paths through report_timestamp()= set *ts. Specifically, if cam_getccb() or cam_send_ccb() fail, or the requ= est was not completed, report_timestamp() does 'goto bailout' without setti= ng *ts. But in that case, report_timestamp() returns a non-zero error. And timestamp() will goto its own bailout, avoiding use of an unset value. > I'm disappointed that `clang' (on i386 and amd64) didn't notice this; I w= as under the impression `clang' did more of that type of deep path analysis= than `gcc'. I think it's purely spurious, although understandably difficult for the compiler to notice. Adrian's proposed zero initialization seems like a fine fix. Best, Conrad From owner-svn-src-all@freebsd.org Sat Dec 3 20:35:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0C72C65896; Sat, 3 Dec 2016 20:35:40 +0000 (UTC) (envelope-from adrian@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 AA6B99B6; Sat, 3 Dec 2016 20:35:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB3KZdNg006250; Sat, 3 Dec 2016 20:35:39 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3KZd4I006249; Sat, 3 Dec 2016 20:35:39 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201612032035.uB3KZd4I006249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 3 Dec 2016 20:35:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r309513 - head/sbin/camcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 20:35:41 -0000 Author: adrian Date: Sat Dec 3 20:35:39 2016 New Revision: 309513 URL: https://svnweb.freebsd.org/changeset/base/309513 Log: [camcontrol] init ts=0 to quieten gcc. It "looks" like ts is set to something on success, and not modified on error. Checked on IRC with: cem Modified: head/sbin/camcontrol/timestamp.c Modified: head/sbin/camcontrol/timestamp.c ============================================================================== --- head/sbin/camcontrol/timestamp.c Sat Dec 3 20:30:25 2016 (r309512) +++ head/sbin/camcontrol/timestamp.c Sat Dec 3 20:35:39 2016 (r309513) @@ -328,7 +328,7 @@ timestamp(struct cam_device *device, int int retry_count, int timeout, int verbosemode __unused) { int c; - uint64_t ts; + uint64_t ts = 0; char *format_string = NULL; char *timestamp_string = NULL; int action = -1; From owner-svn-src-all@freebsd.org Sat Dec 3 20:56:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E0F6C652BF for ; Sat, 3 Dec 2016 20:56:38 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wj0-x233.google.com (mail-wj0-x233.google.com [IPv6:2a00:1450:400c:c01::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 D65471ADA for ; Sat, 3 Dec 2016 20:56:37 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wj0-x233.google.com with SMTP id v7so259175656wjy.2 for ; Sat, 03 Dec 2016 12:56:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=c9tgLfAwCsk+jZyVV08/glFWKvxX/XLm51SIL24rUQc=; b=08v7eieoDDdYgR0D9FxMMtk1u66dNDRXIO3RbuS0S52fKvYo8Jrq4+pgOxBZNLYmyM dbJerj1F360W43YE1KTl1PUt4O5bM39hT7PsW3tnKyB7rd98/3QXu6d5MG/jXTZCtgE4 kgfvCRc0edoh633xRpkL8emJ2NWYgign8Fbn5jdh8xy0nymcOdpbV82+DRADdxhKdRMW 7pIZ2Q19rRxNABHq7rYFphmiuCudDPjxVubJ5Vxn9QTo3ZeoWqzkD63cTA8Izsp4mwRi qyityhf6gSAhBlVqks+OI2CjPtB7Cr8X+3bDsj13QW6WzW3S/in6cJMOhwou0myXKEsS anDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=c9tgLfAwCsk+jZyVV08/glFWKvxX/XLm51SIL24rUQc=; b=KNcKGG9n4PcGhzWa0cqLMEsXkEodhvLd1bSAuWDkEes5Ewc4jkgFojAD8BI/AO8Uy1 n67V2711HieWsheC2CSQKDxE5cm9N1O0PzF1z/ObTzXJ5EpP9goHsZRToY6qP6NhBrLC EQxauk9yIS066hTVFqa2TGMwSxpaQGyUXlcWEdvxJJDbVDBcWvy+7ypB/TC3eQzu9UX8 XajcPaNTChEjqnbuqFJg3naECKud4EQAxpU1B4UR0SFX+f2Q1BS5mciZqFB0qLLH9iPl 7Ofs9SsgvLELbs0Q+EpdTn0xfSoSk7e4UwZ0V1cc1s4JY2fSPfl4g6vH2TR0Uf3fafNa M6Wg== X-Gm-Message-State: AKaTC03Qlj+eZ/qHCNTnr8BzylD+V0ybKmKZe78cvxZQmgJB1C9c19PPZDa7sMyl+TFW2GtVkk8E24EYbAGMokB8 X-Received: by 10.194.87.103 with SMTP id w7mr19891736wjz.164.1480798596207; Sat, 03 Dec 2016 12:56:36 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.253.65 with HTTP; Sat, 3 Dec 2016 12:56:35 -0800 (PST) In-Reply-To: References: <201612020821.uB28L8s2000195@repo.freebsd.org> From: Oliver Pinter Date: Sat, 3 Dec 2016 21:56:35 +0100 Message-ID: Subject: Re: svn commit: r309400 - head/sys/dev/acpica To: Hans Petter Selasky , jkim@freebsd.org Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , freebsd-acpi@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 20:56:38 -0000 On 12/3/16, Oliver Pinter wrote: > On Fri, Dec 2, 2016 at 9:21 AM, Hans Petter Selasky > wrote: >> Author: hselasky >> Date: Fri Dec 2 08:21:08 2016 >> New Revision: 309400 >> URL: https://svnweb.freebsd.org/changeset/base/309400 >> >> Log: >> Fix for endless recursion in the ACPI GPE handler during boot. >> >> When handling a GPE ACPI interrupt object the EcSpaceHandler() >> function can be called which checks the EC_EVENT_SCI bit and then >> recurse on the EcGpeQueryHandler() function. If there are multiple GPE >> events pending the EC_EVENT_SCI bit will be set at the next call to >> EcSpaceHandler() causing it to recurse again via the >> EcGpeQueryHandler() function. This leads to a slow never ending >> recursion during boot which prevents proper system startup, because >> the EC_EVENT_SCI bit never gets cleared in this scenario. >> >> The behaviour is reproducible with the ALASKA AMI in combination with >> a newer Skylake based mainboard in the following way: >> >> Enter BIOS and adjust the clock one hour forward. Save and exit the >> BIOS. System fails to boot due to the above mentioned bug in >> EcGpeQueryHandler() which was observed recursing multiple times. >> >> This patch adds a simple recursion guard to the EcGpeQueryHandler() >> function and also also adds logic to detect if new GPE events occurred >> during the execution of EcGpeQueryHandler() and then loop on this >> function instead of recursing. >> >> Reviewed by: jhb >> MFC after: 2 weeks >> >> Modified: >> head/sys/dev/acpica/acpi_ec.c > > > I have similar error since the latest BIOS update on my gigabyte > H170N-Wifi board. The curiosity of the BIOS update was after upgrading > to this version, there are no possibility to rollback to older > version. > > The other weird thing, is that MFCing back this patch does not help. I > get stucked lock in acmtx mutex, as you > could see from the attached log. The other interesting is the ACPI > error at boot time: > > [1] ACPI Error: Mutex [0x0] is not acquired, cannot release > (20160527/utmutex-386) > [1] ACPI Error: Could not release AML Interpreter mutex > (20160527/exutils-147) > [1] ACPI Error: Mutex [0x0] is not acquired, cannot release > (20160527/utmutex-386) > [1] ACPI Error: Could not release AML Interpreter mutex > (20160527/exutils-147) > [1] cpu1: on acpi0 > [1] ACPI Error: Mutex [0x0] is not acquired, cannot release > (20160527/utmutex-386) > [1] ACPI Error: Could not release AML Interpreter mutex > (20160527/exutils-147) > [1] ACPI Error: Mutex [0x0] is not acquired, cannot release > (20160527/utmutex-386) > [1] ACPI Error: Could not release AML Interpreter mutex > (20160527/exutils-147) > > (This error is on 10-STABLE.) > After backported the last to ACPICA update to 10-STABLE with this patch, the issue reducated to this warning message: [1] acpi0: Power Button (fixed) [1] ACPI Error: Method parse/execution failed [\134_SB.PCI0.IOTR._CRS] (Node 0xfffff80006592f00), AE_AML_NO_RESOURCE_END_TAG (20161117/psparse-560) [1] ACPI Error: Method execution failed [\134_SB.PCI0.IOTR._CRS] (Node 0xfffff80006592f00), AE_AML_NO_RESOURCE_END_TAG (20161117/uteval-111) [1] can't fetch resources for \134_SB_.PCI0.IOTR - AE_AML_NO_RESOURCE_END_TAG but the lockup has gone. ;) [trim] From owner-svn-src-all@freebsd.org Sat Dec 3 21:04:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE86BC65562; Sat, 3 Dec 2016 21:04:38 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-qk0-f177.google.com (mail-qk0-f177.google.com [209.85.220.177]) (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 8ED531FD5; Sat, 3 Dec 2016 21:04:38 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-qk0-f177.google.com with SMTP id x190so312223642qkb.0; Sat, 03 Dec 2016 13:04:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=hz4bFkgWpl+6hl+KIX5t9qHHbsSozmddU7I6lJcqP8o=; b=CNY3masU/hXEHMWG/euvoh5keDAjnTzHRebMibpwUOhJIZsDBHtVqrmmhEnAZa3S6Y IOrwJddjJlxmIQeYwQB1DoRu3nbgSMgzq8y3nbITmhbpv6x0kUUB04lE8218TeeslnSO 4kBIAFuBiDKoWXY/4q1XN+ngeotM4Z4TDd5CJ/To/EvXHihOTLvZ1pMatgNFW3seBmUz Z4Wc2nUVnXX47DTig6guPb+kI0cSbdV+/V6JBQjJd/+AmoukO/Duv86K/LnV/coVRpxA hTYCTIVs7qA33sphazqu4WuVacKsuIS6zB6JSW9Uj816ZEsC+HlmpzHRKNffOTIWKr+f o0Nw== X-Gm-Message-State: AKaTC00SJJIxlRZmRkjISG7iSHiPPVMJrjB/6YKgYuQqZt/igd0FPJOcx/3lRRXmQp31pA== X-Received: by 10.55.4.19 with SMTP id 19mr44047005qke.18.1480795339128; Sat, 03 Dec 2016 12:02:19 -0800 (PST) Received: from mail-qt0-f181.google.com (mail-qt0-f181.google.com. [209.85.216.181]) by smtp.gmail.com with ESMTPSA id i41sm5617175qtc.18.2016.12.03.12.02.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Dec 2016 12:02:19 -0800 (PST) Received: by mail-qt0-f181.google.com with SMTP id p16so281182433qta.0; Sat, 03 Dec 2016 12:02:18 -0800 (PST) X-Received: by 10.237.53.119 with SMTP id b52mr50076675qte.74.1480795338721; Sat, 03 Dec 2016 12:02:18 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.200.58.165 with HTTP; Sat, 3 Dec 2016 12:02:18 -0800 (PST) In-Reply-To: <201612030209.uB329Ngb043254@repo.freebsd.org> References: <201612030209.uB329Ngb043254@repo.freebsd.org> From: Conrad Meyer Date: Sat, 3 Dec 2016 12:02:18 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r309462 - head/tests/sys/kern To: Ngie Cooper Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 21:04:38 -0000 On Fri, Dec 2, 2016 at 6:09 PM, Ngie Cooper wrote: > Author: ngie > Date: Sat Dec 3 02:09:23 2016 > New Revision: 309462 > URL: https://svnweb.freebsd.org/changeset/base/309462 > > Log: > Fix test coredump_phnum_test:coredump_phnum require.config specification > > The requirement is set via `atf_set "require.config" "allow_sysctl_side_effects"', > not `atf_set "require.config" "allow_sysctl_side_effects"' > > X-MFC with: r308177 > Pointyhat to: cmeyer Ngie, This line was added verbatim at your request: https://reviews.freebsd.org/D7264?id=18609#inline-43800 Conrad From owner-svn-src-all@freebsd.org Sat Dec 3 21:19:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1CA5C65B9B; Sat, 3 Dec 2016 21:19:46 +0000 (UTC) (envelope-from trasz@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 80634B8C; Sat, 3 Dec 2016 21:19:46 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB3LJjMu022478; Sat, 3 Dec 2016 21:19:45 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3LJjkn022477; Sat, 3 Dec 2016 21:19:45 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201612032119.uB3LJjkn022477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 3 Dec 2016 21:19:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309514 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 21:19:46 -0000 Author: trasz Date: Sat Dec 3 21:19:45 2016 New Revision: 309514 URL: https://svnweb.freebsd.org/changeset/base/309514 Log: MFC r308088: Fix getfsstat(2) handling of flags. The 'flags' argument is an enum, not a bitfield. For the intended usage - being passed either MNT_WAIT, or MNT_NOWAIT - this shouldn't introduce any changes in behaviour. Modified: stable/11/sys/kern/vfs_syscalls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_syscalls.c ============================================================================== --- stable/11/sys/kern/vfs_syscalls.c Sat Dec 3 20:35:39 2016 (r309513) +++ stable/11/sys/kern/vfs_syscalls.c Sat Dec 3 21:19:45 2016 (r309514) @@ -495,16 +495,16 @@ kern_getfsstat(struct thread *td, struct sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; /* * If MNT_NOWAIT or MNT_LAZY is specified, do not - * refresh the fsstat cache. MNT_NOWAIT or MNT_LAZY - * overrides MNT_WAIT. + * refresh the fsstat cache. */ - if (((flags & (MNT_LAZY|MNT_NOWAIT)) == 0 || - (flags & MNT_WAIT)) && - (error = VFS_STATFS(mp, sp))) { - mtx_lock(&mountlist_mtx); - nmp = TAILQ_NEXT(mp, mnt_list); - vfs_unbusy(mp); - continue; + if (flags != MNT_LAZY && flags != MNT_NOWAIT) { + error = VFS_STATFS(mp, sp); + if (error != 0) { + mtx_lock(&mountlist_mtx); + nmp = TAILQ_NEXT(mp, mnt_list); + vfs_unbusy(mp); + continue; + } } if (priv_check(td, PRIV_VFS_GENERATION)) { bcopy(sp, &sb, sizeof(sb)); From owner-svn-src-all@freebsd.org Sat Dec 3 21:23:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E804C65D6C; Sat, 3 Dec 2016 21:23:45 +0000 (UTC) (envelope-from trasz@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 E8B00F76; Sat, 3 Dec 2016 21:23:44 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB3LNi2r026146; Sat, 3 Dec 2016 21:23:44 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3LNiCI026145; Sat, 3 Dec 2016 21:23:44 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201612032123.uB3LNiCI026145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 3 Dec 2016 21:23:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309515 - stable/11/sys/kern X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 21:23:45 -0000 Author: trasz Date: Sat Dec 3 21:23:43 2016 New Revision: 309515 URL: https://svnweb.freebsd.org/changeset/base/309515 Log: MFC r308209: Fix getfsstat(2) with MNT_WAIT to not skip filesystems that are in the process of being unmounted. Previously it would skip them, even if the unmount eventually failed eg due to the filesystem being busy. This behaviour broke autounmountd(8) - if you tried to manually unmount a mounted filesystem, using 'automount -u', and the autounmountd attempted to refresh the filesystem list in that very moment, it would conclude that the filesystem got unmounted and not try to unmount it afterwards. Modified: stable/11/sys/kern/vfs_syscalls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_syscalls.c ============================================================================== --- stable/11/sys/kern/vfs_syscalls.c Sat Dec 3 21:19:45 2016 (r309514) +++ stable/11/sys/kern/vfs_syscalls.c Sat Dec 3 21:23:43 2016 (r309515) @@ -446,16 +446,19 @@ kern_getfsstat(struct thread *td, struct size_t *countp, enum uio_seg bufseg, int flags) { struct mount *mp, *nmp; - struct statfs *sfsp, *sp, sb; + struct statfs *sfsp, *sp, sb, *tofree; size_t count, maxcount; int error; +restart: maxcount = bufsize / sizeof(struct statfs); - if (bufsize == 0) + if (bufsize == 0) { sfsp = NULL; - else if (bufseg == UIO_USERSPACE) + tofree = NULL; + } else if (bufseg == UIO_USERSPACE) { sfsp = *buf; - else /* if (bufseg == UIO_SYSSPACE) */ { + tofree = NULL; + } else /* if (bufseg == UIO_SYSSPACE) */ { count = 0; mtx_lock(&mountlist_mtx); TAILQ_FOREACH(mp, &mountlist, mnt_list) { @@ -464,8 +467,8 @@ kern_getfsstat(struct thread *td, struct mtx_unlock(&mountlist_mtx); if (maxcount > count) maxcount = count; - sfsp = *buf = malloc(maxcount * sizeof(struct statfs), M_TEMP, - M_WAITOK); + tofree = sfsp = *buf = malloc(maxcount * sizeof(struct statfs), + M_TEMP, M_WAITOK); } count = 0; mtx_lock(&mountlist_mtx); @@ -480,9 +483,24 @@ kern_getfsstat(struct thread *td, struct continue; } #endif - if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK)) { - nmp = TAILQ_NEXT(mp, mnt_list); - continue; + if (flags == MNT_WAIT) { + if (vfs_busy(mp, MBF_MNTLSTLOCK) != 0) { + /* + * If vfs_busy() failed, and MBF_NOWAIT + * wasn't passed, then the mp is gone. + * Furthermore, because of MBF_MNTLSTLOCK, + * the mountlist_mtx was dropped. We have + * no other choice than to start over. + */ + mtx_unlock(&mountlist_mtx); + free(tofree, M_TEMP); + goto restart; + } + } else { + if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK) != 0) { + nmp = TAILQ_NEXT(mp, mnt_list); + continue; + } } if (sfsp && count < maxcount) { sp = &mp->mnt_stat; From owner-svn-src-all@freebsd.org Sat Dec 3 21:26:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A243AC65E72; Sat, 3 Dec 2016 21:26:35 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::243]) (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 71E101192; Sat, 3 Dec 2016 21:26:35 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x243.google.com with SMTP id 3so11690498pgd.0; Sat, 03 Dec 2016 13:26:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=tDmEFVxZhNEgMSqbwc3Cmmnz+M/yQCetK9cM2Ef8vW8=; b=qlMY2EG1kASJ8rM1Yc+gZ3U40UFjP0DtOKdR7Miv+SPdGGIN+fSsvpPqHsU+bC6BVr ROT0YFwl2HZWf2L4EpLEr2pvnGa5TQ2Du2XgbNIPIsQfUelpiscKUYFLvA2loGpYfX7W eG8nVFK3KpTPqdeSHRdV0VtA3UoRPBoSlNgwNhkmSh6q4jQRMaZqV7ICyT53nDTyqns3 iIjY4SkiRPcKPQGl/ADXnCqKGgelsho84ztkOU/TPsJYGBOWqQwbGhzYS45GVGOhHawW bsk2noDWSRJX800HUUFg/rkaXF5QNxhAOYuXaiFcBYyQnhkRKRZcljnIySxZGAVXteGI FRCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=tDmEFVxZhNEgMSqbwc3Cmmnz+M/yQCetK9cM2Ef8vW8=; b=dC+sr1p4Jmyf2SavhYFLzfFY4j9MQfiJM67d5MAJfXe0Fc/FN4jwoNs4ojXCpKMrHX uIsH+dv6Mv8Ti84H76pg0BEnYuacP4QShzidKfa5LsTRDTITL06/OvUGmIiBpJvZLkxe dZnvRbBJ+bYXfo1nJvp7cEfaMp9nVhOK6o/qsMuVqfa1WIPynZYJpqJg8lLNnG8v8lEu HaKXemVbCkr5f05zi2UXjNPRQRw14IbOL6ZilDiwTVhT63776zzOiItCozF/Y4LMu3/O Ip/AI7D2dQq2M9UxUZ+S02FbSPwZ79+R6oB+I0Im6P53y6JJ3uf2zNRjq91Ex+v5dfTr yymA== X-Gm-Message-State: AKaTC03cdjQyT78daveWN6j2C+hnrcp3+Bgbvxf6q3b64EoH5T907rpttB4dBopKQvui4w== X-Received: by 10.98.108.3 with SMTP id h3mr50832530pfc.65.1480800394750; Sat, 03 Dec 2016 13:26:34 -0800 (PST) Received: from [192.168.50.73] (50-251-209-113-static.hfc.comcastbusiness.net. [50.251.209.113]) by smtp.gmail.com with ESMTPSA id x2sm16835999pfx.65.2016.12.03.13.26.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 03 Dec 2016 13:26:34 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r309462 - head/tests/sys/kern From: Ngie Cooper X-Mailer: iPhone Mail (14B100) In-Reply-To: Date: Sat, 3 Dec 2016 13:26:33 -0800 Cc: Ngie Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201612030209.uB329Ngb043254@repo.freebsd.org> To: cem@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 21:26:35 -0000 > On Dec 3, 2016, at 12:02, Conrad Meyer wrote: >=20 >> On Fri, Dec 2, 2016 at 6:09 PM, Ngie Cooper wrote: >> Author: ngie >> Date: Sat Dec 3 02:09:23 2016 >> New Revision: 309462 >> URL: https://svnweb.freebsd.org/changeset/base/309462 >>=20 >> Log: >> Fix test coredump_phnum_test:coredump_phnum require.config specification= >>=20 >> The requirement is set via `atf_set "require.config" "allow_sysctl_side_= effects"', >> not `atf_set "require.config" "allow_sysctl_side_effects"' >>=20 >> X-MFC with: r308177 >> Pointyhat to: cmeyer >=20 > Ngie, >=20 > This line was added verbatim at your request: > https://reviews.freebsd.org/D7264?id=3D18609#inline-43800 Ok, I'll take that part of the pointhat. -Ngie= From owner-svn-src-all@freebsd.org Sat Dec 3 21:27:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78682C65F06; Sat, 3 Dec 2016 21:27:20 +0000 (UTC) (envelope-from trasz@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 2F0B6131E; Sat, 3 Dec 2016 21:27:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB3LRJRs026330; Sat, 3 Dec 2016 21:27:19 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3LRJPi026328; Sat, 3 Dec 2016 21:27:19 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201612032127.uB3LRJPi026328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 3 Dec 2016 21:27:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309516 - stable/11/sys/cam/ctl X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 21:27:20 -0000 Author: trasz Date: Sat Dec 3 21:27:19 2016 New Revision: 309516 URL: https://svnweb.freebsd.org/changeset/base/309516 Log: MFC r308250: Check for lengths being <= 0. Note that this interface can only be accessed by root. It uses unsigned ints instead of size_t to preserve the ABI. PR: 207627 Modified: stable/11/sys/cam/ctl/ctl.c stable/11/sys/cam/ctl/ctl_ioctl.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl.c ============================================================================== --- stable/11/sys/cam/ctl/ctl.c Sat Dec 3 21:23:43 2016 (r309515) +++ stable/11/sys/cam/ctl/ctl.c Sat Dec 3 21:27:19 2016 (r309516) @@ -2370,7 +2370,7 @@ ctl_ioctl_fill_ooa(struct ctl_lun *lun, } static void * -ctl_copyin_alloc(void *user_addr, int len, char *error_str, +ctl_copyin_alloc(void *user_addr, unsigned int len, char *error_str, size_t error_str_len) { void *kptr; @@ -2425,6 +2425,12 @@ ctl_copyin_args(int num_args, struct ctl for (i = 0; i < num_args; i++) { uint8_t *tmpptr; + if (args[i].namelen == 0) { + snprintf(error_str, error_str_len, "Argument %d " + "name length is zero", i); + goto bailout; + } + args[i].kname = ctl_copyin_alloc(args[i].name, args[i].namelen, error_str, error_str_len); if (args[i].kname == NULL) @@ -2437,10 +2443,17 @@ ctl_copyin_args(int num_args, struct ctl } if (args[i].flags & CTL_BEARG_RD) { + if (args[i].vallen == 0) { + snprintf(error_str, error_str_len, "Argument %d " + "value length is zero", i); + goto bailout; + } + tmpptr = ctl_copyin_alloc(args[i].value, args[i].vallen, error_str, error_str_len); if (tmpptr == NULL) goto bailout; + if ((args[i].flags & CTL_BEARG_ASCII) && (tmpptr[args[i].vallen - 1] != '\0')) { snprintf(error_str, error_str_len, "Argument " Modified: stable/11/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- stable/11/sys/cam/ctl/ctl_ioctl.h Sat Dec 3 21:23:43 2016 (r309515) +++ stable/11/sys/cam/ctl/ctl_ioctl.h Sat Dec 3 21:27:19 2016 (r309516) @@ -317,20 +317,20 @@ typedef enum { * * flags: Flags for the parameter, see above for values. * - * vallen: Length of the value in bytes. + * vallen: Length of the value in bytes, including the terminating NUL. * - * value: Value to be set/fetched. + * value: Value to be set/fetched. This must be NUL-terminated. * * kname: For kernel use only. * * kvalue: For kernel use only. */ struct ctl_be_arg { - int namelen; - char *name; - int flags; - int vallen; - void *value; + unsigned int namelen; + char *name; + int flags; + unsigned int vallen; + void *value; char *kname; void *kvalue; From owner-svn-src-all@freebsd.org Sat Dec 3 21:48:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B1EDC65691; Sat, 3 Dec 2016 21:48:34 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-io0-x243.google.com (mail-io0-x243.google.com [IPv6:2607:f8b0:4001:c06::243]) (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 53CFD1E13; Sat, 3 Dec 2016 21:48:34 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-io0-x243.google.com with SMTP id j92so15063533ioi.0; Sat, 03 Dec 2016 13:48:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=fx37WjlRZqnwcZRXfsHGWHf6rzEk3cEUL8dDEq3VSdg=; b=HiOWtzBbK7E2oa7ldk2lTwZz1/BxWUF+/jsPX7Nraa1bF8J48KL0zRnC+d+sditWPQ RMupSsp825g53Dyw8okvE0UNthwddIf5eo38Fc/Bcjz8j3iP1iQy26vUnf8YrQ+XHecR nn74qb/2Z0iprNhhd8Tzjo83HL3aO9QSvnKOynppaCPwRyB7v00wT0XS9NxBlh5OlSzJ WkQZJ3piM182KC4sWVAMnhMY/RpTIj7meJLAs7jdwApsLcIs/J/W71GB4dMsep2BmKzk oH663J48WwbYJK0NaVSXdt/5eUg67IpsOeK0I847ABknNlMxMB9uzlsfMRlS9YkUOOtb Q2Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=fx37WjlRZqnwcZRXfsHGWHf6rzEk3cEUL8dDEq3VSdg=; b=RLyBxJdRoMzTncNsBlOtSOimhvAnmltdKwg1q1clTzZtNDqg2ao61YbjPxIKPXY/cb WLGe0I46h4fd5TukA9l7rDXM0As3SW1YZO9+LQPYIpszk0e3tqdVom3Y9JP+LLlgYfeH x2pROBD70dXAWtQ+GXWpxnzMNJnpU1NZYy0BuUPtIKoIBCW4U9NEqc79kmltrYHoWiQN 1wELiqLYLjNYEySGH1yhgMyeE4Te9eD3QxrxNORR5+FlseodpYkd358gRghwv67wfC6r YHzturflHKGwS92LT+djjJbiLZJT8caLIuMm4GGCoWLG0XU1ZhgK2LxZikwRZxKFuxUX +KVA== X-Gm-Message-State: AKaTC016DRszXBjfTwc/I+dB0D1YDHcZD/piPSSdqukPerSXGg4PwSuad8GgdaBxigkU87jgyaZ52sYmRtaElw== X-Received: by 10.107.164.35 with SMTP id n35mr8483977ioe.171.1480801713585; Sat, 03 Dec 2016 13:48:33 -0800 (PST) MIME-Version: 1.0 Sender: antoine.brodin.freebsd@gmail.com Received: by 10.107.128.164 with HTTP; Sat, 3 Dec 2016 13:48:33 -0800 (PST) In-Reply-To: <201612020930.uB29UDQR031063@repo.freebsd.org> References: <201612020930.uB29UDQR031063@repo.freebsd.org> From: Antoine Brodin Date: Sat, 3 Dec 2016 22:48:33 +0100 X-Google-Sender-Auth: yhTBbdfPXvLP_kxRjHkIq447qMo Message-ID: Subject: Re: svn commit: r309405 - head/contrib/libarchive/libarchive To: Martin Matuska Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 21:48:34 -0000 On Fri, Dec 2, 2016 at 10:30 AM, Martin Matuska wrote: > Author: mm > Date: Fri Dec 2 09:30:13 2016 > New Revision: 309405 > URL: https://svnweb.freebsd.org/changeset/base/309405 > > Log: > MFV r309403: > > Sync libarchive with vendor. > > Vendor bugfixes: > Fix for heap-buffer-overflow in archive_le16dec() > Fix for heap-buffer-overflow in uudecode_bidder_bid() > Reworked fix for compatibility with archives created by Perl Archive::Tar > > MFC after: 1 week Hi, There are still ports failing to extract (logs are ipv6 only): http://beefy11.nyi.freebsd.org/data/head-i386-default/p427588_s309451/logs/errors/jakarta-commons-logging-1.2.log http://beefy11.nyi.freebsd.org/data/head-i386-default/p427588_s309451/logs/errors/activemq-5.14.1.log http://beefy11.nyi.freebsd.org/data/head-i386-default/p427588_s309451/logs/errors/hadoop2-2.7.2_1.log Please request an exp-run before updating libarchive. Cheers, Antoine From owner-svn-src-all@freebsd.org Sat Dec 3 21:49:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72868C6582D; Sat, 3 Dec 2016 21:49:27 +0000 (UTC) (envelope-from rmacklem@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 2923A84; Sat, 3 Dec 2016 21:49:27 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB3LnQDB034689; Sat, 3 Dec 2016 21:49:26 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3LnQTE034688; Sat, 3 Dec 2016 21:49:26 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201612032149.uB3LnQTE034688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 3 Dec 2016 21:49:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r309517 - stable/11/sbin/umount X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 21:49:27 -0000 Author: rmacklem Date: Sat Dec 3 21:49:26 2016 New Revision: 309517 URL: https://svnweb.freebsd.org/changeset/base/309517 Log: MFC: r308871 Modify umount so that it does not do an Unmount RPC for NFSv4 mounts and uses TCP for the Unmount RPC if the mount is over TCP. Without this patch, umount does an Unmount RPC over UDP for all NFS mounts. Modified: stable/11/sbin/umount/umount.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/umount/umount.c ============================================================================== --- stable/11/sbin/umount/umount.c Sat Dec 3 21:27:19 2016 (r309516) +++ stable/11/sbin/umount/umount.c Sat Dec 3 21:49:26 2016 (r309517) @@ -49,6 +49,7 @@ static const char rcsid[] = #include #include #include +#include #include #include @@ -323,6 +324,9 @@ umountfs(struct statfs *sfs) CLIENT *clp; char *nfsdirname, *orignfsdirname; char *hostp, *delimp; + char buf[1024]; + struct nfscl_dumpmntopts dumpmntopts; + const char *proto_ptr = NULL; ai = NULL; do_rpc = 0; @@ -361,8 +365,24 @@ umountfs(struct statfs *sfs) * mount from mntfromname that is still mounted. */ if (getmntentry(sfs->f_mntfromname, NULL, NULL, - CHECKUNIQUE) != NULL) + CHECKUNIQUE) != NULL) { do_rpc = 1; + proto_ptr = "udp"; + /* + * Try and find out whether this NFS mount is NFSv4 and + * what protocol is being used. If this fails, the + * default is NFSv2,3 and use UDP for the Unmount RPC. + */ + dumpmntopts.ndmnt_fname = sfs->f_mntonname; + dumpmntopts.ndmnt_buf = buf; + dumpmntopts.ndmnt_blen = sizeof(buf); + if (nfssvc(NFSSVC_DUMPMNTOPTS, &dumpmntopts) >= 0) { + if (strstr(buf, "nfsv4,") != NULL) + do_rpc = 0; + else if (strstr(buf, ",tcp,") != NULL) + proto_ptr = "tcp"; + } + } } if (!namematch(ai)) { @@ -400,7 +420,7 @@ umountfs(struct statfs *sfs) * has been unmounted. */ if (ai != NULL && !(fflag & MNT_FORCE) && do_rpc) { - clp = clnt_create(hostp, MOUNTPROG, MOUNTVERS3, "udp"); + clp = clnt_create(hostp, MOUNTPROG, MOUNTVERS3, proto_ptr); if (clp == NULL) { warnx("%s: %s", hostp, clnt_spcreateerror("MOUNTPROG")); From owner-svn-src-all@freebsd.org Sat Dec 3 21:56:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53D75C65A5A; Sat, 3 Dec 2016 21:56:47 +0000 (UTC) (envelope-from rmacklem@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 0A617793; Sat, 3 Dec 2016 21:56:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uB3LukW9038465; Sat, 3 Dec 2016 21:56:46 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uB3Lukdr038464; Sat, 3 Dec 2016 21:56:46 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201612032156.uB3Lukdr038464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 3 Dec 2016 21:56:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r309518 - stable/10/sbin/umount X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Dec 2016 21:56:47 -0000 Author: rmacklem Date: Sat Dec 3 21:56:46 2016 New Revision: 309518 URL: https://svnweb.freebsd.org/changeset/base/309518 Log: MFC: r308871 Modify umount so that it does not do an Unmount RPC for NFSv4 mounts and uses TCP for the Unmount RPC if the mount is over TCP. Without this patch, umount does an Unmount RPC over UDP for all NFS mounts. Modified: stable/10/sbin/umount/umount.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/umount/umount.c ============================================================================== --- stable/10/sbin/umount/umount.c Sat Dec 3 21:49:26 2016 (r309517) +++ stable/10/sbin/umount/umount.c Sat Dec 3 21:56:46 2016 (r309518) @@ -49,6 +49,7 @@ static const char rcsid[] = #include #include #include +#include #include #include @@ -317,6 +318,9 @@ umountfs(struct statfs *sfs) CLIENT *clp; char *nfsdirname, *orignfsdirname; char *hostp, *delimp; + char buf[1024]; + struct nfscl_dumpmntopts dumpmntopts; + const char *proto_ptr = NULL; ai = NULL; do_rpc = 0; @@ -355,8 +359,24 @@ umountfs(struct statfs *sfs) * mount from mntfromname that is still mounted. */ if (getmntentry(sfs->f_mntfromname, NULL, NULL, - CHECKUNIQUE) != NULL) + CHECKUNIQUE) != NULL) { do_rpc = 1; + proto_ptr = "udp"; + /* + * Try and find out whether this NFS mount is NFSv4 and + * what protocol is being used. If this fails, the + * default is NFSv2,3 and use UDP for the Unmount RPC. + */ + dumpmntopts.ndmnt_fname = sfs->f_mntonname; + dumpmntopts.ndmnt_buf = buf; + dumpmntopts.ndmnt_blen = sizeof(buf); + if (nfssvc(NFSSVC_DUMPMNTOPTS, &dumpmntopts) >= 0) { + if (strstr(buf, "nfsv4,") != NULL) + do_rpc = 0; + else if (strstr(buf, ",tcp,") != NULL) + proto_ptr = "tcp"; + } + } } if (!namematch(ai)) { @@ -394,7 +414,7 @@ umountfs(struct statfs *sfs) * has been unmounted. */ if (ai != NULL && !(fflag & MNT_FORCE) && do_rpc) { - clp = clnt_create(hostp, MOUNTPROG, MOUNTVERS3, "udp"); + clp = clnt_create(hostp, MOUNTPROG, MOUNTVERS3, proto_ptr); if (clp == NULL) { warnx("%s: %s", hostp, clnt_spcreateerror("MOUNTPROG"));